{"version":3,"file":"app-1146dd7e.9729664bca28a8e6916d.bundle.js","mappings":";;;;;;;;;;;;;;AAAA;AAEA;AAIA;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnBA;;;;;;;;;;;;;;;ACFA;AAEA;AAMA;AAAA;AAJA;AAKA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAnDA;;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AASA;AAAA;AAPA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AA3GA;;;;;;;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AAEA;AAMA;AAAA;AAJA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;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;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AAjDA;;;;;;;;;;;;;;;ACLA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAxDA;;;;;;;;;;;;;;;ACFA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAnBA;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AAEA;AAMA;AAAA;AAJA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AA7FA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;AChHA;AACA;AACA;AACA;AAEA;AAUA;AAAA;AARA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAhKA;;;;;;;;;;;;;;;ACLA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AArBA;;;;;;;;;;;;;;;ACFA;AAEA;AAMA;AAAA;AAJA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAzCA;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AAEA;AAMA;AAAA;AAJA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAlDA;;;;;;;;;;;;;;;ACJA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAjCA;;;;;;;;;;;;;;;;ACFA;AACA;AAEA;AAOA;AAAA;AALA;AAEA;AAIA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnFA;;;;;;;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AAEA;AASA;AAAA;AAPA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAlIA;;;;;;;;;;;;;;;;;ACPA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAKA;AAAA;AAHA;AAIA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AA5BA;;;;;;;;;;;;;;;ACfA;AAEA;AAMA;AAAA;AAJA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAvBA;;;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AAAA;AANA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAhDA;;;;;;;;;;;;;;;;;;ACPA;AACA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AA1BA;AA4BA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACnDA;AAEA;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;;;;;;;;;;;;;;;;;;AC9BA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AAFA;AAuBA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAWA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAhJA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAwCA;AACA;AACA;AACA;AACA;AACA;AACA;AAkFA;AAtJA;;;;;;;;;;;;;;;;ACLA;AACA;AAEA;AAUA;AAAA;AARA;AAEA;AACA;AACA;AACA;AAIA;AAEA;AACA;AAEA;AACA;AACA;AACA;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;AA9CA;;;;;;;;;;;;;;;;ACHA;AAEA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAfA;;;;;;;;;;;;;;;;;;ACPA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjDA;;;;;;;;;;;;;;;;;;ACrBA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAEA;AACA;AAEA;AAKA;AAAA;AAHA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAvDA;;;;;;;;;;;;;;;;ACnCA;AACA;AAEA;AAKA;AAAA;AAHA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AA1BA;;;;;;;;;;;;;;;ACHA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AArCA;;;;;;;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AACA;AAAA;AAAA;AANA;AACA;AACA;AACA;AAyLA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtMA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAoBA;AAhNA;;;;;;;;;;;;;;;AC3FA;AAEA;AAMA;AAAA;AAJA;AAKA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAnBA;;;;;;;;;;;;;;;ACFA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AA3BA;;;;;;;;;;;;;;;ACFA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAbA;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AAEA;AAOA;AAAA;AALA;AAEA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjEA;;;;;;;;;;;;;;;;ACJA;AACA;AAEA;AAKA;AAAA;AAHA;AAIA;AACA;AACA;AAEA;AACA;AAGA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAxBA;;;;;;;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AAEA;AAKA;AAAA;AAHA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AAAA;AANA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;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;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AA/IA;;;;;;;;;;;;;;;;ACRA;AACA;AAEA;AAKA;AAAA;AAHA;AAIA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAhCA;;;;;;;;;;;;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAcA;AAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;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;AAEA;AAEA;AACA;AACA;AACA;AAGA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;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;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAzOA;;;;;;;;;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAgBA;AAAA;AAdA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;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;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAvMA;;;;;;;;;;;;;;;ACbA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AArBA;;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AAEA;AAcA;AAAA;AAZA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;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;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAjMA;;;;;;;;;;;;;;;;;ACNA;AACA;AAEA;AAEA;AAOA;AAAA;AALA;AACA;AAKA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAGA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;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;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAhFA;;;;;;;;;;;;;;;ACLA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AA1IA;;;;;;;;;;;;;;;ACFA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAZA;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AALA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AApEA;;;;;;;;;;;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAOA;AAAA;AALA;AACA;AAKA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AArLA;;;;;;;;;;;;;;;ACzDA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAGA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AA3CA;;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AAEA;AAKA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACpHA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AA7KA;;;;;;;;;;;;;;;;;;;ACJA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC1CA;AACA;AACA;AAEA;AAKA;AAAA;AAHA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAvKA;;;;;;;;;;;;;;;ACJA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAXA;;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AAEA;AAKA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;ACtMA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAnDA;;;;;;;;;;;;;;;ACJA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAnBA;;;;;;;;;;;;;;;;ACFA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxBA;AA0BA;AACA;AACA;;;;;;;;;;;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AAEA;AAaA;AAAA;AAXA;AACA;AACA;AAEA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAtEA;;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAUA;AAAA;AARA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA3FA;;;;;;;;;;;;;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;;AAEA;AAAA;AAJA;AAKA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AAAA;AAGA;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;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;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;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAnKA;;;;;;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AANA;AACA;AACA;AAKA;AAEA;AACA;AACA;AAEA;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;;;;;;;;;;;;;;;ACpDA;AAEA;AAIA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAXA","sources":["webpack://www.zeusteam.com/./src/services/agency.js","webpack://www.zeusteam.com/./src/services/agent-numbers.js","webpack://www.zeusteam.com/./src/services/agent-sites.js","webpack://www.zeusteam.com/./src/services/analytics.js","webpack://www.zeusteam.com/./src/services/badges.js","webpack://www.zeusteam.com/./src/services/bonuses.js","webpack://www.zeusteam.com/./src/services/calendar.js","webpack://www.zeusteam.com/./src/services/capacitor.js","webpack://www.zeusteam.com/./src/services/carriers.js","webpack://www.zeusteam.com/./src/services/commissions.js","webpack://www.zeusteam.com/./src/services/config.js","webpack://www.zeusteam.com/./src/services/content.js","webpack://www.zeusteam.com/./src/services/contests.js","webpack://www.zeusteam.com/./src/services/crm.js","webpack://www.zeusteam.com/./src/services/dashboards.js","webpack://www.zeusteam.com/./src/services/dialer.js","webpack://www.zeusteam.com/./src/services/favorites.js","webpack://www.zeusteam.com/./src/services/files-for.js","webpack://www.zeusteam.com/./src/services/files.js","webpack://www.zeusteam.com/./src/services/functions.js","webpack://www.zeusteam.com/./src/services/geography.js","webpack://www.zeusteam.com/./src/services/google.js","webpack://www.zeusteam.com/./src/services/imports.js","webpack://www.zeusteam.com/./src/services/kpis.js","webpack://www.zeusteam.com/./src/services/lead-scripts.js","webpack://www.zeusteam.com/./src/services/lead-sources.js","webpack://www.zeusteam.com/./src/services/leaderboards.js","webpack://www.zeusteam.com/./src/services/leads.js","webpack://www.zeusteam.com/./src/services/levels.js","webpack://www.zeusteam.com/./src/services/member-assistant-logins.js","webpack://www.zeusteam.com/./src/services/member-carriers.js","webpack://www.zeusteam.com/./src/services/member-config.js","webpack://www.zeusteam.com/./src/services/member-files.js","webpack://www.zeusteam.com/./src/services/member-service.js","webpack://www.zeusteam.com/./src/services/members.js","webpack://www.zeusteam.com/./src/services/mentors.js","webpack://www.zeusteam.com/./src/services/menus.js","webpack://www.zeusteam.com/./src/services/messages.js","webpack://www.zeusteam.com/./src/services/notes.js","webpack://www.zeusteam.com/./src/services/nylas.js","webpack://www.zeusteam.com/./src/services/onboardings.js","webpack://www.zeusteam.com/./src/services/pipelines.js","webpack://www.zeusteam.com/./src/services/policies.js","webpack://www.zeusteam.com/./src/services/print-templates.js","webpack://www.zeusteam.com/./src/services/production-service.js","webpack://www.zeusteam.com/./src/services/products.js","webpack://www.zeusteam.com/./src/services/q-and-a.js","webpack://www.zeusteam.com/./src/services/rapid-starts.js","webpack://www.zeusteam.com/./src/services/recruiting-service.js","webpack://www.zeusteam.com/./src/services/reports.js","webpack://www.zeusteam.com/./src/services/roles.js","webpack://www.zeusteam.com/./src/services/sales-tools.js","webpack://www.zeusteam.com/./src/services/sites.js","webpack://www.zeusteam.com/./src/services/sso.js","webpack://www.zeusteam.com/./src/services/tags.js","webpack://www.zeusteam.com/./src/services/tasks.js","webpack://www.zeusteam.com/./src/services/to-dos.js","webpack://www.zeusteam.com/./src/services/ui-widgets.js","webpack://www.zeusteam.com/./src/services/versions.js","webpack://www.zeusteam.com/./src/services/wills.js"],"sourcesContent":["import { Api } from 'common/server';\r\n\r\nexport class Agency {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n /**\r\n * Get the agents within the agency with bonus for the month\r\n * @param {String} memberId - the guid\r\n * @param {String} forDate - toISOString\r\n * @returns \r\n */\r\n async agentsMonthlyBonus(memberId, forDate) {\r\n let url = `report/agent-monthly-bonus/${encodeURIComponent(memberId)}`;\r\n if (forDate) url += `?asOfDate=${encodeURIComponent(forDate)}`;\r\n return await this._api.get(url);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class AgentNumbers {\r\n static inject = [Api];\r\n _api;\r\n\r\n _contractStatuses;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n dispose() {\r\n this._contractStatuses = undefined;\r\n }\r\n\r\n async forCarrier(carrierId) {\r\n return await this._api.get(`member/carrier-number/me/${encodeURIComponent(carrierId)}`);\r\n }\r\n\r\n async statusColor(agentNumber) {\r\n try {\r\n if (agentNumber.agentNumber && !agentNumber.status) return 'green';\r\n await this._loadContractStatuses();\r\n const contractStatusIndex = this._contractStatuses.findIndex(x => x.code === agentNumber.status);\r\n if (contractStatusIndex < 0) return null;\r\n return this._contractStatuses[contractStatusIndex].color;\r\n } catch (err) {\r\n console.log(err);\r\n this._contractStatuses = undefined;\r\n }\r\n }\r\n\r\n async agentNumberStatuses() {\r\n try {\r\n await this._loadContractStatuses();\r\n return this._contractStatuses;\r\n } catch (err) {\r\n console.log(err);\r\n this._contractStatuses = undefined;\r\n }\r\n }\r\n\r\n async _loadContractStatuses() {\r\n if (this._contractStatuses) return;\r\n try {\r\n const statuses = await this._api.get('config/ContractStatuses');\r\n if (statuses) this._contractStatuses = JSON.parse(statuses);\r\n else this._contractStatuses = [];\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\nimport { Content } from 'services/content';\r\nimport { Page } from 'common/ui';\r\n\r\nexport const AGENT_SITE_TYPE = {\r\n Agent: 'agent',\r\n YourCalendarOnline: 'your-calendar-online',\r\n MyBizCardOnline: 'my-biz-card-online'\r\n};\r\n\r\nexport class AgentSites {\r\n static inject = [Api, I18n, Content, Page];\r\n _api;\r\n _i18n;\r\n _content;\r\n _page;\r\n siteCode = null;\r\n site = null;\r\n\r\n constructor(api, i18n, content, page) {\r\n this._api = api;\r\n this._i18n = i18n;\r\n this._content = content;\r\n this._page = page;\r\n }\r\n\r\n validate() {\r\n return this.site;\r\n }\r\n\r\n agentName() {\r\n if (!this.site || !this.site.member) return '';\r\n return this.site.member.fullName;\r\n }\r\n\r\n profile() {\r\n return this.site.member;\r\n }\r\n\r\n bioImg() {\r\n return this.site.bioImg;\r\n }\r\n\r\n async status(siteType, memberId) {\r\n let url = `member-site/${encodeURIComponent(siteType)}/status`;\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async ssoUrl(siteType, memberId) {\r\n let url = `member-site/${encodeURIComponent(siteType)}/sso`;\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async contentFor(key) {\r\n try {\r\n let uiWidget;\r\n switch (key) {\r\n case 'home-top': uiWidget = this.site.homeTop; break;\r\n case 'home-bottom': uiWidget = this.site.homeBottom; break;\r\n case 'about': uiWidget = this.site.about; break;\r\n case 'bio': uiWidget = this.site.bio; break;\r\n }\r\n if (uiWidget) {\r\n return uiWidget;\r\n }\r\n const uiw = await this._content.uiWidget(key);\r\n return uiw\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async contactForm(memberId, firstName, lastName, email, phone) {\r\n const model = { firstName, lastName, email, phone };\r\n await this._api.post(`member/site/${encodeURIComponent(memberId)}/contact-form`, model);\r\n }\r\n\r\n async create(siteType) {\r\n return await this._api.post(`member-site/${encodeURIComponent(siteType)}`);\r\n }\r\n\r\n async createExternal(siteType, memberId) {\r\n let url = `member-site/${encodeURIComponent(siteType)}/external`;\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.post(url);\r\n }\r\n\r\n async load(siteType) {\r\n return await this._api.get(`member-site/${encodeURIComponent(siteType)}`);\r\n }\r\n\r\n async save(siteType, slug, isActive, metadata) {\r\n await this._api.post(`member-site/${encodeURIComponent(siteType)}/settings`, { slug, isActive, metadata });\r\n }\r\n\r\n async delete(siteType) {\r\n await this._api.delete(`member-site/${encodeURIComponent(siteType)}`);\r\n }\r\n\r\n async deleteFile(memberId, fileId) {\r\n await this._api.delete(`member-file/${encodeURIComponent(memberId)}/${encodeURIComponent(fileId)}`);\r\n }\r\n\r\n async renameFile(memberId, fileId, displayName) {\r\n await this._api.put(`member-file/${encodeURIComponent(memberId)}/${encodeURIComponent(fileId)}/rename?displayName=${encodeURIComponent(displayName)}`);\r\n }\r\n\r\n async viewFile(file) {\r\n try {\r\n const model = { id: file.id };\r\n await this._page.export(this._api, 'member-file/export-file', model);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\nimport { c } from 'common/common';\r\n\r\nexport class Analytics {\r\n static inject = [EventAggregator, Api, I18n];\r\n _ea;\r\n _api;\r\n _i18n;\r\n\r\n constructor(ea, api, i18n) {\r\n this._ea = ea;\r\n this._api = api;\r\n this._i18n = i18n;\r\n }\r\n\r\n async forPolicies(timePeriod, asOfMoment, startDate, endDate) {\r\n let url = 'analytics/policies';\r\n const qs = [];\r\n if (timePeriod) qs.push(`timePeriod=${encodeURIComponent(timePeriod)}`);\r\n if (asOfMoment) qs.push(`asOfDate=${encodeURIComponent(asOfMoment.format())}`);\r\n if (startDate) qs.push(`startDate=${encodeURIComponent(startDate)}`);\r\n if (endDate) qs.push(`endDate=${encodeURIComponent(endDate)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n const policies = await this._api.get(url);\r\n policies.forEach(p => {\r\n p.policyNumberCallback = () => this._openPolicyCard(p.policy);\r\n if (p.writingAgentId) p.writingAgentCallback = () => this._openAgentCard(p.writingAgentId);\r\n if (p.splitWritingAgentId) p.splitWritingAgentCallback = () => this._openAgentCard(p.splitWritingAgentId);\r\n if (p.teamId) p.teamCallback = () => this._openAgentCard(p.teamId);\r\n if (p.agencyId) p.agencyCallback = () => this._openAgentCard(p.agencyId);\r\n if (p.masterAgencyId) p.masterAgencyCallback = () => this._openAgentCard(p.masterAgencyId);\r\n });\r\n return policies;\r\n }\r\n\r\n async forAgents() {\r\n const agents = await this._api.get('analytics/agents');\r\n agents.forEach(a => {\r\n if (a.lifeLevel) a.lifeLevelName = this._i18n.tr(`level-${a.lifeLevel}`);\r\n if (a.annuityLevel) a.annuityLevelName = this._i18n.tr(`level-${a.annuityLevel}`);\r\n if (a.hmaLevel) a.hmaLevelName = this._i18n.tr(`level-${a.hmaLevel}`);\r\n });\r\n return agents;\r\n }\r\n\r\n _openPolicyCard(policy) {\r\n this._ea.publish(c.EventKeys.site.openPolicy, { policyId: policy.id });\r\n }\r\n\r\n _openAgentCard(agentId) {\r\n this._ea.publish(c.EventKeys.site.openProfile, { memberId: agentId });\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Badges {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async all(badgeType = 'agent') {\r\n const url = `badge/${encodeURIComponent(badgeType)}/definition`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async assigned(badgeType, code) {\r\n const url = `badge/${encodeURIComponent(badgeType)}/assigned/${encodeURIComponent(code)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async for(badgeType, memberId = null) {\r\n let url = `badge/${encodeURIComponent(badgeType)}`;\r\n const qs = [];\r\n if (memberId) qs.push(`memberId=${encodeURIComponent(memberId)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async unassigned(badgeType, memberId) {\r\n let url = `badge/${encodeURIComponent(badgeType)}/unassigned`;\r\n const qs = [];\r\n if (memberId) qs.push(`memberId=${encodeURIComponent(memberId)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async assign(memberId, code) {\r\n let url = `badge/${encodeURIComponent(code)}/assign`;\r\n const model = { memberId };\r\n return await this._api.post(url, model);\r\n }\r\n\r\n async unassign(memberId, code) {\r\n let url = `badge/${encodeURIComponent(code)}/unassign`;\r\n const model = { memberId };\r\n return await this._api.post(url, model);\r\n }\r\n\r\n async saveDefinition(badgeType, code, name, color, icon, ordering) {\r\n let url = `badge/${encodeURIComponent(badgeType)}/definition`;\r\n const model = { code, name, color, icon, ordering };\r\n return await this._api.post(url, model);\r\n }\r\n\r\n async deleteDefinition(code) {\r\n let url = `badge/${encodeURIComponent(code)}/definition`;\r\n return await this._api.delete(url);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Bonuses {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async personalSummary(id, date) {\r\n return await this._api.get(`bonus/monthly/personal/${encodeURIComponent(id)}?date=${encodeURIComponent(date.format('L'))}`);\r\n }\r\n\r\n async downlinePersonal(id, view, asOfDate) {\r\n return await this._api.get(`bonus/monthly/personal/${encodeURIComponent(id)}/${encodeURIComponent(view)}?date=${encodeURIComponent(asOfDate)}`);\r\n }\r\n\r\n async agencySummary(id, date) {\r\n return await this._api.get(`bonus/monthly/agency/${encodeURIComponent(id)}?date=${encodeURIComponent(date.format('L'))}`);\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator'\r\nimport { Api } from 'common/server';\r\nimport { MemberConfig } from 'services/member-config';\r\nimport { c } from 'common/common';\r\n\r\nexport class Calendar {\r\n static inject = [EventAggregator, Api, MemberConfig];\r\n _ea;\r\n _api;\r\n _memberConfig;\r\n\r\n constructor(ea, api, memberConfig) {\r\n this._ea = ea;\r\n this._api = api;\r\n this._memberConfig = memberConfig;\r\n }\r\n\r\n async events(view, timePeriod, notificationTypes, start, end) {\r\n const qs = [];\r\n qs.push(`view=${encodeURIComponent(view)}`);\r\n if (notificationTypes) qs.push(`include=${encodeURIComponent(notificationTypes)}`);\r\n if (start) qs.push(`start=${encodeURIComponent(start)}`);\r\n if (end) qs.push(`end=${encodeURIComponent(end)}`);\r\n return await this._api.get(`calendar/notifications/${encodeURIComponent(timePeriod)}?${qs.join('&')}`);\r\n }\r\n\r\n async yourCalendarOnline(memberId) {\r\n let url = 'your-calendar-online/status';\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async saveYourCalendarOnline(slug, settings, memberId) {\r\n let url = 'your-calendar-online/settings';\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.post(url, { slug, settings });\r\n }\r\n\r\n async bookingCalendars(memberId) {\r\n let url = 'your-calendar-online/booking-calendars';\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async setBookingCalendars(calendars, memberId) {\r\n let url = 'your-calendar-online/booking-calendars';\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.put(url, calendars);\r\n }\r\n\r\n async saveBookingCalendar(calendar, memberId) {\r\n let url = 'your-calendar-online/booking-calendar';\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.post(url, calendar);\r\n }\r\n\r\n async deleteBookingCalendar(bookingCalendarId, memberId) {\r\n let url = `your-calendar-online/booking-calendar/${encodeURIComponent(bookingCalendarId)}`;\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.delete(url);\r\n }\r\n\r\n\r\n async deleteYourCalendarOnline(memberId) {\r\n let url = 'your-calendar-online';\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n const response = await this._api.delete(url);\r\n await this._memberConfig.reset();\r\n return response;\r\n }\r\n\r\n async defaultBookingCalendars() {\r\n return await this._api.get('your-calendar-online/booking-calendars/default');\r\n }\r\n\r\n downlineUsesBookingCalendars() {\r\n return this._memberConfig.value('your-calendar-downline-use-scheduler-pages') ? true : false;\r\n }\r\n\r\n async setDownlineUseBookingCalendars(useSchedulingPages, forMemberId) {\r\n let url = `your-calendar-online/set-downline-use-scheduling-pages?downlineUse=${useSchedulingPages ? 'true' : 'false'}`;\r\n if (forMemberId) url += `&memberId=${encodeURIComponent(forMemberId)}`;\r\n const response = await this._api.post(url);\r\n await this._memberConfig.reset();\r\n return response;\r\n }\r\n\r\n openSchedulerPage(slug, name, email, phone, address, dob, zIndex) {\r\n const params = [];\r\n if (name) params.push(`name=${encodeURIComponent(name)}`);\r\n if (email) params.push(`email=${encodeURIComponent(email)}`);\r\n if (phone) params.push(`phone=${encodeURIComponent(phone)}`);\r\n if (address) params.push(`address=${encodeURIComponent(address)}`);\r\n if (dob) params.push(`date%20of%20birth=${encodeURIComponent(dob)}`);\r\n let url = `https://schedule.nylas.com/${encodeURIComponent(slug)}`;\r\n if (params.length) url += `?${params.join('&')}`;\r\n this._ea.publish(c.EventKeys.site.openLightbox, { embedSrc: url, fullHeight: true, zIndex });\r\n }\r\n}\r\n","import { c } from 'common/common';\r\nimport { Capacitor } from '@capacitor/core';\r\nimport { Browser } from '@capacitor/browser';\r\nimport { Device } from '@capacitor/device';\r\nimport { SplashScreen } from '@capacitor/splash-screen';\r\nimport { Keyboard } from '@capacitor/keyboard';\r\nimport { App } from '@capacitor/app';\r\nimport { ScreenOrientation } from '@capacitor/screen-orientation';\r\n\r\n/**\r\n * @returns {Promise} platform - android, ios, web\r\n */\r\n export async function getDevicePlatform() {\r\n const info = await Device.getInfo();\r\n return info ? info.platform : 'web';\r\n}\r\n\r\n/**\r\n * Hide the splash screen if native\r\n */\r\nexport function hideSplashScreen() {\r\n if (!Capacitor.isNativePlatform()) return;\r\n SplashScreen.hide();\r\n}\r\n\r\n/**\r\n * Hide the keyboard if native\r\n */\r\nexport async function hideKeyboard() {\r\n if (!Capacitor.isNativePlatform()) return;\r\n await Keyboard.hide();\r\n}\r\n\r\n/**\r\n* Opens a uri in the system\r\n* @param {String} uri - the uri to load\r\n* @returns {Promise}\r\n*/\r\nexport async function openUrl(uri) {\r\n if (!Capacitor.isNativePlatform()) {\r\n await App.openUrl({ url: uri });\r\n } else {\r\n window.open(uri, '_system');\r\n }\r\n}\r\n\r\n/**\r\n* Opens a uri in a new browser within the app\r\n* @param {String} uri - the uri to load\r\n* @returns {Promise}\r\n*/\r\nexport async function openBrowser(uri) {\r\n await Browser.open({ url: uri });\r\n}\r\n\r\n/**\r\n * @param {Function} callback\r\n * @returns Listener\r\n */\r\nexport function addAppStateChangeListener(callback) {\r\n return App.addListener('appStateChange', (state) => callback(state));\r\n}\r\n\r\nexport async function initializeKeyboardEvents(ea) {\r\n if (!Capacitor.isNativePlatform()) return;\r\n const platform = await getDevicePlatform();\r\n Keyboard.addListener('keyboardDidShow', (info) => {\r\n try {\r\n if (!Capacitor.isNativePlatform()) return;\r\n ea.publish(c.EventKeys.keyboard.opened, { height: info.keyboardHeight });\r\n } catch (err) {\r\n // do nothing\r\n }\r\n });\r\n\r\n Keyboard.addListener('keyboardWillHide', () => {\r\n try {\r\n if (!Capacitor.isNativePlatform()) return;\r\n } catch (err) {\r\n // do nothing\r\n }\r\n });\r\n\r\n Keyboard.addListener('keyboardDidHide', () => {\r\n try {\r\n if (!Capacitor.isNativePlatform()) return;\r\n ea.publish(c.EventKeys.keyboard.closed);\r\n } catch (err) {\r\n // do nothing\r\n }\r\n });\r\n}\r\n\r\nexport async function screenOrientation() {\r\n try {\r\n const data = await ScreenOrientation.orientation();\r\n const orientation = data.type.indexOf('portrait') >= 0 ? 'portrait' : 'landscape';\r\n return orientation;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n}\r\n\r\nexport function addScreenOrientationListener(callback) {\r\n try {\r\n ScreenOrientation.addListener('screenOrientationChange', (data) => {\r\n const orientation = data.type.indexOf('portrait') >= 0 ? 'portrait' : 'landscape';\r\n callback(orientation);\r\n });\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n}","import { Api } from 'common/server';\r\nimport { Page } from 'common/ui';\r\nimport { ROLE } from 'common/constants';\r\nimport { AgentNumbers } from 'services/agent-numbers';\r\n\r\nexport class Carriers {\r\n static inject = [Api, Page, AgentNumbers];\r\n _api;\r\n _page;\r\n _agentNumbers;\r\n\r\n _carriers;\r\n\r\n ADMIN_ROLES = ROLE.CarrierAdmin;\r\n\r\n constructor(api, page, agentNumbers) {\r\n this._api = api;\r\n this._page = page;\r\n this._agentNumbers = agentNumbers;\r\n }\r\n\r\n async initialize() {\r\n await this.all();\r\n }\r\n\r\n dispose() {\r\n this._carriers = undefined;\r\n }\r\n\r\n clear() {\r\n this._carriers = undefined;\r\n }\r\n\r\n async all() {\r\n try {\r\n if (!this._carriers) {\r\n this._carriers = await this._api.get('carrier');\r\n this._carriers.forEach(carrier => {\r\n carrier.linkLists = carrier.linkLists ? JSON.parse(carrier.linkLists) : [];\r\n carrier.linkLists.forEach(ll => {\r\n ll.links.forEach(l => {\r\n if (!l.type) l.type = 'link';\r\n });\r\n });\r\n });\r\n }\r\n return this._carriers;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async forAgentSite() {\r\n return await this._api.get('carrier/for-agent-site');\r\n }\r\n\r\n async favorites() {\r\n return await this._api.get('carrier/favorites');\r\n }\r\n\r\n async add(model) {\r\n model.metadata = JSON.stringify(model.metadata);\r\n const data = await this._api.post('carrier', model);\r\n this._carriers = undefined;\r\n return data;\r\n }\r\n\r\n async update(id, model) {\r\n model.metadata = JSON.stringify(model.metadata);\r\n const data = await this._api.put(`carrier/${encodeURIComponent(id)}`, model);\r\n this._carriers = undefined;\r\n return data;\r\n }\r\n\r\n async delete(id) {\r\n const data = await this._api.delete(`carrier/${encodeURIComponent(id)}`);\r\n this._carriers = undefined;\r\n return data;\r\n }\r\n\r\n async policyCount(id) {\r\n return await this._api.get(`carrier/${encodeURIComponent(id)}/policy-count`);\r\n }\r\n\r\n async saveLinkLists(carrierId, linkLists) {\r\n await this._api.put(`carrier/${carrierId}/link-lists`, { linkLists: JSON.stringify(linkLists)});\r\n }\r\n\r\n async commissionGrid(id) {\r\n return await this._api.get(`carrier/${encodeURIComponent(id)}/commission-grid`);\r\n }\r\n\r\n async policyStatuses(id) {\r\n return await this._api.get(`carrier/${encodeURIComponent(id)}/policy-status`);\r\n }\r\n\r\n async savePolicyStatus(id, carrierStatus, zeusStatus) {\r\n const model = { carrierStatus, status: zeusStatus };\r\n return await this._api.post(`carrier/${encodeURIComponent(id)}/policy-status`, model);\r\n }\r\n\r\n async deletePolicyStatus(id, carrierStatus) {\r\n return await this._api.delete(`carrier/${encodeURIComponent(id)}/policy-status/${encodeURIComponent(carrierStatus)}`);\r\n }\r\n\r\n async saveSuranceBayData(id, data) {\r\n return await this._api.post(`carrier/${encodeURIComponent(id)}/surance-bay-data`, data);\r\n }\r\n\r\n async setOrdering(orderedIds) {\r\n await this._api.post('carrier/set-ordering', { orderedIds });\r\n this._carriers = undefined;\r\n }\r\n\r\n async setActive(id, isActive) {\r\n await this._api.post(`carrier/${encodeURIComponent(id)}/set-is-active/${encodeURIComponent(isActive)}`);\r\n }\r\n\r\n async contractingHierarchy(id, memberId) {\r\n const agents = await this._api.get(`carrier/${encodeURIComponent(id)}/contracting-hierarchy/${encodeURIComponent(memberId)}`);\r\n for (let a of agents) {\r\n for (let cn of a.carrierNumbers) {\r\n cn.statusColor = await this._agentNumbers.statusColor(cn);\r\n }\r\n }\r\n return agents;\r\n }\r\n\r\n async imports(startMoment = null, endMoment = null) {\r\n let url = 'carrier/imports';\r\n let qs = [];\r\n if (startMoment) qs.push(`start=${encodeURIComponent(startMoment.startOf('day').toISOString())}`);\r\n if (endMoment) qs.push(`end=${encodeURIComponent(endMoment.endOf('day').toISOString())}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async importStatus(fileName) {\r\n return await this._api.get(`carrier/imports?fileName=${encodeURIComponent(fileName)}`);\r\n }\r\n\r\n async checkImportStatus(fileName) {\r\n return await this._api.get(`carrier/import-file/status?fileName=${encodeURIComponent(fileName)}`);\r\n }\r\n\r\n async cancelImport(fileName) {\r\n return await this._api.post(`carrier/cancel-import-file?fileName=${encodeURIComponent(fileName)}`);\r\n }\r\n\r\n async reprocessImport(fileName, additionalData) {\r\n return await this._api.post(`carrier/reprocess-file?fileName=${encodeURIComponent(fileName)}`, additionalData);\r\n }\r\n\r\n async importException(exceptionId) {\r\n return await this._api.post(`carrier/reprocess-exception/${encodeURIComponent(exceptionId)}`);\r\n }\r\n\r\n async downloadImportFile(importFileName, dataFeedType = 'policy', carrierId = null) {\r\n try {\r\n const model = { importFileName, dataFeedType, carrierId };\r\n await this._page.export(this._api, 'carrier/download-import-file', model);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Commissions {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async all(memberId, widgetPeriod, asOfDate, groupBy, policyId, clientId, carrierId) {\r\n let url = 'commission';\r\n const qs = [];\r\n if (memberId) qs.push(`memberId=${encodeURIComponent(memberId)}`);\r\n if (widgetPeriod) qs.push(`widgetPeriod=${encodeURIComponent(widgetPeriod)}`);\r\n if (asOfDate) qs.push(`asOfDate=${encodeURIComponent(asOfDate)}`);\r\n if (groupBy) qs.push(`groupBy=${encodeURIComponent(groupBy)}`);\r\n if (policyId) qs.push(`policyId=${encodeURIComponent(policyId)}`);\r\n if (clientId) qs.push(`clientId=${encodeURIComponent(clientId)}`);\r\n if (carrierId) qs.push(`carrieId=${encodeURIComponent(carrierId)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.get(url);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Config {\r\n static inject = [Api];\r\n _api;\r\n\r\n all;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async initialize() {\r\n try {\r\n this.all = await this._api.get('config');\r\n console.log(this.all);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n value(key) {\r\n if (!this.all) return undefined;\r\n return this.all[key];\r\n }\r\n\r\n bool(key) {\r\n if (!this.all) return false;\r\n const v = this.all[key];\r\n if (!v) return false;\r\n if (typeof v === 'string') return v.toLowerCase() === 'true';\r\n return v;\r\n }\r\n\r\n json(key) {\r\n const value = this.value(key);\r\n if (!value) return value;\r\n return JSON.parse(value);\r\n }\r\n\r\n async get(key) {\r\n return await this._api.get(`config/${encodeURIComponent(key)}`);\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\n\r\nexport class Content {\r\n static inject = [EventAggregator, Api, I18n];\r\n _ea;\r\n _api;\r\n _i18n;\r\n\r\n constructor(ea, api, i18n) {\r\n this._ea = ea;\r\n this._api = api;\r\n this._i18n = i18n;\r\n }\r\n\r\n async allByType(type) {\r\n return await this._api.get(`content/ui-widget/list/${encodeURIComponent(this._i18n.defaultLocale)}/type/${encodeURIComponent(type)}`);\r\n }\r\n\r\n async delete(id) {\r\n return await this._api.delete(`content/ui-widget/${encodeURIComponent(id)}`);\r\n }\r\n\r\n async emailTemplate(key, replaceVariables) {\r\n return await this._api.post(`content/email/${encodeURIComponent(key)}/template`, replaceVariables)\r\n }\r\n\r\n async emailKeys() {\r\n return await this._api.get('content/email');\r\n }\r\n\r\n async emailSettings(key) {\r\n return await this._api.get(`content/email/${encodeURIComponent(key)}/settings`);\r\n }\r\n\r\n async saveEmailSettings(key, settings) {\r\n return await this._api.post(`content/email/${encodeURIComponent(key)}/settings`, settings);\r\n }\r\n\r\n async sendTestEmail(key) {\r\n return await this._api.post(`content/email/${encodeURIComponent(key)}/test`);\r\n }\r\n\r\n async uiWidget(key) {\r\n let locale = this._i18n.currentLocale;\r\n return await this._api.get(`content/ui-widget/${encodeURIComponent(key)}/${encodeURIComponent(locale)}`);\r\n }\r\n\r\n async saveUiTerm(namespace, code, value, language) {\r\n language = language ?? this._i18n.defaultLocale;\r\n const payload = { namespace, code, language, translation: value };\r\n return await this._api.post('content/ui-term', payload);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Contests {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async all() {\r\n return await this._api.get('contest');\r\n }\r\n\r\n async standings(code, memberId) {\r\n let url = `contest/${encodeURIComponent(code)}/standings`;\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async memberStanding(code, memberId) {\r\n let url = `contest/${encodeURIComponent(code)}/standings/${encodeURIComponent(memberId)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async monthlyConsistency(asOfDate) {\r\n let url = 'contest/monthly-consistency';\r\n if (asOfDate) url += `?asOfDate=${encodeURIComponent(asOfDate)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async awardPoints(code, memberId, pointCode) {\r\n let url = `contest/${encodeURIComponent(code)}/award-points/${encodeURIComponent(memberId)}?pointCode=${encodeURIComponent(pointCode)}`;\r\n return await this._api.post(url);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { formatAddress } from 'services/functions';\r\n\r\nexport class CRM {\r\n static inject = [Api];\r\n _api;\r\n\r\n NAV_KEY = 'zeus.crm-nav';\r\n _localStorage;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n this._localStorage = window.localStorage;\r\n }\r\n\r\n dispose() {\r\n this.clearNav();\r\n }\r\n\r\n async clients(search) {\r\n let url = '/crm/client';\r\n if (search) url += `?search=${encodeURIComponent(search)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async client(id) {\r\n return await this._api.get(`/crm/client/${encodeURIComponent(id)}`);\r\n }\r\n\r\n async clientPolicies(id) {\r\n return await this._api.get(`/crm/client/${encodeURIComponent(id)}/policy`);\r\n }\r\n\r\n async locations(includeInactive, display, timePeriod, sortType1, sortType2, sortType3) {\r\n try {\r\n let url = `crm/locations?includeInactive=${includeInactive ? 'true' : 'false'}`;\r\n const qs = [];\r\n if (display) qs.push(`display=${encodeURIComponent(display)}`);\r\n if (timePeriod) qs.push(`timePeriod=${encodeURIComponent(timePeriod)}`);\r\n if (sortType1) qs.push(`sortType1=${encodeURIComponent(sortType1)}`);\r\n if (sortType2) qs.push(`sortType2=${encodeURIComponent(sortType2)}`);\r\n if (sortType3) qs.push(`sortType3=${encodeURIComponent(sortType3)}`);\r\n if (qs.length) url += `&${qs.join('&')}`;\r\n\r\n const locations = await this._api.get(url);\r\n locations.forEach(l => {\r\n l.formattedAddress = formatAddress(l);\r\n });\r\n return locations;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n clearNav() {\r\n this._localStorage.removeItem(this.NAV_KEY);\r\n }\r\n\r\n setNavList(clients) {\r\n try {\r\n const ids = clients.map(x => x.id);\r\n this._localStorage.setItem(this.NAV_KEY, JSON.stringify(ids));\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n getNav(currentId) {\r\n try {\r\n const ids = JSON.parse(this._localStorage.getItem(this.NAV_KEY) || '[]');\r\n const currentIndex = ids.indexOf(currentId);\r\n if (currentIndex < 0) {\r\n this.clearNav();\r\n return { hasNav: false };\r\n }\r\n const previousId = currentIndex > 0 ? ids[currentIndex - 1] : undefined;\r\n const nextId = currentIndex >= 0 && currentIndex < ids.length ? ids[currentIndex + 1] : undefined;\r\n return {\r\n hasNav: previousId || nextId ? true : false,\r\n previousId,\r\n nextId\r\n };\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Security } from 'common/security';\r\nimport { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\nimport { c } from 'common/common'\r\nimport { ROLE } from 'common/constants';\r\n\r\nexport class Dashboards {\r\n static inject = [EventAggregator, Security, Api, I18n];\r\n _ea;\r\n _security;\r\n _api;\r\n _i18n;\r\n\r\n _dashboards;\r\n\r\n constructor(ea, security, api, i18n) {\r\n this._ea = ea;\r\n this._security = security;\r\n this._api = api;\r\n this._i18n = i18n;\r\n }\r\n\r\n async initialize() {\r\n await this.all();\r\n }\r\n\r\n dispose() {\r\n this._dashboards = undefined;\r\n }\r\n\r\n triggerMenuUpdate() {\r\n this._ea.publish(c.EventKeys.menu.reset, { menu: 'members', fireEvent: true });\r\n }\r\n\r\n async all() {\r\n try {\r\n if (!this._dashboards) {\r\n this._dashboards = [];\r\n const dashboards = await this._api.get('dashboard');\r\n\r\n dashboards.forEach(d => {\r\n let display = false;\r\n if (d.showFor && d.showFor.length) {\r\n d.showFor.forEach(sf => {\r\n switch (sf) {\r\n case 'admin': if (this._security.isAdmin) display = true; break;\r\n case 'masterAgency': if (this._security.isMasterAgency()) display = true; break;\r\n case 'agency': if (this._security.isAgency()) display = true; break;\r\n case 'team': if (this._security.isTeam()) display = true; break;\r\n case 'agent': display = true; break;\r\n }\r\n });\r\n } else {\r\n display = true;\r\n }\r\n if (!d.layout || !d.layout.length) display = false;\r\n if (d.canEdit) display = true;\r\n if (display) this._dashboards.push(d);\r\n });\r\n }\r\n return this._dashboards;\r\n } catch (err) {\r\n console.log(err);\r\n this._dashboards = [];\r\n }\r\n }\r\n\r\n async byKey(key) {\r\n try {\r\n if (!this._dashboards) await this.initialize();\r\n if (!key) {\r\n const defaultDashboard = this._dashboards.find(x => x.isDefault === true);\r\n if (defaultDashboard) return defaultDashboard;\r\n this._dashboards[0].isDefault = true;\r\n return this._dashboards[0];\r\n }\r\n const dashboard = this._dashboards.find(x => x.key === key);\r\n if (!dashboard) return this._dashboards[0];\r\n return dashboard;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async save(key, layout, name, originalKey, triggerMenuUpdate = false) {\r\n let url = `dashboard/${encodeURIComponent(key)}`;\r\n const qs = [];\r\n if (name) qs.push(`name=${encodeURIComponent(name)}`);\r\n if (originalKey) qs.push(`originalKey=${encodeURIComponent(originalKey)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n await this._api.post(url, layout);\r\n\r\n try {\r\n if (this._dashboards) {\r\n const existingIndex = this._dashboards.findIndex(x => x.key === key);\r\n if (existingIndex >= 0) {\r\n this._dashboards[existingIndex].layout = layout;\r\n } else {\r\n this._dashboards = undefined;\r\n await this.initialize();\r\n }\r\n }\r\n if (triggerMenuUpdate) {\r\n this.triggerMenuUpdate();\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async toggleMemberDefault(key) {\r\n await this._api.post(`dashboard/${encodeURIComponent(key)}/set-member-default`);\r\n this._dashboards = undefined;\r\n await this.initialize();\r\n }\r\n\r\n async delete(key) {\r\n await this._api.delete(`dashboard/${encodeURIComponent(key)}`);\r\n const existing = this._dashboards.find(x => x.key === key);\r\n this._dashboards = undefined;\r\n const trigger = existing && !existing.isPublishedDashboard;\r\n await this.initialize();\r\n if (trigger) this.triggerMenuUpdate();\r\n }\r\n\r\n async setDefault(key) {\r\n await this._api.post(`dashboard/${encodeURIComponent(key)}/set-default`);\r\n this._dashboards = undefined;\r\n await this.initialize();\r\n }\r\n\r\n async reset(key) {\r\n await this._api.post(`dashboard/${encodeURIComponent(key)}/reset`);\r\n this._dashboards = undefined;\r\n await this.initialize();\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { Security } from 'common/security';\r\n\r\nexport const DIALER_TEAM = {\r\n Single: 'dialer-team-single',\r\n NewLead: 'dialer-team-new-lead',\r\n Double: 'dialer-team-double',\r\n Triple: 'dialer-team-triple',\r\n NoPrompt: 'dialer-team-no-prompt',\r\n\r\n all: () => {\r\n return [DIALER_TEAM.Single, DIALER_TEAM.NewLead, DIALER_TEAM.Double, DIALER_TEAM.Triple, DIALER_TEAM.NoPrompt];\r\n },\r\n}\r\n\r\nexport class Dialer {\r\n static inject = [Api, Security];\r\n _api;\r\n _security;\r\n\r\n constructor(api, security) {\r\n this._api = api;\r\n this._security = security;\r\n }\r\n\r\n async teams() {\r\n return await this._api.get('dialer/teams');\r\n }\r\n\r\n async agentTeams(agentId) {\r\n const teamSettings = await this._api.get(`dialer/agent/${encodeURIComponent(agentId)}/teams/`);\r\n return teamSettings.map(x => x.dialerTeamSettingKey);\r\n }\r\n\r\n async canDial(dialerTeam) {\r\n const dialerTeams = await this.agentTeams(this._security.authenticatedMemberId);\r\n return dialerTeams.includes(dialerTeam);\r\n }\r\n\r\n async call(leadIds, dialerTeamKey, phoneNumber, agentIds) {\r\n const payload = { leadIds, dialerTeamKey, phoneNumber, agentIds };\r\n return await this._api.post('dialer/call', payload);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Favorites {\r\n static inject = [Api];\r\n _api;\r\n\r\n _favoritesByType = {};\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async ids(type) {\r\n if (this._favoritesByType[type]) return this._favoritesByType[type];\r\n const ids = await this._api.get(`favorite/${encodeURIComponent(type)}`);\r\n this._favoritesByType[type] = ids;\r\n return ids;\r\n }\r\n\r\n async set(type, id, isFavorite) {\r\n const url = `favorite/${encodeURIComponent(type)}/${encodeURIComponent(id)}?isFavorite=${isFavorite ? 'true' : 'false'}`;\r\n const ids = await await this._api.post(url);\r\n this._favoritesByType[type] = ids;\r\n return ids;\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Api } from 'common/server';\r\nimport { Config } from 'services/config';\r\nimport { fileIsImage, fileIcon } from './files';\r\nimport environment from '../../config/environment.json';\r\nimport { c } from 'common/common';\r\n\r\nexport class FilesFor {\r\n static inject = [EventAggregator, Api, Config];\r\n _ea;\r\n _api;\r\n _config;\r\n\r\n settings = {};\r\n\r\n constructor(ea, api, config) {\r\n this._ea = ea;\r\n this._api = api;\r\n this._config = config;\r\n this._initialize();\r\n }\r\n\r\n _initialize() {\r\n try {\r\n this.settings = JSON.parse(this._config.value('filesForJson'));\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async list(forType, forId, fileType = null) {\r\n let url = `file-for/${encodeURIComponent(forType)}/${encodeURIComponent(forId)}`;\r\n if (fileType) url += `?fileType=${encodeURIComponent(fileType)}`;\r\n const files = await this._api.get(url);\r\n files.forEach(f => {\r\n f.isImage = fileIsImage(f.mediaType);\r\n f.url = `${environment.api}/api/file-for/${f.id}`;\r\n f.icon = fileIcon(f.mediaType);\r\n });\r\n return files;\r\n }\r\n\r\n viewSrc(fileId) {\r\n return `${environment.api}/api/file-for/${encodeURIComponent(fileId)}?dispositionType=inline`;\r\n }\r\n\r\n async delete(fileId, forId) {\r\n const response = await this._api.delete(`file-for/${encodeURIComponent(fileId)}`);\r\n this._ea.publish(c.EventKeys.fileFor.updated(forId));\r\n return response;\r\n }\r\n\r\n async rename(fileId, displayName) {\r\n await this._api.put(`file-for/${encodeURIComponent(fileId)}/rename?displayName=${encodeURIComponent(displayName)}`);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport environment from '../../config/environment.json';\r\n\r\nexport class Files {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async list(searchOn = null) {\r\n let url = 'file';\r\n if (searchOn) url += `?searchOn=${encodeURIComponent(searchOn)}`;\r\n const files = await this._api.get(url);\r\n files.forEach(f => {\r\n f.isImage = fileIsImage(f.mediaType);\r\n f.url = `${environment.api}/api/file/${f.id}`;\r\n });\r\n return files;\r\n }\r\n\r\n async delete(fileId) {\r\n return this._api.delete(`file/${encodeURIComponent(fileId)}`);\r\n }\r\n\r\n async rename(fileId, displayName) {\r\n await this._api.put(`file/${encodeURIComponent(fileId)}/rename?displayName=${encodeURIComponent(displayName)}`);\r\n }\r\n}\r\n\r\nexport function fileIcon(mediaType) {\r\n if (mediaType.indexOf('image') === 0) return 'fa-duotone fa-file-image';\r\n if (mediaType.indexOf('video') === 0) return 'fa-duotone fa-file-video';\r\n switch (mediaType) {\r\n case 'application/pdf': return 'fa-duotone fa-file-pdf';\r\n case 'application/zip': return 'fa-duotone fa-file-zipper';\r\n case 'vnd.ms-excel': return 'fa-duotone fa-file-powerpoint';\r\n case 'application/zip': return 'fa-duotone fa-file-zipper';\r\n case 'text/html': return 'fa-duotone fa-file-code';\r\n default:\r\n if (mediaType.indexOf('vnd.openxmlformats-officedocument.spreadsheetml') >= 0) return 'fa-duotone fa-file-excel';\r\n if (mediaType.indexOf('vnd.openxmlformats-officedocument.presentationml') >= 0) return 'fa-duotone fa-file-powerpoint';\r\n if (mediaType.indexOf('vnd.openxmlformats-officedocument.wordprocessingml') >= 0) return 'fa-duotone fa-file-word';\r\n return 'fa-duotone fa-file';\r\n }\r\n}\r\n\r\nexport function fileIsImage(mediaType) {\r\n if (mediaType.indexOf('image') === 0) return true;\r\n return false;\r\n}\r\n","import * as phoneNumberLib from 'libphonenumber-js';\r\n\r\nexport function formatPhone(value) {\r\n try {\r\n const phoneNumber = phoneNumberLib.parsePhoneNumber(value, 'US');\r\n if (phoneNumber.isValid()) return phoneNumber.formatNational();\r\n return value;\r\n } catch (err) {\r\n return value;\r\n }\r\n}\r\n\r\nexport function formatAddress(object) {\r\n try {\r\n let address = '';\r\n if (!object) return address;\r\n if (object.streetAddress) address += `${object.streetAddress}
`;\r\n if (object.streetAddress2) address += `${object.streetAddress2}
`;\r\n if (object.address) address += `${object.address}
`;\r\n if (object.address2) address += `${object.address2}
`;\r\n if (object.city) address += `${object.city} `;\r\n if (object.state) address += object.state;\r\n if (object.state && (object.zip || object.zipCode)) address += ', ';\r\n if (object.zip) address += object.zip;\r\n if (object.zipCode) address += object.zipCode;\r\n if (object.county) address += `
${object.county}`;\r\n return address;\r\n } catch (err) {\r\n return value;\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { HttpClient } from 'aurelia-http-client';\r\nimport * as topojson from 'topojson-client';\r\nimport environment from './../../config/environment.json';\r\n\r\nexport class Geography {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async usStates() {\r\n return await this._api.get('geography/us-states');\r\n }\r\n\r\n async usCounties(usState) {\r\n return await this._api.get(`geography/us-counties/${encodeURIComponent(usState)}`);\r\n }\r\n\r\n async zips(usCounties) {\r\n return await this._api.get(`geography/zips/${encodeURIComponent(usCounties.join(','))}`);\r\n }\r\n\r\n async countiesByFips(usCounties) {\r\n return await this._api.get(`geography/us-counties/by-fips/${encodeURIComponent(usCounties.join(','))}`);\r\n }\r\n\r\n geojson = {\r\n usCounties: async() => {\r\n const httpClient = new HttpClient();\r\n const data = await Promise.all([\r\n this.topojsonToGeojson(`${environment.url}/maps/us-counties.json`, 'counties'),\r\n httpClient.get(`${environment.url}/maps/ct-counties.geojson`),\r\n httpClient.get(`${environment.url}/maps/va-counties.geojson`),\r\n httpClient.get(`${environment.url}/maps/ak-boroughs.geojson`),\r\n ]);\r\n const vaCountyFeatures = JSON.parse(data[2].response).features;\r\n vaCountyFeatures.forEach(c => {\r\n c.id = c.properties.GEOID;\r\n c.properties.name = c.properties.NAME;\r\n delete c.properties.NAME;\r\n });\r\n const akBoroughFeatures = JSON.parse(data[3].response).features;\r\n akBoroughFeatures.forEach(f => {\r\n f.id = f.properties.FIPS;\r\n f.properties.name = f.properties.CommunityName.replace(' Borough', '').replace(' Census Area', '');\r\n delete f.properties.CommunityName;\r\n delete f.properties.OBJECTID;\r\n delete f.properties.Census_Area;\r\n delete f.properties.EconomicRegion;\r\n delete f.properties.last_update_date;\r\n delete f.properties.created_date\r\n });\r\n const removeCountyIds = [...vaCountyFeatures.map(x => x.id), ...akBoroughFeatures.map(x => x.id)];\r\n const usCountyFeatures = data[0].features.filter(x => !removeCountyIds.includes(x.id));\r\n return { type: 'FeatureCollection', features: [...usCountyFeatures, ...JSON.parse(data[1].response).features, ...vaCountyFeatures, ...akBoroughFeatures]};\r\n },\r\n ctCounties: async() => {\r\n return this.topojsonToGeojson(`${environment.url}/maps/ct-counties.topojson`, 'counties');\r\n },\r\n usStates: async() => {\r\n return this.topojsonToGeojson(`${environment.url}/maps/us-states.json`, 'states');\r\n },\r\n };\r\n\r\n async topojsonToGeojson(url, objectName) {\r\n const httpClient = new HttpClient();\r\n const response = await httpClient.get(url);\r\n const data = JSON.parse(response.response);\r\n let geojson = topojson.feature(data, data.objects[objectName]);\r\n return geojson;\r\n }\r\n\r\n topojson = {\r\n usCounties: (style, labelMinZoom = 8, mouseoverSetStyleCallback = undefined, clickSetStyleCallback = undefined, clickCallback = undefined, includeFips = undefined) => {\r\n const topoStyle = style ?? {\r\n strokeColor: '#000',\r\n strokeOpacity: 1.0,\r\n strokeWeight: 1.0,\r\n fillColor: 'transparent',\r\n fillOpacity: 'transparent',\r\n };\r\n return {\r\n id: 'us-counties',\r\n url: `${environment.url}/maps/us-counties.json`,\r\n objectName: 'counties',\r\n includeIds: includeFips,\r\n clearOnReload: true,\r\n style: topoStyle,\r\n label: {\r\n cssClass: 'zeus-county-label',\r\n minZoom: labelMinZoom,\r\n template: (geojsonFeature) => {\r\n return geojsonFeature.properties.name;\r\n }\r\n },\r\n mouseover: {\r\n setStyle: (feature) => {\r\n if (!mouseoverSetStyleCallback) return null;\r\n return mouseoverSetStyleCallback(feature);\r\n }\r\n },\r\n click: {\r\n setStyle: (feature) => {\r\n if (!clickSetStyleCallback) return null;\r\n return clickSetStyleCallback(feature);\r\n },\r\n callback: (feature) => {\r\n if (!clickCallback) return null;\r\n return clickCallback(feature);\r\n }\r\n }\r\n };\r\n },\r\n usStates: (style, labelMinZoom = 8, mouseoverSetStyleCallback = undefined, clickSetStyleCallback = undefined, clickCallback = undefined) => {\r\n const topoStyle = style ?? {\r\n strokeColor: '#000',\r\n strokeOpacity: 1.0,\r\n strokeWeight: 1.0,\r\n fillColor: 'transparent',\r\n fillOpacity: 'transparent',\r\n };\r\n return {\r\n id: 'us-states',\r\n url: `${environment.url}/maps/us-states.json`,\r\n objectName: 'states',\r\n style: topoStyle,\r\n label: {\r\n cssClass: 'zeus-state-label',\r\n minZoom: labelMinZoom,\r\n template: (geojsonFeature) => {\r\n return geojsonFeature.properties.name;\r\n }\r\n },\r\n mouseover: {\r\n setStyle: (feature) => {\r\n if (!mouseoverSetStyleCallback) return null;\r\n return mouseoverSetStyleCallback(feature);\r\n }\r\n },\r\n click: {\r\n setStyle: (feature) => {\r\n if (!clickSetStyleCallback) return null;\r\n return clickSetStyleCallback(feature);\r\n },\r\n callback: (feature) => {\r\n if (!clickCallback) return null;\r\n return clickCallback(feature);\r\n }\r\n }\r\n };\r\n }\r\n };\r\n}","import { Config } from 'services/config';\r\nimport { Loader } from '@googlemaps/js-api-loader';\r\n\r\nexport class Google {\r\n static inject = [Config];\r\n _config;\r\n\r\n initialized = false;\r\n loaded = false;\r\n mapsApiKey;\r\n maps;\r\n _domParser;\r\n\r\n constructor(config) {\r\n this._config = config;\r\n\r\n this._initialize();\r\n }\r\n\r\n _initialize() {\r\n try {\r\n const data = this._config.value('googleIntegration');\r\n if (!data) return;\r\n const integration = JSON.parse(data);\r\n if (!integration || !integration.isConfigured) return;\r\n this.mapsApiKey = integration.mapsApiKey;\r\n this.initialized = true;\r\n this._domParser = new DOMParser();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async load() {\r\n if (this.loaded) return;\r\n try {\r\n this.loaded = true;\r\n const loader = new Loader({\r\n apiKey: this.mapsApiKey,\r\n version: 'weekly',\r\n libraries: ['places', 'marker', 'visualization', 'drawing']\r\n });\r\n \r\n await loader.load();\r\n } catch (err) {\r\n console.log(err);\r\n this.loaded = false;\r\n }\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport const IMPORT_TYPE = {\r\n Leads: 'leads',\r\n Policies: 'policies'\r\n};\r\n\r\nexport class Imports {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async columnTypes(importType) {\r\n return await this._api.get(`import/definition/column-types/${importType}`);\r\n }\r\n\r\n async saveDefinition(payload) {\r\n return await this._api.post('import/definition', payload);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { TIME_PERIOD } from 'common/constants';\r\n\r\nexport const KPI_FOR = {\r\n Personal: 'personal',\r\n Team: 'team'\r\n};\r\n\r\nexport const KPI_PERIOD = {\r\n Weekly: 'weekly',\r\n Monthly: 'monthly',\r\n\r\n toTimePeriod: (kpiPeriod) => {\r\n switch (kpiPeriod) {\r\n case KPI_PERIOD.Weekly: return TIME_PERIOD.WTD;\r\n case KPI_PERIOD.Monthly: return TIME_PERIOD.MTD;\r\n default: return TIME_PERIOD.MTD;\r\n }\r\n },\r\n};\r\n\r\nexport class Kpis {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async templates() {\r\n return await this._api.get('kpi-template');\r\n }\r\n\r\n async updateTemplate(kpi, goal) {\r\n const model = { goal };\r\n return await this._api.put(`kpi-template/${encodeURIComponent(kpi.kpiType)}/${encodeURIComponent(kpi.kpiFor)}/${encodeURIComponent(kpi.kpiPeriod)}`, model);\r\n }\r\n\r\n async activateTemplate(kpi, isActive) {\r\n const url = `kpi-template/${encodeURIComponent(kpi.kpiType)}/${encodeURIComponent(kpi.kpiFor)}/${encodeURIComponent(kpi.kpiPeriod)}/${isActive ? 'activate' : 'deactivate'}`;\r\n return await this._api.post(url);\r\n }\r\n\r\n async health(memberId, asOfDate, productionType) {\r\n let url = `kpi/${encodeURIComponent(memberId)}/health`;\r\n const qs = [];\r\n if (asOfDate) qs.push(`asOfDate=${encodeURIComponent(asOfDate)}`);\r\n if (productionType) qs.push(`productionType=${encodeURIComponent(productionType)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async allAvailable() {\r\n return await this._api.get('kpi');\r\n }\r\n\r\n async progress(kpi, asOfDate = undefined) {\r\n let url = `kpi/${encodeURIComponent(kpi.kpiType)}/${encodeURIComponent(kpi.kpiFor)}/${encodeURIComponent(kpi.kpiPeriod)}`;\r\n if (asOfDate) url += `?asOfDate=${encodeURIComponent(asOfDate)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async progress2(kpi, asOfDate = undefined, memberId = undefined) {\r\n let url = 'kpi';\r\n const qs = [];\r\n if (asOfDate) qs.push(`asOfDate=${encodeURIComponent(asOfDate)}`);\r\n if (memberId) qs.push(`memberId=${encodeURIComponent(memberId)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.post(url, kpi);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\n\r\nexport const SCRIPT_TYPE = {\r\n Phone: 'phone',\r\n InPerson: 'in-person',\r\n\r\n all: () => {\r\n return [SCRIPT_TYPE.Phone, SCRIPT_TYPE.InPerson ];\r\n },\r\n\r\n allWithIcons: () => {\r\n return [\r\n { key: SCRIPT_TYPE.Phone, icon: 'fa-duotone fa-solid fa-phone' },\r\n { key: SCRIPT_TYPE.InPerson, icon: 'fa-duotone fa-solid fa-house-user' },\r\n ];\r\n },\r\n};\r\n\r\nexport const SCRIPT_PERSON = {\r\n First: 'first',\r\n Third: 'third',\r\n\r\n all: () => {\r\n return [SCRIPT_PERSON.First, SCRIPT_PERSON.Third ];\r\n },\r\n\r\n allWithIcons: () => {\r\n return [\r\n { key: SCRIPT_PERSON.First, icon: 'fa-duotone fa-solid fa-user' },\r\n { key: SCRIPT_PERSON.Third, icon: 'fa-duotone fa-solid fa-users' },\r\n ];\r\n },\r\n};\r\n\r\nexport class LeadScripts {\r\n static inject = [Api, I18n];\r\n _api;\r\n _i18n;\r\n\r\n constructor(api, i18n) {\r\n this._api = api;\r\n this._i18n = i18n;\r\n }\r\n\r\n async all() {\r\n const all = await this._api.get('lead-scripts');\r\n all.forEach(s => {\r\n s.scriptTypeName = this._i18n.tr(`lead:script-type-${s.scriptType}`);\r\n s.scriptPersonName = this._i18n.tr(`lead:script-person-${s.scriptPerson}`);\r\n });\r\n return all;\r\n }\r\n\r\n async save(payload) {\r\n return await this._api.post('lead-scripts', payload);\r\n }\r\n\r\n async delete(id) {\r\n return await this._api.delete(`lead-scripts/${encodeURIComponent(id)}`);\r\n }\r\n\r\n async copy(id) {\r\n return await this._api.post(`lead-scripts/${encodeURIComponent(id)}/copy`);\r\n }\r\n\r\n async setDefault(id) {\r\n return await this._api.put(`lead-scripts/default/${encodeURIComponent(id)}`);\r\n }\r\n\r\n async filterOptions() {\r\n return await this._api.get('lead-scripts/filter-options');\r\n }\r\n\r\n async saveFilter(id, filter) {\r\n return await this._api.put(`lead-scripts/${encodeURIComponent(id)}/filters`, filter);\r\n }\r\n\r\n async scriptForLead(leadId, type, person) {\r\n let url = `lead-scripts/for-lead/${encodeURIComponent(leadId)}`;\r\n const params = [];\r\n if (type) params.push(`type=${encodeURIComponent(type)}`);\r\n if (person) params.push(`person=${encodeURIComponent(person)}`);\r\n if (params.length) url += `?${params.join('&')}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async sampleScript(scriptId) {\r\n return await this._api.get(`lead-scripts/for-script/${encodeURIComponent(scriptId)}`);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\n\r\nexport class LeadSources {\r\n static inject = [Api, I18n];\r\n _api;\r\n _i18n;\r\n\r\n constructor(api, i18n) {\r\n this._api = api;\r\n this._i18n = i18n;\r\n }\r\n\r\n async all() {\r\n const ls = await this._api.get('lead-sources');\r\n ls.forEach(x => {\r\n x.receivedAgeValue = this._i18n.tr(`lead:age-${x.receivedAge}`);\r\n x.leadTypeValue = this._i18n.tr(`lead:type-${x.leadType}`);\r\n });\r\n return ls;\r\n }\r\n\r\n async save(payload) {\r\n return await this._api.post('lead-sources', payload);\r\n }\r\n\r\n async delete(id) {\r\n return await this._api.delete(`lead-sources/${encodeURIComponent(id)}`);\r\n }\r\n}\r\n","import {Api} from 'common/server';\r\n\r\nexport class Leaderboards {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async all() {\r\n return await this._api.get('leaderboard');\r\n }\r\n\r\n async byCode(code, lineOfBusiness, limit, forDate) {\r\n let url = `leaderboard/by-code/${encodeURIComponent(code)}/${encodeURIComponent(lineOfBusiness)}`;\r\n const qs = [];\r\n if (limit) qs.push(`limit=${encodeURIComponent(limit)}`);\r\n if (forDate) qs.push(`date=${encodeURIComponent(forDate.toISOString(true))}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n const leaderboard = await this._api.get(url);\r\n leaderboard.leaders.forEach(l => {\r\n l.member = { id: l.memberId, firstName: l.firstName, lastName: l.lastName, fullName: `${l.firstName} ${l.lastName}` };\r\n });\r\n return leaderboard;\r\n }\r\n\r\n async entries(code, memberId) {\r\n return await this._api.get(`leaderboard/by-code/${encodeURIComponent(code)}/entries/${encodeURIComponent(memberId)}`);\r\n }\r\n\r\n async updateEntry(id, entryDate, value, lineOfBusiness) {\r\n const model = { entryDate, value, lineOfBusiness };\r\n return await this._api.put(`leaderboard/entry/${encodeURIComponent(id)}`, model);\r\n }\r\n\r\n async deleteEntry(id) {\r\n return await this._api.delete(`leaderboard/entry/${encodeURIComponent(id)}`);\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\nimport { Config } from 'services/config';\r\nimport { ServiceWithListNav } from 'resources/base-classes/service-with-list-nav';\r\nimport { formatAddress, formatPhone } from 'services/functions';\r\n\r\nexport const LEAD_STATUS = {\r\n New: 'new',\r\n Calling: 'calling',\r\n Appointment: 'appointment',\r\n Application: 'application',\r\n DoorKnock: 'door-knock',\r\n Exhausted: 'exhausted',\r\n Issued: 'issued',\r\n\r\n all: () => {\r\n return [LEAD_STATUS.New, LEAD_STATUS.Calling, LEAD_STATUS.Appointment, LEAD_STATUS.Application, LEAD_STATUS.DoorKnock, LEAD_STATUS.Exhausted, LEAD_STATUS.Issued ];\r\n },\r\n allData: (i18n) => {\r\n const all = LEAD_STATUS.all();\r\n const allData = [];\r\n const defaults = LEAD_STATUS.defaults();\r\n all.forEach(s => {\r\n const status = { key: s, name: i18n.tr(`lead-status-${s}`), active: defaults.includes(s), icon: LEAD_STATUS.icon(s) };\r\n allData.push(status);\r\n });\r\n return allData;\r\n },\r\n icon: (status) => {\r\n switch (status) {\r\n case LEAD_STATUS.New: return 'fa-duotone fa-sparkles';\r\n case LEAD_STATUS.Calling: return 'fa-duotone fa-phone';\r\n case LEAD_STATUS.Appointment: return 'fa-duotone fa-calendar-check';\r\n case LEAD_STATUS.Application: return 'fa-duotone fa-file-contract';\r\n case LEAD_STATUS.DoorKnock: return 'fa-duotone fa-door-closed';\r\n case LEAD_STATUS.Exhausted: return 'fa-duotone fa-tombstone-blank';\r\n case LEAD_STATUS.Issued: return 'fa-duotone fa-file-invoice-dollar';\r\n default: return 'fa-duotone fa-circle-question';\r\n }\r\n },\r\n defaults: () => {\r\n return [LEAD_STATUS.New, LEAD_STATUS.Calling, LEAD_STATUS.Appointment, LEAD_STATUS.Application, LEAD_STATUS.DoorKnock];\r\n },\r\n};\r\n\r\nexport const LEAD_TYPE = {\r\n CallIn: 'call-in',\r\n DirectMail: 'direct-mail',\r\n InternetProspect: 'internet-prospect',\r\n InternetRequest: 'internet-request',\r\n Inventory3090d: 'inv-30-90',\r\n InventoryU30d: 'inv-u30',\r\n PolicyOwner: 'policy-owner',\r\n EmergencyContact: 'emergency-contact',\r\n\r\n all: () => {\r\n return [LEAD_TYPE.CallIn, LEAD_TYPE.DirectMail, LEAD_TYPE.InternetProspect, LEAD_TYPE.InternetRequest, LEAD_TYPE.Inventory3090d, LEAD_TYPE.InventoryU30d, LEAD_TYPE.PolicyOwner, LEAD_TYPE.EmergencyContact];\r\n },\r\n};\r\n\r\nexport const LEAD_AGE = {\r\n Fresh: 'fresh',\r\n Mature: 'mature',\r\n RealTime: 'real-time',\r\n\r\n all: () => {\r\n return [LEAD_AGE.Fresh, LEAD_AGE.Mature, LEAD_AGE.RealTime];\r\n }\r\n};\r\n\r\nexport const LEAD_KPI = {\r\n Dial: 'dial',\r\n Connect: 'connect',\r\n AppointmentBooked: 'appointment-booked',\r\n AppointmentLeadRatio: 'appointment-lead-ratio',\r\n ConnectAppointmentRatio: 'connect-appointment-ratio',\r\n DialAppointmentRatio: 'dial-appointment-ratio',\r\n DialsPerLead: 'dials-per-lead',\r\n LeadsReceived: 'lead-received',\r\n\r\n all: () => {\r\n return [LEAD_KPI.Dial, LEAD_KPI.Connect, LEAD_KPI.AppointmentBooked, LEAD_KPI.AppointmentLeadRatio, LEAD_KPI.ConnectAppointmentRatio, LEAD_KPI.DialAppointmentRatio, LEAD_KPI.DialsPerLead, LEAD_KPI.LeadsReceived];\r\n },\r\n\r\n\r\n default: () => {\r\n return LEAD_KPI.Dial;\r\n }\r\n}\r\n\r\nexport class Leads extends ServiceWithListNav {\r\n static inject = [EventAggregator, Api, I18n, Config];\r\n _ea;\r\n _api;\r\n _i18n;\r\n _config;\r\n\r\n constructor(ea, api, i18n, config) {\r\n super('zeus.leads.list-nav');\r\n this._ea = ea;\r\n this._api = api;\r\n this._i18n = i18n;\r\n this._config = config;\r\n }\r\n\r\n dispositions(status) {\r\n try {\r\n const config = JSON.parse(this._config.value('leadsJson'));\r\n if (!status) return [];\r\n return config.dispositionsByStatus[status];\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n allDispositions() {\r\n try {\r\n const config = JSON.parse(this._config.value('leadsJson'));\r\n return config.dispositions;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n printTemplateVariables(forHeaderOrFooter = false) {\r\n try {\r\n const config = JSON.parse(this._config.value('leadsJson'));\r\n const variables = [...new Set(config.printTemplates.variables)].sort((a, b) => a.localeCompare(b)); // get the unique variables\r\n if (!forHeaderOrFooter) return variables;\r\n return variables.filter(x => x.indexOf('{{lead') < 0 && x.indexOf('{{agent') < 0);\r\n } catch (err) {\r\n console.log(err);\r\n return [];\r\n }\r\n }\r\n\r\n async pool(onlyAssigned) {\r\n let url = 'leads/pool';\r\n if (onlyAssigned) url += '?onlyAssigned=true';\r\n const leads = await this._api.get(url);\r\n return leads;\r\n }\r\n\r\n async delete(leadIds) {\r\n return await this._api.delete('leads', leadIds);\r\n }\r\n\r\n async sendTo(leadIds, sendTo) {\r\n return await this._api.post(`leads/pool/send-to/${encodeURIComponent(sendTo)}`, leadIds);\r\n }\r\n\r\n async forAgent(memberId, ids = null, leadTypes = null, notLeadTypes = null) {\r\n let url = 'leads';\r\n const payload = { memberId: memberId ?? null, ids, leadTypes, notLeadTypes };\r\n const leads = await this._api.post(url, payload);\r\n const unknownCounty = this._i18n.tr('county-unknown');\r\n leads.forEach(l => {\r\n if (!l.county) l.county = unknownCounty;\r\n l.statusName = this._i18n.tr(`lead-status-${l.status}`);\r\n if (l.type) l.typeName = this._i18n.tr(`lead:type-${l.type}`);\r\n if (l.disposition) l.dispositionName = this._i18n.tr(`lead:disposition-${l.disposition}`);\r\n l.formattedAddress = formatAddress(l);\r\n });\r\n return leads;\r\n }\r\n\r\n async byId(leadId) {\r\n return await this._api.get(`leads/${encodeURIComponent(leadId)}`);\r\n }\r\n\r\n async updateProfile(leadId, payload) {\r\n return await this._api.put(`leads/${encodeURIComponent(leadId)}`, payload);\r\n }\r\n\r\n async assignLeads(memberId, leadIds, includeHistory) {\r\n return await this._api.post('leads/pool/assign', { memberId, leadIds, includeHistory });\r\n }\r\n\r\n async assignments(leadId) {\r\n return await this._api.get(`leads/${encodeURIComponent(leadId)}/assignments`);\r\n }\r\n\r\n async unassignLeads(leadIds) {\r\n return await this._api.post('leads/pool/unassign', { leadIds });\r\n }\r\n\r\n async activities(leadId) {\r\n return await this._api.get(`leads/${encodeURIComponent(leadId)}/activities`);\r\n }\r\n\r\n async setStatus(leadId, status) {\r\n return await this._api.post(`leads/${encodeURIComponent(leadId)}/status/${encodeURIComponent(status)}`);\r\n }\r\n\r\n async setDisposition(leadId, disposition, notes) {\r\n const payload = { notes };\r\n return await this._api.post(`leads/${encodeURIComponent(leadId)}/disposition/${encodeURIComponent(disposition)}`, payload);\r\n }\r\n\r\n async resetToNew(leadId) {\r\n return await this._api.post(`leads/${encodeURIComponent(leadId)}/reset-new`);\r\n }\r\n\r\n async filters() {\r\n return await this._api.get('leads/auto-assign/filter');\r\n }\r\n\r\n async saveFilter(id, name) {\r\n return await this._api.post('leads/auto-assign/filter', { id, name });\r\n }\r\n\r\n async deleteFilter(id) {\r\n return await this._api.delete(`leads/auto-assign/filter/${encodeURIComponent(id)}`);\r\n }\r\n\r\n async setFilters(id, filters) {\r\n return await this._api.post(`leads/auto-assign/filter/${encodeURIComponent(id)}`, filters);\r\n }\r\n\r\n async setSendTo(id, sendTo) {\r\n return await this._api.post(`leads/auto-assign/filter/${encodeURIComponent(id)}/send-to`, { sendTo });\r\n }\r\n\r\n async assignAgentToFilter(id, agentId, percentage) {\r\n return await this._api.post(`leads/auto-assign/filter/${encodeURIComponent(id)}/assignment`, { agentId, percentage });\r\n }\r\n\r\n async removeAgentFromFilter(id, agentId) {\r\n return await this._api.delete(`leads/auto-assign/filter/${encodeURIComponent(id)}/assignment/${encodeURIComponent(agentId)}`);\r\n }\r\n\r\n async setAutoAssignOrdering(orderedIds) {\r\n return await this._api.post('leads/auto-assign/filter-ordering', orderedIds);\r\n }\r\n\r\n async doNotCall(leadId) {\r\n return await this._api.post(`leads/${encodeURIComponent(leadId)}/do-not-call`);\r\n }\r\n\r\n async removeDoNotCall(leadId) {\r\n return await this._api.post(`leads/${encodeURIComponent(leadId)}/remove-do-not-call`);\r\n }\r\n\r\n async canAccess(leadId) {\r\n const data = await this._api.get(`leads/${encodeURIComponent(leadId)}/can-access`);\r\n return data.canAccess;\r\n }\r\n\r\n async opportunities(usCountyFips) {\r\n let url = 'leads/opportunities';\r\n if (usCountyFips) {\r\n if (Array.isArray(usCountyFips)) url += `?county=${encodeURIComponent(usCountyFips.join(','))}`;\r\n else url += `?county=${encodeURIComponent(usCountyFips)}`;\r\n }\r\n return await this._api.get(url);\r\n }\r\n\r\n async currentInventoryOpportunities(usCountyFips) {\r\n let url = 'leads/opportunities/inventory';\r\n if (usCountyFips) {\r\n if (Array.isArray(usCountyFips)) url += `?county=${encodeURIComponent(usCountyFips.join(','))}`;\r\n else url += `?county=${encodeURIComponent(usCountyFips)}`;\r\n }\r\n return await this._api.get(url);\r\n }\r\n\r\n async kpis(timePeriod, agentId, start, end, kpi, view, groupBy) {\r\n let url = 'leads/kpis';\r\n const qs = [];\r\n if (timePeriod) qs.push(`timePeriod=${encodeURIComponent(timePeriod)}`);\r\n if (agentId) qs.push(`memberId=${encodeURIComponent(agentId)}`);\r\n if (start) qs.push(`start=${encodeURIComponent(start)}`);\r\n if (end) qs.push(`end=${encodeURIComponent(end)}`);\r\n if (kpi) qs.push(`kpi=${encodeURIComponent(kpi)}`);\r\n if (view) qs.push(`view=${encodeURIComponent(view)}`);\r\n if (groupBy) qs.push(`groupBy=${encodeURIComponent(groupBy)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return this._api.get(url);\r\n }\r\n\r\n mapPopupContent = async(lead, includeStreetView = true) => {\r\n try {\r\n let html = `
`;\r\n html += `
${this._i18n.tr('lead:power-score')}: ${lead.powerScore}
`;\r\n if (lead.phone) html += `
${formatPhone(lead.phone)}
`;\r\n if (lead.email) html += `
${lead.email}
`;\r\n html += `
${lead.formattedAddress}
`;\r\n if (includeStreetView) html += `
`;\r\n html += `
`;\r\n html += '
';\r\n return {\r\n header: lead.fullName,\r\n body: html,\r\n };\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Levels {\r\n static inject = [Api];\r\n _api;\r\n\r\n _allByType;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async byType() {\r\n if (this._allByType) return this._allByType;\r\n this._allByType = await this._api.get(`level/all-by-type`);\r\n return this._allByType;\r\n }\r\n\r\n async byTypeRestricted(restrictedByMemberId) {\r\n return await this._api.get(`level/all-by-type?restrictedByMemberId=${encodeURIComponent(restrictedByMemberId)}`);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class MemberAssistantLogins {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async forMember(memberId) {\r\n const url = memberId ? `member-assistant?memberId=${encodeURIComponent(memberId)}` : 'member-assistant';\r\n return await this._api.get(url);\r\n }\r\n\r\n async save(id, email, password, firstName, lastName) {\r\n const model = { id, email, password, firstName, lastName };\r\n return await this._api.post('member-assistant', model);\r\n }\r\n\r\n async changePassword(id, password) {\r\n const model = { id, password };\r\n return await this._api.post(`member-assistant/${encodeURIComponent(id)}/set-password`, model);\r\n }\r\n\r\n async delete(id) {\r\n const url = `member-assistant/${encodeURIComponent(id)}`;\r\n return await this._api.delete(url);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class MemberCarriers {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async downlineDebt(memberId) {\r\n let url = 'member-carrier/downline-debt';\r\n if (memberId) url += `?memberId=${encodeURIComponent(memberId)}`;\r\n return await this._api.get(url);\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Api } from 'common/server';\r\nimport { c } from 'common/common';\r\n\r\nexport class MemberConfig {\r\n static inject = [EventAggregator, Api];\r\n _api;\r\n\r\n all;\r\n _handlers = [];\r\n\r\n constructor(ea, api) {\r\n this._ea = ea;\r\n this._api = api;\r\n }\r\n\r\n async initialize() {\r\n try {\r\n await this._load();\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.agent.configUpdated, () => this._load()));\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async _load() {\r\n try {\r\n this.all = await this._api.get('member-config');\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n dispose() {\r\n this.all = undefined;\r\n this._handlers.forEach(h => h.dispose());\r\n this._handlers = [];\r\n }\r\n\r\n value(key) {\r\n if (!this.all) return undefined;\r\n const setting = this.all.find(x => x.key === key);\r\n if (!setting) return null;\r\n return setting.value;\r\n }\r\n\r\n json(key) {\r\n const value = this.value(key);\r\n if (!value) return value;\r\n return JSON.parse(value);\r\n }\r\n\r\n async save(key, value) {\r\n this.all = await this._api.post(`member-config/${encodeURIComponent(key)}`, { settingValue: value});\r\n }\r\n\r\n async reset() {\r\n this._handlers.forEach(h => h.dispose());\r\n this._handlers = [];\r\n await this.initialize();\r\n }\r\n\r\n async jsonFor(memberId, key) {\r\n const all = await this._api.get(`member-config/${encodeURIComponent(memberId)}`);\r\n const setting = all.find(x => x.key === key);\r\n if (!setting) return null;\r\n if (!setting.value) return null;\r\n return JSON.parse(setting.value);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { Config } from 'services/config';\r\n\r\nexport class MemberFiles {\r\n static inject = [Api, Config];\r\n _api;\r\n _config;\r\n\r\n constructor(api, config) {\r\n this._api = api;\r\n this._config = config;\r\n }\r\n\r\n async list(memberId) {\r\n const url = memberId\r\n ? `member-file/${encodeURIComponent(memberId)}`\r\n : 'member-file';\r\n return await this._api.get(url);\r\n }\r\n\r\n fileTypes() {\r\n return this._config.value('memberFileTypes');\r\n }\r\n\r\n async delete(memberId, fileId) {\r\n return this._api.delete(`member-file/${encodeURIComponent(memberId)}/${encodeURIComponent(fileId)}`);\r\n }\r\n}\r\n","import {inject} from 'aurelia-framework';\r\nimport {Security} from 'common/security';\r\nimport {Api} from 'common/server';\r\nimport moment from 'moment';\r\n\r\n@inject(Security, Api)\r\nexport class MemberService {\r\n _security;\r\n _api;\r\n\r\n constructor(security, api) {\r\n this._security = security;\r\n this._api = api;\r\n }\r\n\r\n getProfile(memberId) {\r\n memberId = memberId || this._security.authenticatedMemberId;\r\n return new Promise((resolve, reject) => {\r\n this._api.getData('member/' + memberId).then(data => {\r\n resolve(data);\r\n });\r\n });\r\n }\r\n\r\n getMyDownline() {\r\n return this.getDownline(this._security.authenticatedMemberId);\r\n }\r\n\r\n getDownline(memberId) {\r\n memberId = memberId || this._security.authenticatedMemberId;\r\n return new Promise((resolve, reject) => {\r\n this._api.getData('member/' + memberId + '/downline').then(data => {\r\n resolve(data);\r\n });\r\n });\r\n }\r\n}","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Api } from 'common/server';\r\nimport { Security } from 'common/security';\r\nimport { Page } from 'common/ui';\r\nimport { AgentNumbers } from 'services/agent-numbers';\r\nimport { DIALER_TEAM } from 'services/dialer';\r\nimport { c } from 'common/common';\r\n\r\nexport class Members {\r\n static inject = [EventAggregator, Api, Security, Page, AgentNumbers];\r\n _ea;\r\n _api;\r\n _security;\r\n _page;\r\n _agentNumbers;\r\n\r\n constructor(ea, api, security, page, agentNumbers) {\r\n this._ea = ea;\r\n this._api = api;\r\n this._security = security;\r\n this._page = page;\r\n this._agentNumbers = agentNumbers;\r\n }\r\n\r\n async access(id) {\r\n return this._api.get(`member/${encodeURIComponent(id)}/access`);\r\n }\r\n\r\n async getAgentNumber(memberId, carrierId) {\r\n return await this._api.get(`member/${encodeURIComponent(memberId)}/carrier-number?carrierId=${encodeURIComponent(carrierId)}`);\r\n }\r\n\r\n async saveAgentNumber(memberId, id, carrierId, agentNumber, lineOfBusiness, visible, status, comments, assignedDate) {\r\n if (status === 'null') status = null;\r\n const model = {\r\n id,\r\n carrierId,\r\n agentNumber,\r\n lineOfBusiness,\r\n visible,\r\n status,\r\n comments,\r\n assignedDate,\r\n };\r\n return await this._api.post(`member/${encodeURIComponent(memberId)}/carrier-number`, model);\r\n }\r\n\r\n async deleteAgentNumber(memberId, id) {\r\n return await this._api.delete(`member/${encodeURIComponent(memberId)}/carrier-number/${encodeURIComponent(id)}`);\r\n }\r\n\r\n async downloadVCard(id) {\r\n await this._page.exportData(this._api, `member/${encodeURIComponent(id)}/export-vcard-key`, 'member/export-vcard');\r\n }\r\n\r\n async setTeam(id, isTeam) {\r\n await this._api.post(`member/${encodeURIComponent(id)}/${isTeam ? 'make-team' : 'remove-team'}`);\r\n }\r\n\r\n async setAgency(id, isAgency) {\r\n await this._api.post(`member/${encodeURIComponent(id)}/${isAgency ? 'make-agency' : 'remove-agency'}`);\r\n }\r\n\r\n async isSuppressed(id) {\r\n const data = await this._api.get(`member/${encodeURIComponent(id)}/is-suppressed`);\r\n return data.isSuppressed;\r\n }\r\n\r\n async setSuppression(id, suppress) {\r\n await this._api.post(`member/${encodeURIComponent(id)}/${suppress ? 'suppress' : 'unsuppress'}`);\r\n }\r\n\r\n async levelChangeOptions(id) {\r\n return await this._api.get(`member/${encodeURIComponent(id)}/level-change-options`);\r\n }\r\n\r\n async requestLevelChange(id, levelType, level, comments) {\r\n await this._api.post(`member/${encodeURIComponent(id)}/request-level-change`, { levelType: levelType, requestedLevel: level, requestComments: comments });\r\n }\r\n\r\n async getMember(memberId) {\r\n return await this._api.get(`member/${encodeURIComponent(memberId || this._security.authenticatedMemberId)}/public`)\r\n }\r\n\r\n async getDirectUpline(memberId) {\r\n return await this._api.get(`member/${encodeURIComponent(memberId || this._security.authenticatedMemberId)}/direct-upline`)\r\n }\r\n\r\n async getMentor(memberId) {\r\n return await this._api.get(`member/${encodeURIComponent(memberId || this._security.authenticatedMemberId)}/mentor`)\r\n }\r\n\r\n async getAgency(memberId) {\r\n return await this._api.get(`member/${encodeURIComponent(memberId || this._security.authenticatedMemberId)}/agency`)\r\n }\r\n\r\n async masterAgency(memberId) {\r\n return await this._api.get(`member/${encodeURIComponent(memberId || this._security.authenticatedMemberId)}/master-agency`);\r\n }\r\n\r\n async getMassCommunicationStatus(memberId) {\r\n return await this._api.get(`member/${encodeURIComponent(memberId)}/mass-communication-status`);\r\n }\r\n\r\n async settings(memberId, type) {\r\n return await this._api.get(`member/${encodeURIComponent(memberId)}/setting/${encodeURIComponent(type)}`);\r\n }\r\n\r\n async settingValue(memberId, key) {\r\n const setting = await this._api.get(`member/${encodeURIComponent(memberId)}/setting/${encodeURIComponent(key)}/value`);\r\n if (!setting) return undefined;\r\n return setting.value;\r\n }\r\n\r\n async saveSettings(memberId, type, model) {\r\n const response = await this._api.post(`member/${encodeURIComponent(memberId)}/setting/${encodeURIComponent(type)}`, model);\r\n this._ea.publish(c.EventKeys.agent.configUpdated);\r\n return response;\r\n }\r\n\r\n async canAccessProfile(memberId) {\r\n const response = await this._api.get(`member/${encodeURIComponent(memberId)}/can-access-profile`);\r\n return response.canAccessProfile;\r\n }\r\n\r\n async licenses(memberId) {\r\n return await this._api.get(`member/${encodeURIComponent(memberId)}/licenses`);\r\n }\r\n\r\n async downlineContractedInState(memberId, usState, carrierId) {\r\n const params = [];\r\n if (usState) params.push(`state=${encodeURIComponent(usState)}`);\r\n if (carrierId) params.push(`carrierId=${encodeURIComponent(carrierId)}`);\r\n const qs = params.length === 0 ? '' : `?${params.join('&')}`;\r\n const downline = await this._api.get(`member/${memberId}/downline/contracted${qs}`);\r\n for (let d of downline) {\r\n for (let an of d.carrierNumbers) {\r\n an.statusColor = await this._agentNumbers.statusColor(an);\r\n }\r\n }\r\n return downline;\r\n }\r\n\r\n async isInDownline(memberId) {\r\n const data = await this._api.get(`member/${encodeURIComponent(memberId)}/is-in-downline`);\r\n return data.isInDownline;\r\n }\r\n\r\n async autoDialTeam() {\r\n return await this.settingValue(this._security.authenticatedMemberId, DIALER_TEAM.Single);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { Security } from 'common/security';\r\n\r\nexport class Mentors {\r\n static inject = [Api, Security];\r\n _api;\r\n _security;\r\n\r\n constructor(api, security) {\r\n this._api = api;\r\n this._security = security;\r\n }\r\n\r\n async all() {\r\n return await this._api.get('mentor');\r\n }\r\n\r\n async forAgent(memberId) {\r\n return await this._api.get(`mentor/${encodeURIComponent(memberId)}`);\r\n }\r\n\r\n async assignMentor(memberId, mentorMemberId) {\r\n let url = `mentor/${encodeURIComponent(memberId)}/assign/${encodeURIComponent(mentorMemberId)}`;\r\n return await this._api.post(url);\r\n }\r\n\r\n async removeMentor(memberId) {\r\n return await this._api.delete(`mentor/${encodeURIComponent(memberId)}`);\r\n }\r\n\r\n\r\n async mentees(memberId) {\r\n if (!memberId) memberId = this._security.authenticatedMemberId;\r\n return await this._api.get(`mentor/${encodeURIComponent(memberId)}/mentees`);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { Carriers } from 'services/carriers';\r\nimport { Dashboards } from 'services/dashboards';\r\nimport { I18n } from 'common/i18n';\r\nimport { Security } from 'common/security';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Config } from 'services/config';\r\nimport { Notifier } from 'common/ui';\r\nimport { c } from 'common/common';\r\n\r\nexport const MENU_AREA = {\r\n members: 'members',\r\n admin: 'admin',\r\n bigButtons: 'big-buttons',\r\n onboarding: 'onboarding',\r\n};\r\n\r\nexport const MENU_TYPE = {\r\n carriers: 'Carriers',\r\n dashboards: 'Dashboards',\r\n custom: 'Custom',\r\n};\r\n\r\nexport class Menus {\r\n static inject = [Api, Carriers, Dashboards, I18n, Security, EventAggregator, Config, Notifier];\r\n _api;\r\n _carriers;\r\n _dashboards;\r\n _i18n;\r\n _security;\r\n _ea;\r\n _config;\r\n _notifier;\r\n\r\n _menuByArea = {};\r\n _handlers = [];\r\n\r\n constructor(api, carriers, dashboards, i18n, security, ea, config, notifier) {\r\n this._api = api;\r\n this._carriers = carriers;\r\n this._dashboards = dashboards;\r\n this._i18n = i18n;\r\n this._security = security;\r\n this._ea = ea;\r\n this._config = config;\r\n this._notifier = notifier;\r\n }\r\n\r\n async initialize() {\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.menu.reset, (data) => {\r\n this._menuByArea[data.menu] = undefined;\r\n const fireEvent = data ? data.fireEvent : false;\r\n this._initialize(data.menu, fireEvent);\r\n }));\r\n await this._initialize(MENU_AREA.members);\r\n }\r\n\r\n async _initialize(menuArea, fireEvent) {\r\n try {\r\n this._menuByArea[menuArea] = await this._initializeArea(menuArea);\r\n if (fireEvent) this._ea.publish(c.EventKeys.menu.updated, { area: menuArea });\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async _initializeArea(area) {\r\n const menu = this._loadByArea(area);\r\n if (!menu) return undefined;\r\n menu.forEach(async(menuItem) => {\r\n switch (menuItem.type) {\r\n case MENU_TYPE.custom:\r\n if (!menuItem.items || !menuItem.items.length) return;\r\n menuItem.items.forEach(async(subItem) => {\r\n // handle non typical sub menus\r\n });\r\n return;\r\n case MENU_TYPE.carriers:\r\n menuItem.type = MENU_TYPE.custom;\r\n if (!menuItem.items) menuItem.items = [];\r\n const carriers = await this._loadCarriers();\r\n const carrierSubMenu = [];\r\n carriers.forEach(carrier => {\r\n const csm = {\r\n type: MENU_TYPE.custom,\r\n href: `#/members/carriers/${encodeURIComponent(carrier.slug)}`,\r\n name: `${carrier.name}${!carrier.isActive ? ' (inactive)' : ''}`,\r\n };\r\n if (!carrier.isActive) csm.ifRole = this._carriers.ADMIN_ROLES;\r\n carrierSubMenu.push(csm);\r\n });\r\n menuItem.items = [...carrierSubMenu, ...menuItem.items];\r\n return;\r\n case MENU_TYPE.dashboards:\r\n menuItem.type = MENU_TYPE.custom;\r\n if (!menuItem.items) menuItem.items = [];\r\n const dashboards = await this._loadDashboards();\r\n const dashboardsSubMenu = [];\r\n const dashboardGroups = [];\r\n dashboards.forEach(d => {\r\n const group = d.group || d.key;\r\n if (dashboardGroups.indexOf(group) >= 0) return;\r\n dashboardGroups.push(d.group);\r\n });\r\n\r\n const canAddCustomDashboard = this._config.value('membersCanAddCustomDashboards');\r\n\r\n dashboardGroups.forEach(g => {\r\n const groupDashboards = dashboards.filter(x => x.group === g);\r\n const hasSubMenu = groupDashboards[0].showHeading;\r\n const dashboardWithSub = hasSubMenu\r\n ?\r\n {\r\n type: MENU_TYPE.custom,\r\n code: g,\r\n href: undefined,\r\n name: this._i18n.tr(`dashboard-nav-${g}`),\r\n items: [],\r\n }\r\n : undefined;\r\n groupDashboards.forEach(dashboard => {\r\n if (!dashboard.layout || !dashboard.layout.length) {\r\n // Display the empty ones for the dashboard admins\r\n if (!dashboard.canEdit) return;\r\n }\r\n const dashboardItem = {\r\n type: MENU_TYPE.custom,\r\n href: `#/members/dashboard/${encodeURIComponent(dashboard.key)}`,\r\n name: dashboard.name || this._i18n.tr(`dashboard-nav-${dashboard.key}`),\r\n icon: dashboard.icon,\r\n }\r\n if (dashboardWithSub) {\r\n dashboardWithSub.items.push(dashboardItem);\r\n } else {\r\n dashboardsSubMenu.push(dashboardItem);\r\n }\r\n });\r\n if (dashboardWithSub) {\r\n dashboardsSubMenu.push(dashboardWithSub);\r\n }\r\n });\r\n\r\n if (canAddCustomDashboard) {\r\n const addDashboard = {\r\n type: MENU_TYPE.custom,\r\n href: `#/members/dashboard/add-personal-dashboard`,\r\n name: this._i18n.tr('dashboard-nav-add-personal-dashboard'),\r\n icon: 'fas fa-user-plus',\r\n };\r\n dashboardsSubMenu.push(addDashboard);\r\n }\r\n menuItem.items = [...dashboardsSubMenu, ...menuItem.items];\r\n return;\r\n default:\r\n return;\r\n }\r\n });\r\n return menu;\r\n }\r\n\r\n async _loadCarriers() {\r\n try {\r\n return await this._carriers.all();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async _loadDashboards() {\r\n try {\r\n return await this._dashboards.all();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n dispose() {\r\n this._menuByArea[MENU_AREA.members] = undefined;\r\n this._handlers.forEach(h => h.dispose());\r\n this._handlers = [];\r\n }\r\n\r\n async byArea(area) {\r\n if (!this._menuByArea[area]) this._menuByArea[area] = await this._initializeArea(area);\r\n return this._menuByArea[area];\r\n }\r\n\r\n _loadByArea(area) {\r\n const menus = this._config.value('menus');\r\n const areaMenu = menus[area];\r\n return JSON.parse(areaMenu);\r\n }\r\n\r\n async addToMobileMenu(id = null, type, code, title, description, href, icon, metadata) {\r\n const payload = {\r\n id,\r\n type,\r\n code,\r\n title,\r\n description,\r\n href,\r\n icon,\r\n metadata,\r\n };\r\n const data = await this._api.post('menu/mobile', payload);\r\n await this._resetMenu(MENU_AREA.bigButtons);\r\n this._notifier.success('mobile-menu-updated');\r\n return data;\r\n }\r\n\r\n async removeFromMobileMenu(id, type, code) {\r\n if (!id) {\r\n const mm = this.mobileMenu(id, type, code);\r\n id = mm.id;\r\n }\r\n const data = await this._api.delete(`menu/mobile/${encodeURIComponent(id)}`);\r\n await this._resetMenu(MENU_AREA.bigButtons);\r\n this._notifier.success('mobile-menu-updated');\r\n return data;\r\n }\r\n\r\n async setMobileMenuOrdering(ids) {\r\n const data = await this._api.post('menu/mobile/reorder', ids);\r\n await this._resetMenu(MENU_AREA.bigButtons);\r\n this._notifier.success('mobile-menu-updated');\r\n return data;\r\n }\r\n\r\n async _resetMenu(area) {\r\n await this._config.initialize();\r\n this._initialize(area, true);\r\n }\r\n\r\n mobileMenu(id, type, code) {\r\n try {\r\n const bigButtonsMenu = this._loadByArea(MENU_AREA.bigButtons);\r\n const item = id\r\n ? bigButtonsMenu.find(x => x.id === id)\r\n : bigButtonsMenu.find(x => x.type === type && x.code === code);\r\n return item;\r\n } catch (err) {\r\n console.log(err);\r\n return false;\r\n }\r\n }\r\n\r\n isOnMobileMenu(type, code) {\r\n try {\r\n const bigButtonsMenu = this._loadByArea(MENU_AREA.bigButtons);\r\n const item = bigButtonsMenu.find(x => x.type === type && x.code === code);\r\n return item !== undefined;\r\n } catch (err) {\r\n console.log(err);\r\n return false;\r\n }\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Api } from 'common/server';\r\nimport { Security } from 'common/security';\r\nimport { c } from 'common/common';\r\nimport environment from '../../config/environment.json';\r\n\r\nexport const MESSAGE_STATUS = {\r\n current: 'current',\r\n archived: 'archived',\r\n all: 'all',\r\n notifications: 'notifications',\r\n};\r\n\r\nexport class Messages {\r\n static inject = [EventAggregator, Api, Security];\r\n _ea;\r\n _api;\r\n _security;\r\n\r\n counts = {};\r\n _checker;\r\n _checkEveryMinutes = environment.messageCheckMinutes;\r\n _errorCtr = 0;\r\n\r\n _handlers = [];\r\n\r\n NAV_KEY = 'zeus.messages-nav';\r\n _localStorage;\r\n\r\n constructor(ea, api, security) {\r\n this._ea = ea;\r\n this._api = api;\r\n this._security = security;\r\n this._localStorage = window.localStorage;\r\n }\r\n\r\n async initialize() {\r\n this._startLoadCounts(true, true);\r\n }\r\n\r\n dispose() {\r\n this._clearChecker();\r\n this.clearNav();\r\n this.counts = {};\r\n }\r\n\r\n async reload(showNotification = true) {\r\n this._startLoadCounts(showNotification);\r\n }\r\n\r\n _startLoadCounts(showNotification = true, runChecker = false) {\r\n window.setTimeout(() => this._loadCounts(showNotification, runChecker), 500);\r\n }\r\n\r\n async _loadCounts(showNotification = true, runChecker = false) {\r\n if (!this._security.isAuthenticated) {\r\n this.dispose();\r\n return;\r\n }\r\n try {\r\n this.counts = await this._api.get('message-counts');\r\n this._fireEvent(showNotification);\r\n this._errorCtr = 0;\r\n } catch (err) {\r\n this.errorCtr++;\r\n } finally {\r\n if (this._errorCtr > 10) return;\r\n if (runChecker) {\r\n this._checker = window.setTimeout(() => this._loadCounts(true, true), this._checkEveryMinutes * 60 * 1000);\r\n }\r\n }\r\n }\r\n\r\n async current() {\r\n try {\r\n return await this._api.get('message');\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async list(status) {\r\n try {\r\n const messages = await this._api.get(`message?messageStatus=${encodeURIComponent(status)}`);\r\n return messages;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async listFor(type, forId) {\r\n return await this._api.get(`message/${encodeURIComponent(type)}/${encodeURIComponent(forId)}`);\r\n }\r\n\r\n _fireEvent(showNotification = true) {\r\n this._ea.publish(c.EventKeys.messages.updated, { showNotification });\r\n }\r\n\r\n _clearChecker() {\r\n if (!this._checker) return;\r\n window.clearTimeout(this._checker);\r\n this._checker = undefined;\r\n }\r\n\r\n async get(id) {\r\n return await this._api.get(`message/${encodeURIComponent(id)}`);\r\n }\r\n\r\n async archive(messageId, isArchived) {\r\n const response = await this._api.post(`message/${encodeURIComponent(messageId)}/archive/${encodeURIComponent(isArchived)}`);\r\n this._startLoadCounts(false);\r\n return response;\r\n }\r\n\r\n async read(messageId, isRead) {\r\n const response = await this._api.post(`message/${encodeURIComponent(messageId)}/read/${encodeURIComponent(isRead)}`);\r\n this._startLoadCounts();\r\n return response;\r\n }\r\n\r\n async massArchive(messageIds, isArchived) {\r\n const response = await this._api.post(`message/archive/${encodeURIComponent(isArchived)}`, messageIds);\r\n this._startLoadCounts(false);\r\n return response;\r\n }\r\n\r\n async massRead(messageIds, isRead) {\r\n const response = await this._api.post(`message/read/${encodeURIComponent(isRead)}`, messageIds);\r\n this._startLoadCounts();\r\n return response;\r\n }\r\n\r\n async create(messageType, subject, content, toMemberId, replyToMessageId, start, end, filterBy, level, levelOrAbove, memberIdAndDownline) {\r\n return this.save(replyToMessageId || null, subject, content, toMemberId, messageType, start, end, filterBy, level, levelOrAbove, null, memberIdAndDownline);\r\n }\r\n\r\n async edit(id, messageType, subject, content, start, end, filterBy, level, levelOrAbove, memberIdAndDownline) {\r\n return this.save(null, subject, content, null, messageType, start, end, filterBy, level, levelOrAbove, id, memberIdAndDownline);\r\n }\r\n\r\n async reply(toMessageId, subject, content, toMemberId) {\r\n return this.save(toMessageId, subject, content, toMemberId);\r\n }\r\n\r\n async save(replyToMessageId, subject, content, toMemberId, messageType, startDate, endDate, filterBy, level, levelOrAbove, editMessageId, memberIdAndDownline) {\r\n let toFilter = null;\r\n if (filterBy === 'Life' || filterBy === 'Annuity' || filterBy === 'HMA') {\r\n toFilter = {\r\n levelType: filterBy,\r\n level: level,\r\n levelOrAbove: levelOrAbove ? true : false\r\n }\r\n }\r\n if (filterBy === 'agent-and-downline') {\r\n toFilter = {\r\n memberIdAndDownline: memberIdAndDownline,\r\n }\r\n }\r\n const model = {\r\n id: editMessageId || null,\r\n replyToMessageId,\r\n subject,\r\n content,\r\n toMemberId,\r\n messageType,\r\n startDate,\r\n endDate,\r\n toFilter\r\n };\r\n const response = await this._api.post('message', model);\r\n this._startLoadCounts(false);\r\n return response;\r\n }\r\n\r\n async delete(messageId) {\r\n const response = await this._api.delete(`message/${encodeURIComponent(messageId)}`);\r\n this._startLoadCounts(false);\r\n return response;\r\n }\r\n\r\n clearNav() {\r\n this._localStorage.removeItem(this.NAV_KEY);\r\n }\r\n\r\n setNavList(messages) {\r\n try {\r\n const ids = messages.map(x => x.id);\r\n this._localStorage.setItem(this.NAV_KEY, JSON.stringify(ids));\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n getNav(currentId) {\r\n try {\r\n const ids = JSON.parse(this._localStorage.getItem(this.NAV_KEY) || '[]');\r\n const currentIndex = ids.indexOf(currentId);\r\n if (currentIndex < 0) {\r\n this.clearNav();\r\n return { hasNav: false };\r\n }\r\n const previousId = currentIndex > 0 ? ids[currentIndex - 1] : undefined;\r\n const nextId = currentIndex >= 0 && currentIndex < ids.length ? ids[currentIndex + 1] : undefined;\r\n return {\r\n hasNav: previousId || nextId ? true : false,\r\n previousId,\r\n nextId\r\n };\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Notes {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async list(type, aboutId) {\r\n let url = `note/${encodeURIComponent(type)}/${encodeURIComponent(aboutId)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async save(id, noteType, aboutId, notes) {\r\n const model = { id, noteType, aboutId, notes };\r\n return await this._api.post('note', model);\r\n }\r\n\r\n async delete(id) {\r\n return await this._api.delete(`note/${encodeURIComponent(id)}`);\r\n }\r\n}\r\n","import environment from '../../config/environment.json';\r\nimport { Security } from 'common/security';\r\nimport { Api } from 'common/server';\r\nimport { MemberConfig } from 'services/member-config';\r\nimport { Config } from 'services/config';\r\n\r\nexport class Nylas {\r\n static inject = [Security, Api, MemberConfig, Config];\r\n _security;\r\n _api;\r\n _memberConfig;\r\n _config;\r\n\r\n _nylasIntegration;\r\n schedulePageDomain;\r\n schedulePageBase;\r\n _nylasLoaded = false;\r\n _forMemberId;\r\n _forMemberNylasConfig;\r\n\r\n constructor(security, api, memberConfig, config) {\r\n this._security = security;\r\n this._api = api;\r\n this._memberConfig = memberConfig;\r\n this._config = config;\r\n this.schedulePageDomain = this._config.value('yourCalendarOnlineUrl');\r\n this.schedulePageBase = `${this.schedulePageDomain || 'https://schedule.yourcalendaronline.com'}#`;\r\n }\r\n\r\n loadScript() {\r\n try {\r\n const existingScript = document.getElementById('zeus-nylas-script');\r\n if (existingScript) return;\r\n const scriptEl = document.createElement('script');\r\n scriptEl.setAttribute('id', 'zeus-nylas-script');\r\n scriptEl.setAttribute('type', 'text/javascript');\r\n scriptEl.setAttribute('src', 'https://schedule.nylas.com/schedule-editor/v1.0/schedule-editor.js');\r\n document.body.appendChild(scriptEl);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async _nylasConfig(forMemberId) {\r\n if (forMemberId && !this._security.isAuthenticatedMember(forMemberId)) {\r\n // Need to load the nylas config for forMemberId\r\n if (this._forMemberId === forMemberId && this._forMemberNylasConfig) return this._forMemberNylasConfig;\r\n this._forMemberId = forMemberId;\r\n this._forMemberNylasConfig = await this._memberConfig.jsonFor(this._forMemberId, 'nylas');\r\n console.log(this._forMemberNylasConfig);\r\n return this._forMemberNylasConfig;\r\n }\r\n return this._memberConfig.json('nylas');\r\n }\r\n\r\n async mustReauth(forMemberId) {\r\n try {\r\n const nylas = await this._nylasConfig(forMemberId);\r\n if (!nylas) return false;\r\n return nylas.mustReauth;\r\n } catch (err) {\r\n console.log(err);\r\n return false;\r\n }\r\n }\r\n\r\n async authorizedEmail(forMemberId) {\r\n try {\r\n const nylas = await this._nylasConfig(forMemberId);\r\n if (!nylas) return undefined;\r\n return nylas.email;\r\n } catch (err) {\r\n console.log(err);\r\n return undefined;\r\n }\r\n }\r\n\r\n async email(overrideEmail, forMemberId) {\r\n try {\r\n const nylas = await this._nylasConfig(forMemberId);\r\n if (!nylas) {\r\n if (overrideEmail) return overrideEmail;\r\n return this._security.agent.email;\r\n }\r\n if (!nylas.email) return overrideEmail;\r\n return nylas.email;\r\n } catch (err) {\r\n console.log(err);\r\n if (this._security.agent) return this._security.agent.email;\r\n return '';\r\n }\r\n }\r\n\r\n async grantId(forMemberId) {\r\n try {\r\n const nylas = await this._nylasConfig(forMemberId);\r\n if (!nylas) return null;\r\n return nylas.grantId;\r\n } catch (err) {\r\n console.log(err);\r\n return null;\r\n }\r\n }\r\n\r\n async isAuthenticated(forMemberId) {\r\n return await this.grantId(forMemberId) ? true : false;\r\n }\r\n\r\n async _loadSettings() {\r\n if (this._nylasIntegration) return;\r\n const nylasIntegration = await this._api.get('config/NylasIntegration');\r\n if (nylasIntegration == null) return;\r\n this._nylasIntegration = JSON.parse(nylasIntegration);\r\n }\r\n\r\n async clientId() {\r\n try {\r\n await this._loadSettings();\r\n return this._nylasIntegration.clientId;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async redirectUri() {\r\n try {\r\n await this._loadSettings();\r\n let redirectUri = `${environment.url}${this._nylasIntegration.authenticationRedirectUri}`;\r\n return redirectUri;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async redirectToAuthUrl(email, from, forMemberId) {\r\n try {\r\n const stateValue = `${forMemberId ?? this._security.authenticatedMemberId}|${email}`;\r\n\r\n await this._loadSettings();\r\n let redirectUri = `${environment.url}${this._nylasIntegration.authenticationRedirectUri}`;\r\n if (window.location.origin && window.location.origin.indexOf('imobackoffice.com') >= 0) {\r\n redirectUri = `${window.location.origin}${this._nylasIntegration.authenticationRedirectUri}`;\r\n }\r\n if (from) redirectUri += `?from=${from}`;\r\n return `https://api.us.nylas.com/v3/connect/auth?client_id=${this._nylasIntegration.clientId}&redirect_uri=${encodeURIComponent(redirectUri)}&response_type=code&access_type=online&prompt=select_provider&state=${encodeURIComponent(stateValue)}&login_hint=${encodeURIComponent(email)}`;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n schedulerUrl(slug) {\r\n return `${this.schedulePageBase}${slug}`;\r\n }\r\n\r\n schedulerSlug(url) {\r\n let slug = url.substr(this.schedulePageBase.length);\r\n if (slug.indexOf('/') === 0) slug = slug.substr(1);\r\n return slug;\r\n }\r\n\r\n async editScheduler(forMemberId) {\r\n try {\r\n const grantId = await this.grantId(forMemberId);\r\n if (!grantId) return;\r\n nylas.scheduler.show({\r\n pageDomain: this.schedulePageBase,\r\n auth: { grantId },\r\n style: { tintColor: '#32325d', backgroundColor: 'white' },\r\n defaults: {\r\n appearance: { show_autoschedule: false, show_nylas_branding: false },\r\n event: {\r\n duration: 10,\r\n },\r\n },\r\n });\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async addressBook() {\r\n return await this._api.get('nylas/address-book');\r\n }\r\n\r\n async authenticated(code, stateValue) {\r\n const statePipeIdx = stateValue.indexOf('|');\r\n const memberId = stateValue.substr(0, statePipeIdx);\r\n const email = stateValue.substr(statePipeIdx + 1);\r\n const payload = { code, memberId, email };\r\n console.log(stateValue, email, memberId);\r\n await this._api.post('nylas/authenticated', payload);\r\n await this._memberConfig.initialize();\r\n }\r\n\r\n async resetAuth() {\r\n const response = await this._api.post('nylas/reset-auth');\r\n await this._memberConfig.reset();\r\n return response;\r\n }\r\n}","import { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\n\r\nexport const ONBOARDING_STATUS_BREAKS = [0.5,-1.5];\r\n\r\nexport class Onboardings {\r\n static inject = [Api, I18n];\r\n _api;\r\n _i18n;\r\n\r\n STEP_COLORS = ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c'];\r\n\r\n constructor(api, i18n) {\r\n this._api = api;\r\n this._i18n = i18n;\r\n }\r\n\r\n async myStatus() {\r\n return await this._api.get('onboarding');\r\n }\r\n\r\n async memberStatus(memberId) {\r\n return await this._api.get(`onboarding/${encodeURIComponent(memberId)}`);\r\n }\r\n\r\n async updateProgress(progressModel) {\r\n return await this._api.post('onboarding', progressModel);\r\n }\r\n\r\n async contractDetails() {\r\n return await this._api.get(`onboarding/contract-details`);\r\n }\r\n\r\n async checkContractedStatus(forMemberId) {\r\n const url = forMemberId\r\n ? `onboarding/${encodeURIComponent(forMemberId)}/check-contracted-status`\r\n : 'onboarding/check-contracted-status';\r\n return await this._api.get(url);\r\n }\r\n\r\n async backStep(progressModel) {\r\n return await this._api.post('onboarding/back-step', progressModel);\r\n }\r\n\r\n async reset(memberId) {\r\n return await this._api.post(`onboarding/${encodeURIComponent(memberId)}/reset`);\r\n }\r\n\r\n async complete(memberId) {\r\n return await this._api.post(`onboarding/${encodeURIComponent(memberId)}/complete`);\r\n }\r\n\r\n async teamStatus(forAgency) {\r\n let url = 'onboarding/team-status';\r\n if (forAgency === true) url += '?forAgency=true';\r\n const status = await this._api.get(url);\r\n status.countsRYG = [0, 0, 0];\r\n status.onboardings.forEach(o => {\r\n o.currentStep = this._i18n.tr(`onboarding-step-abbr-${o.currentStepCode}`);\r\n o.currentStepBoxStyle = `background-color:${this.stepColor(o.currentStepCode)}`;\r\n o.currentSubstep = this._i18n.tr(`onboarding-step-${o.currentSubstepCodeValue}`);\r\n o.statusColor = '';\r\n if (o.overUnderExpectedDays > ONBOARDING_STATUS_BREAKS[0]) {\r\n o.statusColor = 'g';\r\n status.countsRYG[2]++;\r\n } else if (o.overUnderExpectedDays > ONBOARDING_STATUS_BREAKS[1]) {\r\n o.statusColor = 'y';\r\n status.countsRYG[1]++;\r\n } else {\r\n o.statusColor = 'r';\r\n status.countsRYG[0]++;\r\n }\r\n });\r\n return status;\r\n }\r\n\r\n stepColor(stepCode) {\r\n switch (stepCode) {\r\n case 'select-platforms': return this.STEP_COLORS[0];\r\n case 'life-platform': return this.STEP_COLORS[1];\r\n case 'annuity-platform': return this.STEP_COLORS[2];\r\n case 'hma-platform': return this.STEP_COLORS[3];\r\n default: return '';\r\n }\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Pipelines {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async availableTemplates(personType, memberId) {\r\n let url = 'pipelines/templates/available';\r\n const qs = [];\r\n if (personType) qs.push(`personType=${encodeURIComponent(personType)}`);\r\n if (memberId) qs.push(`memberId=${encodeURIComponent(memberId)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async pipelines(personType, memberId) {\r\n let url = 'pipelines';\r\n const qs = [];\r\n if (personType) qs.push(`personType=${encodeURIComponent(personType)}`);\r\n if (memberId) qs.push(`memberId=${encodeURIComponent(memberId)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async all(memberId) {\r\n let url = 'pipelines/all';\r\n const qs = [];\r\n if (memberId) qs.push(`memberId=${encodeURIComponent(memberId)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async createPipeline(name, personType, description, color, showAgentProperties, code, carrierId) {\r\n const payload = { name, personType, description, color, showAgentProperties, code: code || null, carrierId: carrierId || null };\r\n return await this._api.post(`pipelines`, payload);\r\n }\r\n\r\n async createPipelineFromTemplate(pipelineTemplateId) {\r\n const payload = { pipelineTemplateId };\r\n return await this._api.post(`pipelines`, payload);\r\n }\r\n\r\n async deletePipeline(id) {\r\n return await this._api.delete(`pipelines/${encodeURIComponent(id)}`);\r\n }\r\n\r\n async editPipeline(id, name, personType, description, color, showAgentProperties, code, carrierId) {\r\n const payload = { name, personType, description, color, showAgentProperties, code : code || null, carrierId: carrierId || null };\r\n return await this._api.put(`pipelines/${encodeURIComponent(id)}`, payload);\r\n }\r\n\r\n async copyPipeline(id, name, description, color, showAgentProperties) {\r\n const payload = { name, description, color, showAgentProperties };\r\n return await this._api.post(`pipelines/${encodeURIComponent(id)}/copy`, payload);\r\n }\r\n\r\n async setPipelineOrdering(orderedIds) {\r\n await this._api.post('pipelines/set-ordering', { orderedIds });\r\n }\r\n\r\n async pipeline(id) {\r\n return await this._api.get(`pipelines/${encodeURIComponent(id)}`);\r\n }\r\n\r\n async pipelineShares(id) {\r\n return await this._api.get(`pipelines/${encodeURIComponent(id)}/share`);\r\n }\r\n\r\n async sharePipeline(id, memberId, canEdit) {\r\n return await this._api.post(`pipelines/${encodeURIComponent(id)}/share/${encodeURIComponent(memberId)}/${encodeURIComponent(canEdit)}`);\r\n }\r\n\r\n async removePipelineShare(id, memberId) {\r\n return await this._api.delete(`pipelines/${encodeURIComponent(id)}/share/${encodeURIComponent(memberId)}`);\r\n }\r\n\r\n async backlog(pipelineId) {\r\n return await this._api.get(`pipelines/${encodeURIComponent(pipelineId)}/persons/backlog`);\r\n }\r\n\r\n async addPerson(pipelineId, personType, personId, stageId) {\r\n return await this._api.post(`pipelines/${encodeURIComponent(pipelineId)}/persons/${encodeURIComponent(personType)}/${encodeURIComponent(personId)}?stageId=${encodeURIComponent(stageId)}`);\r\n }\r\n\r\n async removePerson(pipelineId, personType, personId) {\r\n return await this._api.delete(`pipelines/${encodeURIComponent(pipelineId)}/persons/${encodeURIComponent(personType)}/${encodeURIComponent(personId)}`);\r\n }\r\n\r\n async movePerson(pipelineId, personType, personId, stageId) {\r\n if (!stageId) {\r\n return await this._api.delete(`pipelines/${pipelineId}/persons/${encodeURIComponent(personType)}/${encodeURIComponent(personId)}/stages`);\r\n }\r\n return await this._api.put(`pipelines/${pipelineId}/persons/${encodeURIComponent(personType)}/${encodeURIComponent(personId)}/stages/${stageId}`);\r\n }\r\n\r\n async personsInStage(pipelineId, stageId, archivedPersons) {\r\n return await this._api.get(`pipelines/${encodeURIComponent(pipelineId)}/stages/${stageId}/persons?archived=${archivedPersons ? 'true' : 'false'}`);\r\n }\r\n\r\n async orderPersons(pipelineId, stageId, orderedPersonIds) {\r\n return await this._api.post(`pipelines/${encodeURIComponent(pipelineId)}/stages/${encodeURIComponent(stageId)}/order-persons`, orderedPersonIds);\r\n }\r\n\r\n async savePerson(pipelineId, personType, personId, metadata) {\r\n return await this._api.put(`pipelines/${encodeURIComponent(pipelineId)}/persons/${encodeURIComponent(personType)}/${encodeURIComponent(personId)}/metadata`, metadata);\r\n }\r\n\r\n async addStage(pipelineId, name, expectedDaysInStage, color) {\r\n const payload = { name, expectedDaysInStage, color };\r\n return await this._api.post(`pipelines/${encodeURIComponent(pipelineId)}/stages`, payload);\r\n }\r\n\r\n async editStage(pipelineId, stageId, name, expectedDaysInStage, color) {\r\n const payload = { name, expectedDaysInStage, color };\r\n return await this._api.put(`pipelines/${encodeURIComponent(pipelineId)}/stages/${encodeURIComponent(stageId)}`, payload);\r\n }\r\n\r\n async deleteStage(pipelineId, stageId) {\r\n return await this._api.delete(`pipelines/${encodeURIComponent(pipelineId)}/stages/${encodeURIComponent(stageId)}`);\r\n }\r\n\r\n async setStageOrdering(pipelineId, orderedIds) {\r\n await this._api.post(`pipelines/${encodeURIComponent(pipelineId)}/set-stage-ordering`, { orderedIds });\r\n }\r\n\r\n async purge(pipelineId, personId, personType) {\r\n let url = `pipelines/${encodeURIComponent(pipelineId)}`;\r\n if (personId) url += `/persons/${encodeURIComponent(personType)}/${encodeURIComponent(personId)}`;\r\n url += '/purge';\r\n return await this._api.delete(url);\r\n }\r\n\r\n async restorePerson(pipelineId, personId, personType) {\r\n let url = `pipelines/${encodeURIComponent(pipelineId)}/persons/${encodeURIComponent(personType)}/${encodeURIComponent(personId)}/restore`;\r\n return await this._api.post(url);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Policies {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async convertToLeads(policyIds) {\r\n const payload = { policyIds };\r\n return await this._api.post('policy/convert-to-leads', payload);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { Config } from 'services/config';\r\nimport { Content } from 'services/content';\r\nimport { I18n } from 'common/i18n';\r\n\r\nexport class PrintTemplates {\r\n static inject = [Api, Config, Content, I18n];\r\n _api;\r\n _config;\r\n _content;\r\n _i18n;\r\n\r\n constructor(api, config, content, i18n) {\r\n this._api = api;\r\n this._config = config;\r\n this._content = content;\r\n this._i18n = i18n;\r\n }\r\n\r\n async byAboutType(printType, aboutType) {\r\n return await this._api.get(`print-templates/${encodeURIComponent(printType)}/${encodeURIComponent(aboutType)}`);\r\n }\r\n\r\n async filterOptions(aboutType) {\r\n return await this._api.get(`print-templates/${encodeURIComponent(aboutType)}/filter-options`);\r\n }\r\n\r\n async save(id, printType, aboutType, name) {\r\n const payload = { name, printType, aboutType };\r\n if (id) {\r\n return await this._api.put(`print-templates/${encodeURIComponent(id)}`, payload);\r\n } else {\r\n return await this._api.post('print-templates', payload);\r\n }\r\n }\r\n\r\n async copy(id) {\r\n return await this._api.post(`print-templates/${encodeURIComponent(id)}/copy`);\r\n }\r\n\r\n async saveHtml(id, html) {\r\n const payload = { html };\r\n return await this._api.put(`print-templates/${encodeURIComponent(id)}/html`, payload);\r\n }\r\n\r\n async saveVariable(namespace, code, value) {\r\n const response = await this._content.saveUiTerm(namespace, code, value);\r\n await this._i18n.reloadTranslations();\r\n return response;\r\n }\r\n\r\n\r\n async getHtml(key) {\r\n return await this._config.get(key);\r\n }\r\n\r\n async saveHeaderFooterHtml(endpoint, html) {\r\n const response = await this._api.post(endpoint, { html });\r\n await this._config.initialize();\r\n return response;\r\n }\r\n\r\n async setDefault(printType, aboutType, id) {\r\n return await this._api.put(`print-templates/${encodeURIComponent(printType)}/${encodeURIComponent(aboutType)}/default/${encodeURIComponent(id)}`);\r\n }\r\n\r\n async saveFilter(id, filter) {\r\n return await this._api.put(`print-templates/${encodeURIComponent(id)}/filters`, filter);\r\n }\r\n\r\n async delete(id) {\r\n return await this._api.delete(`print-templates/${encodeURIComponent(id)}`);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport moment from 'moment';\r\nimport { TIME_PERIOD, REPORT_FOR } from 'common/constants';\r\nimport { PolicyStatusValueConverter } from 'resources/value-converters/policy-status';\r\n\r\nexport const SUMMARY_TYPE = {\r\n Personal: 'Personal',\r\n Team: 'Team',\r\n Agency: 'Agency',\r\n MasterAgency: 'MasterAgency'\r\n};\r\n\r\nexport const CACHE_TYPE = {\r\n Personal: 'Personal',\r\n Downline: 'Downline',\r\n Team: 'Team',\r\n Agency: 'Agency',\r\n MasterAgency: 'MasterAgency',\r\n\r\n options: (access) => {\r\n const options = [];\r\n options.push(CACHE_TYPE.Personal);\r\n options.push(CACHE_TYPE.Downline);\r\n if (access) {\r\n if (access.isTeam) options.push(CACHE_TYPE.Team);\r\n if (access.isAgency) options.push(CACHE_TYPE.Agency);\r\n if (access.isMasterAgency) options.push(CACHE_TYPE.MasterAgency);\r\n }\r\n return options;\r\n },\r\n\r\n toScope: (cacheType) => {\r\n switch (cacheType) {\r\n case CACHE_TYPE.Personal: return 'personal';\r\n case CACHE_TYPE.Downline: return 'downline';\r\n case CACHE_TYPE.Team: return 'team';\r\n case CACHE_TYPE.Agency: return 'agency';\r\n case CACHE_TYPE.MasterAgency: return 'master-agency';\r\n default: return '';\r\n }\r\n }\r\n};\r\n\r\nexport const CACHE_PERIOD = {\r\n Yesterday: 'Yesterday',\r\n LastYesterday: 'LastYesterday',\r\n CurrentWeek: 'CurrentWeek',\r\n LastWeek: 'LastWeek',\r\n LastLastWeek: 'LastLastWeek',\r\n CurrentMonth: 'CurrentMonth',\r\n LastMonth: 'LastMonth',\r\n CurrentYear: 'CurrentYear',\r\n LastYear: 'LastYear',\r\n\r\n options: () => [CACHE_PERIOD.Yesterday, CACHE_PERIOD.CurrentWeek, CACHE_PERIOD.LastWeek, CACHE_PERIOD.CurrentMonth, CACHE_PERIOD.CurrentYear],\r\n};\r\n\r\nexport class ProductionService {\r\n static inject = [Api, PolicyStatusValueConverter];\r\n _api;\r\n _policyStatusValueConverter;\r\n\r\n TIME_PERIOD = TIME_PERIOD;\r\n\r\n constructor(api, policyStatusValueConverter) {\r\n this._api = api;\r\n this._policyStatusValueConverter = policyStatusValueConverter;\r\n }\r\n\r\n async status(memberId, cacheType = CACHE_TYPE.Personal, cachePeriod = CACHE_PERIOD.Yesterday) {\r\n return await this._api.get(`production/agent/${encodeURIComponent(memberId)}/status?type=${encodeURIComponent(cacheType)}&period=${encodeURIComponent(cachePeriod)}`);\r\n }\r\n\r\n async placementAndPersistency(memberId) {\r\n return await this._api.get(`production/agent/${encodeURIComponent(memberId)}/p-and-p`);\r\n }\r\n\r\n /**\r\n * \r\n * @param {String} id - of the member\r\n * @param {Moment} date - used to calculate the time period to return\r\n * @param {String} timePeriod - the time period: WTD, MTD, YTD\r\n * @param {String} summaryType - the type of summary: Personal, Team, Agency\r\n * @returns \r\n */\r\n summary(id = null, date = null, timePeriod = TIME_PERIOD.WTD, summaryType = SUMMARY_TYPE.Personal) {\r\n const apiDate = date ? date.format('l') : null;\r\n return this._api.get(`production/summary?memberId=${encodeURIComponent(id)}&date=${encodeURIComponent(apiDate)}&timePeriod=${encodeURIComponent(timePeriod)}&summaryType=${encodeURIComponent(summaryType)}`);\r\n }\r\n\r\n getPoliciesApiQs(forMemberId, primaryAgent, carrier, lineOfBusiness, statusGroup, start, end) {\r\n let qs = '';\r\n if (forMemberId) qs += '&forMemberId=' + encodeURIComponent(forMemberId);\r\n if (primaryAgent) qs += '&agentId=' + encodeURIComponent(primaryAgent);\r\n if (carrier) qs += '&carrierExternalId=' + encodeURIComponent(carrier);\r\n if (lineOfBusiness) qs += '&lob=' + encodeURIComponent(lineOfBusiness);\r\n if (statusGroup) qs += '&statusGroup=' + encodeURIComponent(statusGroup);\r\n if (start) qs += '&start=' + encodeURIComponent(this._qsDateValue(start));\r\n if (end) qs += '&end=' + encodeURIComponent(this._qsDateValue(end));\r\n qs += '&limitToSubmittedDaysInPast=365'; // rolling year\r\n return qs;\r\n }\r\n\r\n getPolicyListQs(forMemberId, primaryAgent, carrier, lineOfBusiness, statusGroup, start, end, limitToSubmittedDaysInPast) {\r\n let qs = '';\r\n if (forMemberId) qs += '&forMemberId=' + encodeURIComponent(forMemberId);\r\n if (primaryAgent) qs += '&agent=' + encodeURIComponent(primaryAgent);\r\n if (carrier) qs += '&carrier=' + encodeURIComponent(carrier);\r\n if (lineOfBusiness) qs += '&lob=' + encodeURIComponent(lineOfBusiness);\r\n if (statusGroup) qs += '&status=' + encodeURIComponent(statusGroup);\r\n if (start) qs += '&start=' + encodeURIComponent(this._qsDateValue(start));\r\n if (end) qs += '&end=' + encodeURIComponent(this._qsDateValue(end));\r\n if (limitToSubmittedDaysInPast) qs += \"&limitToSubmittedDaysInPast=\" + encodeURIComponent(limitToSubmittedDaysInPast);\r\n return qs;\r\n }\r\n\r\n getPolicies(forMemberId, primaryAgent, carrier, lineOfBusiness, statusGroup, start, end) {\r\n return new Promise((resolve, reject) => {\r\n let qs = this.getPoliciesApiQs(forMemberId, primaryAgent, carrier, lineOfBusiness, statusGroup, start, end);\r\n this._api.getData('production/policy-list?' + qs).then(data => {\r\n resolve(data);\r\n });\r\n });\r\n }\r\n\r\n async policy(id) {\r\n let url = `production/policy/${encodeURIComponent(id)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async policyByNumber(policyNumber) {\r\n return await this._api.get(`policy/by-number/${encodeURIComponent(policyNumber)}`);\r\n }\r\n\r\n getCarriers() {\r\n return new Promise((resolve, reject) => {\r\n this._api.getData('production/carriers').then(data => {\r\n resolve(data);\r\n });\r\n });\r\n }\r\n\r\n async pendingAnnuities() {\r\n const policies = await this._api.get('production/policy/pending-annuities'); \r\n policies.forEach(p => p.statusName = this._policyStatusValueConverter.toView(p.status));\r\n return policies;\r\n }\r\n\r\n /**\r\n * Search policies\r\n * @param {String} scope \r\n * @param {[String]} status - an array of statuses to search by\r\n * @param {String} forMemberId\r\n * @param {String} dateType - Submitted, Paid, Chargeback - the date to use when searching by date\r\n * @param {String} start - the start date\r\n * @param {String} end - the end date\r\n * @returns {Promise<[Object]>}\r\n */\r\n async searchPolicies(scope, status, forMemberId = null, dateType, start, end) {\r\n const model = {\r\n forAgency: scope === 'agency',\r\n forTeam: scope === 'team',\r\n forMasterAgency: scope === 'master-agency',\r\n forDownline: scope === 'downline',\r\n forMemberId,\r\n status,\r\n dateType,\r\n start,\r\n end\r\n };\r\n const policies = await this._api.post('policy', model);\r\n policies.forEach(p => p.statusName = this._policyStatusValueConverter.toView(p.status));\r\n return policies;\r\n }\r\n\r\n _qsDateValue(dt) {\r\n let dtMoment = moment(dt, 'MM/DD/YYYY');\r\n if (!dtMoment.isValid()) return null;\r\n return dtMoment.format();\r\n }\r\n\r\n async policyStatuses() {\r\n return await this._api.get('production/policy-status-list');\r\n }\r\n\r\n async policySubStatuses() {\r\n return await this._api.get('production/policy-substatus-list');\r\n }\r\n\r\n async removeStatusOverride(id) {\r\n return await this._api.post(`policy/${encodeURIComponent(id)}/remove-status-override`);\r\n }\r\n\r\n async removeSubStatus(id) {\r\n return await this._api.post(`policy/${encodeURIComponent(id)}/remove-substatus`);\r\n }\r\n\r\n async volumeRankings(settings, asOfDate, memberId) {\r\n let url = 'production/volume-ranking';\r\n const qs = [];\r\n if (asOfDate) qs.push(`asOfDate=${encodeURIComponent(asOfDate)}`);\r\n if (memberId) qs.push(`memberId=${encodeURIComponent(memberId)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.post(url, settings);\r\n }\r\n\r\n async premiumTypes() {\r\n return await this._api.get('production/premium-type');\r\n }\r\n\r\n async policySplits(policyId) {\r\n return await this._api.get(`policy/${policyId}/splits`);\r\n }\r\n\r\n async splitPolicy(policyId, splitWithMemberId, splitPercentage) {\r\n return await this._api.post(`policy/${policyId}/split`, { splitWithMemberId, splitPercentage });\r\n }\r\n\r\n /**\r\n * Get policy status changes for the selected date\r\n * @param {Moment} forDate - the moment date to get the status changes\r\n * @param {String||null} carrierId\r\n * @returns [object]\r\n */\r\n async policyStatusChanges(forDate, carrierId) {\r\n let url = `policy/status-changes?forDate=${forDate.toISOString()}`;\r\n if (carrierId) url += `&carrierId=${encodeURIComponent(carrierId)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n /**\r\n * Get the agency monthly production report\r\n * @returns [object]\r\n */\r\n async agencyMonthlyProduction(timePeriod) {\r\n const payload = { timePeriod };\r\n return await this._api.post('production/agency/monthly-production', payload);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Products {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async typesByLOB() {\r\n return await this._api.get('product-type');\r\n }\r\n\r\n async list(carrierId) {\r\n const url = carrierId\r\n ? `product?carrierId=${encodeURIComponent(carrierId)}`\r\n : 'product';\r\n return await this._api.get(url);\r\n }\r\n\r\n async save(id, carrierId, name, aliases, lineOfBusiness, productType, underwriting, factors, existingPoliciesImpactOption, existingPoliciesImpactAfterDate) {\r\n const model = { id, carrierId, name, aliases, lineOfBusiness, productType, underwriting, factors, existingPoliciesImpactOption, existingPoliciesImpactAfterDate };\r\n return await this._api.post('product', model);\r\n }\r\n\r\n async delete(id, moveToProductId) {\r\n return await this._api.delete(`product/${encodeURIComponent(id)}`, { moveToProductId });\r\n }\r\n\r\n async defaultFactors() {\r\n return await this._api.get('product-factor-type-defaults');\r\n }\r\n\r\n async factorPremiumTypes() {\r\n return await this._api.get('product-factor-premium-type');\r\n }\r\n\r\n async addAlias(productId, alias) {\r\n return await this._api.post(`product/${productId}/alias`, { alias });\r\n }\r\n\r\n async removeAlias(productId, alias) {\r\n return await this._api.delete(`product/${productId}/alias`, { alias });\r\n }\r\n}\r\n","import {inject} from 'aurelia-framework';\r\nimport {Api} from 'common/server';\r\nimport {I18n} from 'common/i18n';\r\nimport {Notifier} from 'common/ui';\r\n\r\n@inject(Api, I18n, Notifier)\r\nexport class QandA {\r\n\r\n intros = [];\r\n\r\n constructor(api, i18n, notifier) {\r\n this._api = api;\r\n this._i18n = i18n;\r\n this._notifier = notifier;\r\n }\r\n\r\n initialize(clear) {\r\n if (clear) this._clear();\r\n return this._loadAll();\r\n }\r\n\r\n _clear() {\r\n this.intros = [];\r\n }\r\n\r\n _loadAll() {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n if (me.intros.length) {\r\n resolve(me.intros);\r\n return;\r\n }\r\n\r\n me.intros = [];\r\n me._api.getData('q-and-a/list/' + this._i18n.currentLocale).then(qAndAIntros => {\r\n me.intros = qAndAIntros;\r\n resolve(me.intros);\r\n }).catch(error => {\r\n reject();\r\n });\r\n });\r\n }\r\n\r\n saveQandA(id, slug, ordering, isActive) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n var saveModel = { slug: slug, ordering: ordering, isActive: isActive };\r\n\r\n if (id) {\r\n me._api.updateData(\"q-and-a/\" + id, saveModel).then(data => {\r\n me._notifier.success('q-and-a-update-successful', { slug: slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n if (typeof error === 'string' && error.indexOf('q-and-a-error') === 0) {\r\n me._notifier.error(error);\r\n } else {\r\n me._notifier.generalError();\r\n }\r\n reject();\r\n });\r\n } else {\r\n me._api.postData(\"q-and-a\", saveModel).then(data => {\r\n me._notifier.success('q-and-a-add-successful', { slug: slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n if (error.indexOf('q-and-a-error') === 0) {\r\n me._notifier.error(error);\r\n } else {\r\n me._notifier.generalError();\r\n }\r\n reject();\r\n });\r\n }\r\n });\r\n }\r\n\r\n deleteQandA(id) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n me._api.deleteData(\"q-and-a/\" + id).then(data => {\r\n me._notifier.success('q-and-a-delete-successful', { slug: me.slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n me._notifier.generalError();\r\n reject();\r\n });\r\n });\r\n }\r\n\r\n getIntro(slug) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n if (this.intros.length > 0) {\r\n resolve(me._getIntroFromList(slug));\r\n return;\r\n }\r\n\r\n me._clear();\r\n me._loadAll().then(() => {\r\n resolve(me._getIntroFromList(slug));\r\n }).catch(error => {\r\n console.log(error);\r\n reject(null);\r\n });\r\n });\r\n }\r\n\r\n _getIntroFromList(slug) {\r\n let intro = this.intros.find(x => x.slug === slug);\r\n return intro;\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\nimport { Notifier } from 'common/ui';\r\n\r\nexport class RapidStarts {\r\n static inject = [Api, I18n, Notifier];\r\n intros = [];\r\n\r\n constructor(api, i18n, notifier) {\r\n this.api = api;\r\n this.i18n = i18n;\r\n this.notifier = notifier;\r\n }\r\n\r\n initialize(clear) {\r\n if (clear) this._clear();\r\n return this._loadAll();\r\n }\r\n\r\n _clear() {\r\n this.intros = [];\r\n }\r\n\r\n _loadAll() {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n if (me.intros.length) {\r\n resolve(me.intros);\r\n return;\r\n }\r\n\r\n me.intros = [];\r\n me.api.getData('rapid-start/list/' + this.i18n.currentLocale).then(rapidStartIntros => {\r\n me.intros = rapidStartIntros;\r\n resolve(me.intros);\r\n }).catch(error => {\r\n reject();\r\n });\r\n });\r\n }\r\n\r\n saveRapidStart(id, slug, ordering, isActive, minimumLevel) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n var saveModel = { slug: slug, ordering: ordering, isActive: isActive, minimumLevel: minimumLevel };\r\n\r\n if (id) {\r\n me.api.updateData(\"rapid-start/\" + id, saveModel).then(data => {\r\n me.notifier.success('rapid-start-update-successful', { slug: slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n if (typeof error === 'string' && error.indexOf('rapid-start.error') === 0) {\r\n me.notifier.error(error);\r\n } else {\r\n me.notifier.generalError();\r\n }\r\n reject();\r\n });\r\n } else {\r\n me.api.postData(\"rapid-start\", saveModel).then(data => {\r\n me.notifier.success('rapid-start-add-successful', { slug: slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n if (error.indexOf('rapid-start.error') === 0) {\r\n me.notifier.error(error);\r\n } else {\r\n me.notifier.generalError();\r\n }\r\n reject();\r\n });\r\n }\r\n });\r\n }\r\n\r\n deleteRapidStart(id) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n me.api.deleteData(\"rapid-start/\" + id).then(data => {\r\n me.notifier.success('rapid-start-delete-successful', { slug: me.slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n me.notifier.generalError();\r\n reject();\r\n });\r\n\r\n });\r\n }\r\n\r\n saveRapidStartTopic(id, rapidStartId, slug, ordering, isActive) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n var saveModel = { rapidStartId: rapidStartId, slug: slug, ordering: ordering, isActive: isActive };\r\n\r\n if (id) {\r\n me.api.updateData(\"rapid-start/topic/\" + id, saveModel).then(data => {\r\n me.notifier.success('rapid-start-topic-update-successful', { slug: slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n if (typeof error === 'string' && error.indexOf('rapid-start.error') === 0) {\r\n me.notifier.error(error);\r\n } else {\r\n me.notifier.generalError();\r\n }\r\n reject();\r\n });\r\n } else {\r\n me.api.postData(\"rapid-start/topic\", saveModel).then(data => {\r\n me.notifier.success('rapid-start-topic-add-successful', { slug: slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n if (error.indexOf('rapid-start.error') === 0) {\r\n me.notifier.error(error);\r\n } else {\r\n me.notifier.generalError();\r\n }\r\n reject();\r\n });\r\n }\r\n });\r\n }\r\n\r\n deleteRapidStartTopic(id) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n me.api.deleteData(\"rapid-start/topic/\" + id).then(data => {\r\n me.notifier.success('rapid-start-topic-delete-successful', { slug: me.slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n me.notifier.generalError();\r\n reject();\r\n });\r\n\r\n });\r\n }\r\n\r\n getRapidStartIntro(slug) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n if (this.intros.length > 0) {\r\n resolve(me._getRapidStartIntroFromList(slug));\r\n return;\r\n }\r\n\r\n me._clear();\r\n me._loadAll().then(() => {\r\n resolve(me._getRapidStartIntroFromList(slug));\r\n }).catch(error => {\r\n console.log(error);\r\n reject(null);\r\n });\r\n });\r\n }\r\n\r\n _getRapidStartIntroFromList(slug) {\r\n for (var i = 0; i < this.intros.length; i++) {\r\n if (this.intros[i].slug !== slug) continue;\r\n return this.intros[i];\r\n }\r\n return null;\r\n }\r\n\r\n getChapter(chapterNumber) {\r\n for (var i = 0; i < this.chapters.length; i++) {\r\n if (this.chapters[i].number === chapterNumber) return this.chapters[i];\r\n }\r\n return null;\r\n }\r\n}\r\n","import {inject} from 'aurelia-framework';\r\nimport {Api} from 'common/server';\r\nimport moment from 'moment';\r\n\r\n@inject(Api)\r\nexport class RecruitingService {\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n getSummaryQs(forMemberId, teamSummary, start, end, timePeriod) {\r\n const qs = [];\r\n if (forMemberId) qs.push(`forMemberId=${encodeURIComponent(forMemberId)}`);\r\n if (teamSummary === true) qs.push('teamSummary=true');\r\n if (teamSummary === false) qs.push('teamSummary=false');\r\n if (start) qs.push(`start=${encodeURIComponent(this._qsDateValue(start))}`);\r\n if (end) qs.push(`end=${encodeURIComponent(this._qsDateValue(end))}`);\r\n if (timePeriod) qs.push(`timePeriod=${encodeURIComponent(timePeriod)}`);\r\n return qs.join('&');\r\n }\r\n\r\n async getSummaries(forMemberId, teamSummary, start, end) {\r\n let qs = this.getSummaryQs(forMemberId, teamSummary, start, end);\r\n return this._api.get(`recruiting/summary?${qs}`);\r\n }\r\n\r\n getOnboardingSummaries(forMemberId, teamSummary, start, end) {\r\n return new Promise((resolve, reject) => {\r\n let qs = this.getSummaryQs(forMemberId, teamSummary, start, end);\r\n this._api.getData('recruiting/onboarding-summary?' + qs).then(data => {\r\n resolve(data);\r\n });\r\n });\r\n }\r\n\r\n _qsDateValue(dt) {\r\n let dtMoment = moment(dt, 'MM/DD/YYYY');\r\n if (!dtMoment.isValid()) return null;\r\n return dtMoment.format();\r\n }\r\n}","import { Api } from 'common/server';\r\nimport { METRIC_TYPE, AGENT_METRIC_TYPE } from 'common/constants';\r\nimport { PolicyStatusValueConverter } from 'resources/value-converters/policy-status';\r\n\r\nexport class Reports {\r\n static inject = [Api, PolicyStatusValueConverter];\r\n _api;\r\n _policyStatusValueConverter\r\n\r\n constructor(api, policyStatusValueConverter) {\r\n this._api = api;\r\n this._policyStatusValueConverter = policyStatusValueConverter;\r\n }\r\n\r\n async metrics(metrics, asOfDate, detailsForMemberId) {\r\n let url = 'report/metrics';\r\n const qsParams = [];\r\n if (asOfDate) qsParams.push(`asOfDate=${encodeURIComponent(asOfDate)}`);\r\n if (detailsForMemberId) qsParams.push(`memberId=${encodeURIComponent(detailsForMemberId)}`);\r\n if (qsParams.length) url += `?${qsParams.join('&')}`;\r\n return await this._api.post(url, metrics);\r\n }\r\n\r\n /**\r\n * Get the data for the by carrier metric report\r\n * @param {Moment} asOfDate - the moment for the report\r\n * @param {String} metricType - from constants.METRIC_TYPE\r\n * @param {String} policyDateType - from constants.POLICY_DATE_TYPE\r\n * @param {String} policyStatusGroup - from constants.POLICY_STATUS_GROUP\r\n * @param {String} premiumType\r\n * @returns {Object}\r\n */\r\n async byCarrierMetrics(asOfMoment, timePeriod, metricType, policyDateType, policyStatusGroup, premiumType) {\r\n const query = { asOfDate: asOfMoment.format(), timePeriod, metricType, policyDateType, policyStatusGroup, premiumType };\r\n switch (metricType) {\r\n case METRIC_TYPE.Count: query.policyStatusGroup = null; query.premiumType = null; break;\r\n case METRIC_TYPE.PolicyStatusGroup: query.premiumType = null; break;\r\n case METRIC_TYPE.Premium: query.policyStatusGroup = null; break;\r\n }\r\n return await this._api.post('report/by-carrier/metrics', query);\r\n }\r\n\r\n validateByCarrierMetrics(timePeriod, metricType, policyDateType, policyStatusGroup, premiumType) {\r\n if (!metricType || !policyDateType || !timePeriod) return false;\r\n switch (metricType) {\r\n case METRIC_TYPE.Count: return true;\r\n case METRIC_TYPE.PolicyStatusGroup: return policyStatusGroup ? true : false;\r\n case METRIC_TYPE.Premium: return premiumType ? true : false;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Get the data for the by agent metric report\r\n * @param {Moment} asOfDate - the moment for the report\r\n * @param {String} metricType - from constants.AGENT_METRIC_TYPE\r\n * @param {[String]} linesOfBusiness - from constants.LOB\r\n * @param {String} policyDateType - from constants.POLICY_DATE_TYPE\r\n * @param {String} policyStatusGroup - from constants.POLICY_STATUS_GROUP\r\n * @param {String} premiumType\r\n * @param {String} detailsForMemberId - include to retrieve the details and not the full metrics\r\n * @returns {Object}\r\n */\r\n async byAgentMetrics(asOfMoment, timePeriod, metricType, linesOfBusiness, policyDateType, policyStatusGroup, premiumType, detailsForMemberId) {\r\n const query = { asOfDate: asOfMoment.format(), timePeriod, metricType, linesOfBusiness, policyDateType, policyStatusGroup, premiumType };\r\n switch (metricType) {\r\n case AGENT_METRIC_TYPE.Count: query.policyStatusGroup = null; query.premiumType = null; break;\r\n case AGENT_METRIC_TYPE.PolicyStatusGroup: query.premiumType = null; break;\r\n case AGENT_METRIC_TYPE.Premium: query.policyStatusGroup = null; break;\r\n case AGENT_METRIC_TYPE.Recruit: query.premiumType = null; query.policyStatusGroup = null; query.linesOfBusiness = null; break;\r\n case AGENT_METRIC_TYPE.RegisteredRep: query.premiumType = null; query.policyStatusGroup = null; query.linesOfBusiness = null; break;\r\n case AGENT_METRIC_TYPE.Prospect: query.premiumType = null; query.policyStatusGroup = null; query.linesOfBusiness = null; break;\r\n }\r\n const url = detailsForMemberId ? `report/by-agent/metrics/${encodeURIComponent(detailsForMemberId)}/details` : 'report/by-agent/metrics';\r\n return await this._api.post(url, query);\r\n }\r\n\r\n validateByAgentMetrics(timePeriod, metricType, linesOfBusiness, policyDateType, policyStatusGroup, premiumType) {\r\n if (!metricType || !timePeriod) return false;\r\n switch (metricType) {\r\n case AGENT_METRIC_TYPE.Count: return linesOfBusiness ? true : false;\r\n case AGENT_METRIC_TYPE.PolicyStatusGroup: return linesOfBusiness && policyStatusGroup && policyDateType ? true : false;\r\n case AGENT_METRIC_TYPE.Premium: return linesOfBusiness && premiumType && policyDateType ? true : false;\r\n case AGENT_METRIC_TYPE.Recruit: return true;\r\n case AGENT_METRIC_TYPE.RegisteredRep: return true;\r\n case AGENT_METRIC_TYPE.Prospect: return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Get the data for the by agency metric report\r\n * @param {Moment} asOfDate - the moment for the report\r\n * @param {String} metricType - from constants.AGENT_METRIC_TYPE\r\n * @param {[String]} linesOfBusiness - from constants.LOB\r\n * @param {String} policyDateType - from constants.POLICY_DATE_TYPE\r\n * @param {String} policyStatusGroup - from constants.POLICY_STATUS_GROUP\r\n * @param {String} premiumType\r\n * @param {String} detailsForMemberId - include to retrieve the details and not the full metrics\r\n * @returns {Object}\r\n */\r\n async byAgencyMetrics(asOfMoment, timePeriod, metricType, linesOfBusiness, policyDateType, policyStatusGroup, premiumType, detailsForMemberId) {\r\n const query = { asOfDate: asOfMoment.format(), timePeriod, metricType, linesOfBusiness, policyDateType, policyStatusGroup, premiumType };\r\n switch (metricType) {\r\n case AGENT_METRIC_TYPE.Count: query.policyStatusGroup = null; query.premiumType = null; break;\r\n case AGENT_METRIC_TYPE.PolicyStatusGroup: query.premiumType = null; break;\r\n case AGENT_METRIC_TYPE.Premium: query.policyStatusGroup = null; break;\r\n case AGENT_METRIC_TYPE.Recruit: query.premiumType = null; query.policyStatusGroup = null; query.linesOfBusiness = null; break;\r\n case AGENT_METRIC_TYPE.RegisteredRep: query.premiumType = null; query.policyStatusGroup = null; query.linesOfBusiness = null; break;\r\n case AGENT_METRIC_TYPE.Prospect: query.premiumType = null; query.policyStatusGroup = null; query.linesOfBusiness = null; break;\r\n }\r\n const url = detailsForMemberId ? `report/by-agency/metrics/${encodeURIComponent(detailsForMemberId)}/details` : 'report/by-agency/metrics';\r\n return await this._api.post(url, query);\r\n }\r\n\r\n validateByAgencyMetrics(timePeriod, metricType, linesOfBusiness, policyDateType, policyStatusGroup, premiumType) {\r\n if (!metricType || !timePeriod) return false;\r\n switch (metricType) {\r\n case AGENT_METRIC_TYPE.Count: return linesOfBusiness ? true : false;\r\n case AGENT_METRIC_TYPE.PolicyStatusGroup: return linesOfBusiness && policyStatusGroup && policyDateType ? true : false;\r\n case AGENT_METRIC_TYPE.Premium: return linesOfBusiness && premiumType && policyDateType ? true : false;\r\n case AGENT_METRIC_TYPE.Recruit: return true;\r\n case AGENT_METRIC_TYPE.RegisteredRep: return true;\r\n case AGENT_METRIC_TYPE.Prospect: return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Get the data for the by team metric report\r\n * @param {Moment} asOfDate - the moment for the report\r\n * @param {String} metricType - from constants.AGENT_METRIC_TYPE\r\n * @param {[String]} linesOfBusiness - from constants.LOB\r\n * @param {String} policyDateType - from constants.POLICY_DATE_TYPE\r\n * @param {String} policyStatusGroup - from constants.POLICY_STATUS_GROUP\r\n * @param {String} premiumType\r\n * @param {String} detailsForMemberId - include to retrieve the details and not the full metrics\r\n * @returns {Object}\r\n */\r\n async byTeamMetrics(asOfMoment, timePeriod, metricType, linesOfBusiness, policyDateType, policyStatusGroup, premiumType, detailsForMemberId) {\r\n const query = { asOfDate: asOfMoment.format(), timePeriod, metricType, linesOfBusiness, policyDateType, policyStatusGroup, premiumType };\r\n switch (metricType) {\r\n case AGENT_METRIC_TYPE.Count: query.policyStatusGroup = null; query.premiumType = null; break;\r\n case AGENT_METRIC_TYPE.PolicyStatusGroup: query.premiumType = null; break;\r\n case AGENT_METRIC_TYPE.Premium: query.policyStatusGroup = null; break;\r\n case AGENT_METRIC_TYPE.Recruit: query.premiumType = null; query.policyStatusGroup = null; query.linesOfBusiness = null; break;\r\n case AGENT_METRIC_TYPE.RegisteredRep: query.premiumType = null; query.policyStatusGroup = null; query.linesOfBusiness = null; break;\r\n case AGENT_METRIC_TYPE.Prospect: query.premiumType = null; query.policyStatusGroup = null; query.linesOfBusiness = null; break;\r\n }\r\n const url = detailsForMemberId ? `report/by-team/metrics/${encodeURIComponent(detailsForMemberId)}/details` : 'report/by-team/metrics';\r\n return await this._api.post(url, query);\r\n }\r\n\r\n validateByTeamMetrics(timePeriod, metricType, linesOfBusiness, policyDateType, policyStatusGroup, premiumType) {\r\n if (!metricType || !timePeriod) return false;\r\n switch (metricType) {\r\n case AGENT_METRIC_TYPE.Count: return linesOfBusiness ? true : false;\r\n case AGENT_METRIC_TYPE.PolicyStatusGroup: return linesOfBusiness && policyStatusGroup && policyDateType ? true : false;\r\n case AGENT_METRIC_TYPE.Premium: return linesOfBusiness && premiumType && policyDateType ? true : false;\r\n case AGENT_METRIC_TYPE.Recruit: return true;\r\n case AGENT_METRIC_TYPE.RegisteredRep: return true;\r\n case AGENT_METRIC_TYPE.Prospect: return true;\r\n }\r\n return false;\r\n }\r\n\r\n async policies(query) {\r\n const data = await this._api.post('policy/report', query);\r\n data.policies.forEach(p => p.statusName = this._policyStatusValueConverter.toView(p.status));\r\n return data;\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Roles {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async all() {\r\n return await this._api.get('security/roles');\r\n }\r\n}\r\n","import {inject} from 'aurelia-framework';\r\nimport {Api} from 'common/server';\r\nimport {I18n} from 'common/i18n';\r\nimport {Notifier} from 'common/ui';\r\n\r\n@inject(Api, I18n, Notifier)\r\nexport class SalesTools {\r\n\r\n intros = [];\r\n\r\n constructor(api, i18n, notifier) {\r\n this.api = api;\r\n this.i18n = i18n;\r\n this.notifier = notifier;\r\n }\r\n\r\n initialize(clear) {\r\n if (clear) this._clear();\r\n return this._loadAll();\r\n }\r\n\r\n _clear() {\r\n this.intros = [];\r\n }\r\n\r\n _loadAll() {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n if (me.intros.length) {\r\n resolve(me.intros);\r\n return;\r\n }\r\n\r\n me.intros = [];\r\n me.api.getData('sales-tools/list/' + this.i18n.currentLocale).then(salesToolsIntros => {\r\n me.intros = salesToolsIntros;\r\n resolve(me.intros);\r\n }).catch(error => {\r\n reject();\r\n });\r\n });\r\n }\r\n\r\n saveCategory(id, slug, ordering, isActive) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n var saveModel = { slug: slug, ordering: ordering, isActive: isActive };\r\n\r\n if (id) {\r\n me.api.updateData(\"sales-tools/category/\" + id, saveModel).then(data => {\r\n me.notifier.success('sales-tools-category-update-successful', { slug: slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n if (typeof error === 'string' && error.indexOf('sales-tools-error') === 0) {\r\n me.notifier.error(error);\r\n } else {\r\n me.notifier.generalError();\r\n }\r\n reject();\r\n });\r\n } else {\r\n me.api.postData(\"sales-tools/category\", saveModel).then(data => {\r\n me.notifier.success('sales-tools-category-add-successful', { slug: slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n if (error.indexOf('sales-tools-error') === 0) {\r\n me.notifier.error(error);\r\n } else {\r\n me.notifier.generalError();\r\n }\r\n reject();\r\n });\r\n }\r\n });\r\n }\r\n\r\n deleteCategory(id) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n me.api.deleteData(\"sales-tools/category/\" + id).then(data => {\r\n me.notifier.success('sales-tools-category-delete-successful', { slug: me.slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n me.notifier.generalError();\r\n reject();\r\n });\r\n\r\n });\r\n }\r\n\r\n saveGroup(id, categoryId, newCategoryId, slug, ordering, isActive) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n var saveModel = { salesToolCategoryId: categoryId, slug: slug, ordering: ordering, isActive: isActive };\r\n\r\n if (id) {\r\n me.api.updateData(\"sales-tools/category/\" + newCategoryId + \"/group/\" + id, saveModel).then(data => {\r\n me.notifier.success('sales-tools-groups-update-successful', { slug: slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n if (typeof error === 'string' && error.indexOf('sales-tools-error') === 0) {\r\n me.notifier.error(error);\r\n } else {\r\n me.notifier.generalError();\r\n }\r\n reject();\r\n });\r\n } else {\r\n me.api.postData(\"sales-tools/category/\" + categoryId + \"/group\", saveModel).then(data => {\r\n me.notifier.success('sales-tools-groups-add-successful', { slug: slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n if (error.indexOf('sales-tools-error') === 0) {\r\n me.notifier.error(error);\r\n } else {\r\n me.notifier.generalError();\r\n }\r\n reject();\r\n });\r\n }\r\n });\r\n }\r\n\r\n deleteGroup(id) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n me.api.deleteData(\"sales-tools/group/\" + id).then(data => {\r\n me.notifier.success('sales-tools-groups-delete-successful', { slug: me.slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n me.notifier.generalError();\r\n reject();\r\n });\r\n\r\n });\r\n }\r\n\r\n saveTool(id, groupId, newGroupId, slug, ordering, isActive) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n var saveModel = { salesToolGroupId: groupId, slug: slug, ordering: ordering, isActive: isActive, salesToolType: 'Download' };\r\n\r\n if (id) {\r\n me.api.updateData(\"sales-tools/group/\" + newGroupId + \"/tool/\" + id, saveModel).then(data => {\r\n me.notifier.success('sales-tools-tools-update-successful', { slug: slug });\r\n me._clear();\r\n resolve(data.id);\r\n }).catch(error => {\r\n if (typeof error === 'string' && error.indexOf('sales-tools-error') === 0) {\r\n me.notifier.error(error);\r\n } else {\r\n me.notifier.generalError();\r\n }\r\n reject();\r\n });\r\n } else {\r\n me.api.postData(\"sales-tools/group/\" + groupId + \"/tool\", saveModel).then(data => {\r\n me.notifier.success('sales-tools-tools-add-successful', { slug: slug });\r\n me._clear();\r\n resolve(data.id);\r\n }).catch(error => {\r\n if (error.indexOf('sales-tools-error') === 0) {\r\n me.notifier.error(error);\r\n } else {\r\n me.notifier.generalError();\r\n }\r\n reject();\r\n });\r\n }\r\n });\r\n }\r\n\r\n deleteTool(id) {\r\n var me = this;\r\n return new Promise((resolve, reject) => {\r\n\r\n me.api.deleteData(\"sales-tools/tool/\" + id).then(data => {\r\n me.notifier.success('sales-tools-tools-delete-successful', { slug: me.slug });\r\n me._clear();\r\n resolve();\r\n }).catch(error => {\r\n me.notifier.generalError();\r\n reject();\r\n });\r\n\r\n });\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport environment from '../../config/environment.json';\r\nimport { Capacitor } from '@capacitor/core';\r\n\r\nexport class Sites {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n title() {\r\n if (__zeusTheme) return __zeusTheme.siteTitle;\r\n return 'LPFN';\r\n }\r\n\r\n async theme() {\r\n if (typeof __zeusTheme !== 'undefined') {\r\n if (__zeusTheme) {\r\n if (__zeusTheme.light) return __zeusTheme;\r\n }\r\n }\r\n let hostDomain = Capacitor.isNativePlatform\r\n ? 'myzeus.com'\r\n : window.location.host;\r\n let url = `site/theme?domain=${encodeURIComponent(hostDomain)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async themeByDomain(domain) {\r\n return await this._api.get(`site/theme?domain=${encodeURIComponent(domain)}`);\r\n }\r\n\r\n async themes() {\r\n return await this._api.get('site/themes');\r\n }\r\n\r\n async addTheme(domain, name, email, primaryColor, secondaryColor, highlightColor, boxBackgroundColor) {\r\n const model = { isNew: true, name, domain, email, primaryColor, secondaryColor, highlightColor, boxBackgroundColor };\r\n return await this._api.post('site/themes', model);\r\n }\r\n\r\n async updateTheme(domain, name, email, primaryColor, secondaryColor, highlightColor, boxBackgroundColor) {\r\n const model = { isNew: false, name, domain, email, primaryColor, secondaryColor, highlightColor, boxBackgroundColor };\r\n return await this._api.post('site/themes', model);\r\n }\r\n\r\n async deleteTheme(domain) {\r\n return await this._api.delete(`site/themes?domain=${encodeURIComponent(domain)}`)\r\n }\r\n\r\n async setThemeActive(domain, isActive) {\r\n return await this._api.post(`site/themes/set-active/${isActive}?domain=${encodeURIComponent(domain)}`);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Sso {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async suranceBay(module, view, newWindow = true) {\r\n return await this._api.get(`sso/surancebay?module=${encodeURIComponent(module || 'producer_info')}&view=${encodeURIComponent(view || 'contracts')}&newWindow=${encodeURIComponent(newWindow)}`);\r\n }\r\n\r\n async suranceBayAffiliates() {\r\n return await this._api.get('sso/surancebay/affiliate');\r\n }\r\n\r\n async saveSuranceBayAffiliate(memberId, affiliate) {\r\n return await this._api.post(`sso/surancebay/affiliate/${encodeURIComponent(memberId)}/${encodeURIComponent(affiliate)}`);\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Tags {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async list(tagType, referenceId = null) {\r\n let url = `tag/${encodeURIComponent(tagType)}`;\r\n if (referenceId) url += `/${encodeURIComponent(referenceId)}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n /**\r\n * Assign tags to an object\r\n * @param {String} tagType\r\n * @param {Guid} referenceId \r\n * @param {[String]} tags \r\n * @returns \r\n */\r\n async assign(tagType, referenceId, tags) {\r\n return this._api.post(`tag/${encodeURIComponent(tagType)}/${encodeURIComponent(referenceId)}`, tags);\r\n }\r\n}\r\n\r\nexport const TAG_TYPE = {\r\n File: 'file'\r\n};\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Api } from 'common/server';\r\nimport { Security } from 'common/security';\r\nimport { c } from 'common/common';\r\nimport environment from '../../config/environment.json';\r\n\r\nexport class Tasks {\r\n static inject = [EventAggregator, Api, Security];\r\n _ea;\r\n _api;\r\n _security;\r\n\r\n current = [];\r\n _checker;\r\n _checkEveryMinutes = environment.taskCheckMinutes;\r\n _errorCtr = 0;\r\n\r\n _handlers = [];\r\n\r\n constructor(ea, api, security) {\r\n this._ea = ea;\r\n this._api = api;\r\n this._security = security;\r\n }\r\n\r\n async initialize() {\r\n await this._load();\r\n }\r\n\r\n dispose() {\r\n this._clearChecker();\r\n this.current = [];\r\n }\r\n\r\n async _load() {\r\n if (!this._security.isAuthenticated) {\r\n this.dispose();\r\n return;\r\n }\r\n try {\r\n this.current = await this._api.get('task');\r\n this._fireEvent();\r\n this._errorCtr = 0;\r\n } catch (err) {\r\n this.current = [];\r\n this.errorCtr++;\r\n } finally {\r\n if (this._errorCtr > 10) return;\r\n this._checker = window.setTimeout(() => this._load(), this._checkEveryMinutes * 60 * 1000);\r\n }\r\n }\r\n\r\n _fireEvent() {\r\n this._ea.publish(c.EventKeys.tasks.updated);\r\n }\r\n\r\n _clearChecker() {\r\n if (!this._checker) return;\r\n window.clearTimeout(this._checker);\r\n this._checker = undefined;\r\n }\r\n\r\n async complete(taskId, model) {\r\n const response = await this._api.post(`task/${encodeURIComponent(taskId)}/complete`, model);\r\n const idx = this.current.findIndex(x => x.id === taskId);\r\n if (idx >= 0) this.current.splice(idx, 1);\r\n this._fireEvent();\r\n return response;\r\n }\r\n\r\n async save(taskId, model) {\r\n const response = await this._api.post(`task/${encodeURIComponent(taskId)}/set-metadata`, model);\r\n const idx = this.current.findIndex(x => x.id === taskId);\r\n if (idx >= 0) this.current[idx].metadata = model;\r\n return response;\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Security } from 'common/security';\r\nimport { c } from 'common/common';\r\n\r\nexport const toDoType = {\r\n GENERAL: 'General',\r\n AGENT: 'Agent',\r\n POLICY: 'Policy',\r\n LEAD: 'Lead',\r\n\r\n all: () => [ toDoType.GENERAL, toDoType.AGENT, toDoType.POLICY, toDoType.LEAD ],\r\n}\r\n\r\nexport class ToDos {\r\n static inject = [Api, EventAggregator, Security];\r\n _api;\r\n _ea;\r\n _security;\r\n\r\n today = [];\r\n\r\n _handlers = [];\r\n\r\n constructor(api, ea, security) {\r\n this._api = api;\r\n this._ea = ea;\r\n this._security = security;\r\n }\r\n\r\n async initialize() {\r\n await this._loadToday();\r\n }\r\n\r\n dispose() {\r\n this.today = [];\r\n }\r\n\r\n async _loadToday() {\r\n if (!this._security.isAuthenticated) {\r\n this.dispose();\r\n return;\r\n }\r\n try {\r\n const today = await this._api.get('to-do/today');\r\n if (today && today.toDos.length) {\r\n today.toDos.forEach(t => {\r\n if (t.aboutType === toDoType.AGENT) t.member = { id: t.aboutId, fullName: t.aboutName };\r\n if (t.aboutType === toDoType.POLICY) t.policy = { id: t.aboutId, policyNumber: t.aboutName };\r\n if (t.aboutType === toDoType.LEAD) t.lead = { id: t.aboutId, fullName: t.aboutName };\r\n });\r\n }\r\n this.today = today ? today.toDos ?? [] : [];\r\n this._ea.publish(c.EventKeys.toDos.todayUpdated);\r\n } catch (err) {\r\n this.today = [];\r\n }\r\n }\r\n\r\n async currentStatus(aboutType, aboutId) {\r\n return await this._api.get(`to-do/${encodeURIComponent(aboutType)}/status/${encodeURIComponent(aboutId)}`);\r\n }\r\n\r\n async listForMember(memberId, includeComplete, createdByMemberId) {\r\n let url = 'to-do';\r\n const qs = [];\r\n if (memberId) qs.push(`memberId=${encodeURIComponent(memberId)}`);\r\n if (includeComplete) qs.push('includeComplete=true');\r\n if (createdByMemberId) qs.push(`createdByMemberId=${encodeURIComponent(createdByMemberId)}`);\r\n if (qs.length) url += `?${qs.join('&')}`;\r\n return await this._api.get(url);\r\n }\r\n\r\n async list(type, aboutId, includeComplete) {\r\n let url = `to-do/${encodeURIComponent(type)}/${encodeURIComponent(aboutId)}`;\r\n if (includeComplete) url += '?includeComplete=true';\r\n return await this._api.get(url);\r\n }\r\n\r\n async save(id, aboutType, aboutId, assignToMemberId, title, comments, dueDate) {\r\n const model = { id, aboutType, aboutId, assignToMemberId, title, comments, dueDate };\r\n const response = await this._api.post('to-do', model);\r\n this._ea.publish(c.EventKeys.toDos.updated);\r\n this._ea.publish(c.EventKeys.toDos.toDoUpdated(aboutId));\r\n this._loadToday();\r\n return response;\r\n }\r\n\r\n async complete(id, aboutId, completed = true) {\r\n let url = `to-do/${encodeURIComponent(id)}/complete`;\r\n if (!completed) url += '?completed=false';\r\n const response = await this._api.put(url);\r\n this._ea.publish(c.EventKeys.toDos.updated);\r\n this._ea.publish(c.EventKeys.toDos.toDoUpdated(aboutId));\r\n this._loadToday();\r\n return response;\r\n }\r\n\r\n async delete(id, aboutId) {\r\n const response = await this._api.delete(`to-do/${encodeURIComponent(id)}`);\r\n this._ea.publish(c.EventKeys.toDos.updated);\r\n this._ea.publish(c.EventKeys.toDos.toDoUpdated(aboutId));\r\n this._loadToday();\r\n return response;\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Security } from 'common/security';\r\nimport { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\nimport { c } from 'common/common';\r\nimport moment from 'moment';\r\n\r\nexport class UiWidgets {\r\n static inject = [EventAggregator, Security, Api, I18n];\r\n lastUpdated = null;\r\n uiWidgets = [];\r\n //_updatesSinceTimer = null;\r\n\r\n constructor(eventAggregator, security, api, i18n) {\r\n this.eventAggregator = eventAggregator;\r\n this.security = security;\r\n this.api = api;\r\n this.i18n = i18n;\r\n\r\n //var mins = 5;\r\n //this._updatesSinceTimer = window.setInterval(() => { this._loadSince(); }, mins * 60 * 1000);\r\n }\r\n\r\n initialize() {\r\n // Do not load all, instead, lazy load in the get function\r\n //return this._loadAll();\r\n }\r\n\r\n async _loadAll() {\r\n this.uiWidgets = [];\r\n this.lastUpdated = moment();\r\n const widgets = await this.api.get('content/ui-widget/list/' + this.i18n.currentLocale);\r\n for (let i = 0; i < widgets.length; i++) {\r\n this.uiWidgets[widgets[i].key] = widgets[i];\r\n }\r\n }\r\n\r\n async _loadSince() {\r\n try {\r\n const widgets = await this.api.get('content/ui-widget/updated-since/' + this.i18n.currentLocale + '?sinceDate=' + this.lastUpdated.toISOString());\r\n for (let i = 0; i < widgets.length; i++) {\r\n this._updateCachedWidget(widgets[i]);\r\n }\r\n this.lastUpdated = moment();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async loadKey(key) {\r\n try {\r\n const uiWidget = await this._get(key, undefined, this.i18n.currentLocale);\r\n this.addToCache(uiWidget);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async get(key, memberId, lazyLoad = true) {\r\n if (!memberId) {\r\n let widget = this.uiWidgets[key];\r\n if (!widget) {\r\n widget = lazyLoad ? await this._get(key, undefined, this.i18n.currentLocale) : { key: undefined };\r\n if (widget.key) {\r\n this.addToCache(widget);\r\n } else {\r\n widget = { id: null, key: key, title: '', html: '' };\r\n }\r\n }\r\n // return a clone to not get the replaced variables\r\n return JSON.parse(JSON.stringify(widget));\r\n }\r\n\r\n // For memberId, always get from API\r\n const memberWidget = await this._get(key, memberId, null);\r\n return memberWidget;\r\n }\r\n\r\n async getForLocale(key, locale, memberId) {\r\n try {\r\n if (this.i18n.currentLocale === locale && !memberId) {\r\n return this.get(key);\r\n }\r\n\r\n const uiWidget = await this.api.get('content/ui-widget/' + key + '/' + locale);\r\n if (uiWidget.id === '00000000-0000-0000-0000-000000000000' || !uiWidget.id) {\r\n uiWidget.id = null;\r\n uiWidget.key = key;\r\n uiWidget.language = locale;\r\n }\r\n return uiWidget;\r\n } catch (err) {\r\n return null;\r\n }\r\n }\r\n\r\n async _get(key, memberId, locale) {\r\n try {\r\n const uiWidget = await this.api.get('content/ui-widget/' + key + '?pendingApproval=true');\r\n if (uiWidget.id === '00000000-0000-0000-0000-000000000000' || !uiWidget.id) {\r\n uiWidget.id = null;\r\n uiWidget.key = key;\r\n uiWidget.language = locale;\r\n if (uiWidget.pendingApproval) {\r\n uiWidget.title = uiWidget.pendingApproval.title;\r\n uiWidget.html = uiWidget.pendingApproval.html;\r\n }\r\n }\r\n return uiWidget;\r\n } catch (err) {\r\n return null;\r\n }\r\n }\r\n\r\n async add(key, language, title, html, widgetType, approval, memberId, comment, fromEmail) {\r\n const model = { key, language, title, html, widgetType, approval, memberId, comment, fromEmail: fromEmail || null };\r\n const data = await this.api.post('content/ui-widget', model);\r\n const widget = {\r\n id: data.id,\r\n key: key,\r\n lastUpdated: data.lastUpdated,\r\n language: language,\r\n title: title,\r\n html: html,\r\n fromEmail: fromEmail || null,\r\n };\r\n this._updateCachedWidget(widget);\r\n return widget;\r\n }\r\n\r\n async update(id, key, language, title, html, widgetType, approval, memberId, comment, fromEmail) {\r\n const model = { key, language, title, html, widgetType, approval, memberId, comment, fromEmail: fromEmail || null };\r\n const data = await this.api.put('content/ui-widget/' + id, model);\r\n const widget = {\r\n id: id,\r\n key: key,\r\n lastUpdated: data.lastUpdated,\r\n language: language,\r\n title: title,\r\n html: html,\r\n fromEmail: fromEmail || null,\r\n };\r\n this._updateCachedWidget(widget);\r\n }\r\n\r\n addToCache(uiWidget) {\r\n this._updateCachedWidget(uiWidget, false);\r\n }\r\n\r\n _updateCachedWidget(uiWidget, publishEvent = true) {\r\n if (!this._matchesCurrentLocale(uiWidget.language)) return;\r\n var existing = this.get(uiWidget.key, undefined, false);\r\n if (existing.id) {\r\n this.uiWidgets[uiWidget.key].title = uiWidget.title;\r\n this.uiWidgets[uiWidget.key].html = uiWidget.html;\r\n } else {\r\n this.uiWidgets[uiWidget.key] = uiWidget;\r\n }\r\n\r\n if (publishEvent) this.eventAggregator.publish(c.EventKeys.uiWidgetUpdated, { key: uiWidget.key });\r\n }\r\n\r\n _matchesCurrentLocale(locale) {\r\n if (locale === 'en' && this.i18n.currentLocale === 'en-US') return true;\r\n return locale === this.i18n.currentLocale;\r\n }\r\n\r\n async getArchives(key, language) {\r\n return await this.api.get('content/ui-widget/history/' + encodeURIComponent(language) + '?key=' + encodeURIComponent(key));\r\n }\r\n}\r\n","import { HttpClient } from 'aurelia-http-client';\r\nimport { siteUrlBase } from 'common/common';\r\nimport environment from '../../config/environment.json';\r\nimport { Capacitor } from '@capacitor/core';\r\n\r\nexport class Versions {\r\n _checkVersionInMinutes = environment.versionCheckMinutes || 20;\r\n _lastChecked;\r\n _httpClient;\r\n\r\n version;\r\n\r\n constructor() {\r\n this.version = (typeof __zeus_version === 'string') ? __zeus_version : '0.0.0';\r\n\r\n this._lastChecked = new Date(-8640000000000000); // the minimum ms since epoch value for js date\r\n this._initializeHttpClient();\r\n }\r\n\r\n _initializeHttpClient() {\r\n if (this._httpClient) return;\r\n this._httpClient = new HttpClient();\r\n }\r\n\r\n async hasNewClientVersion() {\r\n if (Capacitor.isNativePlatform()) return false;\r\n const now = new Date();\r\n try {\r\n const diffTime = Math.abs(this._lastChecked.getTime() - now.getTime());\r\n const diffMinutes = diffTime / (1000 * 60);\r\n if (diffMinutes < this._checkVersionInMinutes) return false;\r\n } catch (errTime) {\r\n console.log(errTime);\r\n return false;\r\n }\r\n try {\r\n const response = await this._httpClient.get(`${siteUrlBase()}/version.js?v=${now.getTime()}`);\r\n // eslint-disable-next-line no-useless-escape\r\n const serverVersionMatch = response.content.match(/__zeus_version\\s\\=\\s\"([^\\s]*)\"/);\r\n if (!serverVersionMatch) {\r\n return false;\r\n }\r\n const serverVersion = serverVersionMatch[1];\r\n return serverVersion !== this.version;\r\n } catch (err) {\r\n console.log('Version', err);\r\n return false;\r\n } finally {\r\n // Reset the last checked so the app will only check based on the check version in minutes\r\n this._lastChecked = now;\r\n }\r\n }\r\n}\r\n","import { Api } from 'common/server';\r\n\r\nexport class Wills {\r\n static inject = [Api];\r\n _api;\r\n\r\n constructor(api) {\r\n this._api = api;\r\n }\r\n\r\n async fastWillSso() {\r\n return await this._api.get('sso/fastwill');\r\n }\r\n}\r\n"],"names":[],"sourceRoot":""}