PageSourceSearch

https://book.boltmovers.com/chunk-WBLUDZ64.js

js boltmovers.com collected 2026-10-08 05:02:38 UTC 30,865 bytes, 899 lines download raw bytes

1import {
2  AlertController,
3  AppUsersService,
4  FirestoreService,
5  LoadingController,
6  Platform,
7  SaasCustomerService,
8  StorageService
9} from "./chunk-JDKRZWNO.js";
10import {
11  APPLICATION_CONFIG_COLLECTION,
12  require_dayjs_min,
13  require_lodash,
14  require_timezone
15} from "./chunk-VC4FNO6F.js";
16import {
17  BehaviorSubject,
18  ReplaySubject,
19  Subject,
20  combineLatest,
21  firstValueFrom,
22  interval,
23  switchMap,
24  tap,
25  ɵɵdefineInjectable,
26  ɵɵinject
27} from "./chunk-OKGTPDCW.js";
28import {
29  Capacitor,
30  registerPlugin
31} from "./chunk-62DANBNQ.js";
32import {
33  __async,
34  __spreadProps,
35  __spreadValues,
36  __toESM
37} from "./chunk-K2M74TSM.js";
38
39// libs/ionic-services/src/lib/ionic-loading.service.ts
40var IonicLoadingService = class _IonicLoadingService {
41  loadingCtrl;
42  loader = null;
43  loaderPresented = false;
44  constructor(loadingCtrl) {
45    this.loadingCtrl = loadingCtrl;
46  }
47  presentLoader(text) {
48    return __async(this, null, function* () {
49      if (!this.loaderPresented) {
50        this.loaderPresented = true;
51        this.loader = yield this.loadingCtrl.create({
52          spinner: "circular",
53          message: text ? text : "Loading...",
54          translucent: true,
55          duration: 15e3,
56          cssClass: "md-loader"
57        });
58        yield this.loader.present();
59        return this.loader;
60      }
61      return null;
62    });
63  }
64  dismissLoader() {
65    return __async(this, null, function* () {
66      setTimeout(() => {
67        if (this.loaderPresented) {
68          const watcher = interval(50).subscribe((count) => {
69            if (this.loader) {
70              watcher.unsubscribe();
71              this.loaderPresented = false;
72              try {
73                this.loadingCtrl.dismiss();
74              } catch (error) {
75                console.log("Error dismissing", error);
76              }
77              delete this.loader;
78            }
79            if (count > 49) {
80              watcher.unsubscribe();
81              this.loaderPresented = false;
82              console.log("Expired.");
83            }
84          });
85        }
86      }, 25);
87    });
88  }
89  static \u0275fac = function IonicLoadingService_Factory(__ngFactoryType__) {
90    return new (__ngFactoryType__ || _IonicLoadingService)(\u0275\u0275inject(LoadingController));
91  };
92  static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _IonicLoadingService, factory: _IonicLoadingService.\u0275fac, providedIn: "root" });
93};
94
vendor: 191 bytes, lines 95-99
95// node_modules/@capacitor/preferences/dist/esm/index.js
96var Preferences = registerPlugin("Preferences", {
97  web: () => import("./chunk-4XFDJSSL.js").then((m) => new m.PreferencesWeb())
98});
99
100// libs/ionic-services/src/lib/mobile-team-schedule.service.ts
101var import_dayjs = __toESM(require_dayjs_min());
102var import_timezone = __toESM(require_timezone());
103var import_lodash = __toESM(require_lodash());
104var MobileTeamScheduleService = class _MobileTeamScheduleService {
105  appUsersService;
106  _scheduleEntrySubject = new ReplaySubject(1);
107  _quoteInvoiceSubject = new ReplaySubject(1);
108  _scheduleEntryIdSubject = new BehaviorSubject(void 0);
109  _quoteInvoiceIdSubject = new BehaviorSubject(void 0);
110  _quoteIdSubject = new BehaviorSubject("");
111  _customerIdSubject = new BehaviorSubject("");
112  _isMobileAppIdentifierSubject = new BehaviorSubject("");
113  _feedbackSinceLastViewedSubject = new BehaviorSubject(false);
114  _customerEditedOrAddedSubject = new BehaviorSubject("");
115  _feedbackLastViewedSubject = new BehaviorSubject(0);
116  onDestroy$ = new Subject();
117  constructor(appUsersService) {
118    this.appUsersService = appUsersService;
119    import_dayjs.default.extend(import_timezone.default);
120  }
121  scheduleEntry$() {
122    return this._scheduleEntrySubject;
123  }
124  setScheduleEntry(scheduleEntry) {
125    this._scheduleEntrySubject.next(scheduleEntry);
126  }
127  quoteInvoice$() {
128    return this._quoteInvoiceSubject;
129  }
130  setQuoteInvoice(quoteInvoice) {
131    this._quoteInvoiceSubject.next(quoteInvoice);
132  }
133  getQuoteId() {
134    return this._quoteIdSubject.getValue();
135  }
136  setQuoteId(quoteId) {
137    return __async(this, null, function* () {
138      this._quoteIdSubject.next(quoteId);
139      yield Preferences.set({ key: "aqi", value: quoteId });
140    });
141  }
142  clearStorageOfQuoteId() {
143    return __async(this, null, function* () {
144      this._quoteIdSubject.next("");
145      yield Preferences.remove({ key: "aqi" });
146    });
147  }
148  quoteId$() {
149    return this._quoteIdSubject;
150  }
151  getCustomerId() {
152    return this._customerIdSubject.getValue();
153  }
154  // _customerIdSubject is only set in mobile-team and not estimator-mobile
155  //  estimator-mobile uses authenticated customer, but in mobile team the
156  //  authenticated user is a team member, not a customer
157  setCustomerId(customerId) {
158    return __async(this, null, function* () {
159      this._customerIdSubject.next(customerId);
160      yield Preferences.set({ key: "cid", value: customerId });
161    });
162  }
163  // used in book-...components to discern use in mobile-team('mt') or estimator-mobile('em')
164  getMobileAppIdentifier() {
165    return this._isMobileAppIdentifierSubject.getValue();
166  }
167  setMobileAppIdentifier(appId) {
168    return __async(this, null, function* () {
169      this._isMobileAppIdentifierSubject.next(appId);
170    });
171  }
172  clearStorageOfCustomerId() {
173    return __async(this, null, function* () {
174      this._customerIdSubject.next("");
175      yield Preferences.remove({ key: "cid" });
176    });
177  }
178  customerId$() {
179    return this._customerIdSubject;
180  }
181  checkForCustomerIdAndActiveQuoteId() {
182    return __async(this, null, function* () {
183      Preferences.get({ key: "cid" }).then((cid) => {
184        if (cid.value) {
185          this._customerIdSubject.next(cid.value);
186        }
187      });
188      Preferences.get({ key: "aqi" }).then((aqi) => {
189        if (aqi.value) {
190          this._quoteIdSubject.next(aqi.value);
191        }
192      });
193    });
194  }
195  getQuoteInvoiceId() {
196    return this._quoteInvoiceIdSubject.getValue();
197  }
198  setQuoteInvoiceId(id) {
199    this._quoteInvoiceIdSubject.next(id);
200  }
201  getScheduleEntryId() {
202    return this._scheduleEntryIdSubject.getValue();
203  }
204  addTeamMembersToSchedule(qs) {
205    return __async(this, null, function* () {
206      if (!qs.teamMembers) {
207        qs.teamMembers = [];
208      }
209      const workers = (0, import_lodash.sortBy)(yield Promise.all(qs.teamMembers.map((wid) => this.appUsersService.lookupEmployee(wid))), "appUser.firstName");
210      const leadIndex = (0, import_lodash.findIndex)(workers, (w) => w.userId === qs.teamLead);
211      if (leadIndex >= 0) {
212        const lead = workers.splice(leadIndex, 1);
213        workers.unshift(lead[0]);
214      }
215      return __spreadProps(__spreadValues({}, qs), { workers });
216    });
217  }
218  scheduleTeamMemebers(qs) {
219    return __async(this, null, function* () {
220      if (!qs.teamMembers) {
221        qs.teamMembers = [];
222      }
223      const workers = (0, import_lodash.sortBy)(yield Promise.all(qs.teamMembers.map((wid) => this.appUsersService.lookupEmployee(wid))), "appUser.firstName");
224      const leadIndex = (0, import_lodash.findIndex)(workers, (w) => w.userId === qs.teamLead);
225      if (leadIndex >= 0) {
226        const lead = workers.splice(leadIndex, 1);
227        workers.unshift(lead[0]);
228      }
229      return workers;
230    });
231  }
232  initializeActiveQuoteScheduleIdFromStorage() {
233    return __async(this, null, function* () {
234      const asei = yield Preferences.get({ key: "asei" });
235      if (asei && asei.value) {
236        this._scheduleEntryIdSubject.next(asei.value);
237      }
238    });
239  }
240  initializeFeedbackLastViewedFromStorage() {
241    return __async(this, null, function* () {
242      const flv = yield Preferences.get({ key: "flv" });
243      if (flv && flv.value) {
244        this._feedbackLastViewedSubject.next(parseInt(flv.value));
245      }
246    });
247  }
248  hasNewCustomerFeedback$() {
249    return this._feedbackSinceLastViewedSubject;
250  }
251  hasNewCustomerFeedback() {
252    return this._feedbackSinceLastViewedSubject.getValue();
253  }
254  setHasNewCustomerFeedback(value) {
255    this._feedbackSinceLastViewedSubject.next(value);
256  }
257  customerEditedOrAdded$() {
258    return this._customerEditedOrAddedSubject;
259  }
260  getCustomerEditedOrAdded() {
261    return this._customerEditedOrAddedSubject.getValue();
262  }
263  setCustomerEditedOrAdded(value) {
264    this._customerEditedOrAddedSubject.next(value);
265  }
266  clearSelectedScheduleEntry() {
267    return __async(this, null, function* () {
268      this._scheduleEntrySubject.next(null);
269      this._scheduleEntryIdSubject.next(void 0);
270      yield Preferences.remove({ key: "asei" });
271    });
272  }
273  feedbackLastViewed$() {
274    return this._feedbackLastViewedSubject;
275  }
276  getFeedbackLastViewed() {
277    return this._feedbackLastViewedSubject.getValue();
278  }
279  setFeedbackLastViewed(millis) {
280    return __async(this, null, function* () {
281      this._feedbackLastViewedSubject.next(millis);
282      yield Preferences.set({ key: "flv", value: `${millis}` });
283    });
284  }
285  ngOnDestroy() {
286    this.onDestroy$.next(true);
287    this.onDestroy$.complete();
288  }
289  static \u0275fac = function MobileTeamScheduleService_Factory(__ngFactoryType__) {
290    return new (__ngFactoryType__ || _MobileTeamScheduleService)(\u0275\u0275inject(AppUsersService));
291  };
292  static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _MobileTeamScheduleService, factory: _MobileTeamScheduleService.\u0275fac, providedIn: "root" });
293};
294
vendor: 159 bytes, lines 295-299
295// node_modules/@capacitor/app/dist/esm/index.js
296var App = registerPlugin("App", {
297  web: () => import("./chunk-XUV4CHXZ.js").then((m) => new m.AppWeb())
298});
299
vendor: 196 bytes, lines 300-304
300// node_modules/@capacitor/splash-screen/dist/esm/index.js
301var SplashScreen = registerPlugin("SplashScreen", {
302  web: () => import("./chunk-ZL4VNRV2.js").then((m) => new m.SplashScreenWeb())
303});
304
vendor: 379 bytes, lines 305-318
305// node_modules/@capacitor/status-bar/dist/esm/definitions.js
306var Style;
307(function(Style2) {
308  Style2["Dark"] = "DARK";
309  Style2["Light"] = "LIGHT";
310  Style2["Default"] = "DEFAULT";
311})(Style || (Style = {}));
312var Animation;
313(function(Animation2) {
314  Animation2["None"] = "NONE";
315  Animation2["Slide"] = "SLIDE";
316  Animation2["Fade"] = "FADE";
317})(Animation || (Animation = {}));
318
vendor: 102 bytes, lines 319-321
319// node_modules/@capacitor/status-bar/dist/esm/index.js
320var StatusBar = registerPlugin("StatusBar");
321
322// libs/ionic-services/src/lib/mobile-app-utility.service.ts
323var MobileAppUtilityService = class _MobileAppUtilityService {
324  platform;
325  firestoreService;
326  storageService;
327  appUsersService;
328  saasCustomerService;
329  mobileTeamScheduleService;
330  alertController;
331  _darkModeSubject = new BehaviorSubject("light");
332  _appVersionSubject = new BehaviorSubject("");
333  _mobileUrlSubject = new ReplaySubject(1);
334  _activeRoomIndexSubject = new BehaviorSubject(-1);
335  _defaultInventoryModeSubject = new BehaviorSubject("photos");
336  modeColors = {
337    light: {
338      mainGrey: "#666666",
339      lightGrey: "rgb(214, 212, 212)",
340      lightGreyContrast: "#fff",
341      primary: "#7eb7ef",
342      primaryContrast: "#fff"
343    },
344    dark: {
345      mainGrey: "#b9b6b6",
346      lightGrey: "rgb(149, 149, 149)",
347      lightGreyContrast: "#000",
348      primary: "#7eb7ef",
349      primaryContrast: "#fff"
350    }
351  };
352  constructor(platform, firestoreService, storageService, appUsersService, saasCustomerService, mobileTeamScheduleService, alertController) {
353    this.platform = platform;
354    this.firestoreService = firestoreService;
355    this.storageService = storageService;
356    this.appUsersService = appUsersService;
357    this.saasCustomerService = saasCustomerService;
358    this.mobileTeamScheduleService = mobileTeamScheduleService;
359    this.alertController = alertController;
360  }
361  setMobileLogo() {
362    return __async(this, null, function* () {
363      console.warn("setMobileLogo should only be called once!");
364      this._mobileUrlSubject.next(null);
365      combineLatest([
366        this.appUsersService.aggregatedUser$,
367        this.saasCustomerService.neverEmptySaasCustomerId$()
368      ]).pipe(switchMap((_0) => __async(this, [_0], function* ([agu, saasCustomerIdObserved]) {
369        return agu?.saasCustomerId ? agu.saasCustomerId : saasCustomerIdObserved;
370      })), tap((companyId) => __async(this, null, function* () {
371        if (companyId) {
372          const mobileUrl = yield this.storageService.saasGetImageDownloadUrl(companyId, "images", "logos", "mobile");
373          this._mobileUrlSubject.next(mobileUrl);
374        }
375      })), switchMap((companyId) => this.saasCustomerService.companySettings$(companyId))).subscribe();
376    });
377  }
378  mobileLogoUrl$() {
379    return this._mobileUrlSubject;
380  }
381  setDarkMode(darkMode) {
382    return __async(this, null, function* () {
383      this._darkModeSubject.next(darkMode);
384      document.body.classList.toggle("dark", darkMode === "dark");
385      yield Preferences.set({ key: "darkMode", value: JSON.stringify(darkMode) });
386      yield this.setStatusBarStyle(darkMode);
387      yield this.themeAndroidStatusBar();
388    });
389  }
390  checkDarkModeSettingAndSetStatusBar(isEstimator = false) {
391    return __async(this, null, function* () {
392      Preferences.get({ key: "darkMode" }).then((darkModeJson) => {
393        const darkMode = darkModeJson.value ? JSON.parse(darkModeJson.value) : "light";
394        this._darkModeSubject.next(darkMode);
395        document.body.classList.toggle("dark", darkMode === "dark");
396        if (!isEstimator) {
397          this.setStatusBarStyle(darkMode);
398          this.themeAndroidStatusBar();
399        }
400      });
401    });
402  }
403  checkHasDisclosedBGPermission() {
404    return __async(this, null, function* () {
405      return (yield Preferences.get({ key: "hasDisclosedBGPermission" })).value === "true";
406    });
407  }
408  setHasDisclosedBGPermission() {
409    return __async(this, null, function* () {
410      yield Preferences.set({ key: "hasDisclosedBGPermission", value: "true" });
411    });
412  }
413  darkMode$() {
414    return this._darkModeSubject;
415  }
416  getDarkModeValue() {
417    return this._darkModeSubject.getValue();
418  }
419  appVersion$() {
420    return this._appVersionSubject;
421  }
422  getAppVersionValue() {
423    return this._appVersionSubject.getValue();
424  }
425  setActiveRoomIndex(i) {
426    return __async(this, null, function* () {
427      this._activeRoomIndexSubject.next(i);
428      yield Preferences.set({ key: "ari", value: `${i}` });
429    });
430  }
431  getActiveRoomIndex() {
432    return this._activeRoomIndexSubject.getValue();
433  }
434  setDefaultInventoryMode(v) {
435    return __async(this, null, function* () {
436      this._defaultInventoryModeSubject.next(v);
437      if (v !== "notes") {
438        yield Preferences.set({ key: "dim", value: v });
439      }
440    });
441  }
442  defaultInventoryMode$() {
443    return this._defaultInventoryModeSubject;
444  }
445  getDefaultInventoryMode() {
446    return this._defaultInventoryModeSubject.getValue();
447  }
448  initializeActiveQuoteIdFromStorage() {
449    return __async(this, null, function* () {
450      const aqi = yield Preferences.get({ key: "aqi" });
451      if (aqi && aqi.value) {
452        this.mobileTeamScheduleService.setQuoteId(aqi.value);
453        const ari = yield Preferences.get({ key: "ari" });
454        if (ari && ari.value) {
455          this._activeRoomIndexSubject.next(parseInt(ari.value));
456        }
457        const dim = yield Preferences.get({ key: "dim" });
458        if (dim && dim.value) {
459          this._defaultInventoryModeSubject.next(dim.value);
460        } else {
461          this._defaultInventoryModeSubject.next("photos");
462        }
463      } else {
464        this._defaultInventoryModeSubject.next("photos");
465      }
466    });
467  }
468  setStatusBarStyle(darkMode) {
469    return __async(this, null, function* () {
470      if (Capacitor.isNativePlatform()) {
471        if (darkMode === "dark") {
472          yield StatusBar.setStyle({ style: Style.Dark });
473        } else {
474          yield StatusBar.setStyle({ style: Style.Light });
475        }
476      }
477    });
478  }
479  themeAndroidStatusBar() {
480    return __async(this, null, function* () {
481      if (Capacitor.isNativePlatform()) {
482        if (Capacitor.getPlatform() === "android") {
483          const toolbarBG = getComputedStyle(document.body).getPropertyValue("--toolbar-bg");
484          yield StatusBar.setBackgroundColor({ color: toolbarBG });
485        }
486      }
487    });
488  }
489  hideSplashScreen() {
490    return __async(this, null, function* () {
491      setTimeout(() => {
492        SplashScreen.hide();
493      }, 1500);
494    });
495  }
496  setAppVersion(appVersion) {
497    return __async(this, null, function* () {
498      if (Capacitor.isNativePlatform()) {
499        const appInfo = yield App.getInfo();
500        this._appVersionSubject.next(`${appInfo.version} - ${appInfo.build}`);
501      } else {
502        this._appVersionSubject.next(appVersion);
503      }
504    });
505  }
506  checkForAppUpdate() {
507    return __async(this, null, function* () {
508      if (Capacitor.isNativePlatform()) {
509        const applicationConfig = yield firstValueFrom(this.firestoreService.documentValueChanges$(`${APPLICATION_CONFIG_COLLECTION}/mobileTeam`));
510        const appVersion = this.getAppVersionValue();
511        console.log("App Version:", appVersion);
512        let latestVersion;
513        let storeName;
514        if (this.platform.platforms().includes("android")) {
515          latestVersion = applicationConfig.currentVersionAndroid;
516          storeName = "Google Play Store";
517        } else {
518          latestVersion = applicationConfig.currentVersionIos;
519          storeName = "AppStore";
520        }
521        if (latestVersion && appVersion) {
522          if (this.compareVersionAndBuild(latestVersion, appVersion)) {
523            const alert = yield this.alertController.create({
524              header: "New Version Available",
525              message: `There is a newer version of this app available. Update your app on ${storeName}.`,
526              buttons: [
527                {
528                  text: "Got It!",
529                  role: "cancel"
530                }
531              ]
532            });
533            yield alert.present();
534          }
535        }
536      }
537    });
538  }
539  compareVersionAndBuild(remoteConfigVersion, appVersion) {
540    const appVersionArray = appVersion.split("-");
541    const version = appVersionArray[0];
542    const build = appVersionArray[1];
543    const deviceVersionArray = version.split(".");
544    if (deviceVersionArray.length === 2) {
545      deviceVersionArray.push("0");
546    }
547    const remoteConfigArray = remoteConfigVersion.split("-");
548    const remoteConfigVersionArray = remoteConfigArray[0].split(".");
549    if (remoteConfigVersionArray.length === 2) {
550      remoteConfigVersionArray.push("0");
551    }
552    if (parseInt(remoteConfigVersionArray[0]) !== parseInt(deviceVersionArray[0])) {
553      return parseInt(remoteConfigVersionArray[0]) > parseInt(deviceVersionArray[0]);
554    }
555    if (parseInt(remoteConfigVersionArray[1]) !== parseInt(deviceVersionArray[1])) {
556      return parseInt(remoteConfigVersionArray[1]) > parseInt(deviceVersionArray[1]);
557    }
558    if (parseInt(remoteConfigVersionArray[2]) !== parseInt(deviceVersionArray[2])) {
559      return parseInt(remoteConfigVersionArray[2]) > parseInt(deviceVersionArray[2]);
560    }
561    if (parseInt(remoteConfigArray[1]) !== parseInt(build)) {
562      return parseInt(remoteConfigArray[1]) > parseInt(build);
563    }
564    return false;
565  }
566  getValueOfJobOfferUseGeocoderService() {
567    return __async(this, null, function* () {
568      const applicationConfig = yield firstValueFrom(this.firestoreService.documentValueChanges$(`${APPLICATION_CONFIG_COLLECTION}/mobileTeam`));
569      return applicationConfig.jobOffersUseGeocoderService ? applicationConfig.jobOffersUseGeocoderService : false;
570    });
571  }
572  logout() {
573    return __async(this, null, function* () {
574      this.mobileTeamScheduleService.setQuoteId("");
575      this._activeRoomIndexSubject.next(-1);
576      this._defaultInventoryModeSubject.next("photos");
577      yield Preferences.remove({ key: "aqi" });
578      yield Preferences.remove({ key: "ari" });
579      yield Preferences.remove({ key: "dim" });
580    });
581  }
582  mapStylesDarkMode() {
583    return [
584      { elementType: "geometry", stylers: [{ color: "#242f3e" }] },
585      { elementType: "labels.text.stroke", stylers: [{ color: "#242f3e" }] },
586      { elementType: "labels.text.fill", stylers: [{ color: "#746855" }] },
587      {
588        featureType: "administrative.locality",
589        elementType: "labels.text.fill",
590        stylers: [{ color: "#d59563" }]
591      },
592      {
593        featureType: "poi",
594        elementType: "labels.text.fill",
595        stylers: [{ color: "#d59563" }]
596      },
597      {
598        featureType: "poi.park",
599        elementType: "geometry",
600        stylers: [{ color: "#263c3f" }]
601      },
602      {
603        featureType: "poi.park",
604        elementType: "labels.text.fill",
605        stylers: [{ color: "#6b9a76" }]
606      },
607      {
608        featureType: "road",
609        elementType: "geometry",
610        stylers: [{ color: "#38414e" }]
611      },
612      {
613        featureType: "road",
614        elementType: "geometry.stroke",
615        stylers: [{ color: "#212a37" }]
616      },
617      {
618        featureType: "road",
619        elementType: "labels.text.fill",
620        stylers: [{ color: "#9ca5b3" }]
621      },
622      {
623        featureType: "road.highway",
624        elementType: "geometry",
625        stylers: [{ color: "#746855" }]
626      },
627      {
628        featureType: "road.highway",
629        elementType: "geometry.stroke",
630        stylers: [{ color: "#1f2835" }]
631      },
632      {
633        featureType: "road.highway",
634        elementType: "labels.text.fill",
635        stylers: [{ color: "#f3d19c" }]
636      },
637      {
638        featureType: "transit",
639        elementType: "geometry",
640        stylers: [{ color: "#2f3948" }]
641      },
642      {
643        featureType: "transit.station",
644        elementType: "labels.text.fill",
645        stylers: [{ color: "#d59563" }]
646      },
647      {
648        featureType: "water",
649        elementType: "geometry",
650        stylers: [{ color: "#17263c" }]
651      },
652      {
653        featureType: "water",
654        elementType: "labels.text.fill",
655        stylers: [{ color: "#515c6d" }]
656      },
657      {
658        featureType: "water",
659        elementType: "labels.text.stroke",
660        stylers: [{ color: "#17263c" }]
661      }
662    ];
663  }
664  static \u0275fac = function MobileAppUtilityService_Factory(__ngFactoryType__) {
665    return new (__ngFactoryType__ || _MobileAppUtilityService)(\u0275\u0275inject(Platform), \u0275\u0275inject(FirestoreService), \u0275\u0275inject(StorageService), \u0275\u0275inject(AppUsersService), \u0275\u0275inject(SaasCustomerService), \u0275\u0275inject(MobileTeamScheduleService), \u0275\u0275inject(AlertController));
666  };
667  static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _MobileAppUtilityService, factory: _MobileAppUtilityService.\u0275fac, providedIn: "root" });
668};
669
670// libs/ionic-services/src/lib/ionic-confirm.service.ts
671var import_dayjs2 = __toESM(require_dayjs_min());
672var IonicConfirmService = class _IonicConfirmService {
673  alertCtrl;
674  alertPresented = false;
675  constructor(alertCtrl) {
676    this.alertCtrl = alertCtrl;
677  }
678  confirmRemoveTeamMember(teamMemberName) {
679    return __async(this, null, function* () {
680      const header = `Do you want to remove ${teamMemberName} from this job?`;
681      const data = yield this.coreConfirm(header);
682      return data === true;
683    });
684  }
685  confirmRemoveTruck(i) {
686    return __async(this, null, function* () {
687      const header = `Do you want to remove truck ${i} from this job?`;
688      const data = yield this.coreConfirm(header);
689      return data === true;
690    });
691  }
692  confirmReviewsCompleted() {
693    return __async(this, null, function* () {
694      const header = `Have you completed team, truck, and supplies review?`;
695      const data = yield this.coreConfirm(header);
696      return data === true;
697    });
698  }
699  confirmLogEventStopped() {
700    return __async(this, null, function* () {
701      const header = `Press Cancel and then Job Complete if you have finished this job, or press Confirm if you plan to continue with it tomorrow.`;
702      const data = yield this.coreConfirm(header);
703      return data === true;
704    });
705  }
706  confirmLogEventArrivedDispatchDone() {
707    return __async(this, null, function* () {
708      const header = `Are you finished for the day?`;
709      const buttons = [
710        {
711          text: "No",
712          role: "cancel",
713          cssClass: "alert-button-clear"
714        },
715        {
716          text: "Yes",
717          role: "confirm",
718          cssClass: "alert-button-fill-right alert-button-fill"
719        }
720      ];
721      const data = yield this.coreConfirm(header, void 0, buttons);
722      return data === true;
723    });
724  }
725  confirmJobComplete() {
726    return __async(this, null, function* () {
727      const header = `Confirm the following:`;
728      const message = `<p>Walk through completed with the customer.</p>
729                     <p>Rearranging / Setting up furniture complete.</p>
730                     <p>Truck/s are super clean and ready to leave.</p>`;
731      const data = yield this.coreConfirm(header, message);
732      return data === true;
733    });
734  }
735  confirmTeamMembersChange(teamMemberNames) {
736    return __async(this, null, function* () {
737      const header = `Confirm team members changed to:`;
738      const message = `<h5>${teamMemberNames}</h5>`;
739      const data = yield this.coreConfirm(header, message);
740      return data === true;
741    });
742  }
743  confirmTeamLeadChange(teamMemberName) {
744    return __async(this, null, function* () {
745      const header = `Confirm team lead changed to:`;
746      const message = `<h5>${teamMemberName}</h5>`;
747      const data = yield this.coreConfirm(header, message);
748      return data === true;
749    });
750  }
751  confirmRoomAction(i, rooms, deleteOrCopy) {
752    return __async(this, null, function* () {
753      const header = deleteOrCopy === "delete" ? `Delete ${rooms[i].name} and ${this.productCount(rooms[i].products)} items.` : `Duplicate ${rooms[i].name} and contents.`;
754      const data = yield this.coreConfirm(header);
755      return data === true;
756    });
757  }
758  productCount(roomProducts) {
759    let quantity = 0;
760    roomProducts.forEach((product) => quantity = quantity + (product.quantity ? product.quantity : 0));
761    return quantity;
762  }
763  confirmJobAction(quote) {
764    return __async(this, null, function* () {
765      const header = `Duplicate ${(0, import_dayjs2.default)(quote.quoteOptions.movingDate.seconds * 1e3).format("MMM - DD - YYYY")} job.`;
766      const data = yield this.coreConfirm(header);
767      return data === true;
768    });
769  }
770  confirmToReview() {
771    return __async(this, null, function* () {
772      const header = "Frequently Forgotten Rooms";
773      const message = "Laundry, Garage, Front/Back Patio, Attic";
774      const data = yield this.coreConfirm(header, message);
775      return data === true;
776    });
777  }
778  confirmDeleteProduct(product) {
779    return __async(this, null, function* () {
780      const header = product.quantity === 1 ? `Do you want to delete ${product.quantity} ${product.name}?` : `Do you want to delete ${product.quantity} ${product.name}s?`;
781      const data = yield this.coreConfirm(header);
782      return data === true;
783    });
784  }
785  confirmDeletePhoto() {
786    return __async(this, null, function* () {
787      const header = "Confirm delete photo.";
788      const data = yield this.coreConfirm(header);
789      return data === true;
790    });
791  }
792  confirmEditSection(page, room) {
793    return __async(this, null, function* () {
794      let header = "";
795      switch (page) {
796        case "contact":
797          header = "Do you want to edit your contact info?";
798          break;
799        case "addresses":
800          header = "Do you want to edit your move addresses or view map?";
801          break;
802        case "rooms":
803          header = "Do you want to edit your rooms?";
804          break;
805        case "room-inventory":
806          header = `Do you want to edit ${room.name}`;
807          break;
808      }
809      const data = yield this.coreConfirm(header);
810      return data === true;
811    });
812  }
813  confirmBackgroundLocationAccess() {
814    return __async(this, null, function* () {
815      const header = "Background Location Access";
816      const message = "Move Details collects location data to enable recording your trips from dispatches to job sites and back, even when the app is closed or not in use.";
817      const buttons = [
818        {
819          text: "Close",
820          role: "confirm",
821          cssClass: "alert-button-clear"
822        }
823      ];
824      const data = yield this.coreConfirm(header, message, buttons, "", true);
825      return;
826    });
827  }
828  coreConfirm(header, message, buttons, cssClass, preventBackdropDismiss) {
829    return __async(this, null, function* () {
830      const alert = yield this.alertCtrl.create({
831        header,
832        buttons: [
833          {
834            text: "Cancel",
835            role: "cancel",
836            cssClass: "alert-button-clear"
837          },
838          {
839            text: "Confirm",
840            role: "confirm",
841            cssClass: "alert-button-fill-right alert-button-fill"
842          }
843        ]
844      });
845      if (buttons) {
846        alert.buttons = buttons;
847      }
848      if (message) {
849        alert.message = message;
850      }
851      if (cssClass) {
852        alert.cssClass = cssClass;
853      } else {
854        alert.cssClass = "alert-wrapper";
855      }
856      if (preventBackdropDismiss) {
857        alert.backdropDismiss = false;
858      }
859      yield alert.present();
860      return alert.onDidDismiss().then((data) => {
861        return data.role === "confirm";
862      });
863    });
864  }
865  static \u0275fac = function IonicConfirmService_Factory(__ngFactoryType__) {
866    return new (__ngFactoryType__ || _IonicConfirmService)(\u0275\u0275inject(AlertController));
867  };
868  static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _IonicConfirmService, factory: _IonicConfirmService.\u0275fac, providedIn: "root" });
869};
870
871// libs/ionic-services/src/lib/mobile-team-startup.service.ts
872var MobileTeamStartupService = class _MobileTeamStartupService {
873  appUsersService;
874  saasCustomerService;
875  constructor(appUsersService, saasCustomerService) {
876    this.appUsersService = appUsersService;
877    this.saasCustomerService = saasCustomerService;
878    this.initializeSaasCustomerId().then();
879  }
880  initializeSaasCustomerId() {
881    return __async(this, null, function* () {
882      yield firstValueFrom(this.appUsersService.aggregatedUser$);
883      const agu$ = this.appUsersService.aggregatedUser$;
884      this.saasCustomerService.setNewSaasCustomerIdObservable({ agu$ });
885    });
886  }
887  static \u0275fac = function MobileTeamStartupService_Factory(__ngFactoryType__) {
888    return new (__ngFactoryType__ || _MobileTeamStartupService)(\u0275\u0275inject(AppUsersService), \u0275\u0275inject(SaasCustomerService));
889  };
890  static \u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _MobileTeamStartupService, factory: _MobileTeamStartupService.\u0275fac, providedIn: "root" });
891};
892
893export {
894  IonicConfirmService,
895  IonicLoadingService,
896  Preferences,
897  MobileTeamScheduleService,
898  MobileAppUtilityService
899};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.