{"version":3,"file":"app-8e8fa9c3.9729664bca28a8e6916d.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AASA;AAAA;AANA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAzCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAmDA;AAAA;AAjDA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAGA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AASA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAvTA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAsBA;AAAA;AApBA;AACA;AACA;AACA;AACA;AAAA;AAGA;AAAA;AAIA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAtGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AAEA;AAgBA;AAAA;AAdA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAvGA;;;;;;;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AAEA;AAQA;AAAA;AALA;AACA;AACA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAMA;AAAA;AAHA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAUA;AAAA;AAPA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAIA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAGA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAtEA;;;;;;;;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAcA;AAAA;AAZA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AAIA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;ACpBA;AACA;AACA;AAEA;AAQA;AAAA;AANA;AACA;AAEA;AAIA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAGA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnCA;;;;;;;;;;;;;;;;;ACJA;AACA;AAEA;AAUA;AAAA;AARA;AACA;AACA;AACA;AACA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAlEA;;;;;;;;;;;;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AA0BA;AAAA;AAxBA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAIA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AApHA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;AC1BA;AACA;AAEA;AAKA;AAAA;AAHA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AApBA;;;;;;;;;;;;;;;;;;ACHA;AACA;AACA;AAEA;AAOA;AAAA;AAJA;AACA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAgBA;AAAA;AAdA;AACA;AACA;AAEA;AAAA;AAEA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AAEA;AAKA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AApJA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AAEA;AAUA;AAAA;AARA;AACA;AACA;AAEA;AAKA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA/CA;;;;;;;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AAJA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAAA;AAHA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AA9DA;;;;;;;;;;;;;;;;;;ACpBA;AACA;AACA;AAEA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAAA;AACA;AACA;;;;;;;;;;;;;;ACjBA;;;;;;;;;;;ACAA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA","sources":["webpack://www.zeusteam.com/./src/admin/policies/dialogs/split-policy.js","webpack://www.zeusteam.com/./src/admin/policies/edit-policy.js","webpack://www.zeusteam.com/./src/admin/policies/status-changes.js","webpack://www.zeusteam.com/./src/admin/policies/upload-files.js","webpack://www.zeusteam.com/./src/admin/q-and-a/answer.js","webpack://www.zeusteam.com/./src/admin/q-and-a/answers.js","webpack://www.zeusteam.com/./src/admin/q-and-a/dialog/answer-editor.js","webpack://www.zeusteam.com/./src/admin/reports/_index.js","webpack://www.zeusteam.com/./src/admin/reports/agency-reports.js","webpack://www.zeusteam.com/./src/admin/reports/agent-reports.js","webpack://www.zeusteam.com/./src/admin/reports/audit-logs/audit-logs.js","webpack://www.zeusteam.com/./src/admin/reports/policy-reports.js","webpack://www.zeusteam.com/./src/admin/reports/product-reports.js","webpack://www.zeusteam.com/./src/admin/reports/system-events/level-changed.js","webpack://www.zeusteam.com/./src/admin/site/dialog/site-theme-editor.js","webpack://www.zeusteam.com/./src/admin/site/site-list.js","webpack://www.zeusteam.com/./src/admin/team-member-hierarchy.js","webpack://www.zeusteam.com/./src/admin/team-member.js","webpack://www.zeusteam.com/./src/admin/team-members.js","webpack://www.zeusteam.com/./src/admin/us-map.js","webpack://www.zeusteam.com/./src/admin/policies/dialogs/split-policy.html","webpack://www.zeusteam.com/./src/admin/policies/edit-policy.html","webpack://www.zeusteam.com/./src/admin/policies/status-changes.html","webpack://www.zeusteam.com/./src/admin/policies/upload-files.html","webpack://www.zeusteam.com/./src/admin/q-and-a/answer.html","webpack://www.zeusteam.com/./src/admin/q-and-a/answers.html","webpack://www.zeusteam.com/./src/admin/q-and-a/dialog/answer-editor.html","webpack://www.zeusteam.com/./src/admin/reports/_index.html","webpack://www.zeusteam.com/./src/admin/reports/agency-reports.html","webpack://www.zeusteam.com/./src/admin/reports/agent-reports.html","webpack://www.zeusteam.com/./src/admin/reports/audit-logs/audit-log-change.html","webpack://www.zeusteam.com/./src/admin/reports/audit-logs/audit-logs.html","webpack://www.zeusteam.com/./src/admin/reports/policy-reports.html","webpack://www.zeusteam.com/./src/admin/reports/product-reports.html","webpack://www.zeusteam.com/./src/admin/reports/system-events/level-changed.html","webpack://www.zeusteam.com/./src/admin/site/dialog/site-theme-editor.html","webpack://www.zeusteam.com/./src/admin/site/site-list.html","webpack://www.zeusteam.com/./src/admin/team-member-hierarchy.html","webpack://www.zeusteam.com/./src/admin/team-member.html","webpack://www.zeusteam.com/./src/admin/team-members.html","webpack://www.zeusteam.com/./src/admin/us-map.html"],"sourcesContent":["import { DialogController } from 'aurelia-dialog';\r\nimport { NewInstance } from 'aurelia-dependency-injection';\r\nimport { ValidationRules, ValidationController } from 'aurelia-validation';\r\nimport { BootstrapFormValidationRenderer } from 'validation/bootstrap-form-validation-renderer';\r\nimport { ProductionService } from 'services/production-service';\r\nimport { Notifier } from 'common/ui';\r\n\r\nexport class SplitPolicy {\r\n static inject = [DialogController, NewInstance.of(ValidationController), ProductionService, Notifier]\r\n\r\n _production;\r\n _notifier;\r\n\r\n splitMember;\r\n splitPercentage = 50;\r\n\r\n constructor(dialogController, validationController, production, notifier) {\r\n this.dialogController = dialogController;\r\n this.dialogController.settings.centerHorizontalOnly = true;\r\n this.validationController = validationController;\r\n this.validationController.addRenderer(new BootstrapFormValidationRenderer());\r\n this._production = production;\r\n this._notifier = notifier;\r\n\r\n ValidationRules\r\n .ensure('splitMember').required()\r\n .ensure('splitPercentage').required().satisfiesRule('integerRange', 0, 100)\r\n .on(this);\r\n }\r\n\r\n activate(model) {\r\n this.policyId = model.policyId;\r\n this.validationController.reset();\r\n }\r\n\r\n async split() {\r\n try {\r\n const v = await this.validationController.validate();\r\n if (!v.valid) return;\r\n if (!this.splitMember) return;\r\n await this._production.splitPolicy(this.policyId, this.splitMember.id, this.splitPercentage);\r\n this.dialogController.ok();\r\n } catch (err) {\r\n if (err) this._notifier.error(err);\r\n else this._notifier.generalError();\r\n console.log(err);\r\n }\r\n }\r\n}","import { PLATFORM } from 'aurelia-pal';\r\nimport { observable } from 'aurelia-framework';\r\nimport { Notifier } from 'common/ui';\r\nimport { Security } from 'common/security';\r\nimport { Api } from 'common/server';\r\nimport { NewInstance } from 'aurelia-dependency-injection';\r\nimport { ValidationRules, ValidationController } from 'aurelia-validation';\r\nimport { BootstrapFormValidationRenderer } from 'validation/bootstrap-form-validation-renderer';\r\nimport { ProductionService } from 'services/production-service';\r\nimport { DialogService } from 'aurelia-dialog';\r\nimport { ConfirmDialog } from 'common/dialogs/confirm/confirm-dialog';\r\nimport { SplitPolicy } from './dialogs/split-policy';\r\nimport { c } from 'common/common';\r\nimport moment from 'moment';\r\nPLATFORM.moduleName('common/dialogs/confirm/confirm-dialog');\r\nPLATFORM.moduleName('./dialogs/split-policy');\r\n\r\nexport class EditPolicy {\r\n static inject = [Notifier, Security, Api, NewInstance.of(ValidationController), ProductionService, DialogService];\r\n _notifier;\r\n _security;\r\n _api;\r\n validationController;\r\n _productionService;\r\n _dialogService;\r\n\r\n policyNumber;\r\n\r\n @observable selectedPolicy;\r\n policy;\r\n\r\n statuses;\r\n status;\r\n subStatuses;\r\n subStatus;\r\n\r\n submittedDate;\r\n paidDate;\r\n chargebackDate;\r\n canceledDate;\r\n closedDate;\r\n signedDate;\r\n finalDispositionDate;\r\n issuedDate;\r\n coverageTerminationDate;\r\n nextDraftDate;\r\n effectiveDate;\r\n\r\n submittedPremium;\r\n targetPremium;\r\n paidPremium;\r\n fullAnnualizedSubmittedPremium;\r\n fullAnnualizedPaidPremium;\r\n\r\n agencyMember;\r\n\r\n isProcessing = false;\r\n\r\n tab;\r\n TAB = {\r\n setDates: 'set-dates',\r\n setPremium: 'set-premium',\r\n setAgency: 'set-agency',\r\n setStatus: 'set-status'\r\n };\r\n\r\n imoSources = ['lpfn', 'other-imo'];\r\n\r\n constructor(notifier, security, api, validationController, productionService, dialogService) {\r\n this._notifier = notifier;\r\n this._security = security;\r\n this._api = api;\r\n this.validationController = validationController;\r\n this.validationController.addRenderer(new BootstrapFormValidationRenderer());\r\n this._productionService = productionService;\r\n this._dialogService = dialogService;\r\n\r\n this.tab = this.TAB.setDates;\r\n\r\n ValidationRules\r\n .ensure('submittedDate').required()\r\n .ensure('submittedPremium').satisfiesRule('decimalRange', 0, 999999999).when(m => m.tab === m.TAB.setPremium)\r\n .ensure('targetPremium').satisfiesRule('decimalRange', 0, 999999999).when(m => m.tab === m.TAB.setPremium)\r\n .ensure('paidPremium').satisfiesRule('decimalRange', 0, 999999999).when(m => m.tab === m.TAB.setPremium)\r\n .ensure('fullAnnualizedSubmittedPremium').satisfiesRule('decimalRange', 0, 999999999).when(m => m.tab === m.TAB.setPremium)\r\n .ensure('fullAnnualizedPaidPremium').satisfiesRule('decimalRange', 0, 999999999).when(m => m.tab === m.TAB.setPremium)\r\n .ensure('status').required().when(m => m.tab === m.TAB.setStatus)\r\n .on(this);\r\n }\r\n\r\n attached() {\r\n this._load();\r\n }\r\n\r\n activate(model) {\r\n if (model.id) {\r\n if (c.RegEx.guid.test(model.id)) {\r\n // TODO: pass GUID to get the policy number\r\n this.loadPolicy(model.id);\r\n } else {\r\n this.findPolicyNumber = model.id;\r\n }\r\n }\r\n }\r\n\r\n async _load() {\r\n try {\r\n this.statuses = await this._productionService.policyStatuses();\r\n this.subStatuses = await this._productionService.policySubStatuses();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n selectedPolicyChanged() {\r\n if (!this.selectedPolicy) {\r\n this.policy = undefined;\r\n return;\r\n }\r\n this.loadPolicy();\r\n }\r\n\r\n async loadPolicy(id) {\r\n try {\r\n if (!this.selectedPolicy && !id) return;\r\n const loadPolicyId = this.selectedPolicy ? this.selectedPolicy.id : id;\r\n this.policy = await this._productionService.policy(loadPolicyId);\r\n this.imoSource = this.policy.imoSource;\r\n this.submittedDate = this._datePickerDate(this.policy.submittedDate);\r\n this.paidDate = this._datePickerDate(this.policy.paidDate);\r\n this.chargebackDate = this._datePickerDate(this.policy.chargebackDate);\r\n this.canceledDate = this._datePickerDate(this.policy.canceledDate);\r\n this.closedDate = this._datePickerDate(this.policy.closedDate);\r\n this.signedDate = this._datePickerDate(this.policy.signedDate);\r\n this.issuedDate = this._datePickerDate(this.policy.issuedDate);\r\n this.coverageTerminationDate = this._datePickerDate(this.policy.coverageTerminationDate);\r\n this.nextDraftDate = this._datePickerDate(this.policy.nextDraftDate);\r\n this.effectiveDate = this._datePickerDate(this.policy.effectiveDate);\r\n this.status = undefined;\r\n this.subStatus = undefined;\r\n\r\n this.submittedPremium = this.policy.submittedPremium;\r\n this.targetPremium = this.policy.targetPremium;\r\n this.paidPremium = this.policy.paidPremium;\r\n this.fullAnnualizedSubmittedPremium = this.policy.fullAnnualizedSubmittedPremium;\r\n this.fullAnnualizedPaidPremium = this.policy.fullAnnualizedPaidPremium;\r\n } catch (err) {\r\n this.policy = undefined;\r\n this._notifier.error(`Policy ${this.policyNumber} not found for ${this.carrier.name}`);\r\n }\r\n }\r\n\r\n _datePickerDate(value) {\r\n if (!value) return null;\r\n return new Date(value).toISOString().substring(0, 10);\r\n }\r\n\r\n displayTab(tab) {\r\n this.tab = tab;\r\n }\r\n\r\n async saveDates() {\r\n if (this.isProcessing) return;\r\n\r\n try {\r\n const v = await this.validationController.validate();\r\n if (!v.valid) return;\r\n this.isProcessing = true;\r\n const model = {\r\n imoSource: this.imoSource,\r\n submittedDate: this._apiDate(this.submittedDate),\r\n paidDate: this._apiDate(this.paidDate),\r\n chargebackDate: this._apiDate(this.chargebackDate),\r\n canceledDate: this._apiDate(this.canceledDate),\r\n closedDate: this._apiDate(this.closedDate),\r\n signedDate: this._apiDate(this.signedDate),\r\n issuedDate: this._apiDate(this.issuedDate),\r\n coverageTerminationDate: this._apiDate(this.coverageTerminationDate),\r\n nextDraftDate: this._apiDate(this.nextDraftDate),\r\n effectiveDate: this._apiDate(this.effectiveDate),\r\n };\r\n\r\n await this._api.post(`policy/${encodeURIComponent(this.policy.id)}/set-dates`, model);\r\n this._notifier.success('Dates set');\r\n this.loadPolicy();\r\n } catch (err) {\r\n console.log(err);\r\n this._notifier.error('Error updating dates');\r\n } finally {\r\n this.isProcessing = false;\r\n }\r\n }\r\n\r\n async updatePremium() {\r\n if (this.isProcessing) return;\r\n\r\n try {\r\n const v = await this.validationController.validate();\r\n if (!v.valid) return;\r\n\r\n this.isProcessing = true;\r\n const model = {\r\n submittedPremium: this._premiumValue(this.submittedPremium),\r\n targetPremium: this._premiumValue(this.targetPremium),\r\n paidPremium: this._premiumValue(this.paidPremium),\r\n fullAnnualizedSubmittedPremium: this._premiumValue(this.fullAnnualizedSubmittedPremium),\r\n fullAnnualizedPaidPremium: this._premiumValue(this.fullAnnualizedPaidPremium),\r\n };\r\n await this._api.post(`policy/${encodeURIComponent(this.policy.id)}/set-premiums`, model);\r\n this._notifier.success('Premiums Set');\r\n this.loadPolicy();\r\n } catch (err) {\r\n console.log(err);\r\n this._notifier.error('Error updating policies');\r\n } finally {\r\n this.isProcessing = false;\r\n }\r\n }\r\n\r\n async saveStatus() {\r\n if (this.isProcessing) return;\r\n\r\n try {\r\n const v = await this.validationController.validate();\r\n if (!v.valid) return;\r\n this.isProcessing = true;\r\n const model = {\r\n carrierId: this.policy.carrier.id,\r\n policyNumber: this.policy.policyNumber,\r\n status: this.status,\r\n subStatus: this.subStatus || null\r\n };\r\n\r\n await this._api.post(`policy/${encodeURIComponent(this.policy.id)}/set-status`, model);\r\n this._notifier.success('Status Set');\r\n this.loadPolicy();\r\n } catch (err) {\r\n this._notifier.error('Error updating policy status');\r\n } finally {\r\n this.isProcessing = false;\r\n }\r\n }\r\n\r\n async removeStatusOverride() {\r\n if (this.isProcessingRemove) return;\r\n try {\r\n await this._productionService.removeStatusOverride(this.policy.id);\r\n this._notifier.success('Status Override Removed');\r\n this.loadPolicy();\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.isProcessingRemove = false;\r\n }\r\n }\r\n\r\n async removeSubStatus() {\r\n if (this.removingSubStatus) return;\r\n try {\r\n this.removingSubStatus = true;\r\n await this._productionService.removeSubStatus(this.policy.id);\r\n this._notifier.success('Sub Status Removed');\r\n this.loadPolicy();\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.removingSubStatus = false;\r\n }\r\n }\r\n\r\n async setAgency() {\r\n if (this.isProcessing) return;\r\n\r\n try {\r\n if (!this.agencyMember) return;\r\n this.isProcessing = true;\r\n const model = {\r\n carrierId: this.carrier.id,\r\n policyNumber: this.policyNumber,\r\n baseshopMemberId: this.baseshopMember.id,\r\n };\r\n\r\n await this._api.post('production/set-policy-baseshop', model);\r\n this._notifier.stickySuccess('Updated baseshop');\r\n } catch (err) {\r\n this._notifier.error('Error updating baseshop');\r\n } finally {\r\n this.isProcessing = false;\r\n }\r\n }\r\n\r\n _premiumValue(value) {\r\n if (value === 0) return 0;\r\n if (!value) return null;\r\n return value;\r\n }\r\n\r\n _apiDate(date) {\r\n if (!date) return null;\r\n if (!moment(date).isValid()) return null;\r\n return moment.utc(date).toISOString();\r\n }\r\n\r\n async recalculateCredits() {\r\n try {\r\n await this._api.post(`policy/${encodeURIComponent(this.policy.id)}/recalculate-credits`);\r\n this._notifier.success(`Policy ${this.policy.policyNumber} credits have been recalculated`);\r\n this.loadPolicy();\r\n } catch (err) {\r\n console.log(err);\r\n this._notifier.error(err);\r\n }\r\n }\r\n\r\n deletePolicy() {\r\n const model = { key: 'delete-policy', okButtonClass: 'btn-danger', messageObject: { policyNumber: this.policy.policyNumber } };\r\n\t this._dialogService.open({ viewModel: ConfirmDialog, model, ignoreTransitions: true }).whenClosed(async(response) => {\r\n\t if (response.wasCancelled) return;\r\n await this._deletePolicy();\r\n });\r\n }\r\n\r\n async _deletePolicy() {\r\n try {\r\n await this._api.delete(`policy/${encodeURIComponent(this.policy.id)}`);\r\n this._notifier.success(`Policy ${this.policy.policyNumber} has been deleted`);\r\n this.selectedPolicy = undefined;\r\n } catch (err) {\r\n console.log(err);\r\n this._notifier.error(err);\r\n }\r\n }\r\n\r\n splitPolicy() {\r\n const model = { policyId: this.policy.id };\r\n\t this._dialogService.open({ viewModel: SplitPolicy, model, ignoreTransitions: true }).whenClosed(async(response) => {\r\n this.loadPolicy();\r\n });\r\n }\r\n}\r\n","import { observable } from 'aurelia-framework';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Api } from 'common/server';\r\nimport { Page } from 'common/ui';\r\nimport { ProductionService } from 'services/production-service';\r\nimport { Carriers } from 'services/carriers';\r\nimport moment from 'moment';\r\nimport { c } from 'common/common';\r\n\r\nexport class StatusChanges {\r\n static inject = [EventAggregator, Api, Page, ProductionService, Carriers];\r\n _ea;\r\n _api;\r\n _page;\r\n _production;\r\n _carriers;\r\n\r\n @observable forDate = moment();\r\n carriers;\r\n @observable carrierId;\r\n\r\n policyFilters = [\r\n { value: '', keys: ['c.code', 'policyNumber', 'writingAgentMember.fullName', 'agency.fullName', 'statusValue', 'insuredFullName'] },\r\n { value: 'nucs', custom: this.policyChangeFilter },\r\n ];\r\n changedPolicyFilters = [{ value: '', keys: ['c.code', 'policyNumber', 'writingAgentMember.fullName', 'agency.fullName', 'statusValue', 'insuredFullName']}];\r\n @observable policyStatusN = true;\r\n @observable policyStatusU = true;\r\n @observable policyStatusC = true;\r\n @observable policyStatusS = true;\r\n\r\n constructor(ea, api, page, production, carriers) {\r\n this._ea = ea;\r\n this._api = api;\r\n this._page = page;\r\n this._production = production;\r\n this._carriers = carriers;\r\n\t}\r\n\r\n async activate() {\r\n this.report = undefined;\r\n this.carriers = await this._carriers.all();\r\n }\r\n\r\n attached() {\r\n this._attached = true;\r\n this._load();\r\n }\r\n\r\n forDateChanged(newValue, oldValue) {\r\n if (!this.forDate || !this._attached) return;\r\n console.log('FOR DATE CHANGED');\r\n if (newValue && oldValue) {\r\n if (moment(newValue).isSame(moment(oldValue))) return;\r\n }\r\n this._load();\r\n }\r\n\r\n async carrierIdChanged() {\r\n if (!this._attached) return;\r\n console.log('CARRIER ID CHANGED');\r\n this._load();\r\n }\r\n\r\n async _load() {\r\n try {\r\n console.log('LOADING');\r\n this.loading = true;\r\n this.report = await this._production.policyStatusChanges(this.forDate, this.carrierId);\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.loading = false;\r\n }\r\n }\r\n\r\n policyStatusNChanged() {\r\n this._policyStatusChanged('n');\r\n }\r\n\r\n policyStatusUChanged() {\r\n this._policyStatusChanged('u');\r\n }\r\n\r\n policyStatusCChanged() {\r\n this._policyStatusChanged('c');\r\n }\r\n\r\n policyStatusSChanged() {\r\n this._policyStatusChanged('s');\r\n }\r\n\r\n _policyStatusChanged(policyChange) {\r\n if (this.policyFilters[1].value.indexOf(policyChange) >= 0) {\r\n this.policyFilters[1].value = this.policyFilters[1].value.replace(policyChange, '');\r\n } else {\r\n this.policyFilters[1].value += policyChange;\r\n }\r\n }\r\n\r\n policyChangeFilter(filterValue, row) {\r\n if (!filterValue) return false;\r\n if (filterValue.indexOf('n') >= 0 && row.isNewPolicy) return true;\r\n if (filterValue.indexOf('u') >= 0 && !row.isNewPolicy && row.isPolicyChanged) return true;\r\n if (filterValue.indexOf('c') >= 0 && !row.isPolicyChanged) return true;\r\n if (filterValue.indexOf('s') >= 0 && row.isSplit) return true;\r\n return false;\r\n }\r\n\r\n openPolicy(policyId) {\r\n this._ea.publish(c.EventKeys.site.openPolicy, { policyId: policyId });\r\n }\r\n\r\n async exportStatusChanges() {\r\n const policyIds = [];\r\n this.report.statusChanges.forEach(p => policyIds.push(p.policy.id));\r\n const model = { format: 'commission', policyIds };\r\n await this._page.export(this._api, 'policy/export', model);\r\n }\r\n}\r\n","import Dropzone from 'dropzone';\r\nimport { Notifier } from 'common/ui';\r\nimport { Security } from 'common/security';\r\nimport { I18n } from 'common/i18n';\r\nimport { FilesFor as FilesForService } from 'services/files-for';\r\nimport environment from '../../../config/environment.json';\r\n\r\nexport class UploadFiles {\r\n static inject = [Notifier, Security, I18n, FilesForService]\r\n _notifier;\r\n _security;\r\n _i18n;\r\n _filesFor;\r\n\r\n dropzoneEl;\r\n formAction;\r\n dropzone = null;\r\n isAttached = false;\r\n forType = 'policy';\r\n fileType = 'policy';\r\n\r\n overwriteForIds = [];\r\n\r\n constructor(notifier, security, i18n, filesFor) {\r\n this._notifier = notifier;\r\n this._security = security;\r\n this._i18n = i18n;\r\n this._filesFor = filesFor;\r\n }\r\n\r\n attached() {\r\n this._initialize();\r\n }\r\n\r\n detached() {\r\n if (!this.dropzone) return;\r\n try {\r\n this.dropzone.destroy();\r\n this.dropzone = undefined;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n _initialize() {\r\n this.detached();\r\n this._setFormAction();\r\n this._initializeDropzone();\r\n }\r\n\r\n _setFormAction() {\r\n const qs = [];\r\n qs.push(`forType=${encodeURIComponent(this.forType)}`);\r\n qs.push(`fileType=${encodeURIComponent(this.fileType)}`);\r\n if (this.overwriteForIds.length) qs.push(`overwriteForIds=${encodeURIComponent(this.overwriteForIds.join(','))}`);\r\n this.formAction = `${environment.api}/api/file-for/mass-upload-by-filename?${qs.join('&')}`;\r\n console.log(this.formAction);\r\n if (this.dropzone) this.dropzone.options.url = this.formAction;\r\n }\r\n\r\n setOverwriteForId(message) {\r\n if (message.overwrite) {\r\n this.overwriteForIds.push(message.forId);\r\n } else {\r\n const idx = this.overwriteForIds.findIndex(message.forId);\r\n if (idx >= 0) this.overwriteForIds.splice(idx, 1);\r\n }\r\n this._setFormAction();\r\n }\r\n\r\n _initializeDropzone() {\r\n this.dropzone = undefined;\r\n\r\n const me = this;\r\n let d = new Date();\r\n const timezoneOffset = d.getTimezoneOffset();\r\n const settings = this._filesFor.settings[this.forType] || {extensions:['.pdf'],maxFileMb:50,fileTypes:[]};\r\n this.fileExtensions = settings.extensions.join(', ');\r\n this.fileSize = settings.maxFileMb;\r\n\r\n this.dropzone = new Dropzone(this.dropzoneEl, {\r\n url: this.formAction,\r\n paramName: 'file',\r\n maxFilesize: settings.maxFileMb, // MB\r\n headers: { 'Authorization': `Bearer ${this._security.token}`, 'X-LEGACY-TimezoneOffset': timezoneOffset },\r\n acceptedFiles: settings.extensions.join(','),\r\n maxFiles: 1,\r\n timeout: 180000,\r\n init: function() {\r\n this.on('addedfile', function(file) {\r\n me.processing = true;\r\n me.messages = [];\r\n });\r\n this.on('success', function(file, response) {\r\n this.removeFile(file);\r\n me.messages = response;\r\n me._notifier.success('file-for-upload-success');\r\n me.processing = false;\r\n me.overwriteForIds = [];\r\n });\r\n this.on('error', function(file, error) {\r\n this.removeAllFiles();\r\n me.messages = [];\r\n me.overwriteForIds = [];\r\n me._notifier.error('my-files-upload-failed', true);\r\n me.isProcessing = false;\r\n });\r\n }\r\n });\r\n }\r\n}\r\n\r\n","import {inject} from 'aurelia-framework';\r\nimport {Redirect} from 'aurelia-router';\r\nimport {Page} from 'common/ui';\r\nimport {QandA} from 'services/q-and-a';\r\n\r\n@inject(Page, QandA)\r\nexport class Answer {\r\n\r\n slug;\r\n question;\r\n answerUiWidgetKey;\r\n qAndA;\r\n\r\n constructor(page, qAndA) {\r\n this._page = page;\r\n this._qAndA = qAndA;\r\n }\r\n\r\n activate(params, routerConfig) {\r\n this.slug = params.slug || null;\r\n if (!this.slug) return new Redirect('#admin/answers');\r\n this._page.track('admin/answers/' + this.slug);\r\n this._load();\r\n }\r\n\r\n _load() {\r\n this._qAndA.getIntro(this.slug).then(intro => {\r\n this.qAndA = intro;\r\n this.question = intro.question;\r\n this.answerUiWidgetKey = intro.answerUiWidgetKey;\r\n console.log(this.qAndA);\r\n });\r\n }\r\n}\r\n","import { PLATFORM } from 'aurelia-pal';\r\nimport {inject} from 'aurelia-framework';\r\nimport {EventAggregator} from 'aurelia-event-aggregator';\r\nimport {Security} from 'common/security';\r\nimport {Page} from 'common/ui';\r\nimport {QandA} from 'services/q-and-a';\r\nimport {AnswerEditor} from './dialog/answer-editor';\r\nimport {DialogService} from 'aurelia-dialog';\r\nPLATFORM.moduleName('./dialog/answer-editor');\r\n\r\n@inject(EventAggregator, Security, Page, QandA, DialogService)\r\nexport class Answers {\r\n\r\n slug = null;\r\n intros = [];\r\n\r\n constructor(eventAggregator, security, page, qAndA, dialogService) {\r\n this._ea = eventAggregator;\r\n this._security = security;\r\n\t this._page = page;\r\n\t this._qAndA = qAndA;\r\n\t this.dialogService = dialogService;\r\n\r\n\t this.isAdmin = this._security.isAdmin;\r\n }\r\n\r\n activate(params, routerConfig) {\r\n this._page.track('admin/answers');\r\n this._initialize(true);\r\n }\r\n\r\n attached() {\r\n var me = this;\r\n\t this._initializeHandler = this._ea.subscribe('zeus.answers.initialize', function(uiWidget) {\r\n\t me._initialize(true);\r\n\t });\r\n\t}\r\n\r\n\tdetached() {\r\n\t this._initializeHandler.dispose();\r\n\t}\r\n\r\n\t_initialize(clear) {\r\n\t this._qAndA.initialize(clear).then(intros => {\r\n\t this.intros = intros;\r\n\t });\r\n\t}\r\n\r\n\topenAnswerEditor(intro) {\r\n\t var me = this;\r\n\t this.dialogService.open({ viewModel: AnswerEditor, model: intro, ordering: intro.ordering, ignoreTransitions: true }).whenClosed(response => {\r\n\t if (response.wasCancelled) return;\r\n\r\n\t if (response.output.qAndADeleted) {\r\n\t me.slug = null;\r\n\t }\r\n \r\n\t me.intros = [];\r\n\t me._initialize(true);\r\n\t });\r\n\t}\r\n\r\n\topenAddAnswer() {\r\n\t var me = this;\r\n\t var model = {\r\n\t ordering: me.intros.length ? me.intros[me.intros.length-1].ordering + 1 : 1\r\n\t };\r\n\t this.dialogService.open({ viewModel: AnswerEditor, model: model, ignoreTransitions: true }).whenClosed(response => {\r\n\t if (response.wasCancelled) return;\r\n\t me.intros = [];\r\n\t me._initialize(true);\r\n\t });\r\n\t}\r\n}\r\n","import {inject} from 'aurelia-framework';\r\nimport {DialogController} from 'aurelia-dialog';\r\nimport {NewInstance} from 'aurelia-dependency-injection';\r\nimport {ValidationRules, ValidationController} from 'aurelia-validation';\r\nimport {BootstrapFormValidationRenderer} from 'validation/bootstrap-form-validation-renderer';\r\nimport {I18n} from 'common/i18n';\r\nimport {QandA} from 'services/q-and-a';\r\nimport {c} from 'common/common';\r\n\r\n@inject(DialogController, NewInstance.of(ValidationController), I18n, QandA)\r\nexport class AnswerEditor {\r\n\r\n id = null;\r\n slug = '';\r\n ordering = null;\r\n isActive = false;\r\n showDeleteConfirm = false;\r\n canEditSlug = false;\r\n\r\n constructor(dialogController, validationController, i18n, qAndA) {\r\n this.dialogController = dialogController;\r\n this.dialogController.settings.centerHorizontalOnly = true;\r\n this.validationController = validationController;\r\n this.validationController.addRenderer(new BootstrapFormValidationRenderer());\r\n this._i18n = i18n;\r\n this._qAndA = qAndA;\r\n\r\n this.deleteText = this._i18n.tr('delete');\r\n\r\n ValidationRules\r\n .ensure('slug').required().matches(c.RegEx.slug)\r\n .ensure('ordering').required().satisfiesRule('integerRange', 1, 5000)\r\n .on(this);\r\n }\r\n\r\n activate(model) {\r\n this.id = null;\r\n this.slug = '';\r\n this.ordering = model.ordering || 1;\r\n this.isActive = false;\r\n this.title = this._i18n.tr('q-and-a-add-title');\r\n if (model) {\r\n this.title = this._i18n.tr('q-and-a-edit-title');\r\n this.id = model.id;\r\n this.slug = model.slug;\r\n this.ordering = model.ordering;\r\n this.isActive = model.isActive;\r\n }\r\n\r\n this.canEditSlug = !this.id;\r\n this.validationController.reset();\r\n }\r\n\r\n save() {\r\n var me = this;\r\n this.validationController.validate().then(v => {\r\n if (!v.valid) return;\r\n\r\n me._qAndA.saveQandA(me.id, me.slug, me.ordering, me.isActive).then(() => {\r\n me.dialogController.ok({ qAndADeleted: false });\r\n }).catch(error => { });\r\n });\r\n }\r\n\r\n resetDelete() {\r\n this.showDeleteConfirm = false;\r\n this.deleteText = this._i18n.tr('delete');\r\n }\r\n\r\n deleteQandA() {\r\n if (!this.showDeleteConfirm) {\r\n this.showDeleteConfirm = true;\r\n this.deleteText = this._i18n.tr('delete-confirm');\r\n return;\r\n }\r\n\r\n this.showDeleteConfirm = false;\r\n\r\n this._qAndA.deleteQandA(this.id).then(() => {\r\n this.dialogController.ok({ qAndADeleted: true });\r\n }).catch(error => { });\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Security } from 'common/security';\r\nimport { Menus } from 'services/menus';\r\nimport { PLATFORM } from 'aurelia-pal';\r\nimport { RouterConfigBase } from 'resources/base-classes/router-config-base';\r\n\r\nexport class Reports extends RouterConfigBase {\r\n\tstatic inject = [EventAggregator, Security, Menus];\r\n\r\n constructor(ea, security, menus) {\r\n super(ea, security, menus, undefined, false);\r\n }\r\n \r\n configureRouter(config, router){\r\n config.auth = true;\r\n config.map([\r\n {\r\n route: ['', 'agent-reports'],\r\n moduleId: PLATFORM.moduleName('admin/reports/agent-reports'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: true,\r\n settings: { title: 'Agent Reports', description: 'Export bonus and production summaries' },\r\n },\r\n {\r\n route: 'agency-reports',\r\n moduleId: PLATFORM.moduleName('admin/reports/agency-reports'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: true,\r\n settings: { title: 'Agency Reports', description: 'Export agency bonus reports' },\r\n },\r\n {\r\n route: 'level-changed',\r\n moduleId: PLATFORM.moduleName('admin/reports/system-events/level-changed'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: true,\r\n settings: { title: 'Level Change Reports', description: 'Export level changes' },\r\n },\r\n {\r\n route: 'products',\r\n moduleId: PLATFORM.moduleName('admin/reports/product-reports'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: true,\r\n settings: { title: 'Product Reports', description: 'Export all products' },\r\n },\r\n {\r\n route: 'policies',\r\n moduleId: PLATFORM.moduleName('admin/reports/policy-reports'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: true,\r\n settings: { title: 'Policy Reports', description: 'Find and export policies' },\r\n },\r\n {\r\n route: 'audit',\r\n moduleId: PLATFORM.moduleName('admin/reports/audit-logs/audit-logs'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: true,\r\n settings: { title: 'Audit Logs', description: 'View changes to policies and agents' },\r\n }\r\n ]);\r\n\r\n this.router = router;\r\n }\r\n\r\n attached() {\r\n this._attached();\r\n }\r\n\r\n detached() {\r\n this._detached();\r\n }\r\n}\r\n","import { observable } from 'aurelia-framework';\r\nimport { Api } from 'common/server';\r\nimport { Page } from 'common/ui';\r\nimport { ProductionService } from 'services/production-service';\r\nimport { TIME_PERIOD, CREDIT_TYPE, CHART_COLORS } from 'common/constants';\r\nimport { mode } from 'common/ui';\r\nimport moment from 'moment';\r\n\r\nexport class AgencyReports {\r\n static inject = [Api, Page, ProductionService];\r\n _api;\r\n _page;\r\n _productionSvc;\r\n\r\n reports = [];\r\n\r\n reportMonth = moment().format();\r\n\r\n monthLineDatasets;\r\n creditTypes = CREDIT_TYPE.all();\r\n @observable viewCreditType = CREDIT_TYPE.SubmittedActual;\r\n\r\n constructor(api, page, productionSvc) {\r\n this._api = api;\r\n this._page = page;\r\n this._productionSvc = productionSvc;\r\n\r\n this._initialize();\r\n }\r\n\r\n _initialize() {\r\n this.reports.push({ name: 'Agency Monthly Bonus (original)', api: 'report/agency-monthly-bonus-export', working: false, useDate: true, model: {} });\r\n this.reports.push({ name: 'Agency Monthly Bonus 2 (50k min; 50% max per leg; downline subtracted)', api: 'report/agency-monthly-bonus2-export', working: false, useDate: true, model: {} });\r\n this.reports.push({ name: 'Agency Monthly Production', api: 'production/agency/submitted-production-export', working: false, useDate: true, model: { timePeriod: TIME_PERIOD.MTD } });\r\n this.reports.push({ name: 'Agency Last 6-Month Production Summary', api: 'production/agency/submitted-production-export', working: false, useDate: true, model: { timePeriod: TIME_PERIOD.SixMonthRolling } });\r\n //this.reports.push({ name: 'Agency Last 6-Month Production by Month', api: 'production/agency/monthly-production-export', working: false, useDate: true, model: { timePeriod: TIME_PERIOD.SixMonthRolling } });\r\n this.reports.push({ name: 'Agency YTD Production', api: 'production/agency/submitted-production-export', working: false, useDate: true, model: { timePeriod: TIME_PERIOD.YTD } });\r\n }\r\n\r\n attached() {\r\n this._loadMonthlyProduction();\r\n }\r\n\r\n viewCreditTypeChanged() {\r\n this._loadMonthlyProduction();\r\n }\r\n\r\n async _loadMonthlyProduction() {\r\n try {\r\n if (!this._monthlyProductionData) {\r\n this._monthlyProductionData = await this._productionSvc.agencyMonthlyProduction(TIME_PERIOD.SixMonthRolling);\r\n }\r\n const monthLineDatasets = [];\r\n const uiMode = mode();\r\n const colors = CHART_COLORS.Classic(uiMode);\r\n let ctr = 0;\r\n this._monthlyProductionData.agencies.forEach(record => {\r\n const data = [];\r\n record.months.forEach(monthRecord => {\r\n const firstOfMonth = moment.utc(monthRecord.month.endOffset).startOf('month');\r\n const premium = monthRecord.premiums.find(x => x.creditType === this.viewCreditType) ?? { premium: 0 };\r\n data.push({ date: firstOfMonth.toISOString(), value: premium.premium });\r\n });\r\n monthLineDatasets.push({\r\n key: record.agency.fullName,\r\n data: data,\r\n color: colors[ctr++],\r\n });\r\n });\r\n this.monthLineDatasets = monthLineDatasets;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async exportReport(report) {\r\n try {\r\n const model = Object.assign(\r\n {},\r\n report.model,\r\n report.useDate ? { date: this.reportMonth.format('MM/DD/YYYY') } : {},\r\n );\r\n report.working = true;\r\n await this._page.export(this._api, report.api, model);\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n report.working = false;\r\n }\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { Page } from 'common/ui';\r\nimport moment from 'moment';\r\n\r\nexport class AgentReports {\r\n static inject = [Api, Page];\r\n _api;\r\n _page;\r\n\r\n reports = [];\r\n reportDate = moment();\r\n\r\n constructor(api, page) {\r\n this._api = api;\r\n this._page = page;\r\n this._initialize();\r\n }\r\n\r\n _initialize() {\r\n this.reports.push({ name: 'Monthly Bonus', api: 'report/agent-monthly-bonus-export', working: false, useDate: true, model: {} });\r\n this.reports.push({ name: 'Monthly Production', api: 'production/agent/submitted-production-export', working: false, useDate: true, model: { timePeriod: 'mtd' } });\r\n this.reports.push({ name: 'YTD Production Summary', api: 'production/agent/ytd-production-summary-export', working: false, useDate: true, model: { timePeriod: 'ytd' } });\r\n }\r\n\r\n async exportReport(report) {\r\n try {\r\n const model = Object.assign(\r\n {},\r\n report.model,\r\n report.useDate ? { date: this.reportDate.format('MM/DD/YYYY') } : {},\r\n );\r\n report.working = true;\r\n await this._page.export(this._api, report.api, model);\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n report.working = false;\r\n }\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport moment from 'moment';\r\n\r\nexport class AuditLogs {\r\n static inject = [Api];\r\n\tstart;\r\n\tend;\r\n\tisProcessing = false;\r\n canNavigate = true;\r\n canGoNext = false;\r\n\r\n pageSize = 50;\r\n\r\n\tconstructor(api) {\r\n\t\tthis._api = api;\r\n\t}\r\n\r\n\tasync run() {\r\n try {\r\n this.isProcessing = true;\r\n const qs = [];\r\n qs.push(`start=${this.start}`);\r\n if (this.end) qs.push(`end=${this.end}`);\r\n const url = `audit-log?${qs.join('&')}`;\r\n this.logs = await this._api.get(url);\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.isProcessing = false;\r\n }\r\n\t}\r\n\r\n activate() {\r\n this._initializing = true;\r\n this.start = moment().startOf('day').add(-1, 'days').format().datePickerDate();\r\n this.end = moment().startOf('day').add(-1, 'days').format().datePickerDate();\r\n this._setNavigation();\r\n this.run();\r\n this._initializing = false;\r\n }\r\n\r\n dateChanged() {\r\n if (this._initializing) return;\r\n if (!this.enterStartAndEnd) this.end = this.start;\r\n this._setNavigation();\r\n this.run();\r\n }\r\n\r\n _setNavigation() {\r\n this.canNavigate = !this.enterStartAndEnd;\r\n this.canGoNext = this.canNavigate && this.start && moment(this.start).startOf('day').isBefore(moment().startOf('day'));\r\n }\r\n\r\n previous() {\r\n if (!this.canNavigate) return;\r\n this._navigate(-1);\r\n }\r\n\r\n next() {\r\n if (!this.canGoNext || !this.canNavigate) return;\r\n this._navigate(1);\r\n }\r\n\r\n _navigate(days) {\r\n this.start = moment(this.start).add(days, 'days').format().datePickerDate();\r\n this.end = moment(this.end).add(days, 'days').format().datePickerDate();\r\n this.run();\r\n this._setNavigation();\r\n }\r\n}\r\n","import { observable } from 'aurelia-framework';\r\nimport { Api } from 'common/server';\r\nimport { Page } from 'common/ui';\r\nimport { Carriers } from 'services/carriers';\r\nimport { Products } from 'services/products';\r\nimport { Reports } from 'services/reports';\r\nimport { ProductionService } from 'services/production-service';\r\n\r\nexport class PolicyReports {\r\n static inject = [Api, Page, Carriers, Products, Reports, ProductionService];\r\n _api;\r\n _page;\r\n _carriers;\r\n _products;\r\n _reports;\r\n _productionService;\r\n\r\n reports = [];\r\n policyNumber;\r\n focusPolicyNumber = true;\r\n submittedRange;\r\n paidRange;\r\n updatedRange;\r\n writingAgent;\r\n agency;\r\n carriers;\r\n @observable carrierId;\r\n products;\r\n productId;\r\n status;\r\n statuses = [];\r\n\r\n pageSize = 10;\r\n\r\n constructor(api, page, carriers, products, reports, productionService) {\r\n this._api = api;\r\n this._page = page;\r\n this._carriers = carriers;\r\n this._products = products;\r\n this._reports = reports;\r\n this._productionService = productionService;\r\n this._initialize();\r\n }\r\n\r\n _initialize() {\r\n this.reports.push({ name: 'Export Policies', api: 'policy/export', working: false, usePolicyNumber: true, useSubmittedDates: true, usePaidDates: true, useUpdatedDates: true, useWritingAgent: true, useAgency: true, useCarrier: true, useProduct: true, useClient: true, useStatus: true, model: {} });\r\n this.reports.push({ name: 'Export Policies - Angie\\'s Format', api: 'policy/export', working: false, usePolicyNumber: true, useSubmittedDates: true, usePaidDates: true, useUpdatedDates: true, useWritingAgent: true, useAgency: true, useCarrier: true, useProduct: true, useClient: true, useStatus: true, model: { format: 'commission' } });\r\n }\r\n\r\n attached() {\r\n this._load();\r\n }\r\n\r\n async _load() {\r\n try {\r\n this.statuses = await this._productionService.policyStatuses();\r\n this.carriers = await this._carriers.all();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async carrierIdChanged() {\r\n try {\r\n if (!this.carrierId) {\r\n this.products = undefined;\r\n return;\r\n }\r\n this.products = await this._products.list(this.carrierId);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async loadPolicies() {\r\n if (this.working) return;\r\n try {\r\n this.working = true;\r\n this.showList = true;\r\n const model = this._reportQuery(this.reports[0]);\r\n const data = await this._reports.policies(model);\r\n this.policies = data.policies;\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.working = false;\r\n }\r\n }\r\n\r\n async exportReport(report) {\r\n if (report.working) return;\r\n try {\r\n const model = this._reportQuery(report);\r\n report.working = true;\r\n await this._page.export(this._api, report.api, model);\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n report.working = false;\r\n }\r\n }\r\n\r\n _reportQuery(report) {\r\n const model = Object.assign(\r\n {},\r\n report.model,\r\n report.usePolicyNumber && this.policyNumber ? {\r\n policyNumber: this.policyNumber\r\n } : {},\r\n report.useSubmittedDates && this.submittedRange && this.submittedRange.length === 2 ? {\r\n submittedStartDate: this.submittedRange[0].format('MM/DD/YYYY'),\r\n submittedEndDate: this.submittedRange[1].format('MM/DD/YYYY')\r\n } : {},\r\n report.usePaidDates && this.paidRange && this.paidRange.length === 2 ? {\r\n paidStartDate: this.paidRange[0].format('MM/DD/YYYY'),\r\n paidEndDate: this.paidRange[1].format('MM/DD/YYYY')\r\n } : {},\r\n report.useUpdatedDates && this.updatedRange && this.updatedRange.length === 2 ? {\r\n updatedStartDate: this.updatedRange[0].format('MM/DD/YYYY'),\r\n updatedEndDate: this.updatedRange[1].format('MM/DD/YYYY')\r\n } : {},\r\n report.useWritingAgent && this.writingAgent ? {\r\n writingAgentId: this.writingAgent.id\r\n } : {},\r\n report.useAgency && this.agency ? {\r\n agencyId: this.agency.id\r\n } : {},\r\n report.useCarrier && this.carrierId ? {\r\n carrierId: this.carrierId\r\n } : {},\r\n report.useProduct && this.productId ? {\r\n productId: this.productId\r\n } : {},\r\n report.useClient && this.clientName ? {\r\n clientName: this.clientName\r\n } : {},\r\n report.useStatus && this.status ? {\r\n status: this.status\r\n } : {},\r\n );\r\n return model;\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { Page } from 'common/ui';\r\n\r\nexport class ProductReports {\r\n static inject = [Api, Page];\r\n _api;\r\n _page;\r\n\r\n constructor(api, page) {\r\n this._api = api;\r\n this._page = page;\r\n }\r\n\r\n async exportReport() {\r\n try {\r\n this.working = true;\r\n await this._page.export(this._api, 'product/report/list-export');\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.working = false;\r\n }\r\n }\r\n}\r\n","import { inject } from 'aurelia-framework';\r\nimport { Api } from 'common/server';\r\nimport { Page } from 'common/ui';\r\n\r\n@inject(Api, Page)\r\nexport class LevelChanged {\r\n\r\n\tstartDate = '';\r\n\tendDate = '';\r\n\tisProcessing = false;\r\n\r\n\tconstructor(api, page) {\r\n\t\tthis.api = api;\r\n\t\tthis.page = page;\r\n\t}\r\n\r\n\tasync exportLevelChangedEvents() {\r\n try {\r\n this.isProcessing = true;\r\n let theStartDate = null;\r\n let theEndDate = null;\r\n if (this.startDate) theStartDate = this.startDate.format('YYYY-MM-DD');\r\n if (this.endDate) theEndDate = this.endDate.format('YYYY-MM-DD');\r\n const postData = {\r\n startDate: theStartDate,\r\n endDate: theEndDate\r\n };\r\n await this.page.exportData(this.api, 'system-events/export-level-changes-key', 'system-events/export-level-changes', postData);\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.isProcessing = false;\r\n }\r\n\t}\r\n}\r\n","import { observable } from 'aurelia-framework';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport { Sites } from 'services/sites';\r\nimport { NewInstance } from 'aurelia-dependency-injection';\r\nimport { ValidationRules, ValidationController } from 'aurelia-validation';\r\nimport { BootstrapFormValidationRenderer } from 'validation/bootstrap-form-validation-renderer';\r\nimport environment from '../../../../config/environment.json';\r\n\r\nexport class SiteThemeEditor {\r\n static inject = [DialogController, Sites, NewInstance.of(ValidationController)];\r\n dialogController;\r\n _sites;\r\n _validationController;\r\n\r\n siteName;\r\n @observable domain;\r\n primaryColor;\r\n secondaryColor;\r\n highlightColor;\r\n boxBackgroundColor;\r\n\r\n showDeleteConfirm = false;\r\n deleteTextKey = 'delete';\r\n\r\n constructor(dialogController, sites, validationController) {\r\n this.dialogController = dialogController;\r\n this._sites = sites;\r\n this._validationController = validationController;\r\n\t\tthis._validationController.addRenderer(new BootstrapFormValidationRenderer());\r\n\r\n\t\tValidationRules\r\n .ensure('siteName').required()\r\n .ensure('domain').required()\r\n .ensure('email').required().email()\r\n .on(this);\r\n }\r\n\r\n async activate(model) {\r\n try {\r\n model = model || {};\r\n this.domain = model.domain;\r\n this.isNew = this.domain ? false : true;\r\n if (!this.isNew) {\r\n await this._load();\r\n }\r\n this._setImageUploadUrls();\r\n this._validationController.reset();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async _load() {\r\n try {\r\n if (!this.domain) return;\r\n this.theme = await this._sites.themeByDomain(this.domain);\r\n this.siteName = this.theme.siteName;\r\n this.email = this.theme.email;\r\n this.primaryColor = this.theme.primaryColor;\r\n this.secondaryColor = this.theme.secondaryColor;\r\n this.highlightColor = this.theme.highlightColor;\r\n this.boxBackgroundColor = this.theme.boxBackgroundColor;\r\n this.logoPath = `${environment.static}/${this.theme.logoPath}`;\r\n this.logoLightPath = `${environment.static}/${this.theme.light.logoPath}`;\r\n this.logoDarkPath = `${environment.static}/${this.theme.dark.logoPath}`;\r\n this.logoIconPath = `${environment.static}/${this.theme.logoIconPath}`;\r\n this.splashLogoPath = `${environment.static}/${this.theme.splash.logoPath}`;\r\n this.splashBackgroundImagePath = `${environment.static}/${this.theme.splash.backgroundImagePath}`;\r\n this.faviconFilePath = `${environment.static}/${this.theme.faviconFilePath}`;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n domainChanged() {\r\n this._setImageUploadUrls();\r\n }\r\n\r\n _setImageUploadUrls() {\r\n this.logoUploadUrl = `${environment.api}/api/site/themes/upload/logo?domain=${encodeURIComponent(this.domain)}`;\r\n this.logoLightUploadUrl = `${environment.api}/api/site/themes/upload/logo-light?domain=${encodeURIComponent(this.domain)}`;\r\n this.logoDarkUploadUrl = `${environment.api}/api/site/themes/upload/logo-dark?domain=${encodeURIComponent(this.domain)}`;\r\n this.logoIconUploadUrl = `${environment.api}/api/site/themes/upload/logo-icon?domain=${encodeURIComponent(this.domain)}`;\r\n this.splashLogoUploadUrl = `${environment.api}/api/site/themes/upload/splash-logo?domain=${encodeURIComponent(this.domain)}`;\r\n this.backgroundImageUploadUrl = `${environment.api}/api/site/themes/upload/bg?domain=${encodeURIComponent(this.domain)}`;\r\n this.faviconsUploadUrl = `${environment.api}/api/site/themes/upload/favicons?domain=${encodeURIComponent(this.domain)}`;\r\n }\r\n \r\n async save() {\r\n try {\r\n const v = await this._validationController.validate();\r\n if (!v.valid) return;\r\n\r\n if (this.isNew) {\r\n const result = await this._sites.addTheme(this.domain, this.siteName, this.email, this.primaryColor, this.secondaryColor, this.highlightColor, this.boxBackgroundColor);\r\n this.isNew = false;\r\n this._load();\r\n return;\r\n } else {\r\n const result = await this._sites.updateTheme(this.domain, this.siteName, this.email, this.primaryColor, this.secondaryColor, this.highlightColor, this.boxBackgroundColor);\r\n }\r\n this.dialogController.ok();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async fileUploaded(fileType) {\r\n try {\r\n await this._load();\r\n switch (fileType) {\r\n case 'logo':\r\n this.logoPath = `${environment.static}/${this.theme.rootPath}/${this.theme.logoName}`;\r\n break;\r\n case 'logo-light':\r\n this.logoLightPath = `${environment.static}/${this.theme.rootPath}/${this.theme.light.logo}`;\r\n break;\r\n case 'logo-dark':\r\n this.logoDarkPath = `${environment.static}/${this.theme.rootPath}/${this.theme.dark.logo}`;\r\n break;\r\n case 'logo-icon':\r\n this.logoIconPath = `${environment.static}/${this.theme.rootPath}/${this.theme.logoIcon}`;\r\n break;\r\n case 'splash-logo':\r\n this.splashLogoPath = `${environment.static}/${this.theme.rootPath}/${this.theme.splash.logoName}`;\r\n break;\r\n case 'bg':\r\n this.splashBackgroundImagePath = `${environment.static}/${this.theme.rootPath}/${this.theme.splash.backgroundImageName}`;\r\n break;\r\n case 'favicons':\r\n this.faviconLogoPath = `${environment.static}/${this.theme.rootPath}/${this.theme.faviconFilePath}`;\r\n break;\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n resetDelete() {\r\n this.showDeleteConfirm = false;\r\n this.deleteTextKey = 'delete';\r\n }\r\n\r\n async deleteSiteTheme() {\r\n if (!this.showDeleteConfirm) {\r\n this.showDeleteConfirm = true;\r\n this.deleteTextKey = 'delete-confirm';\r\n return;\r\n }\r\n\r\n this.showDeleteConfirm = false;\r\n if (this.deleting) return;\r\n try {\r\n this.deleting = true;\r\n await this._sites.deleteTheme(this.domain);\r\n this.dialogController.ok({ themeDeleted: true });\r\n } catch(err) {\r\n this.resetDelete();\r\n console.log(err);\r\n } finally {\r\n this.deleting = false;\r\n }\r\n }\r\n} \r\n\r\n ","import { PLATFORM } from 'aurelia-pal';\r\nimport { SiteThemeEditor } from './dialog/site-theme-editor';\r\nimport { DialogService } from 'aurelia-dialog';\r\nimport { Sites } from 'services/sites';\r\nimport environment from '../../../config/environment.json';\r\nPLATFORM.moduleName('./dialog/site-theme-editor');\r\n\r\nexport class SiteList {\r\n static inject = [Sites, DialogService]\r\n _sites;\r\n _dialogService;\r\n _ea;\r\n\r\n loading = false;\r\n\r\n siteThemes = [];\r\n\r\n constructor(sites, dialogService) {\r\n this._sites = sites;\r\n this._dialogService = dialogService;\r\n }\r\n\r\n attached() {\r\n this._load();\r\n }\r\n\r\n async _load() {\r\n try {\r\n this.loading = true;\r\n this.siteThemes = await this._sites.themes();\r\n this.siteThemes.forEach(st => st.logoPathFull = `${environment.static}/${st.logoPath}`);\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.loading = false;\r\n }\r\n }\r\n\r\n async openEditor(theme) {\r\n await this._dialogService.open({ viewModel: SiteThemeEditor, model: { domain: theme ? theme.domain : null } || {}, ignoreTransitions: true }).whenClosed(async(response) => {\r\n this.siteThemes = [];\r\n await this._load();\r\n });\r\n return false;\r\n }\r\n\r\n async toggleActive(siteTheme) {\r\n try {\r\n siteTheme.isActive = !siteTheme.isActive;\r\n await this._sites.setThemeActive(siteTheme.domain, siteTheme.isActive);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n}\r\n","import {inject} from 'aurelia-framework';\r\nimport {EventAggregator} from 'aurelia-event-aggregator';\r\nimport {Api} from 'common/server';\r\nimport {Page} from 'common/ui';\r\n\r\n@inject(EventAggregator, Api, Page)\r\nexport class TeamMemberHierarchy {\r\n\r\n\tmemberId = null;\r\n\tprofile = null;\r\n\tfullName = '';\r\n\r\n\tconstructor(eventAggregator, api, page) {\r\n\t\tthis.eventAggregator = eventAggregator;\r\n\t\tthis.api = api;\r\n\t\tthis.page = page;\r\n\t}\r\n\r\n\tactivate(params, routerConfig) {\r\n\t\tthis.memberId = params.id;\r\n\t\tthis.loadMember();\r\n\t\tthis.page.scrollToTop();\r\n\t}\r\n\r\n\tloadMember() {\r\n\t\tvar self = this;\r\n\t\tself.api.getData(\"member/\" + this.memberId).then(memberProfile => {\r\n\t\t\tself.profile = memberProfile;\r\n\t\t\tself.fullName = memberProfile.firstName + ' ' + memberProfile.lastName;\r\n\t\t}).catch(error => { });\r\n\t}\r\n\r\n\tshowProfile() {\r\n\t\tthis.eventAggregator.publish(\"zeus.show-member-profile-popup\", { member: this.profile, memberId: this.memberId });\r\n\t}\r\n\r\n}\r\n","import { PLATFORM } from 'aurelia-pal';\r\nimport { Api } from 'common/server';\r\nimport { Notifier } from 'common/ui';\r\nimport { Router } from 'aurelia-router';\r\nimport { DialogService } from 'aurelia-dialog';\r\nimport { AssignRoles } from './dialogs/assign-roles';\r\nimport { SetLevel } from './dialogs/set-level';\r\nimport { ChangeParent } from './dialogs/change-parent';\r\nimport { InactivateMember } from './dialogs/inactivate-member';\r\nimport { ResetPasswordNow } from './dialogs/reset-password-now';\r\nimport { SetMentor } from './dialogs/set-mentor';\r\nimport { ConfirmDialog } from 'common/dialogs/confirm/confirm-dialog';\r\nPLATFORM.moduleName('./dialogs/assign-roles');\r\nPLATFORM.moduleName('./dialogs/set-level');\r\nPLATFORM.moduleName('./dialogs/change-parent');\r\nPLATFORM.moduleName('./dialogs/inactivate-member');\r\nPLATFORM.moduleName('./dialogs/reset-password-now');\r\nPLATFORM.moduleName('./dialogs/set-mentor');\r\nPLATFORM.moduleName('common/dialogs/confirm/confirm-dialog');\r\n\r\nexport class TeamMember {\r\n static inject = [Router, Api, Notifier, DialogService];\r\n memberId = null;\r\n isActive = true;\r\n\r\n\tconstructor(router, api, notifier, dialogService) {\r\n\t\tthis.router = router;\r\n\t\tthis.api = api;\r\n\t\tthis.notifier = notifier;\r\n this._dialogService = dialogService;\r\n\t}\r\n\r\n\tactivate(params) {\r\n\t this.memberId = params.id;\r\n\t this.loadMember();\r\n\t}\r\n\r\n\tasync loadMember() {\r\n try {\r\n \t const data = await this.api.get(`member/${this.memberId}`);\r\n\t\t\tthis.fullName = data.fullName;\r\n\t this.isActive = data.isActive;\r\n\t } catch (err) {\r\n\t this.notifier.generalError();\r\n\t }\r\n\t}\r\n\r\n\tasync tryDelete() {\r\n const model = { key: 'delete-agent', okButtonClass: 'btn-danger', messageObject: { name: this.fullName } };\r\n\t this._dialogService.open({ viewModel: ConfirmDialog, model, ignoreTransitions: true }).whenClosed(async(response) => {\r\n\t if (response.wasCancelled) return;\r\n\t\t\ttry {\r\n\t\t\t\tthis.showLoader = true;\r\n\t\t\t\tawait this.api.delete(`member/${this.memberId}`);\r\n\t\t\t\t// go back to the search page\r\n\t\t\t\treturn this.router.navigate('team-members', true);\r\n\t\t\t} catch (err) {\r\n\t\t\t\tif (err) this.notifier.error(err);\r\n\t\t\t\telse this.notifier.generalError();\r\n\t\t\t} finally {\r\n\t\t\t\tthis.showLoader = false;\r\n\t\t\t}\r\n });\r\n\t}\r\n\r\n openDialog(type) {\r\n const model = { memberId: this.memberId };\r\n let viewModel;\r\n switch (type) {\r\n case 'assign-roles': viewModel = AssignRoles; break;\r\n case 'set-level': viewModel = SetLevel; break;\r\n case 'change-parent': viewModel = ChangeParent; break;\r\n case 'inactivate-member': viewModel = InactivateMember; break;\r\n case 'reset-password': viewModel = ResetPasswordNow; break;\r\n\t\t\tcase 'mentor': viewModel = SetMentor; break;\r\n default: return;\r\n }\r\n\t this._dialogService.open({ viewModel, model, ignoreTransitions: true }).whenClosed(response => {\r\n\t if (response.wasCancelled) return;\r\n\t this.loadMember();\r\n\t });\r\n }\r\n}\r\n","import {inject} from 'aurelia-framework';\r\nimport {Api} from 'common/server';\r\nimport {Page} from 'common/ui';\r\n\r\n@inject(Api, Page)\r\nexport class TeamMembers {\r\n\r\n\tconstructor(api, page) {\r\n\t\tthis.api = api;\r\n\t\tthis.page = page;\r\n\t}\r\n\r\n\texportAll() {\r\n\t this.page.exportData(this.api, 'admin/export-members-key', 'admin/export-members', null)\r\n .then(response => { /*nothing...already handled*/ })\r\n .catch(error => { console.log(error); });\r\n\t}\r\n}\r\n","export class UsMap { }","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;"],"names":[],"sourceRoot":""}