{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./Scripts/app/app-core.js","webpack:///./Scripts/app/app.js","webpack:///./Scripts/app/common/claim-enum.js","webpack:///./Scripts/app/common/common.js","webpack:///./Scripts/app/common/feature-enum.js","webpack:///./Scripts/app/common/index.js","webpack:///./Scripts/app/common/navigation-enums.js","webpack:///./Scripts/app/common/navigation-sorting.js","webpack:///./Scripts/app/components/accounts/accounts-history/accounts-history-ctrl.js","webpack:///./Scripts/app/components/accounts/accounts-history/accounts-history-service.js","webpack:///./Scripts/app/components/accounts/historical-link/historical-link-ctrl.js","webpack:///./Scripts/app/components/accounts/login/login-ctrl.js","webpack:///./Scripts/app/components/accounts/profile/profile-ctrl.js","webpack:///./Scripts/app/components/accounts/profile/profile-service.js","webpack:///./Scripts/app/components/accounts/register/register-ctrl.js","webpack:///./Scripts/app/components/accounts/register/register-service.js","webpack:///./Scripts/app/components/accounts/tenant/tenant-ctrl.js","webpack:///./Scripts/app/components/accounts/tenant/tenant-service.js","webpack:///./Scripts/app/components/approval-documents/documents-approval-ctrl.js","webpack:///./Scripts/app/components/approval-documents/documents-approval-service.js","webpack:///./Scripts/app/components/auditors-dashboard/auditors-dashboard-ctrl.js","webpack:///./Scripts/app/components/auditors-dashboard/auditors-dashboard-service.js","webpack:///./Scripts/app/components/audits/audits-capture-ctrl.js","webpack:///./Scripts/app/components/audits/audits-capture-service.js","webpack:///./Scripts/app/components/building-documents/building-documents-ctrl.js","webpack:///./Scripts/app/components/building-documents/building-documents-service.js","webpack:///./Scripts/app/components/clearances/clearance-capture-ctrl.js","webpack:///./Scripts/app/components/clearances/clearance-capture-service.js","webpack:///./Scripts/app/components/clearances/clearance-request/clearance-request-ctrl.js","webpack:///./Scripts/app/components/clearances/clearance-request/clearance-request-service.js","webpack:///./Scripts/app/components/compliance/compliance-ctrl.js","webpack:///./Scripts/app/components/compliance/compliance-service.js","webpack:///./Scripts/app/components/contractors/find-a-contractor-ctrl.js","webpack:///./Scripts/app/components/dashboard/dashboard-ctrl.js","webpack:///./Scripts/app/components/dashboard/dashboard-service.js","webpack:///./Scripts/app/components/financials/balance-sheet/balance-sheet-ctrl.js","webpack:///./Scripts/app/components/financials/balance-sheet/balance-sheet-service.js","webpack:///./Scripts/app/components/financials/cashflow-statement-new/cashflow-statement-new-ctrl.js","webpack:///./Scripts/app/components/financials/cashflow-statement-new/cashflow-statement-new-service.js","webpack:///./Scripts/app/components/financials/cashflow-statement/cashflow-statement-ctrl.js","webpack:///./Scripts/app/components/financials/cashflow-statement/cashflow-statement-service.js","webpack:///./Scripts/app/components/financials/contractors-roll/contractors-roll-ctrl.js","webpack:///./Scripts/app/components/financials/contractors-roll/contractors-roll-service.js","webpack:///./Scripts/app/components/financials/debtor-age-analysis/debtor-age-analysis-ctrl.js","webpack:///./Scripts/app/components/financials/debtor-age-analysis/debtor-age-analysis-service.js","webpack:///./Scripts/app/components/financials/financial-summary/financial-summary-ctrl.js","webpack:///./Scripts/app/components/financials/financial-summary/financial-summary-service.js","webpack:///./Scripts/app/components/financials/financials-service.js","webpack:///./Scripts/app/components/financials/income-statement/income-statement-ctrl.js","webpack:///./Scripts/app/components/financials/income-statement/income-statement-service.js","webpack:///./Scripts/app/components/financials/income-vs-budget/income-vs-budget-ctrl.js","webpack:///./Scripts/app/components/financials/income-vs-budget/income-vs-budget-service.js","webpack:///./Scripts/app/components/financials/levy-roll/levy-roll-ctrl.js","webpack:///./Scripts/app/components/financials/levy-roll/levy-roll-service.js","webpack:///./Scripts/app/components/financials/wages-roll/wages-roll-ctrl.js","webpack:///./Scripts/app/components/financials/wages-roll/wages-roll-service.js","webpack:///./Scripts/app/components/payment-authorisation/payment-authorisation-ctrl.js","webpack:///./Scripts/app/components/payment-authorisation/payment-authorisation-service.js","webpack:///./Scripts/app/components/payments/payment-approvals-service.js","webpack:///./Scripts/app/components/payments/payment-ctrl.js","webpack:///./Scripts/app/components/personal-documents/personal-documents-ctrl.js","webpack:///./Scripts/app/components/personal-documents/personal-documents-service.js","webpack:///./Scripts/app/components/rentals/rentals-capture-ctrl.js","webpack:///./Scripts/app/components/rentals/rentals-capture-service.js","webpack:///./Scripts/app/components/trustee-dashboard/trustee-dashboard-ctrl.js","webpack:///./Scripts/app/components/trustee-dashboard/trustee-dashboard-service.js","webpack:///./Scripts/app/components/utility-info/utility-info-ctrl.js","webpack:///./Scripts/app/components/utility-info/utility-info-service.js","webpack:///./Scripts/app/controllers/auth-ctrl.js","webpack:///./Scripts/app/controllers/main-ctrl.js","webpack:///./Scripts/app/controllers/mega-nav-ctrl.js","webpack:///./Scripts/app/directives/auth-nav.js","webpack:///./Scripts/app/directives/cached-templates/templates.js","webpack:///./Scripts/app/directives/fix-header-panel/fix-header-panel.js","webpack:///./Scripts/app/directives/flip-card/back.js","webpack:///./Scripts/app/directives/flip-card/flip-card.js","webpack:///./Scripts/app/directives/flip-card/front/front.js","webpack:///./Scripts/app/directives/flip-card/index.js","webpack:///./Scripts/app/directives/flyout-menu/burger-menu.js","webpack:///./Scripts/app/directives/flyout-menu/mini-side-bar.js","webpack:///./Scripts/app/directives/flyout-menu/side-bar.js","webpack:///./Scripts/app/directives/modals/auth-modal-body.js","webpack:///./Scripts/app/directives/modals/auth-modal-header.js","webpack:///./Scripts/app/directives/modals/auth-modal.js","webpack:///./Scripts/app/directives/modals/documents-selector.js","webpack:///./Scripts/app/directives/modals/pdf-viewer.js","webpack:///./Scripts/app/directives/nav-bar/helper-utils.js","webpack:///./Scripts/app/directives/nav-bar/index.js","webpack:///./Scripts/app/directives/nav-bar/main-site/navigation.js","webpack:///./Scripts/app/directives/nav-bar/side/buildings-side-nav.js","webpack:///./Scripts/app/directives/nav-bar/top/buildings-top-nav.js","webpack:///./Scripts/app/directives/ng-html-compile.js","webpack:///./Scripts/app/directives/notification-modal.js","webpack:///./Scripts/app/directives/scrollable/documents/documents-scroller.js","webpack:///./Scripts/app/directives/scrollable/scrollable-ctrl.js","webpack:///./Scripts/app/directives/scrollable/scrollable-documents.js","webpack:///./Scripts/app/directives/scrollable/scrollable-menu.js","webpack:///./Scripts/app/directives/scrollable/scrollable.js","webpack:///./Scripts/app/directives/user-menu.js","webpack:///./Scripts/app/directives/validation/compare-with.js","webpack:///./Scripts/app/directives/validation/error.js","webpack:///./Scripts/app/directives/validation/multi-max-length.js","webpack:///./Scripts/app/directives/validation/validation-summary.js","webpack:///./Scripts/app/directives/validation/validation.js","webpack:///./Scripts/app/directives/validation/validators/date-validator.js","webpack:///./Scripts/app/filters/abs-filter.js","webpack:///./Scripts/app/filters/financials-amount-filter.js","webpack:///./Scripts/app/filters/financials-amount-opposite-filter.js","webpack:///./Scripts/app/filters/financials-seperator-amount-filter.js","webpack:///./Scripts/app/filters/index.js","webpack:///./Scripts/app/filters/money-filter.js","webpack:///./Scripts/app/filters/money-no-decimals-filter.js","webpack:///./Scripts/app/modules/controllers-module.js","webpack:///./Scripts/app/modules/directives-module.js","webpack:///./Scripts/app/modules/filters-module.js","webpack:///./Scripts/app/modules/services-module.js","webpack:///./Scripts/app/modules/views-module.js","webpack:///./Scripts/app/pages/cached-pages/pages.js","webpack:///./Scripts/app/routes.js","webpack:///./Scripts/app/services/buildings-service.js","webpack:///./Scripts/app/services/common/auth-interceptor-service.js","webpack:///./Scripts/app/services/common/authentication-service.js","webpack:///./Scripts/app/services/common/authorization-service.js","webpack:///./Scripts/app/services/common/cache-service.js","webpack:///./Scripts/app/services/common/common-service.js","webpack:///./Scripts/app/services/common/content-service.js","webpack:///./Scripts/app/services/common/countries/countries-util-service.js","webpack:///./Scripts/app/services/common/internal-links-service.js","webpack:///./Scripts/app/services/common/layout-service.js","webpack:///./Scripts/app/services/common/local-storage-service.js","webpack:///./Scripts/app/services/common/navigation-service.js","webpack:///./Scripts/app/services/common/notification-service.js","webpack:///./Scripts/app/services/common/paging-service.js","webpack:///./Scripts/app/services/common/telemetry-service.js","webpack:///./Scripts/app/services/common/user-units-service.js","webpack:///./Scripts/app/services/common/utility-service.js","webpack:///./node_modules/@uirouter/core/lib-esm/common/common.js","webpack:///./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack:///./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack:///./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack:///./node_modules/@uirouter/core/lib-esm/common/index.js","webpack:///./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack:///./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack:///./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack:///./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack:///./node_modules/@uirouter/core/lib-esm/globals.js","webpack:///./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack:///./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack:///./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack:///./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack:///./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack:///./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack:///./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack:///./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack:///./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack:///./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack:///./node_modules/@uirouter/core/lib-esm/index.js","webpack:///./node_modules/@uirouter/core/lib-esm/interface.js","webpack:///./node_modules/@uirouter/core/lib-esm/params/index.js","webpack:///./node_modules/@uirouter/core/lib-esm/params/param.js","webpack:///./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack:///./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack:///./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack:///./node_modules/@uirouter/core/lib-esm/path/index.js","webpack:///./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack:///./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack:///./node_modules/@uirouter/core/lib-esm/resolve/index.js","webpack:///./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack:///./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack:///./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack:///./node_modules/@uirouter/core/lib-esm/router.js","webpack:///./node_modules/@uirouter/core/lib-esm/state/index.js","webpack:///./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack:///./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack:///./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack:///./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack:///./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack:///./node_modules/@uirouter/core/lib-esm/state/stateService.js","webpack:///./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack:///./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack:///./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack:///./node_modules/@uirouter/core/lib-esm/transition/index.js","webpack:///./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack:///./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack:///./node_modules/@uirouter/core/lib-esm/transition/transition.js","webpack:///./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack:///./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack:///./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack:///./node_modules/@uirouter/core/lib-esm/url/index.js","webpack:///./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack:///./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js","webpack:///./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack:///./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack:///./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack:///./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack:///./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/index.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/injector.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/q.js","webpack:///./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack:///./node_modules/@uirouter/core/lib-esm/view/index.js","webpack:///./node_modules/@uirouter/core/lib-esm/view/view.js","webpack:///./node_modules/angular-files-drop/dist/index.js","webpack:///./node_modules/angular-ui-router/lib-esm/angular.js","webpack:///./node_modules/angular-ui-router/lib-esm/directives/stateDirectives.js","webpack:///./node_modules/angular-ui-router/lib-esm/directives/viewDirective.js","webpack:///./node_modules/angular-ui-router/lib-esm/index.js","webpack:///./node_modules/angular-ui-router/lib-esm/injectables.js","webpack:///./node_modules/angular-ui-router/lib-esm/locationServices.js","webpack:///./node_modules/angular-ui-router/lib-esm/services.js","webpack:///./node_modules/angular-ui-router/lib-esm/stateFilters.js","webpack:///./node_modules/angular-ui-router/lib-esm/stateProvider.js","webpack:///./node_modules/angular-ui-router/lib-esm/statebuilders/onEnterExitRetain.js","webpack:///./node_modules/angular-ui-router/lib-esm/statebuilders/views.js","webpack:///./node_modules/angular-ui-router/lib-esm/templateFactory.js","webpack:///./node_modules/angular-ui-router/lib-esm/urlRouterProvider.js","webpack:///./node_modules/angular-ui-router/lib-esm/viewScroll.js","webpack:///./node_modules/base64-js/index.js","webpack:///./node_modules/buffer/index.js","webpack:///./node_modules/buffer/node_modules/isarray/index.js","webpack:///./node_modules/builtin-status-codes/browser.js","webpack:///./node_modules/core-util-is/lib/util.js","webpack:///./node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","webpack:///./node_modules/date-fns/esm/_lib/assign/index.js","webpack:///./node_modules/date-fns/esm/_lib/cloneObject/index.js","webpack:///./node_modules/date-fns/esm/_lib/format/formatters/index.js","webpack:///./node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","webpack:///./node_modules/date-fns/esm/_lib/format/longFormatters/index.js","webpack:///./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","webpack:///./node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/_lib/getUTCWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","webpack:///./node_modules/date-fns/esm/_lib/protectedTokens/index.js","webpack:///./node_modules/date-fns/esm/_lib/setUTCDay/index.js","webpack:///./node_modules/date-fns/esm/_lib/setUTCISODay/index.js","webpack:///./node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/setUTCWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","webpack:///./node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","webpack:///./node_modules/date-fns/esm/_lib/toInteger/index.js","webpack:///./node_modules/date-fns/esm/addBusinessDays/index.js","webpack:///./node_modules/date-fns/esm/addDays/index.js","webpack:///./node_modules/date-fns/esm/addHours/index.js","webpack:///./node_modules/date-fns/esm/addISOWeekYears/index.js","webpack:///./node_modules/date-fns/esm/addMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/addMinutes/index.js","webpack:///./node_modules/date-fns/esm/addMonths/index.js","webpack:///./node_modules/date-fns/esm/addQuarters/index.js","webpack:///./node_modules/date-fns/esm/addSeconds/index.js","webpack:///./node_modules/date-fns/esm/addWeeks/index.js","webpack:///./node_modules/date-fns/esm/addYears/index.js","webpack:///./node_modules/date-fns/esm/areIntervalsOverlapping/index.js","webpack:///./node_modules/date-fns/esm/closestIndexTo/index.js","webpack:///./node_modules/date-fns/esm/closestTo/index.js","webpack:///./node_modules/date-fns/esm/compareAsc/index.js","webpack:///./node_modules/date-fns/esm/compareDesc/index.js","webpack:///./node_modules/date-fns/esm/constants/index.js","webpack:///./node_modules/date-fns/esm/differenceInBusinessDays/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarDays/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarISOWeekYears/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarISOWeeks/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarMonths/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarQuarters/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarWeeks/index.js","webpack:///./node_modules/date-fns/esm/differenceInCalendarYears/index.js","webpack:///./node_modules/date-fns/esm/differenceInDays/index.js","webpack:///./node_modules/date-fns/esm/differenceInHours/index.js","webpack:///./node_modules/date-fns/esm/differenceInISOWeekYears/index.js","webpack:///./node_modules/date-fns/esm/differenceInMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/differenceInMinutes/index.js","webpack:///./node_modules/date-fns/esm/differenceInMonths/index.js","webpack:///./node_modules/date-fns/esm/differenceInQuarters/index.js","webpack:///./node_modules/date-fns/esm/differenceInSeconds/index.js","webpack:///./node_modules/date-fns/esm/differenceInWeeks/index.js","webpack:///./node_modules/date-fns/esm/differenceInYears/index.js","webpack:///./node_modules/date-fns/esm/eachDayOfInterval/index.js","webpack:///./node_modules/date-fns/esm/eachWeekOfInterval/index.js","webpack:///./node_modules/date-fns/esm/eachWeekendOfInterval/index.js","webpack:///./node_modules/date-fns/esm/eachWeekendOfMonth/index.js","webpack:///./node_modules/date-fns/esm/eachWeekendOfYear/index.js","webpack:///./node_modules/date-fns/esm/endOfDay/index.js","webpack:///./node_modules/date-fns/esm/endOfDecade/index.js","webpack:///./node_modules/date-fns/esm/endOfHour/index.js","webpack:///./node_modules/date-fns/esm/endOfISOWeek/index.js","webpack:///./node_modules/date-fns/esm/endOfISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/endOfMinute/index.js","webpack:///./node_modules/date-fns/esm/endOfMonth/index.js","webpack:///./node_modules/date-fns/esm/endOfQuarter/index.js","webpack:///./node_modules/date-fns/esm/endOfSecond/index.js","webpack:///./node_modules/date-fns/esm/endOfToday/index.js","webpack:///./node_modules/date-fns/esm/endOfTomorrow/index.js","webpack:///./node_modules/date-fns/esm/endOfWeek/index.js","webpack:///./node_modules/date-fns/esm/endOfYear/index.js","webpack:///./node_modules/date-fns/esm/endOfYesterday/index.js","webpack:///./node_modules/date-fns/esm/format/index.js","webpack:///./node_modules/date-fns/esm/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/formatDistanceStrict/index.js","webpack:///./node_modules/date-fns/esm/formatDistanceToNow/index.js","webpack:///./node_modules/date-fns/esm/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/fromUnixTime/index.js","webpack:///./node_modules/date-fns/esm/getDate/index.js","webpack:///./node_modules/date-fns/esm/getDay/index.js","webpack:///./node_modules/date-fns/esm/getDayOfYear/index.js","webpack:///./node_modules/date-fns/esm/getDaysInMonth/index.js","webpack:///./node_modules/date-fns/esm/getDaysInYear/index.js","webpack:///./node_modules/date-fns/esm/getDecade/index.js","webpack:///./node_modules/date-fns/esm/getHours/index.js","webpack:///./node_modules/date-fns/esm/getISODay/index.js","webpack:///./node_modules/date-fns/esm/getISOWeek/index.js","webpack:///./node_modules/date-fns/esm/getISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/getISOWeeksInYear/index.js","webpack:///./node_modules/date-fns/esm/getMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/getMinutes/index.js","webpack:///./node_modules/date-fns/esm/getMonth/index.js","webpack:///./node_modules/date-fns/esm/getOverlappingDaysInIntervals/index.js","webpack:///./node_modules/date-fns/esm/getQuarter/index.js","webpack:///./node_modules/date-fns/esm/getSeconds/index.js","webpack:///./node_modules/date-fns/esm/getTime/index.js","webpack:///./node_modules/date-fns/esm/getUnixTime/index.js","webpack:///./node_modules/date-fns/esm/getWeek/index.js","webpack:///./node_modules/date-fns/esm/getWeekOfMonth/index.js","webpack:///./node_modules/date-fns/esm/getWeekYear/index.js","webpack:///./node_modules/date-fns/esm/getWeeksInMonth/index.js","webpack:///./node_modules/date-fns/esm/getYear/index.js","webpack:///./node_modules/date-fns/esm/index.js","webpack:///./node_modules/date-fns/esm/isAfter/index.js","webpack:///./node_modules/date-fns/esm/isBefore/index.js","webpack:///./node_modules/date-fns/esm/isDate/index.js","webpack:///./node_modules/date-fns/esm/isEqual/index.js","webpack:///./node_modules/date-fns/esm/isFirstDayOfMonth/index.js","webpack:///./node_modules/date-fns/esm/isFriday/index.js","webpack:///./node_modules/date-fns/esm/isFuture/index.js","webpack:///./node_modules/date-fns/esm/isLastDayOfMonth/index.js","webpack:///./node_modules/date-fns/esm/isLeapYear/index.js","webpack:///./node_modules/date-fns/esm/isMonday/index.js","webpack:///./node_modules/date-fns/esm/isPast/index.js","webpack:///./node_modules/date-fns/esm/isSameDay/index.js","webpack:///./node_modules/date-fns/esm/isSameHour/index.js","webpack:///./node_modules/date-fns/esm/isSameISOWeek/index.js","webpack:///./node_modules/date-fns/esm/isSameISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/isSameMinute/index.js","webpack:///./node_modules/date-fns/esm/isSameMonth/index.js","webpack:///./node_modules/date-fns/esm/isSameQuarter/index.js","webpack:///./node_modules/date-fns/esm/isSameSecond/index.js","webpack:///./node_modules/date-fns/esm/isSameWeek/index.js","webpack:///./node_modules/date-fns/esm/isSameYear/index.js","webpack:///./node_modules/date-fns/esm/isSaturday/index.js","webpack:///./node_modules/date-fns/esm/isSunday/index.js","webpack:///./node_modules/date-fns/esm/isThisHour/index.js","webpack:///./node_modules/date-fns/esm/isThisISOWeek/index.js","webpack:///./node_modules/date-fns/esm/isThisMinute/index.js","webpack:///./node_modules/date-fns/esm/isThisMonth/index.js","webpack:///./node_modules/date-fns/esm/isThisQuarter/index.js","webpack:///./node_modules/date-fns/esm/isThisSecond/index.js","webpack:///./node_modules/date-fns/esm/isThisWeek/index.js","webpack:///./node_modules/date-fns/esm/isThisYear/index.js","webpack:///./node_modules/date-fns/esm/isThursday/index.js","webpack:///./node_modules/date-fns/esm/isToday/index.js","webpack:///./node_modules/date-fns/esm/isTomorrow/index.js","webpack:///./node_modules/date-fns/esm/isTuesday/index.js","webpack:///./node_modules/date-fns/esm/isValid/index.js","webpack:///./node_modules/date-fns/esm/isWednesday/index.js","webpack:///./node_modules/date-fns/esm/isWeekend/index.js","webpack:///./node_modules/date-fns/esm/isWithinInterval/index.js","webpack:///./node_modules/date-fns/esm/isYesterday/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfDecade/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfISOWeek/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfMonth/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfQuarter/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfWeek/index.js","webpack:///./node_modules/date-fns/esm/lastDayOfYear/index.js","webpack:///./node_modules/date-fns/esm/lightFormat/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","webpack:///./node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","webpack:///./node_modules/date-fns/esm/locale/en-US/index.js","webpack:///./node_modules/date-fns/esm/max/index.js","webpack:///./node_modules/date-fns/esm/min/index.js","webpack:///./node_modules/date-fns/esm/parse/_lib/parsers/index.js","webpack:///./node_modules/date-fns/esm/parse/index.js","webpack:///./node_modules/date-fns/esm/parseISO/index.js","webpack:///./node_modules/date-fns/esm/roundToNearestMinutes/index.js","webpack:///./node_modules/date-fns/esm/setDate/index.js","webpack:///./node_modules/date-fns/esm/setDay/index.js","webpack:///./node_modules/date-fns/esm/setDayOfYear/index.js","webpack:///./node_modules/date-fns/esm/setHours/index.js","webpack:///./node_modules/date-fns/esm/setISODay/index.js","webpack:///./node_modules/date-fns/esm/setISOWeek/index.js","webpack:///./node_modules/date-fns/esm/setISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/setMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/setMinutes/index.js","webpack:///./node_modules/date-fns/esm/setMonth/index.js","webpack:///./node_modules/date-fns/esm/setQuarter/index.js","webpack:///./node_modules/date-fns/esm/setSeconds/index.js","webpack:///./node_modules/date-fns/esm/setWeek/index.js","webpack:///./node_modules/date-fns/esm/setWeekYear/index.js","webpack:///./node_modules/date-fns/esm/setYear/index.js","webpack:///./node_modules/date-fns/esm/startOfDay/index.js","webpack:///./node_modules/date-fns/esm/startOfDecade/index.js","webpack:///./node_modules/date-fns/esm/startOfHour/index.js","webpack:///./node_modules/date-fns/esm/startOfISOWeek/index.js","webpack:///./node_modules/date-fns/esm/startOfISOWeekYear/index.js","webpack:///./node_modules/date-fns/esm/startOfMinute/index.js","webpack:///./node_modules/date-fns/esm/startOfMonth/index.js","webpack:///./node_modules/date-fns/esm/startOfQuarter/index.js","webpack:///./node_modules/date-fns/esm/startOfSecond/index.js","webpack:///./node_modules/date-fns/esm/startOfToday/index.js","webpack:///./node_modules/date-fns/esm/startOfTomorrow/index.js","webpack:///./node_modules/date-fns/esm/startOfWeek/index.js","webpack:///./node_modules/date-fns/esm/startOfWeekYear/index.js","webpack:///./node_modules/date-fns/esm/startOfYear/index.js","webpack:///./node_modules/date-fns/esm/startOfYesterday/index.js","webpack:///./node_modules/date-fns/esm/subDays/index.js","webpack:///./node_modules/date-fns/esm/subHours/index.js","webpack:///./node_modules/date-fns/esm/subISOWeekYears/index.js","webpack:///./node_modules/date-fns/esm/subMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/subMinutes/index.js","webpack:///./node_modules/date-fns/esm/subMonths/index.js","webpack:///./node_modules/date-fns/esm/subQuarters/index.js","webpack:///./node_modules/date-fns/esm/subSeconds/index.js","webpack:///./node_modules/date-fns/esm/subWeeks/index.js","webpack:///./node_modules/date-fns/esm/subYears/index.js","webpack:///./node_modules/date-fns/esm/toDate/index.js","webpack:///./node_modules/es6-promise/auto.js","webpack:///./node_modules/es6-promise/dist/es6-promise.js","webpack:///./node_modules/events/events.js","webpack:///./node_modules/html2canvas/dist/html2canvas.js","webpack:///./node_modules/html2pdf.js/dist/html2pdf.js","webpack:///./node_modules/https-browserify/index.js","webpack:///./node_modules/ieee754/index.js","webpack:///./node_modules/inherits/inherits_browser.js","webpack:///./node_modules/jquery-number/jquery.number.min.js","webpack:///./node_modules/jspdf/dist/jspdf.min.js","webpack:///./node_modules/lodash/lodash.js","webpack:///./node_modules/process-nextick-args/index.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/punycode/punycode.js","webpack:///./node_modules/querystring-es3/decode.js","webpack:///./node_modules/querystring-es3/encode.js","webpack:///./node_modules/querystring-es3/index.js","webpack:///./node_modules/readable-stream/lib/_stream_duplex.js","webpack:///./node_modules/readable-stream/lib/_stream_passthrough.js","webpack:///./node_modules/readable-stream/lib/_stream_readable.js","webpack:///./node_modules/readable-stream/lib/_stream_transform.js","webpack:///./node_modules/readable-stream/lib/_stream_writable.js","webpack:///./node_modules/readable-stream/lib/internal/streams/BufferList.js","webpack:///./node_modules/readable-stream/lib/internal/streams/destroy.js","webpack:///./node_modules/readable-stream/lib/internal/streams/stream-browser.js","webpack:///./node_modules/readable-stream/node_modules/inherits/inherits_browser.js","webpack:///./node_modules/readable-stream/node_modules/isarray/index.js","webpack:///./node_modules/readable-stream/readable-browser.js","webpack:///./node_modules/safe-buffer/index.js","webpack:///./node_modules/setimmediate/setImmediate.js","webpack:///./node_modules/stream-http/index.js","webpack:///./node_modules/stream-http/lib/capability.js","webpack:///./node_modules/stream-http/lib/request.js","webpack:///./node_modules/stream-http/lib/response.js","webpack:///./node_modules/string_decoder/lib/string_decoder.js","webpack:///./node_modules/timers-browserify/main.js","webpack:///./node_modules/to-arraybuffer/index.js","webpack:///./node_modules/url/url.js","webpack:///./node_modules/url/util.js","webpack:///./node_modules/util-deprecate/browser.js","webpack:///./node_modules/validatorjs/src/async.js","webpack:///./node_modules/validatorjs/src/attributes.js","webpack:///./node_modules/validatorjs/src/errors.js","webpack:///./node_modules/validatorjs/src/lang sync ^\\.\\/.*$","webpack:///./node_modules/validatorjs/src/lang.js","webpack:///./node_modules/validatorjs/src/lang/ar.js","webpack:///./node_modules/validatorjs/src/lang/az.js","webpack:///./node_modules/validatorjs/src/lang/be.js","webpack:///./node_modules/validatorjs/src/lang/bg.js","webpack:///./node_modules/validatorjs/src/lang/bs.js","webpack:///./node_modules/validatorjs/src/lang/ca.js","webpack:///./node_modules/validatorjs/src/lang/cs.js","webpack:///./node_modules/validatorjs/src/lang/cy.js","webpack:///./node_modules/validatorjs/src/lang/da.js","webpack:///./node_modules/validatorjs/src/lang/de.js","webpack:///./node_modules/validatorjs/src/lang/el.js","webpack:///./node_modules/validatorjs/src/lang/en.js","webpack:///./node_modules/validatorjs/src/lang/es.js","webpack:///./node_modules/validatorjs/src/lang/et.js","webpack:///./node_modules/validatorjs/src/lang/eu.js","webpack:///./node_modules/validatorjs/src/lang/fa.js","webpack:///./node_modules/validatorjs/src/lang/fi.js","webpack:///./node_modules/validatorjs/src/lang/fr.js","webpack:///./node_modules/validatorjs/src/lang/hr.js","webpack:///./node_modules/validatorjs/src/lang/hu.js","webpack:///./node_modules/validatorjs/src/lang/id.js","webpack:///./node_modules/validatorjs/src/lang/it.js","webpack:///./node_modules/validatorjs/src/lang/ja.js","webpack:///./node_modules/validatorjs/src/lang/ka.js","webpack:///./node_modules/validatorjs/src/lang/ko.js","webpack:///./node_modules/validatorjs/src/lang/lt.js","webpack:///./node_modules/validatorjs/src/lang/lv.js","webpack:///./node_modules/validatorjs/src/lang/mk.js","webpack:///./node_modules/validatorjs/src/lang/mn.js","webpack:///./node_modules/validatorjs/src/lang/ms.js","webpack:///./node_modules/validatorjs/src/lang/nb_NO.js","webpack:///./node_modules/validatorjs/src/lang/nl.js","webpack:///./node_modules/validatorjs/src/lang/pl.js","webpack:///./node_modules/validatorjs/src/lang/pt.js","webpack:///./node_modules/validatorjs/src/lang/pt_BR.js","webpack:///./node_modules/validatorjs/src/lang/ro.js","webpack:///./node_modules/validatorjs/src/lang/ru.js","webpack:///./node_modules/validatorjs/src/lang/se.js","webpack:///./node_modules/validatorjs/src/lang/sl.js","webpack:///./node_modules/validatorjs/src/lang/sq.js","webpack:///./node_modules/validatorjs/src/lang/sr.js","webpack:///./node_modules/validatorjs/src/lang/sv.js","webpack:///./node_modules/validatorjs/src/lang/tr.js","webpack:///./node_modules/validatorjs/src/lang/ua.js","webpack:///./node_modules/validatorjs/src/lang/uk.js","webpack:///./node_modules/validatorjs/src/lang/vi.js","webpack:///./node_modules/validatorjs/src/lang/zh.js","webpack:///./node_modules/validatorjs/src/lang/zh_TW.js","webpack:///./node_modules/validatorjs/src/messages.js","webpack:///./node_modules/validatorjs/src/rules.js","webpack:///./node_modules/validatorjs/src/validator.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/module.js","webpack:///./node_modules/xtend/immutable.js","webpack:///util (ignored)","webpack:///util (ignored)?3d00","webpack:///external \"angular\"","webpack:///external \"angular-animate\"","webpack:///external \"angular-sanitize\"","webpack:///external \"angular-ui-router\"","webpack:///external \"bootstrap\"","webpack:///external \"jQuery\"","webpack:///external \"jQuery-ui\"","webpack:///external \"Moment\""],"names":["angular","module","mobileApiAddress","pretorOnlineUrl","authenticationAPIAddress","pretorDocumentsServerUrl","PretorCDNAddress","pretorInternalUrl","require","$","localStorage","setItem","config","$httpProvider","$sceDelegateProvider","resourceUrlWhitelist","interceptors","push","run","$state","$timeout","$window","$transitions","$location","$rootScope","NavigationService","LocalStorageService","$on","evt","newNav","oldNav","USER_CLAIMS","Object","freeze","MY_PROFILE","VIEW_PAYMENTS","VIEW_LEVY_ROLL","REGISTER_TENANT","VIEW_FINANCIALS","APPROVE_PAYMENTS","CLEARANCE_CAPTURE","VIEW_BALANCE_SHEET","VIEW_PAYMENT_BANDS","VIEW_PROPERTY_LIST","VIEW_FIRE_COMPLIANCE","VIEW_INCOME_STATEMENT","VIEW_INCOME_VS_BUDGET","APPROVE_PAYMENT_BANDS","VIEW_CONTRACTORS_ROLL","VIEW_ACCOUNTS_HISTORY","VIEW_BUILDING_DOCUMENTS","VIEW_CASHFLOW_STATEMENT","VIEW_CASHFLOW_STATEMENT_NEW","VIEW_PERSONAL_DOCUMENTS","REJECT_FINANCIAL_SUMMARY","VIEW_CONTRACTUAL_PAYMENTS","APPROVE_FINANCIAL_SUMMARY","QUERY_FIRE_QUOTE_COMPLIANCE","APPROVE_CONTRACTUAL_PAYMENTS","APPROVE_FIRE_QUOTE_COMPLIANCE","QUERY_MINI_SUB_QUOTE_COMPLIANCE","APPROVE_MINI_SUB_QUOTE_COMPLIANCE","UTILITY","VIEW_DOCUMENTS_APPROVAL","CAPTURE_PAYMENTS","VIEW_LEGAL_COLLECTIONS_ROLL","RENTALS_CAPTURE","AUDITS_CAPTURE","AUDITORS_DASHBOARD","VIEW_WAGES_ROLL","DEBTOR_AGE_ANALYSIS","VIEW_PREVIOUS_FINANCIALS","SHOW_FIND_A_CONTRACTOR","_mapUser","user","hasOwnProperty","UserName","WebUsername","_retrieve","itemName","item","getItem","indexOf","JSON","parse","_isAuthorized","claim","toLowerCase","shouldAuthorize","userProfile","selectedBuildingRef","BuildingProfiles","length","SchemeReference","selectedBuilding","find","buildingProf","buildingRef","trim","hasClaim","BuildingClaimMapped","desc","results","Description","owner","Role","role","capitalize","BuildingProfileUnit","filter","unit","CardCode","includes","mapPageToFeature","page","feature","FEATURES","LEVY_ROLL","PAYMENTS","TENANT","COMPLIANCE","ACCOUNT_HISTORY","BALANCE_SHEET","DOCUMENTS","CASHFLOW_STATEMENT","CASHFLOW_STATEMENT_NEW","CONTRACTORS_ROLL","FINANCIAL_SUMMARY","INCOME_STATEMENT","INCOME_VS_BUDGET","PAYMENT_AUTHORISATION","PERSONAL_DOCUMENTS","DOCUMENTS_APPROVAL","WAGES_ROLL","TRUSTEE_DASHBOARD","text","mapped","fields","split","transformed","map","val","newText","substr","toUpperCase","join","checkIfFeatureIsEnable","featureSettings","isFeatureEnabled","levyRoll","LevyRoll","myProfile","MyProfile","financials","Financials","balanceSheet","BalanceSheet","registerTenant","RegisterTenant","contractorsRoll","ContractorsRoll","incomeStatement","IncomeStatement","payments","Payments","personalDocuments","PersonalDocuments","DASHBOARD","isDashboardEnabled","IsDashboardEnabled","viewAccountHistory","ViewAccountHistory","paymentAuthorisations","PaymentAuthorisations","cashflowStatement","CashflowStatement","utility","viewDocumentsApproval","ViewDocumentsApproval","wagesRoll","WagesRoll","trusteeDashboard","TrusteeDashboard","cashflowStatementNew","CashflowStatementNew","incomeVSBudget","IncomeVSBudget","debtorAgeAnalysis","DebtorAgeAnalysis","showContractor","ShowContractor","shouldBeEnabled","alsoCheckDashboard","isEnabled","isUserAuthorized","buildingsFeatures","canPerformAction","action","schemeRef","userHasRights","paymentsApproval","PaymentsApproval","serverfyJSObject","original","mappedObject","keys","key","temp","newKey","REGISTER","CLEARANCE_REQUEST","LOGIN","HISTORICAL_LINK","NAVIGATION","Compliance","ManageTents","PropertyList","FinancialPack","AccountHistory","PaymentApprovals","BuildingDocuments","PaymentAuthorisation","Utility","DocumentsApproval","ShowFindAContractor","navigationToClaim","claimLink","description","ManageTenants","routeToClaim","routeName","order","NAVIGATION_SORTED","sortedNavigation","originalNavigation","sort","sorting","optionA","optionB","AccountsHistoryCtrl","$scope","BuildingsService","UserUnitsService","NotificationService","AccountsHistoryDataService","init","activate","isBusy","unitList","isDetailsBusy","selectedCardCode","hasSelectedCardCode","undefined","dateTo","moment","format","dateFrom","subtract","event","newValue","onSelectedBuildingChanged","cardCode","params","accountsHistoryService","getSelectedBuildingRef","getAccountsHistorySummary","getUnits","_switchIsBusy","getFriendlyUnitNames","getAccountsHistory","err","error","console","_switchIsDetailsBusy","_initializeDatePicker","$eval","id","selectorDateFrom","selectorDateTo","$inputDateFrom","$inputDateTo","optionsDateFrom","autoclose","forceParse","assumeNearbyYear","enableOnReadonly","container","optionsDateTo","datepicker","getAccountsHistoryReport","go","folder","flag","$http","InternalLinksService","getLinks","accountsHistorySummary","accountsHistory","units","promise","promiseHandler","Promise","resolve","reject","url","getLink","cardCodes","forEach","replace","headers","headersWithContentType","post","data","log","msg","get","openNewTabReport","title","newTab","open","document","write","HistoricalLinkCtrl","AuthenticationService","oldLink","newLink","incomingUrl","toString","redirectUrl","window","location","href","LoginCtrl","$broadcast","Password","resetToken","wantToRegister","dontAskMeAgain","isRegisterFormValid","ConfirmPassword","loadLoader","timeBetweenModals","_handleEvents","passwordFieldType","isNotificationListenerRegistered","InitialiseNavigation","then","currentUser","FirstName","LastName","closeRegisterPromptModal","showRegisterModal","dontShowRegisterPrompt","finally","payLoad","registerUser","WasSuccessful","success","closeRegisterModal","shouldRedirect","isLoginBusy","loginUser","showForgotPasswordModal","userName","userForgotPassword","closeForgotPasswordModal","userResetPassword","closeRestPasswordModal","unsubscribeMonthlyFinancialDocs","closeUnsubscribeMonthlyFinancialDocs","username","$evt","forgotPassword","$event","showUnsubscribeMonthlyFinancialDocs","token","save","showRestPasswordModal","profile","message","timeout","defaultPrevented","preShowForgotPasswordModal","ProfileCtrl","$sce","ProfileService","CountriesUtilService","emailIndex","emailAction","isEditingMobile","isEditingDetails","details","address","lineOne","lineTwo","lineThree","lineFour","postalCode","lastName","firstName","homeNumber","cellNumber","workNumber","idOrPassportNumber","isEditContactInfo","isEditAddressInfo","contactInformation","addressInformation","updatableCellphone","selectedHomeNumber","isEditingHomePhoneNumber","updatableHomePhoneNumber","selectedWorkNumber","isEditingWorkPhoneNumber","updatableWorkPhoneNumber","lockEmailAddress","isEditingEmailAddress","updatableEmailAddress","confirmChangeModal","multipleUnitChangeModal","myProfileInformation","FirstId","AdditionalId","AddressLine1","AddressLine2","HomeNumber","WorkNumber","AddressLine4","PostalCode","EmailUserName","AddressLine3","CellPhoneNumber","Array","isArray","schemeReference","incomingCardCode","addressLine1","addressLine2","addressLine4","addressLine3","payload","emailUserName","idFields","updateDetails","oldUsername","successModal","switchEditAddress","switchEditContactDetails","selectedBuildingRefObj","retrieve","SchemeName","found","extractedSchemeRef","defaultUnit","$$hashKey","json","stringify","getMyProfileInformation","_setAddressInfo","_setContactInfo","EmailAddress","EmailAddressChanges","home","work","email","cell","selectedEmailAddress","selectedCellphoneNumber","element","modal","$watch","oldValue","_onSelectedBuildingChanged","shouldLogoutUser","on","trigger","$resetPasswordModal","$passwordResetButton","$passwordInput","masterEmail","prop","removeAttr","value","css","hide","index","oldNumber","mobileNo","cellphoneIndex","number","form","phone","i","$setDirty","homePhoneNo","homePhoneNumberIndex","WorkPhoneNumberIndex","oldEmailAddress","oldEmail","_toggleMultipleUnitsModal","_hasMultipleUnits","requestChangeForMultipleUnits","$modal","$nextModal","off","RegisteredName","selectedUnitCardCard","CellPhoneNumberUserName","updateContactDetails","hasMultipleUnits","shouldShow","additionalInfo","updateAddressDetails","getSelectedUnit","_setProfileInfo","selectedUnit","mappedIds","field","getTrustedHtml","add","html","addressFields","mappedFields","mappedField","endsWith","trustedHtml","mappedHomeNumber","mappedCellNumber","mappedEmails","canAdd","emails","fullName","FullName","currentBuilding","buildingProfiles","building","userDetails","wasSuccessful","Data","Error","unitInfo","warn","_mapEmails","contactInfo","addressDetails","emailAddresses","RegisterCtrl","RegisterService","isConfirmed","clear","currentStep","activationStatus","confirmEmail","$digest","clearAll","load","selectedCountryCode","style","width","showResendButton","name","surname","cellphone","password","confirmPassword","progress","mobileRegStatus","updateProgress","errMsg","userDoesNotExists","checkIfUserExists","userAlreadyExists","validateEmail","gotoNext","isUserConfirmed","mobileNumber","getInternationalMobileNumber","showError","resend","buildings","registrationData","isMobileRegistered","isWebRegistered","BusinessPartnerUnits","TenantCtrl","TenantDataService","AuthorizationService","noTenantForUnit","idNumber","tenant","leaseEndDate","leaseStartDate","userUnits","isTenantLoading","isEditingTenant","friendlyUnitNames","isMainPageLoading","friendlyUnitNamesPromise","hasTenantBeenRegistered","dbRef","newSelectedUnit","getTenantByCardCode","tenantService","initialiseScreen","objUnit","isUpdating","Id","deregisterTenant","userUnit","handleUnitChange","hasAccess","isAuthorized","getUserUnits","$parent","loadTilesData","TenantService","MasterProfileId","LeaseEndDate","LeaseStartDate","buildingProfile","DocumentsApprovalCtrl","DashboardService","ApprovalDocumentsDataService","hasInitialisedFromSession","query","buildingsDataService","webDocumentApprovalIndividual","Comments","Attachments","userSession","buildingName","getDocumentApprovals","approvalsData","approval","approvalId","currApproval","j","path","iframeApprovalDocuments","trustAsResourceUrl","selectedDocumentIndex","selectedApprovalId","selectedDocumentTypeDesc","DestroyModal","currentSchemeRef","approveDocument","modalId","removeClass","remove","rejectDocument","queryDocument","ContentService","documentsData","docload","Message","base64js","AuditorsDashboardCtrl","AuditorsDashboardService","loadDashboard","_registerEventHandler","howToGuideLink","auditsToken","auditorSchemes","auditorName","openAuditorSchemeInfo","newAuditDetailsToken","urlToken","search","myArray","GetAuditorSchemeInformation","auditsData","GetAuditorSchemes","searchResult","monthNames","dateChange","EndOfFinancialYear","substring","inputDate","Date","day","getDate","monthIndex","getMonth","year","getFullYear","parsedDate","auditorHeaderId","AuditorHeaderId","auditorInfo","getAuditorByAuditorHeaderId","Auditor","FinancialPeriodHeaderId","DB_Ref","auditTokenDetailsToOpen","GetAuditDetailsToView","Token","openAuditDetailsResult","openAuditsDetails","excelDocument","GetAuditorDashboardToExcel","auditorHeaderDetails","worksheet","XLSX","utils","json_to_sheet","workbook","book_new","book_append_sheet","sheet_add_aoa","origin","wscols","hidden","writeFile","auditsHeaderDetails","_map","auditsQueryLogs","newUrl","startUrl","urlLink","AuditsCaptureCtrl","AuditsCaptureService","attachment","selectedAttachment","formsErrors","first","second","header","documentsErrors","hasAuditsDetailBeenSaved","AssigneeList","retrievedAuditDetails","AuditQueryLogsId","SelectedAuditQueryLog","SpecificAuditQueryMessages","messageDate","messageTime","SpecificAuditQueryMessage","hideTextBox","auditorContactDetails","auditsHeaderId","uploadedFileAttachment","savedFinancialPeriodHeaderId","queryNum","queryNumberForQueryMessage","fileInputUrl","expansionAttachment","expansionAttachmentperQuery","ListOfAuditsUploadedDocs","ListOfAuditsUploadedLinks","ListOfAuditsPerQueryUploadedDocs","queryNumberForPerQueryDoc","getGeneratedAuditsTokenHistory","correlationId","tokenHistory","getAuditsTokenHistoryByCorrelationId","financialPeriodHeaderId","auditsHeaderDetail","getAuditsHeaderByFinancialPeriodHeaderId","fileUpload","populateAuditsDetail","getAuditQueryLogs","getAllDocsforLink","result","getUploadedDocumentsByFinancialPeriodHeaderId","valueToRemove","FileType","splice","getAuditQueryLogsById","outstandingDays","Status","DateLoged","unformattedDate","now","date","month","String","padStart","formattedDate","date1","date2","differenceInMilliseconds","differenceInDays","newDifferenceInDays","Math","abs","populateAuditsQueryLogs","auditsDetails","portfolioManger","Manager","bookkeeper","Bookkeeper","auditorResults","auditor","populateAssigneeList","addQueryDoc","getElementById","addEventListener","file","files","addFrameElement","reader","FileReader","type","legitFile","checkFile","readAsArrayBuffer","onload","addQueryAttachment","IsFinalDraftAudit","Blob","fromByteArray","Uint8Array","src","URL","createObjectURL","FileName","contentWindow","errorMsg","getElementsByClassName","innerText","size","selectedAction","show","getListOfAssignees","x","newOption","Option","selectAssignee","auditQuerySubjectText","auditQueryMessageText","assignee","selectedAssignee","addQuerySelectedDoc","addAuditQuery","display","checked","addQueryFrameElement","ongoingFrameElement","WhoLogged","auditorDetails","AuditQueryLogs","queryNumber","QueryNumber","attachmentPerQuery","MatchedQueries","queryMessages","getAuditQueryMessage","dateTime","DateSent","dateTimeParts","datePart","timePart","theDate","theTime","WhenUploaded","QueryDate","QueryTime","lastAttachment","WhoSent","WhoUploaded","OriginalFileName","currentAttachment","sendAuditQueryMessage","viewMessage","queryLogsId","queryStatus","closeTheAuditQuery","reload","populateReAssigneeList","reAssignee","reAssignAuditQueryById","frameElement","ready","stuff","file2","check_file_pdf","externalSupportDoc","auditorInfomat","documentSelectedAction","fileInputInfo","documentType","filePayload","Username","DocumentType","_switchIsBusyUploadingDocumentLoading","saveUploadedFile","auditsFile","change","is","link","queryLog","status","ongoingQueryDoc","ongoingQueryAttachment","removeCurrentOngoingAttachment","blob","fileType","binaryData","atob","arrayBuffer","ArrayBuffer","uint8Array","charCodeAt","theBlob","FrameElement","blobUrl","createElement","download","body","appendChild","click","removeChild","revokeObjectURL","win","corrId","getExcelDocByCorrelationId","isLoading","auditTokenHistory","listOfAssignees","auditsMessages","uploadedDocs","getAuditorContactDetailsByAuditorHeaderId","messageText","focus","BuildingDocumentsCtrl","$interval","TelemetryService","buildingDocumentsDataService","loading","content","buildingDocuments","buildingDocumentsData","buildingDocumentsFlatFile","buildingDocumentsBreadCrumbs","Title","Level","TreeId","ParentId","vm","cancel","ref","bind","isItFinancialsSection","_switchLoadingIndicator","getBuildingDocuments","FatherId","navigate","nav","QueryString","decodeURI","$overlay","paths","clickFolder","toArray","$folder","gotoTop","RecordClassification","baseURL","DatabaseId","documentTab","logTelemetry","tempBreadCrumbs","documentOriginal","Children","breadCrumb","breadCrumbList","shift","documentOrignal","tempInternalDocumentsBreadCrumbs","htmlString","BuildingDocumentsDataService","documents","documentId","ClearanceCaptureCtrl","ClearanceCaptureService","isLegalEntity","validPurchaser","isPurchaserBusy","selectedPurchaserId","purchaserConfirms","purchaseDocumentType","hasSelectedPurchaser","isInAddPurchaserMode","isInEditPurchaserMode","showOtherMaritalStatus","hasClearanceHeaderBeenSaved","purchaser","MaritalStatus","OtherMaritalStatus","documentTypeList","Value","documentTypeListLoaded","headerDocumentsAlreadyUpLoaded","entityTypes","legalEntities","purchaserTypes","purchaseDocTypes","hoaDocument","acknowledgementOfRules","companyRegistrationDocument","clearanceHeader","postCode","vatRegNo","attachments","addressLineOne","addressLineTwo","addressLineFour","addressLineThree","registrationNo","dateValidUntil","selectedEntityType","selectedLegalEntity","pretorToHandleRental","selectedPurchaserType","dateOfRegistration","SellerBankName","SellerBankAccountName","SellerBankAccountNumber","SellerBankBranchCode","newVal","oldVal","readyForSubmit","createMainAttachmentList","purchaserType","PurchaserStatus","parseInt","IsLegalEntity","clearanceCapture","Attorney","AttorneyReference","ValidDate","endOf","toDate","LegalEntity","legalEntityId","ClearanceHeaderId","Name","PostCode","VatRegNumber","AddressOne","AddressTwo","AddressFour","AddressThree","RegistrationNumber","TypeOfLegalEntity","PretorToHandleRental","saveClearanceHeader","addAttachment","submitErrorMessage","headerForm","$setPristine","DateOfRegistration","saveClearanceRegHeaderAttachment","clearPage","getClearanceHeaderInformation","defineDefaultPurchaser","setupStyles","addMainAttachmentWatch","addPersonAttachmentWatch","getMaritalStatuses","getBankingInstitutionName","tabNumber","addClass","isInit","selectedPurchaser","Purchaser","ContactPerson","contactPerson","loadClearanceCaptureByCorrelationId","getBuildingImportantInformation","populateClearanceHeader","is2ndTabSelected","populatePurchaserForm","getSchemeInfo","getUtilityInfo","EQCSS","apply","AttorneyRef","isAtLeastOneContactPerson","checkForAtLeastOneContactPerson","canSubmit","areDocumentsValid","ContactPersonAttachment","hasIdDocument","doc","ClearanceDocumentType","displayLabelForPurchaser","hasProofOfResidence","PurchaserAttachment","hasHoaDocument","hasAcknowledgmentOfRules","hasSellerBankingConfirmation","isHoa","ClearanceHeaderAttachment","hasCompanyRegistrationDoc","LegalEntityAttachment","att","IsRejected","countHowManyAreTrue","obj","_getAllFormErrors","allowSubmit","areFormsDirty","hasErrors","$error","inputForm","$dirty","customErrorMessages","numeric","required","rules","IdNumber","AddressLineOne","AddressLineTwo","purchaserValidation","contactPersonValidation","headerValidation","inputs","otherInputs","normalRules","legalEntityRules","displayLabels","displayLabelForName","fieldsForValidation","validator","Validator","setAttributeNames","passes","errorCount","errors","inputsDisplayLabels","submitClearanceCapture","each","el","$target","target","closest","attrs","attr","readAndStore","docType","disableFileUpload","uploadFile","_switchIsPurchaserBusy","getPurchaser","$purchaserInfo","animate","scrollTop","position","top","DocumentTypeDescription","_","differenceBy","getContactPerson","contactPersonData","createPersonAttachmentList","purchaserData","setCurrentPurchaserTabFocus","$tabSection","LegalEntityId","upsertContactPerson","ContactPersonId","upsertPurchaser","PurchaserId","hideModal","deleteContactPerson","deletePurchaser","lastIndexOf","isHeader","savePurchaser","deleteAttachment","$el","noNewLine","ContactNumber","ClearanceAttachment","$valid","dt","hasDoc","headerTypes","isDocumentUploaded","allow","getConductRulesOrMemoForScheme","selector","$input","$purchasorInput","dateNow","minimumDate","startOf","getDay","startDate","endDate","purchasorInputOptions","startView","minViewMode","selector1","$regInput","regInputOptions","IsHOA","returnVal","IsRegistrationSubmitted","IsSubmitted","HOASchemeName","HOASchemeReference","schemeRules","hoaRules","docs","docRequiredForHeader","label","hasFormsErrors","hasDocumentsErrors","foundErrors","utilities","schemeInformation","isSubmitted","maritalStatuses","bankNames","purchaserId","dataToBeMapped","_mapRejectedPurchasersDocuments","_updatePurchaser","contactPersonId","_mapRejectedContactPersonDocuments","_updateContactPerson","isLegalEntityDoc","_mapDeletedPurchaser","_mapDeletedContactPerson","clearanceHeaderId","maritalStatus","_formatAndMapDate","_mapSellerInfo","_mapRejectedDocuments","momentDate","initDate","momentInitDate","isBefore","currentMomentDate","currentDay","daysInMonth","_mapRejectedHeaderDocuments","ClearanceHeaderRejectedAttachments","LegalEntityRejectedAttachments","attForRemoval","mappedContactPerson","RejectedAttachments","mappedAttachments","mappedPurchasers","oldSellerEmails","SellerEmail","_mapSenderEmails","sellerEmail","sellerEmails","mappedSellerEmails","updatedPurchaser","isNew","oldPurchaser","array","updatedPerson","oldContactPerson","person","deletedContactPerson","deletedPurchaser","ClearanceRequestCtrl","ClearanceRequestService","testObjects","initializeDatePicker","searchTerm","attorneyNameResults","SearchAvailableAttorneyNames","figuresDate","ClearanceRequest","FiguresValidUntil","SaveInitialClearanceRequest","options","UnitStandNumber","SellerName","PurchaserName","AttorneyName","AttorneyContactNumber","AttorneyEmail","Notes","requestValidation","clearanceRequest","initialRequest","SearchTerm","ComplianceCtrl","ComplianceService","hasDataLoaded","queryReason","rejectionReason","selectedMiniSubIndex","miniSubTitleForOne","miniSubTitleForMoreThanOne","fireCompliance","miniSubsCompliance","liftCompliance","loadAllData","loadMiniSubTypes","loadData","_swtichHasDataLoaded","miniSubQuotes","compliance","_registerEventHandlers","approveFireQuote","rejectFireQuote","queryFireQuote","cancelFireApproval","approveMiniSubsQuote","alert","rejectMiniSubsQuote","queryMiniSubsQuote","cancelMiniSubsApproval","approveMinisubsCommunicationsQuote","rejectMinisubsCommunicationsQuote","updateMinisubQuoteStatus","miniSubs","approveLiftQuote","rejectLiftQuote","queryLiftQuote","selectedMiniSub","rawMiniSubServiceType","miniSubTypes","quoteType","payloadResult","fireQuote","FireQuote","liftsQuotes","LiftsQuotes","MiniSubQuotes","minisubCommsQuote","MinisubCommunicationsQuote","mapForClient","_mapFilePath","CommunicationsId","miniSub","_mapMiniSub","_mapMiniSubTypes","RejectionReason","QueryReason","rejectionRequest","ActionReason","communicationsId","additionalQuoteAttachment","pathDate","attachmentPath","normalQuoteAttachment","currentType","mappedQuoteType","FindAContractorCtrl","DashboardCtrl","$q","timeoutPromise","_timeoutProcess","loginEmail","portfolioCount","timeoutDelay","paymentApprovedCount","_timeoutProcessRetry","buildingFeatureSetting","dashboardMenuText","busyProcesses","mainProcess","count","subProcesses","approvals","isBulk","bands","isApproving","isQuerying","tiles","staticTiles","front","mode","styles","subtitle","buildStaticTiles","schemeName","buildingsData","allBuildings","loadMasterEmail","getUserUnitsInformation","getBuildingBackground","getMasterEmail","oldSchemeRef","deferred","defer","fallbackUrl","getTrustedBuildingImageUrl","_handleUserUnitsLoad","_handleBuildingChanged","_handleDefaultSchemeRef","isBusyLastShownStr","time","apiRetry","dateTimeFormat","Balance","toFixed","promises","setSelectedInitialDBRef","getPaymentsTileData","getAccountHistoryTileData","all","scheme","userCanPerformAction","getPayments","noOfPayments","NumberOfResults","tile","newDefaultPayments","dashboardPayment","back","parseFloat","buildingsWithUnits","getFriendlyUnitNamesWithUserBuildingNames","unitCardCode","getAccountHistory","newTile","defaultAccountHistory","tileData","storedRef","navigationData","_mapSchemeRefToObj","sorted","sortBy","bp","defaultDbRef","$emit","buildingResult","loadBySchemeRef","navigated","loadSelectedInitialScheme","selectedTab","indexFound","process","isAllowed","primary","secondary","self","$filter","_mapPayments","cardCard","noOfMonthsHistory","_mapAccountHistory","emailResults","rawData","selectedBuildingRefQueryString","payment","ServiceProviderName","Amount","mappedAmount","CurrentBalance","UnitFriendlyName","AccountHistorySummaries","summary","TotalCharged","BalanceSheetCtrl","FinancialsService","BalanceSheetService","isFilterActive","reportModelHeader","filterYear","filterMonth","statusInformation","selectedBuildingName","_switchIsBusyLoading","financialsServiceData","today","getFormatedDate","stickableStyles","getFinancialYears","saveSelectedDate","selectedYear","selectedMonth","AccountCode","AccountName","replacementString","stringToReplace","accountname","trustAsHtml","encodeURI","mdvice","selectedDateYear","getBalanceSheet","getReport","getSelectedDate","financialYears","WhenTo","getFinancialState","getSelectedYear","yearRaw","isBetween","WhenFrom","actionName","BalanceSheetDataService","balanceSheetData","sessionToken","CashflowStatementNewCtrl","CashflowStatementDataNewService","selectedDate","serviceData","CashflowStatementCtrl","CashflowStatementDataService","isMonthlyView","isYearFilterActive","isLoadingReport","policyDocument","iframePaymentDocuments","previousMonth","investmentStatment","isLoadingTransactionsForYear","isShowingYearlyTransactions","interestAccountCodes","webPaymentApprovalIndividual","monthlyStyles","_registerEventHandling","yearlyTransactions","_registerClicks","$elements","$element","_removeSelected","$selectDiv","hasClass","deselect","isOverBudget","accountCode","budgetIssue","getCashflowStatement","cashflowData","yearlyCashflowData","setReportURL","concatString","concat","getFinancialMonths","getYearlyCashflowStatement","getAllReports","selectedMonthIndex","selectedDateMonth","getSelectedMonth","financialMonths","foundMonth","momentMonth","isSame","_filterOutFutureMonths","monthDateStr","monthDate","_cleanUp","leviesRecievedSummary","GrossLeviesRecieved","TotalLegalFessPaid","NetLeviesRecieved","leviesReceivedSummary","transactions","currentTarget","parents","accCode","openFinancials","className","_handleAccordionToggle","getTransactions","showStatement","showPolicy","getTransactionsForYear","isInterest","setIsLoadingTranstactions","isLoadingTransactions","documentsUrl","loadStatements","attachmentUrl","loadPolicyDocuments","statementAttachment","CorrelationId","_mapStatements","statements","IsInvoice","Path","DocumentExtension","pathToLowerCase","getInvoicePath","lineMemo","getInterestTransactionDetails","previewBankStatement","records","$accordion","isExpanded","collapse","statement","_idToFilePath","yearlyStyles","parentNode","tagName","parent","cssSelector","saveSelectedDateWithMonth","_handleShowDetails","previousDateStr","currentDateStr","previousDate","currentDate","shouldHide","formatedDate","currentYear","currentMonth","foundIndex","FriendlyNameMonth","yearStr","monthStr","filteredMonths","selectedYearMoment","financialYear","whenToMoment","whenFromMoment","isFound","isSameOrBefore","isSameOrAfter","getMapFirstDay","LeviesRecievedSummary","_mapYearlyTransactions","trans","Transactions","ContractorsRollCtrl","ContractorsRollService","strDate","getContractorsRoll","filterByMonth","whenFrom","whenTo","contractorsRollData","contractorsRollTotal","DebtorAgeAnalysisCtrl","PagingService","DebtorAgeAnalysisService","FinancialSummaryService","selectLevytype","buildingWorkflowAndFeatures","canFilter","onlyShowDebtors","isFilterByOrderByUnitNumber","orderByUnitNumber","isFilterByorderByTotal","orderByTotal","isFilterByMonthActive","isFilterByOnlyShowDebtors","isfilterByShowAllLegalMemos","isfilterByShowAllLegalAccountData","DebtorAgeAnalysisPaging","isPagingNavigationVisible","isShowAllLegalMemos","isShowAllLegalAccountData","showHideLegalMemos","showHideLegalAccountData","OrderByFilter","getDebtorAgeAnalysis","pageNumber","mediaDevice","resetVariables","DebtorAgeAnalysisData","filterByShowAllLegalAccountData","filterByHideAllLegalAccountData","OrderByUnitNumber","getLegalReport","numberOfMonths","numberOfDays","floor","getAllLegalReport","financialsSummaryServiceData","getbuildingWorkflowAndFeatures","numberOfResults","limit","firstItemIndex","lastItemIndex","maxPage","ceil","UnitItemCode","panalId","DebtorAgeAnalysisUnitMemoData","_switchIsBusyLoadingMemo","getUnitLegalMemo","code","input","isLoadingMemo","numberOfResultsLegal","debtorAgeAnalysisData","sortByUnitNumber","sortByTotal","FinancialSummaryCtrl","navigateDate","dateLastReportMonth","getLastFinancialMonth","filterDate","yearsAmount","whenFrom2","temp2","getFinancialSummary","navDate","setHours","toISOString","slice","mailingList","selectedEmailListItems","editedEmails","deletedEmails","financialSummary","lastDate","modalSelector","modalTimeout","isBusyFetchingDocuments","zipFileResult","downloadAllAttachments","zipFile","zipBytes","toByteArray","FileBytes","contentType","urlCreator","webkitURL","mozURL","msURL","a","Extension","twatyear","twatmonth","getFinancialSummaryAttachment","loadEmails","_serverfyFinancialSummary","approve","_switchMailingListLoading","getMailingList","EmailListItems","TrusteeMailingListItems","IsTrustee","AdHocMailingListItems","isEdit","isDeleted","CommunicationChannel","MailingListHeaderId","CommunicationChannelDescription","editEmailCore","mail","newEmail","IsDeleted","WhoActioned","editedMail","saveEmailCore","selectedTrusteeMailingListItems","include","selectedAdHocMailingListItems","_serverfyMailingList","saveMailingList","hideLegacyDocuments","HideLegacyFinancialDocuments","printPreviewSummaryWriteUp","HasBeenSent","ApprovalDate","IsNewProcess","WhoApproved","isBuilding","Summary","financialSummaryApproval","_getSelectedBuildingRef","RejectionDate","summaryRejection","Messages","_mapCommunicationChannelDescription","mailingListDetails","momentDateString","htmlContent","_renderPdf","dateOfFinancials","pdfWorker","html2pdf","margin","filename","jsPDF","orientation","set","from","toPdf","pdf","output","pdfContent","pdfWindow","mailItem","onResize","$win","mobileWidth","isMobile","$templateCache","LastFinancialMonth","iframeReportUrl","safeApply","mobileViewText","originalDate","rawSelectedReportMonth","rawSelectedReportYear","intDay","intMonth","strDay","strMonth","todayMoment","showLegalMemos","showAllLegalAccounts","rawResults","httpCallResults","FinancialStatus","_generateFinancialStatusResults","financialType","close","iframeTest","setTimeout","iframeDoc","contentDocument","readyState","spinnerDisplay","removeAttribute","templatePath","htmlTemplate","IncomeStatementCtrl","IncomeStatementService","getIncomeStatement","incomeStatementData","IncomeVSBudgetCtrl","IncomeVSBudgetService","LevyRollCtrl","LevyRollService","isLegalCollectionRollEnabled","isConsolidatedLevyRollEnabled","orderByHighestDebtor","isFilterByOrderByHighestDebtor","levyRollPaging","isPagingNavigationVisibleLegal","getLevyRoll","levyRollData","$collapsable","toggleAllLegalMemos","$collapse","$clickable","children","filterByShowAllLegalMemos","filterByHideAllLegalMemos","ViewLegalCollectionsRoll","ViewConsolidatedLevyRoll","firstItemIndexLegal","lastItemIndexLegal","maxPageLegal","pageNumberLegal","islegalcollectionroll","isconsolidatedlevyroll","levyRollUnitMemoData","showOnlyDebt","NumberOfResultsLegal","WagesRollCtrl","WagesRollService","getWagesRoll","wagesRollData","wagesRollTotal","PaymentAuthorisationCtrl","$uibModal","$cacheFactory","paymentAuthorisationDataService","paymentBandData","webPortfolio","SchemeRef","webPortfolioToggle","isBulkApproving","portfolioArrayLength","webPortfolioComments","disableQuerySubmit","contractualDetails","testCache","buildingRefsAreEqual","lastTriedStr","retryAt","lastTried","shouldTryAgain","isAfter","getPaymentAuthorisation","bandsData","WebPortfolio","portfolio","ContractualPayments","$collapsing","approverAuthorisation","isNoBand","band","IsMandatory","portfolioId","glyphiconClass","approvePaymentAuthorisation","queryPaymentAuthorisation","allowed","hasRoleForBuilding","paymentId","ContractualPaymentId","ContractualAttachment","queryMessage","queryContractualPayment","ids","paymentIDsForApproval","getContractualPaymentIDs","bulkStatusChange","approveContractualPayments","IDs","busy","_id","unApprove","busyType","changeContractualApprovalStatus","unApproveContractualPayment","approveContractualPayment","isUnApproving","hasSelectedPayments","selectedContractualPayments","canApprove","PaymentAuthorisationService","Portfolios","contractualPaymentIDs","PaymentIds","PaymentId","PaymentApprovalService","paymentTypes","serviceProviders","currentCount","_mapApprovals","oldApprovalsData","extend","approved","approvedData","oldApprovedData","getPaymentApprovals","paymentDataPayload","arrayOfAttachmentBase64Blobs","postAsFormData","request","cansubmit","currentVatRate","isPaymentBandEnabled","webPaymentSearch","Checked","innerIndex","serviceProviderResult","serviceProviderId","invoiceNumber","hasDuplicateResult","hasDuplicate","objToBeHttpPosted","arrayOfBase64Blobs","formdata","FormData","append","method","transformRequest","identity","accountsData","PaymentCtrl","paymentApprovalsDataService","hasPaymentsInitiallySucceeded","registerEventHandlers","defaultAddEditPayment","PaymentType","InvoiceNumber","ServiceProviderId","TotalInvoiceAmount","FuturePaymentDate","Allocations","Invoice","SupportingDocuments","IsTaxable","VatRatePercentage","GLAccount","defaultAddEditPaymenOptions","showDuplicateInvoiceWarning","showDuplicateInvoiceError","isCheckingForDuplicateInvoice","tempServiceProvider","futureDatechecked","serviceProviderChecked","searchServiceTerm","schemeConfirmed","serviceProviderConfirmed","invoiceNumberConfirmed","amountConfirmed","invoiceCaptureConfirmed","addEditPayment","addEditPaymenOptions","resetPaymentData","captureFormErrors","assign","allocationRows","selectedserviceProviderName","awaitQueries","selectedItemIndex","panelCollapsed","scrollableStyling","showBulkApprove","paymentsPromise","isAmountChecked","isBusySearching","isBusySaving","selectedPagingLimit","webPaymentApproval","isInvoiceChecked","isSupplierChecked","paymentApprovalsCount","selectedLineItemIndex","limits","searchButtonActive","paymentsForBulkApproval","invoiceApprovedOverlay","webPaymentApprovalApproved","paymentsDataService","approvedPaymentsPaging","canPaymentcapture","allocationAmountMatchedInvoiceTotal","innerPayment","paymentIndex","searchPayments","isDecimal","_isDecimal","$historyTab","shouldShouldBulkApprove","capturePayment","getPaymentTypes","incomingSchemeRef","clearSearchPayments","_switchIsLoading","isPaymentBandEnabledBySchemeRef","_mapIcons","catch","expanded","_bulkStatusChange","bulkApprovePayments","pa","HasApproved","_unApprovePayment","_approvePayment","_changePaymentApprovalStatus","approvePayment","unApprovePayment","searchOption","Options","PageNumber","Limit","_switchIsSearching","reg","RegExp","isNumber","test","isNaN","queryPayment","newCopy","pmt","shouldRemove","querying","queryingPayments","shouldInclude","hasDuplicateInvoice","checkInvoiceNumberHasDuplicate","e","Console","searchServiceProvider","selectedServiceProviderSector","ServiceProviderSector","getCurrentVatRateForScheme","searchAccoutTerm","glAccountResults","SearchGLAccounts","addAllocationAmount","FixNumber","addAllocationAccount","accountName","allocationAccountAlreadyAddedToPayment","newRow","amount","allocationRow","rowIndex","brokenNumber","fixedNumber","Number","renurnVal","totalAllocationAmount","acccode","existingAllocation","hasSelectedServiceProvider","hasInvoiceNumber","hasValidTotalAmount","totalallocationsMatchTotalAmount","futureDatedPaymentIsValid","hasNoDuplicateInvoiceNumber","hasInvoiceBeenUploaded","canAddEditPaymentBeSubmitted","hasPaymentTypeBeenSelected","paymentPayload","allocationPayload","attachmentBlobPayload","_switchIsSaving","submitPaymentResult","submitPaymentForApporval","statusText","preventDefault","newInvoiceattachment","newSupportattachment","FuturePaymentDateChecked","required_if","selectedSchemeName","AllocationCodes","AccountNumber","CapturingUsername","PaymentTypeId","PaymentStatus","cansubmitpayment","canSubmitPaymentForApproval","checksubmit","PersonalDocumentsCtrl","personalDocumentsDataService","personalDocumentsFlatFile","selectedFolder","personalDocumentsBreadCrumbs","getPersonalDocuments","openCardCodeFolder","findIndex","topLevelDocument","pop","openFolder","PersonalDocumentsService","personalDocumentsData","RentalsCaptureCtrl","RentalsCaptureService","loadSignaturePads","secondApplicationChosen","thirdApplicationChosen","fourthApplicationChosen","isFirstApplicantPartner","isSecondApplicantPartner","isThirdApplicantPartner","signaturedata","RentalInitialApplicationsIDFetched","acknowledgmentSection","firstApplicant","secondApplicant","thirdApplicant","fourthApplicant","generalSection","declarationSection","rentalsApplicationToken","rentalInitialApplicationsData","getRentalInitialApplication","setRentalInitialData","rentalsHeader","WhoIsApplying","premisesAddress","rentalAmount","leasePeriod","RentalInitialApplicationsID","OccupationDate","firstPerson","ApplicantNumber","ID_Passport","Nationality","DateOfBirth","Telephone_Home","Telephone_Cell","nextOfKinName","nextOfKinTelephone","CurrentStreet","CurrentSuburb","CurrentCity","CurrentProvince","CurrentPostalCode","ID_Attachment","ProofOfAddressAttachment","OwnCurrentResidence","landlordName","LandlordNumber","landlordEmail","RentalAmountPaid","TimeLivingAtResidence","employersName","Occupation","EmployersEmail","EmployersNumber","PeriodOfEmployment","grossMonthlySalary","currentMonthlyExpenses","employersStreet","employersSuburb","employersCity","employersProvince","employersPostalcode","payslips","bankStatements","applicantSignataure","secondPerson","thirdPerson","fourthPerson","generalDetails","ApplicantOccupyingBuilding","numberOfAdults","numberOfChildren","childAge1","childAge2","childAge3","childAge4","numberOfPets","petType","numberOfVehicles","VehicleType1","Vehicle1Registration","VehicleType2","Vehicle2Registration","VehicleType3","Vehicle3Registration","VehicleType4","Vehicle4Registration","PreviousDefaults","defaultDetails","SeenProperty","SupportingDocument1","SupportingDocument2","SupportingDocument3","OtherTenantFullName","OtherTenantCellNumber","OtherTenantEmail","declarations","WhereSigned","DaySigned","MonthSigned","YearSigned","FirstApplicantCorrID","SecondApplicantCorrID","ThirdApplicantCorrID","FourthApplicantCorrID","firstIDBlobData","firstProofOfAddressBlobData","firstPayslipBlobData","firstBankStatementsBlobData","secondIDBlobData","secondProofOfAddressBlobData","secondPayslipBlobData","secondBankStatementsBlobData","thirdIDBlobData","thirdProofOfAddressBlobData","thirdPayslipBlobData","thirdBankStatementsBlobData","fourthIDBlobData","fourthProofOfAddressBlobData","fourthPayslipBlobData","fourthBankStatementsBlobData","firstPersonSignature","secondPersonSignature","thirdPersonSignature","fourthPersonSignature","supportingDoc1","supportingDoc2","supportingDoc3","livesWithPartner2","spousIsWorking2","livesWithPartner3","spousIsWorking3","livesWithPartner4","spousIsWorking4","uploadedSignatureBlobData","uploadedSignatureBlobData2","uploadedSignatureBlobData3","uploadedSignatureBlobData4","removeFourthApplicantClick","removeThirdApplicantClick","removeSecondApplicantClick","getNumberOfChildren","getNumberOfVehincles","monthsArr","countries","dropdown","selectedOptionElement","innerHTML","option","optionElement","textContent","addSecondApplicantClick","addThirdApplicantClick","addFourthApplicantClick","SignaturePad","canvas","opts","velocityFilterWeight","minWidth","maxWidth","dotSize","penColor","backgroundColor","throttle","throttleOptions","leading","trailing","minPointDistance","onEnd","onBegin","_canvas","_ctx","getContext","lineCap","_handleMouseDown","which","_mouseButtonDown","_strokeBegin","_handleMouseMove","_strokeUpdate","arePointsDisplayed","point","_createPoint","_drawMark","y","_handleMouseUp","_strokeEnd","_handleTouchStart","targetTouches","touch","changedTouches","_handleTouchMove","_handleTouchEnd","wasCanvasTouched","_handleMouseEvents","_handleTouchEvents","prototype","ctx","fillStyle","clearRect","height","fillRect","_reset","showPointsToggle","toDataURL","imageType","quality","arguments","getBlobData","dataURL","arr","mime","match","bstr","n","u8arr","getByteArrayData","byteArray","byteForKey","fromDataURL","dataUrl","image","Image","ratio","devicePixelRatio","drawImage","_isEmpty","_isPointToBeUsed","_addPoint","points","lastPoint","distanceTo","_strokeDraw","beginPath","_drawPoint","closePath","fill","canDrawCurve","msTouchAction","touchAction","removeEventListener","isEmpty","_lastVelocity","_lastWidth","rect","getBoundingClientRect","Point","clientX","left","clientY","c2","c3","curve","tmp","unshift","_calculateCurveControlPoints","c1","Bezier","_addCurve","s1","s2","s3","dx1","dy1","dx2","dy2","m1","m2","l1","sqrt","l2","dxm","dym","k","cm","tx","ty","startPoint","endPoint","velocity","newWidth","velocityFrom","_strokeWidth","_drawCurve","moveTo","arc","PI","restore","startWidth","endWidth","widthDelta","drawSteps","t","tt","ttt","u","uu","uuu","control1","control2","max","getTime","start","pow","steps","cx","cy","px","py","xdiff","ydiff","_point","end","signaturePad","saveButton","clearButton","editButton","font","fillText","IntArray","classList","toggle","idAttachment1","addressDoc1","payslip1","bankStatement1","idAttachment2","addressDoc2","payslip2","bankStatement2","idAttachment3","addressDoc3","payslip3","bankStatement3","idAttachment4","addressDoc4","payslip4","bankStatement4","supportingDocument1","supportingDocument2","supportingDocument3","SignaturePad2","pointsSkippedFromBeingAdded","signaturePad2","saveButton2","clearButton2","editButton2","SignaturePad3","signaturePad3","saveButton3","clearButton3","editButton3","SignaturePad4","signaturePad4","saveButton4","clearButton4","editButton4","removeItem","RentalAmount","UnitName","notOwnProperty","livesWithPartner","currentlyEmployed","isDefaultOrJudgement","isViewingSuppDocs","isOccupying","numOfChildren","numOfVehicles","checkSecondSpouse","checkThirdSpouse","checkFourthSpouse","validateForm","ul","li","createTextNode","toLocaleString","uploadApplicationAcknowledgementInfo","uploadApplicantInfo","uploadGeneralDetailsInfo","uploadDeclarationsInfo","rentalsCapture","personalDetail","idDoc","proofOfAddressDoc","payslipDoc","bankStatementDoc","acknowledgementDetails","generalDetailsPayload","supportDocument1","supportDocument2","supportDocument3","declarationDetails","declarationPayload","tokenId","rentalsApplicationData","rentalsInitialApplicationData","TrusteeDashboardCtrl","TrusteeDashboardService","UtilityinfoCtrl","getUtilityinfo","utilityinfo","getBuildingUtilityInformation","UtilityinfoService","AuthCtrl","closeLoginModal","showLoginModal","ProfileReminder","ShowUserAuthenticationNotSecure","MainCtrl","$injector","LayoutService","CommonService","isHome","authorized","isNewDesign","currentPage","topMarginClass","showFullMenu","GetTrustedBuildingImageUrl","isLoadingBuildingFeaturesPromise","loadingIndicator","loadingImage","largePretorLogo","smallPretorLogo","delete","resize","checkIsMobile","$links","l","$l","selectedBuildingTab","context","current","isMobileScreen","screenWidth","otherPath","isActive","linkText","protocol","host","port","setTitle","friendlyName","hasBuidlingProfiles","isUndefined","getSelectedBuildingReference","tempBuildRef","loadBuildingFeatures","setSelectedBuildingRef","setLocalUserObjects","refreshUserProfile","mappedBuildings","gotUser","$current","lastLoggedInStr","currentDateTime","lastLoggedIn","authorize","buildingReference","hasInitted","getBuildingFeatureSettings","$$url","busyProcess","_triggerMenuClick","shouldOpen","_handleSideBarChange","call","_handleInitChangeForPage","savedBuildingRef","_handleInitChangeForBuilding","confirmToken","updatedUser","elements","selectedElement","isInvalidLogin","oldSelectedBuildingRef","mappedPath","mapPath","unProtectedRoute","queryObj","tab","section","isShowing","toggleSideBar","imgUrl","isSelected","isDesktop","MegaNavCtrl","$anchorScroll","myProfileIsAllowed","oldMenuLink","menuLinks","menu","newMenuLinks","_addMyProfile","redirectedFrom","showLogin","DeleteQueryStringParameter","myProfileLink","landingPage","currentPath","absUrl","$contactUsSection","offset","templateString","bindToController","template","restrict","put","FixHeaderPanel","scope","mainTarget","fixHeaderPanelLink","initialWidth","$stopFixing","selectionString","fixHeaderPanel","remHideClass","unFix","fixHeaderToggle","makeFixed","Back","BackLink","FlipCard","static","flipCardLink","transclude","isStatic","handleNavigation","ele","$ele","tempParams","stringParams","Front","object","FrontLink","BurgerMenuLink","$this","$wrapper","toggleClass","BurgerMenu","MiniSideBar","MiniSideBarLink","htmlStringTemplate","winHeight","menuMinHeight","_changeSideBarHeight","$link","isNotShowing","$urlElement","SideBar","SideBarLink","$menus","lin","$subMenu","$item","shouldCollapseOthers","sm","$sm","$anchor","route","clearSavedDates","getSelection","removeAllRanges","$menuItems","AuthModalBody","AuthModalBodyLink","AuthModalHeader","icon","AuthModalHeaderLink","$iconElement","$titleLabel","AuthModal","showModal","closeModal","canClose","modalHeader","modalBody","AuthModalLink","$modalBackground","slideUp","duration","specialEasing","DocumentsSelector","twoColumns","selectEvent","targetSelector","columnClassName","selectedPayment","containerClassName","selectedChangedEvent","htmlViewTemplate","documentsSelectorLink","scopeReference","$scopeReference","__this","previewDocument","_refreshEQCSS","dir","noOfDocuments","PDFViewer","$iFrame","pageStyles","busyIndicator","ngScope","$content","_applyStyling","switchIsBusy","clearOutIFrame","valueOf","dots","fileExtension","isPdf","renderIFrame","downloadIndicator","ajax","xhrFields","responseType","textStatus","xhr","urlData","errorUrl","setIFrameSrc","$context","$isLoadingDiv","removeProperty","setProperty","getRootScope","_this_","keyProperty","rootScopeRef","tempScope","Navigation","NavigationLink","getTemplate","navigationRoutes","allowedRoutes","mappedRoute","activeLink","routes","generateNavLinks","toggleDashboardList","$arrow","$dashboardList","incomingPage","navigationPage","MainVM","_setSelectPage","BuildingsSideNav","buildingsForPaging","BuildingsSideNavLink","loadDirectiveTemplate","selectedBuildingTitle","selectedBuildingReference","_mapBuildings","changeBuilding","trustedUrl","BuildingsTopNav","BuildingsTopNavLink","toggleBuildingList","$buildingList","tempImgUrl","HtmlCompile","$compile","htmlCompileLink","ngHtmlCompile","main","outerItem","items","contents","NotificationModal","showNotificationModal","shouldCloseOnClick","NotificationModalLink","animationPromise","timeoutPeriod","complete","done","DocumentsScroller","loadHtmlTemplate","DocumentsScrollerLink","offSet","animationDuration","$scroller","scrollLeft","scrollRight","selectDocument","_performScroll","_resetScroller","_getScrollItemWidth","$thisReference","thisReference","direction","currentScrollPosition","newScrollPosition","_scope","$scrollItem","scrollItemWidth","$next","$prev","$items","winWidth","scrollWidth","selectorRaw","animDuration","stickableWidth","nCurrentPosition","$nScrollableItem","nCurrentScrollPos","adjustController","getWidth","stickableScrollable","stickable","scrollPos","stickAt","$otherScrollable","shouldHideMainScrollable","isElementNotBeingShown","scrollDir","ntotalScrollableCols","monthlyActualContainerWidth","nScrollAmount","limitScrolls","trunc","transition","transform","offsetTop","offsetLeft","offsetWidth","offsetHeight","offsetParent","pageYOffset","innerHeight","pageXOffset","innerWidth","fixed","scrollEventHandler","numOfCells","column","$li","$menu","ScrollableMenuLink","outerWidth","showStretched","setHandlersPosition","scroll","currentSteps","setScrollableSize","hideArrows","showArrow","outerHeight","offsetTag","scrollableWidth","Scrollable","ScrollableLink","$container","leftWidth","scrollValue","UserMenu","menus","fullname","onLinkClick","userMenuLink","$ul","$linkTag","$dropDownIcon","menuItem","clickedTag","hideMenu","showMenu","CompareWithLink","ctrl","otherInputName","$form","otherInput","$otherInput","customValidator","ngModelValue","isValid","$setValidity","$parsers","ErrorLink","MultiMaxLength","maxFieldLength","MultiMaxLengthLink","otherInputsSelector","$otherInputs","multiMaxLengthValidator","calculatedLength","ValidationSummary","for","ValidationLink","formName","_toggleValidationDisplay","_registerEventsHandler","fieldName","isDirty","showErrors","empty","fieldLabelText","$name","$field","isDatePicker","$label","span","cleanUpStrings","_generateHtml","isShown","Validation","inputName","$invalid","showValidationErrors","hideValidationErrors","processErrorHandling","_handleNormalErrors","isValidDate","ValidateDate","expression","isMatch","formatted","float","noDecimal","decimal","controller","directive","AuthNav","CompareWith","NgHtmlCompile","ScrollableCtrl","ScrollableMenu","ScrollableDocuments","Abs","FinancialsAmountOpposite","FinancialsAmount","Money","MoneyNoDecimals","FinancialsSeperatorAmount","factory","PretorCache","ContractorsDataService","AuthInterceptorService","PaymentApprovalsDataService","PersonalDocumentsDataService","PaymentAuthorisationDataService","FindAContractorService","uiRouterModule","RoutesRouterConfig","$stateProvider","$urlRouterProvider","_turnOffIsLoggingIn","registerRoutes","registerProfileRout","registerTenantRoute","registerLevyRollRoute","registerRegisterRoute","registerPaymentsRoute","registerDashboardRoute","registerDocumentsRoute","registerComplianceRoute","registerBalanceSheetRoute","registerAccountsHistoryRoute","registerIncomeStatementRoute","registerContractorsRollRoute","registerFinancialSummaryRoute","registerClearanceCaptureRoute","registerClearanceRequestRoute","registerCashflowStatementRoute","registerCashflowStatementNewRoute","registerPersonalDocumentsRoute","registerPaymentAuthorisationRoute","registerUtilityRoute","registerDocumentsApprovalRoute","registerLoginRoute","registerHistoricalLinkRoute","registerRentalsCaptureRoute","registerAuditsCaptureRoute","registerAuditorsDashboardRoute","registerWagesRollRoute","registerTrusteeRoute","registerIncomeVSBudgetRoute","registerDebtorAgeAnalysisRoute","registerFindAContractorRoute","otherwise","historicallink","controllerAs","templateUrl","state","login","utilityRoute","viewDocsApprovalRoute","tenantRoute","registerRoute","unused","paymentsRoute","levyRollRoute","dashboardRoute","documentsRoute","complianceRoute","miniSubCompliance","balanceSheetRoute","accountsHistoryRoute","contractorsRollRoute","clearanceCaptureRoute","clearanceRequestRoute","financialSummaryRoute","incomeStatementRoute","personalDocumentsRoute","cashflowStatementRoute","cashflowStatementNewRoute","paymentAuthorisationRoute","rentalsCaptureRoute","auditsCaptureRoute","auditorsDashboardRoute","wagesRollRoute","trusteeRoute","incomeVsBudgetRoute","debtorAgeAnalysisRoute","contractorRoute","_await","intervalPromise","currentlySelectedSchemeReference","addBuildingImagesToArrayOfBuildingProfiles","selectedProfile","arrayOfBuildingProfiles","selectedBuildingObj","awaitedPromise","basicHeaders","cacheName","isLoaderCached","cache","sessionPromise","_intervalPromise","requestsCollection","requestObj","setSchemeRef","oldRequest","_getOldRequest","when","_saveRequest","session","_continueRequest","_removeRequest","responseError","rejection","SessionToken","req","links","oldUserProfile","updatedUserProfile","_fixBDRefTrim","currentUserDetails","ShowPrompt","ProfileId","_notifyLoadingIndicator","sessionResult","profileResult","requestProfile","newPassword","NewPassword","forceRefresh","urlAuthToken","reAuthenticateUser","authenticateUserViaRest","clearanceToken","authenticateUserViaRestWithClearanceToken","rentalsToken","authenticateUserViaRestWithRentalsToken","authenticateUserViaRestWithAuditsToken","auditsResult","authenticateByAuditsToken","credentialToken","pb","authToken","authenticateByToken","AuthToken","clearanceResult","authenticateByClearanceToken","rentalsResult","authenticateByRentalsToken","profileId","WebProfileId","profileResults","tokenString","_unauthenticatedHeader","_mapProfile","mappedProfile","CurrentPasswordCredentialId","DateCreated","IsActiveDirectoryUser","IsAnonymous","loadLinksPromise","linksDeferred","userAuthToken","rightBuilding","buildingClaim","Errors","userRole","paymentsAllowed","savedIsHome","CacheService","deletedQueryStringParameters","queryStringName","deletedParameter","regex","exec","decodeURIComponent","queryStringParameterName","$$compose","cleanedString","sessionProfile","selectedRef","contentUrl","linksUrl","countryList","mappedList","country","countryCode","isAuthenticating","isMobileApp","urls","saveLink","linksToSave","getDefaultSelectedBuildingRef","foundSelectedBuildingRef","selectedBuildingButton","itemValue","mapUser","itemsToBeCleared","isBusySettingLocalUserObjects","hasLocalUserObjectsBeenSet","isBusyActivating","hasActivated","again","logoutUser","schemeLogin","getClearanceInfo","getRentalsInfo","getAuditsInfo","getAuditorsInfo","getResetPasswordInfo","unsubscribeToMonthlyFinancialDoc","checkValidProfile","gotoTab","toState","toParams","fromState","fromParams","profileIsNotValid","allClaims","flatMap","logout","impersonateUser","getTokenAndAuthUser","retries","promptForNewPassword","isDone","tabToShow","queryStringBuildingRef","shouldLogOut","oldSession","lastLogin","isInvalidOldToken","authorizeClearanceToken","clearanceCorrelationId","authorizeRentalsToken","rentalsCorrelationId","authorizeAuditsToken","auditsCorrelationId","auditorsToken","auditorsCorrelationId","shouldUnsubscribeToMonthlyFinancialDocs","speed","scrollSpeed","telemetryLog","buildingUnitList","getFriendlyUnitNamesStringArray","stringCardCodes","_cardCodesToString","unitsWithDistinctBuildings","allUserUnits","UtilityService","loadingDocumentImage","oldRef","newRef","fileUrl","isString","formatedDateString","queryString","foundQueryString","guid","ext","baseAddress","fn","$$phase","$root","$apply"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc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AR,EAAkBG,SAAlB,EAA6B43F,WAA7B,EAA0Cz3F,mBAA1C,EAA+D4Q,oBAA/D;AAAA,QAC9B,IAAI+1F,cAAJ,CAAmBh2F,KAAnB,EAA0BjR,QAA1B,EAAoCG,SAApC,EAA+C43F,WAA/C,EAA4Dz3F,mBAA5D,EAAiF4Q,oBAAjF,CAD8B;AAAA,CAA/B,G;;;;;;;;;;;;AChQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAC+E;AAC5B;AACT;AACnC;AACP;AACA,IAAI,SAAI;AACR;AACO;AACA;AACA;AACA;AACA;AACA;AACP;AACA;AACO,iBAAiB;AACxB;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,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,8BAA8B,kBAAkB;AAChD,0CAA0C,sCAAsC;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACO,wCAAwC,6CAA6C;AAC5F;AACO,cAAc,kDAAK;AACnB;AACP;AACA;AACA;AACA;AACA;AACA;AACO,iBAAiB,kDAAK;AACtB;AACP;AACA;AACA;AACA;AACA;AACA;AACO,aAAa,kDAAK;AAClB;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,8CAA8C;AAC9C,8CAA8C;AAC9C;AACA;AACO,oCAAoC,2BAA2B;AACtE;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACO;AACP;AACA,gBAAgB,gDAAG;AACnB,qCAAqC,qCAAqC,EAAE,IAAI;AAChF;AACA;AACA;AACA;AACO;AACP,2BAA2B,iDAAI;AAC/B;AACA;AACO;AACP,cAAc,2DAAO;AACrB,qCAAqC,uBAAuB,EAAE,sBAAsB,0BAA0B;AAC9G;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACO;AACP;AACO;AACP,wBAAwB,2DAAO,sBAAsB;AACrD,4CAA4C,wCAAwC,EAAE;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,0BAA0B;AAC1B;AACA;AACO,6BAA6B,6CAA6C,iBAAiB,EAAE,EAAE;AACtG;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,+BAA+B;AAC/B;AACA;AACA,+BAA+B;AAC/B;AACA;AACO,sCAAsC,qBAAqB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,+BAA+B;AAC/B;AACA;AACO,sCAAsC,qBAAqB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,qCAAqC,0BAA0B;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,2DAAO;AAClB;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO,mCAAmC,wDAAwD;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,6BAA6B,gCAAgC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,8BAA8B,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,kEAAkE;AAClE;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP,4BAA4B,2BAA2B;AACvD;AACA;AACA;AACA,4BAA4B,8DAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,wBAAwB;AAClC;AACA;AACO,4BAA4B,6CAA6C,wBAAwB,EAAE,EAAE;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,8BAA8B;AAC9B;AACA;AACO;AACP;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA,uDAAuD,kCAAkC,EAAE,oBAAoB;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,iBAAiB,EAAE;AAC1E;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E;AAC3E,qBAAqB;AACrB;AACA;AACA,+CAA+C;AAC/C,qBAAqB;AACrB;AACA;AACO;AACP;AACA,QAAQ,2DAAO;AACf;AACA,SAAS,4DAAQ;AACjB;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA,kDAAkD,yBAAyB,EAAE;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2DAAO;AACf;AACA,6CAA6C,0BAA0B,EAAE;AACzE;AACO;AACP,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,QAAQ,gDAAG,CAAC,mDAAO;AACnB;AACA,QAAQ,gDAAG,CAAC,kDAAM;AAClB;AACA,QAAQ,gDAAG,CAAC,oDAAQ;AACpB;AACA,QAAQ,gDAAG,CAAC,sDAAU;AACtB,oBAAoB;AACpB,sBAAsB,sDAAU,EAAE,mDAAO,EAAE,kDAAM,EAAE,oDAAQ;AAC3D,uBAAuB,wCAAG,2BAA2B,uBAAuB,EAAE;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,iCAAiC,EAAE;AAC1F;AACA;AACO,mDAAmD,oCAAoC,UAAU,EAAE,aAAa;AAChH,wCAAwC,iCAAiC,sDAAQ,mBAAmB;AAC3G,kC;;;;;;;;;;;;;ACjhBA;AAAA;AAAA;AAAA,gCAAgC;AAChC;AACA,EAAE;AACK;AACP,+CAA+C,+DAA+D,EAAE,IAAI;AACpH;AACA;AACA;AACA;AACA;AACoB;AACpB,wC;;;;;;;;;;;;ACXA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACe;AAChB,gC;;;;;;;;;;;;AC/EA;AAAA;AAAA;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,gCAAgC;AAChC;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACO,4BAA4B,wBAAwB,yBAAyB,GAAG;AACvF;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACO,+CAA+C,kCAAkC,EAAE;AAC1F;AACA;AACA,cAAc,oBAAoB,wBAAwB;AAC1D;AACA;AACA;AACA;AACA;AACO,6BAA6B,oDAAoD;AACxF;AACA;AACA;AACA;AACO,yBAAyB;AAChC;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACO;AACP;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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;AACA;AACA;AACO,gBAAgB,gDAAG,WAAW,iDAAI,CAAC,iDAAI;AAC9C,sC;;;;;;;;;;;;ACxCA;AAAA;AAAA;AAAA;AACkC;AAClC;AACA;AACA,gCAAgC,aAAa;AAC7C,gCAAgC,eAAe;AAC/C;AACA;AACA;AACA,uBAAuB,sDAAM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,iBAAiB,EAAE;AACvE;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,CAAC;AACgB;AACjB,iC;;;;;;;;;;;;ACjDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACqH;AAC7D;AACP;AACZ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA,4CAA4C,yBAAyB,EAAE;AACvE,4CAA4C,+BAA+B,EAAE,EAAE;AAC/E;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,cAAc,2DAAO;AACrB;AACA;AACA,kBAAkB,mEAAS;AAC3B;AACA,WAAW,4DAAQ,UAAU,2DAAO,uCAAuC,8DAAU;AACrF;AACA,uBAAuB,oDAAO;AAC9B,KAAK,uDAAW,EAAE,gDAAG;AACrB,KAAK,kDAAM,EAAE,gDAAG;AAChB,KAAK,qDAAS,EAAE,gDAAG;AACnB,gCAAgC,0CAA0C,EAAE;AAC5E,gCAAgC,qBAAqB,EAAE;AACvD,KAAK,wDAAY;AACjB,KAAK,gDAAG,QAAQ,gDAAQ;AACxB;AACO;AACP;AACA;AACA,YAAY,4DAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+DAAW;AACnB;AACA;AACA;AACA;AACA;AACA,oDAAoD,sBAAsB,EAAE;AAC5E;AACA;AACO,yCAAyC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACK;AACA,2CAA2C,oCAAoC;AAC/E;AACA;AACA;AACA,kCAAkC,2CAA2C;AACpF;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,2BAA2B;AAC3B;AACA;AACO;AACP;AACA,2BAA2B,6BAA6B,gDAAQ,EAAE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,4DAAQ,CAAC,oDAAI,UAAU,4DAAQ;AACvC,uCAAuC,oDAAI;AAC3C,WAAW,qDAAK;AAChB;AACA,mC;;;;;;;;;;;;ACvIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACsC;AACsB;AACkB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mEAAQ;AACnB;AACA;AACA;AACA;AACA,mBAAmB,qEAAU;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AACT;AACpB;AACA,WAAW,yDAAK;AAChB;AACA,WAAW,yDAAK;AAChB;AACA,iCAAiC,yDAAyD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB,EAAE;AAC7D,sCAAsC,kBAAkB,EAAE;AAC1D,qCAAqC,sBAAsB,EAAE;AAC7D;AACA,mEAAmE,6CAA6C,EAAE;AAClH;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,0DAAS;AAClE;AACA;AACA;AACA;AACA;AACA,yDAAyD,0DAAS;AAClE;AACA;AACA;AACA;AACA;AACA,oBAAoB,yDAAK,yDAAyD,yDAAK,6CAA6C,yDAAK,oDAAoD,iEAAgB;AAC7M,+FAA+F,0DAAS;AACxG;AACA;AACA;AACA;AACA;AACA,iEAAiE,0DAAS,MAAM,0DAAS;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,0DAAS,MAAM,0DAAS;AACvH;AACA;AACA;AACA;AACA;AACA,yDAAyD,0DAAS;AAClE;AACA;AACA;AACA;AACA;AACA,yDAAyD,0DAAS;AAClE;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C;AACA;AACA,kCAAkC,0DAAS;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,0DAAS;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,SAAS;AACT,mCAAmC,+DAA+D,EAAE;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACgB;AACjB;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACiB;AACjB,iC;;;;;;;;;;;;ACrPA;AAAA;AAAA;AAAA;AAAA;AACmD;AACZ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,+DAAW;AACrC;AACA;AACA;AACA,qCAAqC,mDAAK;AAC1C;AACA,yCAAyC,mDAAK;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC0B;AAC3B,mC;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACsD;AACjB;AACG;AACoB;AAC5D;AACA,wBAAwB,mDAAU,UAAU,gDAAQ;AACpD,wBAAwB,mDAAU,UAAU,iEAAU;AACtD,wBAAwB,mDAAU;AAClC,wBAAwB,mDAAU;AAClC;AACA,4BAA4B,mDAAU;AACtC,KAAK;AACL;AACO;AACP,wCAAwC;AACxC;AACA,yCAAyC,iEAAU;AACnD,mBAAmB,uDAAO;AAC1B;AACA;AACA;AACA;AACO;AACP,gBAAgB,sDAAM;AACtB,gBAAgB,+CAAO;AACvB,gBAAgB,6CAAK;AACrB;AACA;AACA,uCAAuC,mDAAU;AACjD;AACA;AACA;AACA,KAAK;AACL;AACA,2C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAAA;AAAA;AACwC;AACgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,mDAAK;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mEAAS;AACpB;AACO;AACP,wCAAwC,gBAAgB,kBAAkB;AAC1E;AACA,6C;;;;;;;;;;;;AC5BA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,wCAAwC,0BAA0B,mBAAmB;AACrF;AACA,6C;;;;;;;;;;;;AChBA;AAAA;AAAA;AAAA;AAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;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,kCAAkC,mCAAmC,EAAE;AACvE,+BAA+B,yCAAyC,EAAE;AAC1E,WAAW,6DAAQ;AACnB;AACO;AACP,uCAAuC,6BAA6B,yBAAyB,EAAE,EAAE;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,6DAAQ;AAC3B;AACA,2CAA2C,6DAAQ;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,yDAAyD,EAAE;AAChH;AACA;AACA;AACA;AACA;AACA,oC;;;;;;;;;;;;AC9FA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,qCAAqC,cAAc;AAClG;AACA;AACA;AACA;AACO;AACP,qCAAqC,4BAA4B,uBAAuB,EAAE,EAAE;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,wCAAwC,gBAAgB;AACzG;AACA;AACA;AACA;AACO;AACP,uCAAuC,6BAA6B,yBAAyB,EAAE,EAAE;AACjG;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,uCAAuC,eAAe;AACtG;AACA;AACA;AACA;AACO;AACP,sCAAsC,6BAA6B,wBAAwB,EAAE,EAAE;AAC/F;AACA,6C;;;;;;;;;;;;ACtDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC4D;AACV;AACC;AACnD;AACA;AACA;AACA,gDAAgD,oCAAoC,gBAAgB;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,8DAAW;AACzC;AACA,YAAY,mEAAQ;AACpB;AACA;AACA;AACA;AACA,QAAQ,qEAAU;AAClB,eAAe,6DAAQ;AACvB;AACA;AACA;AACO;AACP,sCAAsC,uBAAuB,2BAA2B,EAAE,EAAE;AAC5F;AACA,sC;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACwC;AACmB;AACvB;AAC7B;AACP;AACA;AACA;AACA,iDAAiD,qBAAqB,iBAAiB,EAAE;AACzF;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sEAAc,0DAA0D,mDAAI;AAC3F;AACO;AACP,uCAAuC,qBAAqB,kCAAkC;AAC9F;AACA;AACA;AACA;AACA,gDAAgD,uBAAuB,qBAAqB,iBAAiB,EAAE;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sEAAc;AAC7B;AACA;AACA,cAAc,mDAAI;AAClB;AACO;AACP,sCAAsC,WAAW,uDAAG,QAAQ,qBAAqB,kCAAkC;AACnH;AACA;AACA;AACA;AACA,kDAAkD,qBAAqB,iBAAiB,EAAE;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sEAAc,yDAAyD,mDAAI;AAC1F;AACO;AACP,wCAAwC,qBAAqB,kCAAkC;AAC/F;AACA,mC;;;;;;;;;;;;ACtDA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA,kDAAkD,qBAAqB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2DAAI;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,yBAAyB,kBAAkB;AACjE;AACA;AACO;AACP,wCAAwC;AACxC;AACA,yC;;;;;;;;;;;;AChCA;AAAA;AAAA;AACA;AACA;AACA,mDAAmD,aAAa;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACO;AACP,yCAAyC,cAAc,iBAAiB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;AAAA;AAAA;AAC+B;AACA;AACF;AACG;AACF;AACK;AACP;AACC;AACH;AACD;AACC;AACE;AAC5B,iC;;;;;;;;;;;;ACbA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA,CAAC;AAC6B;AAC9B,qC;;;;;;;;;;;;AChBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAwB;AACK;AACC;AACF;AAC5B,iC;;;;;;;;;;;;ACJA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACuE;AAClC;AAC0D;AAC7C;AACV;AACxC;AACA;AACA;AACA;AACA,uFAAuF;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0BAA0B;AACR;AACnB;AACA;AACA;AACA,kBAAkB,2DAAI,oCAAoC,4DAAS;AACnE,wBAAwB,oEAAS,aAAa,mBAAmB;AACjE;AACA,WAAW,6DAAM;AACjB;AACA;AACA;AACA,8BAA8B,aAAa;AAC3C;AACA;AACA;AACA;AACA,eAAe,uEAAY;AAC3B,WAAW,6DAAM,OAAO,aAAa;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oDAAS;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oEAAS;AAClB;AACA,2BAA2B,mEAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yDAAyD;AAClE,SAAS,2DAA2D;AACpE;AACA,kBAAkB,kEAAO;AACzB,QAAQ,mEAAQ;AAChB,sBAAsB,8BAA8B;AACpD,yBAAyB,0DAAG,UAAU,wDAAI;AAC1C,WAAW,6DAAM,iCAAiC,iDAAiD,EAAE;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,oEAAS;AAC/B,kBAAkB,oEAAS;AAC3B;AACA;AACA,sBAAsB,oEAAS;AAC/B;AACA;AACA,iCAAiC;AACjC,8DAA8D,cAAc;AAC5E,mBAAmB,6DAAM;AACzB;AACA,QAAQ,6DAAM,QAAQ,mLAAmL;AACzM;AACA;AACA,gCAAgC,aAAa;AAC7C;AACA,2CAA2C,sBAAsB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,iCAAiC,cAAc;AAC/C,+CAA+C,iEAAiE,EAAE;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA,gCAAgC,aAAa;AAC7C,4CAA4C,0CAA0C,EAAE,SAAS,uDAAQ;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6DAAQ;AACzB;AACA,+BAA+B,6DAAQ;AACvC;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,gDAAgD,gBAAgB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sEAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sEAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,mEAAQ;AACzB;AACA;AACA,iBAAiB,wGAAwG;AACzH;AACA;AACA,CAAC;AACgB;AACjB,iC;;;;;;;;;;;;AC9MA;AAAA;AAAA;AAAA;AAAA;AACuD;AACG;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,0BAA0B,EAAE;AACxD,4BAA4B,8BAA8B,EAAE;AAC5D,6BAA6B,8BAA8B,EAAE;AAC7D,wBAAwB,gEAAgE,EAAE;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4BAA4B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACoB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kEAAO,cAAc,oEAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kEAAO;AACvB;AACA;AACA,yBAAyB,0DAAG;AAC5B,4CAA4C,6DAAM,uBAAuB,WAAW,EAAE;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,IAAI,6DAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,qC;;;;;;;;;;;;ACpJA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACkG;AAC9B;AACjC;AACe;AACV;AACxC;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,4BAA4B,2DAAI;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,YAAY,oDAAS,CAAC,6DAAM,EAAE,aAAa,eAAe;AAC9G,qBAAqB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AAAA;AACqD;AACrD;AACA;AACA;AACA,gCAAgC,aAAa;AAC7C,QAAQ,6DAAM;AACd;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA,sBAAsB,gEAAS,+BAA+B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAAM,GAAG;AACxB;AACA;AACA,CAAC;AACsB;AACvB,uC;;;;;;;;;;;;ACrCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC2B;AACC;AAC5B,iC;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC4D;AACrB;AACC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,6DAAM,GAAG;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA,qEAAqE,oBAAoB,EAAE;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,2DAA2D;AAC1G,0EAA0E,QAAQ,iEAAU,0BAA0B,EAAE,IAAI;AAC5H;AACA;AACA;AACA;AACA,eAAe,2DAAI,mBAAmB,0DAAM;AAC5C;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,eAAe,mDAAK;AACpB;AACA;AACA;AACA;AACA;AACA,sCAAsC,qBAAqB;AAC3D;AACA,CAAC;AACmB;AACpB,oC;;;;;;;;;;;;AC5EA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACkH;AACrE;AACM;AACb;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,2DAAI;AACxB,mBAAmB,8DAAW,2BAA2B,wDAAI,wBAAwB,qDAAM,IAAI,KAAK;AACpG;AACA;AACA;AACA,+DAA+D,YAAY,kDAAQ,iCAAiC,EAAE;AACtH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,QAAQ,8DAAO,qBAAqB,EAAE;AAC3E;AACA,4BAA4B,6DAAM,uBAAuB;AACzD,gEAAgE,mBAAmB,EAAE;AACrF,6DAA6D,8CAA8C,EAAE;AAC7G,4CAA4C,sDAAO;AACnD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,aAAa;AAC7C;AACA,uBAAuB,2DAAI,OAAO,0DAAM;AACxC,mBAAmB,6DAAM,GAAG;AAC5B;AACA;AACA,kCAAkC,yBAAyB,EAAE;AAC7D,oBAAoB,sDAAO;AAC3B,sCAAsC,uBAAuB,EAAE;AAC/D,iBAAiB,wDAAI;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6DAAM,GAAG;AACvC;AACA,oCAAoC,2DAAI;AACxC,0BAA0B,2DAAI;AAC9B,gCAAgC,2DAAI,4CAA4C;AAChF;AACA,+BAA+B,6DAAM;AACrC,uBAAuB,kDAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,wDAAwD;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kEAAW;AAChC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAI;AACvB;AACA;AACA;AACA;AACA,sCAAsC,iBAAiB,2BAA2B,uBAAuB,EAAE;AAC3G;AACA;AACA,6CAA6C,0CAA0C,QAAQ,6DAAM,wBAAwB,EAAE,IAAI,EAAE;AACrI;AACA,CAAC;AACoB;AACrB,qC;;;;;;;;;;;;ACxKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC4B;AACC;AACI;AACjC,iC;;;;;;;;;;;;ACJA;AAAA;AAAA;AACO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,qC;;;;;;;;;;;;ACZA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACoD;AACF;AACV;AACM;AACc;AACH;AACzD;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAM;AAClB;AACA,iBAAiB,qEAAU;AAC3B,gBAAgB,4EAAiB;AACjC;AACA,iBAAiB,qEAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6DAAQ;AACnD;AACA,iBAAiB,mEAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6DAAQ;AACzB;AACA;AACA,2FAA2F,8CAA8C,EAAE;AAC3I;AACA;AACA,uDAAuD,kDAAkD;AACzG;AACA;AACA;AACA;AACA,gCAAgC,qEAAU,8BAA8B,uDAAQ;AAChF;AACA;AACA;AACA;AACA;AACA,YAAY,mDAAK;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,iEAAS,+CAA+C,yDAAS;AACvG;AACA;AACA;AACA;AACA,kDAAkD,2CAA2C,aAAa,EAAE,oBAAoB;AAChI;AACA,CAAC;AACqB;AACtB,sC;;;;;;;;;;;;ACjHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACuE;AAC3B;AACJ;AACU;AACJ;AACJ;AACI;AACA;AACN;AACxC,YAAY,0DAAe;AAC3B;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,sDAAsD,gBAAgB,EAAE,GAAG,EAAE,aAAa,oDAAK;AACtJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,yBAAyB,EAAE;AAC7D,oBAAoB,sDAAO;AAC3B,kCAAkC,0BAA0B,EAAE;AAC9D,eAAe,2DAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,yDAAS,sCAAsC,6BAA6B,EAAE;AAChH;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAI,aAAa,0DAAM;AAC1C,oDAAoD,gBAAgB,EAAE;AACtE,iEAAiE,qCAAqC,EAAE;AACxG;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,8BAA8B,eAAe;AAC7C;AACA,yBAAyB,8DAAO;AAChC;AACA;AACA,0CAA0C,0DAAe;AACzD;AACA,QAAQ,mDAAK;AACb,kEAAkE;AAClE,mBAAmB,8DAAO;AAC1B,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,8CAA8C,uDAAG;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,UAAU,+BAA+B,EAAE,EAAE;AACzF;AACA;AACA;AACA,SAAS;AACT;AACA,eAAe,6DAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,eAAe,2DAAI,8BAA8B,QAAQ,8DAAO,+BAA+B,EAAE;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,yDAAS,mCAAmC,mBAAmB,EAAE;AACvF;AACA,2CAA2C,sCAAsC,EAAE;AACnF,oCAAoC,2BAA2B,EAAE,EAAE;AACnE;AACA,qEAAqE,0BAA0B,EAAE;AACjG;AACA,uBAAuB,2DAAI;AAC3B;AACA,gBAAgB,2DAAW;AAC3B,gFAAgF,iEAAS;AACzF;AACA,uBAAuB,sDAAU,qBAAqB,qBAAqB,EAAE;AAC7E;AACA;AACA;AACA;AACA,CAAC;AACyB;AAC1B;AACA;AACA;AACA;AACA,yDAAyD,6DAAQ;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,iEAAS;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,0C;;;;;;;;;;;;AC1MA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC4D;AAChB;AACuB;AACzB;AACY;AACF;AACR;AACS;AACJ;AACH;AACP;AACH;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,yDAAQ;AAClC;AACA,yBAAyB,yDAAQ;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,uCAAuC;AAChF,wCAAwC,qCAAqC;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oDAAK;AAC1B;AACA,+BAA+B,sDAAW;AAC1C;AACA,2BAA2B,wDAAe;AAC1C;AACA,qCAAqC,+EAAiB;AACtD;AACA;AACA;AACA;AACA,qCAAqC,wEAAiB;AACtD;AACA;AACA;AACA;AACA,6BAA6B,wDAAS;AACtC;AACA,8BAA8B,0DAAU;AACxC;AACA,iCAAiC,kEAAa;AAC9C;AACA,gCAAgC,gEAAY;AAC5C;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,0BAA0B,qEAAU;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iEAAU;AAC1B;AACA,6BAA6B;AAC7B,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;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;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,6DAAM;AAC9D;AACA;AACA,CAAC;AACmB;AACpB,kC;;;;;;;;;;;;AC3LA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA+B;AACD;AACC;AACK;AACJ;AACD;AACD;AAC9B,iC;;;;;;;;;;;;ACPA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACiH;AACjC;AAClC;AACe;AACV;AACD;AAClD;AACA,SAAS,mEAAQ;AACjB;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,sCAAsC,cAAc;AACpD;AACA;AACA;AACA;AACA,uCAAuC,8DAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAI;AAChB,iCAAiC,cAAc,EAAE;AACjD;AACA;AACA;AACA;AACA,2FAA2F,kBAAkB;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,sDAAsD;AAC3G,4DAA4D,iBAAiB;AAC7E,2BAA2B,6DAAM,CAAC,6DAAM,CAAC,2DAAI,mBAAmB,gBAAgB,wDAAI;AACpF;AACA;AACA,+BAA+B,kBAAkB,EAAE;AACnD,oBAAoB,yDAAU,IAAI;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,6DAAM,GAAG;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oBAAoB,EAAE;AACrD;AACA;AACA,6CAA6C,kDAAkD;AAC/F;AACA,oBAAoB;AACpB,sDAAsD,uCAAuC;AAC7F;AACA,oBAAoB;AACpB,oDAAoD,sCAAsC;AAC1F;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,qBAAqB;AACrE,mDAAmD,uCAAuC;AAC1F,MAAM,qDAAqD,gCAAgC;AAC3F;AACA;AACO;AACP,2BAA2B,sBAAsB;AACjD;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA,SAAS,EAAE,EAAE;AACb;AACA;AACA;AACA,wBAAwB,6DAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,uCAAuC;AAClF;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,mEAAQ,aAAa,kEAAO,aAAa,qEAAU;AACxF;AACA;AACA,iCAAiC,6BAA6B;AAC9D;AACA,6BAA6B,2DAAO;AACpC,SAAS,wDAAI,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ACA;AACA;AACA,4BAA4B,qEAAqE;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,2BAA2B,+BAA+B,GAAG,EAAE,EAAE,mDAAI;AAC7I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mEAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,yBAAyB,mEAAQ;AACjC;AACA;AACA;AACA,CAAC;AACuB;AACxB,wC;;;;;;;;;;;;AC/RA;AAAA;AAAA;AAAA;AAAA;AACgD;AACN;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,kBAAkB;AACrD;AACA;AACA,oBAAoB,mEAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,6DAAM;AAChC,4DAA4D,+FAA+F,EAAE;AAC7J;AACA;AACA,qIAAqI,mBAAmB,EAAE;AAC1J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gBAAgB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACuB;AACxB,wC;;;;;;;;;;;;AC5DA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmE;AAC5B;AACD;AACsB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA,oBAAoB,8DAAO,CAAC,8DAAO;AACnC,yCAAyC,cAAc;AACvD;AACA;AACA,sBAAsB,iDAAI;AAC1B;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;AACA;AACA;AACA;AACA;AACA,eAAe,+DAAQ,QAAQ,oCAAoC;AACnE;AACA;AACA,oBAAoB,6DAAM;AAC1B,sCAAsC,yEAAyE,EAAE;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,WAAW;AACzC;AACA,YAAY,2DAAI,CAAC,6DAAM,eAAe,0DAAM;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qEAAU;AACzB;AACA;AACA,0CAA0C,QAAQ,mEAAQ,4BAA4B;AACtF;AACA,CAAC;AACsB;AACvB,uC;;;;;;;;;;;;AC9GA;AAAA;AAAA;AAAA;AAAA;AACoD;AACR;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wDAAW;AAC/B;AACA,aAAa,wDAAQ;AACrB;AACA,gDAAgD,uDAAO,WAAW,oDAAI;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,wCAAwC,gEAAgE;AACxG;AACA;AACA,6DAA6D,4DAA4D,eAAe,EAAE,GAAG,EAAE;AAC/I;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,sEAAsE,KAAK;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC4B;AAC7B,6C;;;;;;;;;;;;ACxFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC8C;AACA;AACU;AACV;AACP;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,0DAAY;AACvC,2BAA2B,0DAAY;AACvC,8BAA8B,oEAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2CAA2C;AACjE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,oDAAoD,EAAE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iEAAU;AACtB,SAAS;AACT;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,+CAA+C,oBAAoB,EAAE;AACrE;AACA,qDAAqD,wCAAwC,EAAE;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0DAAM;AAC9B,0CAA0C,kCAAkC,EAAE;AAC9E;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA,oDAAoD,sEAAsE,eAAe,EAAE,GAAG,EAAE;AAChJ;AACA;AACA;AACA;AACA;AACA,iEAAiE,gCAAgC,EAAE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACwB;AACzB,yC;;;;;;;;;;;;ACzJA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACiJ;AAC5E;AAC7B;AACU;AACJ;AACF;AACuB;AACC;AACxB;AACJ;AACF;AACqB;AACT;AACT;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,mEAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,wDAAG,CAAC,8DAAO;AAC7E,QAAQ,2EAAoB,CAAC,wDAAG,gCAAgC,wDAAG;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,iCAAiC,mDAAI;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,yDAAS;AACjC;AACA,uCAAuC,6CAA6C;AACpF;AACA,gCAAgC,mDAAK;AACrC,2BAA2B,uEAAc;AACzC;AACA,oCAAoC,wDAAW;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mEAAS;AAChC;AACA;AACA,uBAAuB,mEAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mEAAS;AAChC,iCAAiC,6DAAQ;AACzC,iFAAiF,uCAAuC,EAAE;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iEAAU;AACtB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oEAAS;AAC7B;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iFAAiF;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA,4BAA4B;AAC5B,wBAAwB,+DAAQ,wBAAwB,8EAAgB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA,YAAY,mEAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,wDAAwD,mEAAQ;AAChE,mBAAmB,wDAAW;AAC9B;AACA;AACA;AACA;AACA;AACA,oCAAoC,aAAa,uDAAQ,qCAAqC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,eAAe;AACjD,iCAAiC,cAAc;AAC/C;AACA;AACA,kBAAkB,+DAAQ,UAAU,8EAAgB;AACpD,sCAAsC,2BAA2B;AACjE,kBAAkB,6DAAM,WAAW,sBAAsB;AACzD;AACA;AACA;AACA;AACA;AACA,mBAAmB,sEAAe;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D;AAC1D,iCAAiC,mEAAS;AAC1C;AACA,mCAAmC,oEAAU;AAC7C;AACA;AACA,2BAA2B,6DAAQ;AACnC;AACA;AACA,mCAAmC,oEAAU,qDAAqD,wDAAW;AAC7G;AACA;AACA;AACA;AACA;AACA,mCAAmC,oEAAU;AAC7C;AACA,2BAA2B,6DAAQ;AACnC;AACA;AACA;AACA;AACA,mBAAmB,6DAAQ;AAC3B,UAAU;AACV;AACA;AACA,QAAQ,+EAAwB,sBAAsB;AACtD;AACA,eAAe,6DAAM,uBAAuB,yBAAyB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA,uBAAuB,gCAAgC;AACvD;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,+DAAQ,WAAW,0BAA0B;AAC/D;AACA,aAAa,oEAAS;AACtB;AACA;AACA;AACA;AACA;AACA,uCAAuC,sCAAsC;AAC7E,eAAe,mDAAK,gBAAgB,mDAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC,2CAA2C;AAC3C,gDAAgD;AAChD,wCAAwC;AACxC,gCAAgC;AAChC;AACA;AACA;AACA;AACA,wCAAwC;AACxC,uCAAuC;AACvC,qCAAqC;AACrC,6CAA6C;AAC7C,0CAA0C;AAC1C,sCAAsC;AACtC,kCAAkC;AAClC;AACA;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA,kBAAkB,+DAAQ,WAAW,0BAA0B;AAC/D,mBAAmB,mEAAQ,iBAAiB,kDAAI;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,oEAAS;AACtB;AACA,aAAa,oEAAS;AACtB;AACA;AACA;AACA,uCAAuC,sCAAsC;AAC7E,eAAe,mDAAK,gBAAgB,mDAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,gBAAgB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,+DAAQ;AAC1B;AACA;AACA,aAAa,oEAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,6BAA6B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;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,qBAAqB,yDAAS;AAC9B;AACA,eAAe,sEAAa;AAC5B;AACA;AACA,CAAC;AACuB;AACxB,wC;;;;;;;;;;;;ACnjBA;AAAA;AAAA;AAAA;AAAA;AAAA;AACgD;AACF;AACX;AACnC;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sDAAM,GAAG,eAAe;AAC/C,wBAAwB,sDAAM,GAAG,gBAAgB;AACjD;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,iEAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iBAAiB;AAClD,2CAA2C,sDAAM,GAAG;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iBAAiB;AAClD,0CAA0C,sDAAM,GAAG;AACnD;AACA;AACA;AACA,wCAAwC,6BAA6B,mEAAQ,eAAe,mEAAQ,kBAAkB;AACtH;AACA,CAAC;AACsB;AACvB,uC;;;;;;;;;;;;AC7IA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC8E;AAC/B;AACyB;AACtB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,+BAA+B,EAAE;AACnE,oBAAoB,sDAAO;AAC3B,oBAAoB,uDAAQ;AAC5B;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,+BAA+B,6DAAM;AACrC;AACA,gCAAgC,yCAAyC;AACzE,iBAAiB;AACjB,iEAAiE,8DAAmB;AACpF,yCAAyC,8DAAc;AACvD,wBAAwB;AACxB,aAAa;AACb;AACA;AACA;AACA,oBAAoB,sDAAO;AAC3B;AACA,mCAAmC,6BAA6B,EAAE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,8DAAmB;AACjE;AACA;AACA;AACA;AACA,iCAAiC,oCAAoC,EAAE;AACvE,oBAAoB,sEAAe,CAAC,0DAAO;AAC3C,oBAAoB,sDAAO;AAC3B,qCAAqC,8CAA8C,EAAE,EAAE;AACvF;AACA;AACA,CAAC;AACsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,0BAA0B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,uC;;;;;;;;;;;;ACpHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC2G;AAEjE;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACO;AACP,kBAAkB,wDAAQ;AAC1B;AACA;AACA,uBAAuB,wBAAwB;AAC/C,2BAA2B,4CAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,0DAAU;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;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,qDAAqD,sDAAsD,EAAE;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sDAAM,uDAAuD,aAAa,EAAE;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sDAAM;AAC7B,oBAAoB,sDAAM;AAC1B;AACA;AACA;AACA,iDAAiD,8DAAmB;AACpE;AACA,8CAA8C,oDAAI;AAClD;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,sDAAM,gBAAgB,gDAAQ;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACyB;AAC1B;AACO;AACP;AACA,uFAAuF;AACvF;AACA,uBAAuB,0DAAU;AACjC;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,wC;;;;;;;;;;;;ACxJA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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;AAC4B;AACE;AACC;AACC;AACH;AACI;AACK;AACF;AACpC,iC;;;;;;;;;;;;ACpBA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kDAAkD;AACnD;AACA;AACA;AACA;AACA,CAAC,kDAAkD;AACC;AACpD,qC;;;;;;;;;;;;ACdA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACa;AAC8C;AACb;AACX;AACnC;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,CAAC,gCAAgC;AACX;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,sDAAE;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;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,eAAe,sDAAE;AACjB;AACA;AACA,yCAAyC,wEAAwE,iEAAS,KAAK;AAC/H;AACA;AACA;AACA;AACA;AACA,eAAe,6DAAM,CAAC,sEAAe,SAAS,6BAA6B;AAC3E;AACA;AACA,CAAC;AACoB;AACrB,yC;;;;;;;;;;;;ACpHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACwC;AACU;AACJ;AACqE;AACtD;AACF;AACR;AACD;AACK;AACX;AACE;AACN;AACW;AACQ;AACf;AACA;AAC5C;AACA,gBAAgB,wDAAI;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,6DAAQ;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,wDAAW;AAC3C;AACA,qCAAqC,kDAAkD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6DAAM,EAAE,UAAU,uDAAG,QAAQ;AACrD;AACA,qBAAqB,0DAAS;AAC9B,4BAA4B,0DAAS;AACrC;AACA,iEAAiE,8DAAmB;AACpF,QAAQ,8DAAc,yCAAyC,aAAa,EAAE;AAC9E;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;AACA;AACA,qCAAqC,2BAA2B,8DAAmB,QAAQ,EAAE;AAC7F,sCAAsC,QAAQ,+DAAS,8CAA8C,EAAE;AACvG;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,mBAAmB,EAAE;AAClG,QAAQ,0DAAS;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAAI;AACnB;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,4BAA4B,qDAAqD;AACjF;AACA,iCAAiC,gEAAU;AAC3C,8BAA8B,gEAAU;AACxC;AACA;AACA,kCAAkC,iBAAiB;AACnD,6DAA6D,wDAAI,wBAAwB,qDAAM,IAAI;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,6BAA6B,EAAE;AACrE,oBAAoB,iDAAQ;AAC5B,oBAAoB,8CAAK;AACzB,sCAAsC,oDAAK;AAC3C;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,UAAU;AACV,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qBAAqB;AACrC;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD;AACA;AACA,mBAAmB,0DAAS,gCAAgC,0DAA0D,EAAE;AACxH,mBAAmB,uEAAc;AACjC;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,kCAAkC,iBAAiB;AACnD,mBAAmB,uEAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA,UAAU;AACV,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C,qBAAqB,sDAAE,CAAC,+DAAU,iCAAiC,+DAAU;AAC7E;AACA;AACA,yBAAyB,2DAAI,0BAA0B,sCAAsC,EAAE;AAC/F,iCAAiC,uEAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,+BAA+B,UAAU;AACzC,iCAAiC;AACjC,gDAAgD;AAChD,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,6BAA6B;AACvD,0BAA0B,6BAA6B;AACvD,0BAA0B,6BAA6B;AACvD,0BAA0B,YAAY;AACtC;AACA;AACA;AACA,+BAA+B,UAAU;AACzC,iCAAiC;AACjC,kDAAkD;AAClD,oDAAoD;AACpD,sDAAsD;AACtD,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0DAAG,6BAA6B,wDAAI;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0DAAG,4BAA4B,wDAAI;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0DAAG,6BAA6B,wDAAI;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uBAAuB;AACzD;AACA,2CAA2C,0DAAM;AACjD;AACA,iBAAiB,wDAAI;AACrB,oBAAoB,uDAAQ;AAC5B,oBAAoB,sDAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,6DAAM,GAAG;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA,UAAU;AACV;AACA,oCAAoC,0DAAS,wDAAwD,0DAAS,0BAA0B,uDAAG;AAC3I;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,kEAAW;AACrC,mCAAmC,0CAA0C,EAAE;AAC/E,oBAAoB,uDAAQ;AAC5B;AACA;AACA;AACA,qDAAqD,yBAAyB,EAAE;AAChF,uDAAuD,+BAA+B,sBAAsB,EAAE,EAAE,EAAE;AAClH,qBAAqB,kEAAW;AAChC;AACA;AACA,mBAAmB,oDAAK;AACxB,SAAS,SAAS,sDAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,kBAAkB,EAAE,SAAS,uDAAQ;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,0DAAS;AACpC,qEAAqE,+DAA+D,EAAE;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,8DAAc;AACxC;AACA,4CAA4C,qDAAqD;AACjG;AACA;AACA,YAAY,mDAAK;AACjB;AACA;AACA,oCAAoC,8DAAmB;AACvD;AACA;AACA,YAAY,mDAAK;AACjB;AACA;AACA;AACA,oCAAoC,8DAAmB;AACvD;AACA;AACA;AACA;AACA,0CAA0C,8DAAmB;AAC7D,oCAAoC,QAAQ,6DAAQ,oBAAoB;AACxE,mBAAmB,8DAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mDAAK;AACjB,mBAAmB,6DAAQ;AAC3B;AACA,yCAAyC,8DAAmB;AAC5D,QAAQ,8DAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sEAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,yDAAS;AAC5B;AACA;AACA;AACA,+DAA+D,2CAA2C,EAAE;AAC5G;AACA,oEAAoE,+BAA+B,iEAAS,yBAAyB,EAAE;AACvI;AACA,mBAAmB,yDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,2DAAI;AACpF;AACA;AACA,kCAAkC,mEAAQ,yEAAyE,iEAAS,2CAA2C,wDAAI,wBAAwB,qDAAM,IAAI,gDAAgD,mEAAQ,iEAAiE,iEAAS;AAC/U;AACA;AACA;AACA;AACA;AACA,CAAC;AACqB;AACtB,sC;;;;;;;;;;;;ACnqBA;AAAA;AAAA;AAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,qBAAqB;AAC1D,0CAA0C,oBAAoB,8DAAc,eAAe;AAC3F,yCAAyC,mBAAmB,8DAAc,cAAc;AACxF,qCAAqC,qBAAqB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC8B;AAC/B,+C;;;;;;;;;;;;AC1BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACkD;AACiB;AACT;AACT;AACP;AACF;AACU;AACN;AACO;AACnD;AACA,aAAa,mDAAI;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,iCAAiC,8DAAmB,6CAA6C;AAC1I,uBAAuB,+DAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,+BAA+B,8BAA8B,EAAE,EAAE;AAC3H,yDAAyD,6DAAQ;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,oBAAoB;AAC7C;AACA,gBAAgB,oEAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,0BAA0B,EAAE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mDAAK;AACb,0CAA0C,+EAA+E;AACzH,2CAA2C,QAAQ,wDAAS,4BAA4B;AACxF,0CAA0C,mDAAmD;AAC7F,8CAA8C,uDAAuD;AACrG;AACA;AACA,0CAA0C,oEAAS;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,wDAAS;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,oEAAS;AACrB;AACA,+CAA+C,oCAAoC,EAAE;AACrF;AACA,QAAQ,mDAAK;AACb;AACA;AACA;AACA,mBAAmB,wDAAS;AAC5B;AACA,4BAA4B,sDAAE,CAAC,8DAAW;AAC1C;AACA;AACA;AACA,mBAAmB,wDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAS;AAC5B;AACA;AACA,mBAAmB,wDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAS;AAC5B;AACA;AACA;AACA;AACA,oBAAoB,yDAAK,yDAAyD,yDAAK,6CAA6C,yDAAK,oDAAoD,kEAAU;AACvM,uDAAuD,iEAAS;AAChE;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,0DAA0D;AAC1D,QAAQ,oEAAS,yCAAyC,sBAAsB,wDAAS,iBAAiB,EAAE;AAC5G;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,gDAAgD,0BAA0B,6BAA6B,GAAG;AAC1G,mDAAmD,0BAA0B,QAAQ,sEAAe,QAAQ,GAAG;AAC/G,kDAAkD;AAClD;AACA,MAAM;AACN;AACA,CAAC;AACyB;AAC1B,0C;;;;;;;;;;;;ACtMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACwE;AAC9B;AACC;AAC+C;AAC7B;AAC8C;AACK;AAC9B;AACf;AAClB;AACQ;AACG;AACV;AACD;AAC2B;AACxC;AACuC;AACA;AAC3E;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,0BAA0B,aAAa,EAAE;AACzC;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,2BAA2B,4EAAoB,CAAC,wDAAG,UAAU,EAAE,wDAAG;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,yEAAkB;AACxE;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAM;AACd;AACA;AACA,gBAAgB,kEAAU;AAC1B,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sDAAU;AAC7B;AACA;AACA;AACA,oBAAoB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;AACxC,iC;;;;;;;;;;;;ACPA;AAAA;AAAA;AAAA;AAAuC;AACS;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,kDAAU;AACvD;AACA;AACA;AACA,wDAAwD,mCAAmC;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,+CAA+C;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,0DAA0D;AAC1G;AACA;AACA;AACA;AACA;AACA,iCAAiC,2CAA2C;AAC5E;AACA;AACA;AACA;AACA;AACA,sCAAsC,gDAAgD;AACtF;AACA;AACA;AACA;AACA;AACA,iCAAiC,2CAA2C;AAC5E;AACA;AACA;AACA;AACA;AACA,qCAAqC,+CAA+C;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA,0CAA0C,yDAAS;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yDAAS,iDAAiD,wDAAQ;AAC9E;AACA,4CAA4C,yDAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,yDAAS;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,yDAAS;AACzB;AACA;AACA,CAAC;AACoB;AACrB,qC;;;;;;;;;;;;AC3JA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC8G;AACjE;AACuB;AACnB;AACgB;AAC5B;AACrC;AACA;AACA,6EAA6E;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,0CAA0C;AACrF;AACA,mBAAmB,oEAAY;AAC/B;AACA;AACA,YAAY,WAAW,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,MAAM;AACrF;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA,+EAA+E,UAAU;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,GAAG;AACjB,cAAc,SAAS;AACvB,cAAc,eAAe,KAAK;AAClC;AACA,eAAe,QAAQ;AACvB;AACA;AACA,kBAAkB,WAAW;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,wDAAQ;AACvC;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,oBAAoB;AACnC;AACA;AACA;AACA,gBAAgB,8BAA8B;AAC9C;AACA,kBAAkB;AAClB;AACA,gBAAgB,OAAO,YAAY;AACnC,+CAA+C,2BAA2B,WAAW,OAAO,YAAY,OAAO;AAC/G,uDAAuD,6BAA6B,WAAW,OAAO,YAAY,OAAO;AACzH;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2DAAI,gBAAgB,0DAAM;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,8DAAO;AAC9B;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,4CAA4C,2DAAI;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,0CAA0C,EAAE;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,8DAA8D,uBAAuB,qDAAO,MAAM,EAAE;AACpG,eAAe,kEAAW;AAC1B,oBAAoB,sDAAO;AAC3B,kCAAkC,oBAAoB,oEAAS,IAAI,EAAE;AACrE;AACA;AACA;AACA,oDAAoD,uBAAuB,qDAAO,QAAQ,EAAE;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sDAAO;AACvC,gCAAgC,8DAAc;AAC9C,2CAA2C,SAAS,mEAAQ,2BAA2B,EAAE;AACzF,gCAAgC,sDAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mEAAQ;AACpC;AACA,+CAA+C,mDAAK;AACpD;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kEAAW;AAChC;AACA,mBAAmB,mBAAmB;AACtC;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;AACA;AACA;AACA,8BAA8B,GAAG;AACjC;AACA,QAAQ;AACR,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,aAAa;AAC7C,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA,gBAAgB,6DAAM,uBAAuB,wDAAI;AACjD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,wCAAwC,iBAAiB;AACzD,2FAA2F,0BAA0B,EAAE,qDAAqD,yBAAyB,EAAE,yDAAyD,kCAAkC,EAAE,0BAA0B,cAAc,EAAE;AAC9U;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,iCAAiC;AACjF;AACA,8BAA8B,0DAAG;AACjC,mBAAmB,0DAAG;AACtB;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA,2BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA;AACA,gBAAgB,oEAAS;AACzB;AACA;AACA;AACA;AACA;AACA,2BAA2B,0BAA0B;AACrD;AACA;AACA;AACA,gBAAgB,oEAAS;AACzB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA,8BAA8B,WAAW;AACzC;AACA;AACA,eAAe,6DAAM,0CAA0C,wBAAwB,EAAE;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC;AACA,gDAAgD,gBAAgB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,uCAAuC;AAC1F;AACA;AACA,wEAAwE,2CAA2C,EAAE;AACrH,oDAAoD,qDAAqD,EAAE,SAAS,uDAAQ;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,GAAG,aAAa,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,aAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,sDAAO;AAC3B,+BAA+B,SAAS,mEAAQ,yBAAyB,EAAE;AAC3E;AACA;AACA;AACA,oBAAoB,sDAAO;AAC3B;AACA,0CAA0C,gCAAgC;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,8DAA8D;AAC9D,gBAAgB,mEAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mEAAQ;AACxB;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,gBAAgB,kEAAO;AACvB,6BAA6B,0DAAG;AAChC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kEAAO;AACxB;AACA;AACA;AACA;AACA,0BAA0B,0DAAG;AAC7B,+CAA+C,6BAA6B,EAAE;AAC9E,SAAS;AACT,oBAAoB,uDAAQ;AAC5B,oBAAoB,sDAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACqB;AACtB,sC;;;;;;;;;;;;ACrhBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAgB,SAAI,IAAI,SAAI;AAC5B;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC6E;AACnC;AACC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,6CAAK,WAAW,+CAAO;AAC1C;AACA;AACA,mBAAmB,6CAAK,WAAW,+CAAO;AAC1C;AACA;AACA,mBAAmB,6CAAK,WAAW,+CAAO;AAC1C;AACA;AACA,CAAC;AACuB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,8DAA8D;AAC/G;AACA,qDAAqD,kEAAkE;AACvH;AACA,4CAA4C,yDAAyD;AACrG;AACA;AACA;AACA;AACA,QAAQ,sDAAM,QAAQ,aAAa,sDAAU,SAAS,6CAAK,EAAE;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,SAAS,iBAAiB,EAAE;AAChE,4BAA4B;AAC5B,mBAAmB,sDAAU,mDAAmD,sDAAM;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,wDAAQ;AACrB;AACA;AACA,QAAQ,uDAAO,CAAC,sDAAU;AAC1B,gBAAgB,0DAAU;AAC1B,oCAAoC,yDAAS,kBAAkB,0DAAU;AACzE,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC4B;AAC7B,6C;;;;;;;;;;;;ACtGA;AAAA;AAAA;AAAA;AAAA;AACiD;AACN;AAC3C;AACA;AACA;AACA;AACA;AACA,eAAe,oEAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,0CAA0C;AAC9E;AACA,0CAA0C,gDAAgD;AAC1F;AACA,gDAAgD,sDAAsD;AACtG;AACA,0CAA0C,gDAAgD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,uDAAuD;AAClG;AACA,qCAAqC,iDAAiD;AACtF;AACA,kCAAkC,8CAA8C;AAChF;AACA,0CAA0C,sDAAsD;AAChG;AACA,0DAA0D,sEAAsE;AAChI,kCAAkC,uDAAc;AAChD;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,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACoB;AACrB,qC;;;;;;;;;;;;ACvIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC0C;AAC6B;AACnB;AACR;AACO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,8DAAW;AACjC,uBAAuB,2DAAO;AAC9B,aAAa,2DAAQ,oBAAoB,uCAAuC,EAAE;AAClF,aAAa,sDAAE,CAAC,sDAAU,qBAAqB,6CAA6C,EAAE;AAC9F,wCAAwC,6CAA6C,EAAE;AACvF,aAAa,sDAAE,4BAA4B,yCAAyC,EAAE;AACtF,aAAa,6DAAU,oBAAoB,wCAAwC,EAAE;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D,wCAAwC;AACxC;AACA;AACA;AACA;AACA,YAAY,mEAAQ;AACpB;AACA,YAAY,sDAAE,CAAC,sDAAU;AACzB,yCAAyC,8BAA8B;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,yBAAyB,EAAE;AACvG;AACA;AACA,4DAA4D,yBAAyB,EAAE;AACvF;AACA;AACA,uBAAuB;AACvB,eAAe,6DAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,+BAA+B;AAClF;AACA;AACA,uBAAuB;AACvB,eAAe,6DAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,IAAI,wBAAwB,+CAA+C,EAAE;AAC1H;AACA,uBAAuB,mEAAQ;AAC/B,oDAAoD,8BAA8B;AAClF,uBAAuB;AACvB,eAAe,6DAAM;AACrB;AACA,+CAA+C,kEAAkE,QAAQ,oEAAS,WAAW,EAAE,EAAE;AACjJ;AACA,CAAC;AACyB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,sBAAsB;AACrE,kCAAkC,uDAAQ;AAC1C;AACA;AACA,CAAC;AACsB;AACvB,mC;;;;;;;;;;;;ACvMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAuC;AACG;AACuC;AACtC;AAC3C;AACA,oCAAoC,8CAA8C;AAClF;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,gDAAgD,sDAAU;AAC1D;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;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,SAAS,0DAAU,cAAc,wDAAQ,cAAc,kDAAE,CAAC,kDAAW,eAAe,kDAAW;AAC/F;AACA;AACA,WAAW,0DAAU,sBAAsB,mDAAG;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uDAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,QAAQ;AACR;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,mBAAmB,yBAAyB,uBAAuB,EAAE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,mDAAG;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0DAAU;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA,4BAA4B,+BAA+B;AAC3D;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,UAAU,uBAAuB,EAAE,EAAE;AAC9F;AACA;AACA;AACA,SAAS;AACT,oDAAoD,qBAAqB,EAAE;AAC3E;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,YAAY,yDAAS;AACrB;AACA;AACA;AACA;AACA;AACA,CAAC;AACmB;AACpB,oC;;;;;;;;;;;;AC5VA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0D;AACpB;AACE;AACD;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kDAAQ;AACjC;AACA;AACA;AACA;AACA;AACA,0BAA0B,oDAAS;AACnC;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,kCAAkC;AAClC;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,iCAAiC,4CAA4C;AAC7E;AACA;AACA;AACA,iFAAiF,iBAAiB;AAClG;AACA;AACA;AACA,mCAAmC,8CAA8C;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,4CAA4C;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,wDAAwD;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,0BAA0B,uDAAO;AACjC,aAAa,gDAAQ,qBAAqB,qCAAqC,EAAE;AACjF,aAAa,kDAAW,wBAAwB,4DAA4D,EAAE;AAC9G,aAAa,kDAAE,CAAC,kDAAW,sBAAsB,2EAA2E,EAAE;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qHAAqH,wBAAwB,EAAE;AAC/I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,sDAAM,EAAE,qBAAqB,YAAY;AACvD;AACA,0CAA0C,2CAA2C;AACrF;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACqB;AACtB,sC;;;;;;;;;;;;ACpQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACgC;AAChC,mC;;;;;;;;;;;;ACFA;AAAA;AAAA;AAAA;AAAA;AACkE;AACV;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gDAAgD,gBAAgB,EAAE,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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAoB;AACO;AACW;AACA;AACE;AACG;AACJ;AACC;AAChB;AACE;AAC1B,iC;;;;;;;;;;;;ACVA;AAAA;AAAA;AAAA;AAC8F;AAC9F;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;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,UAAU;AACV;AACO;AACP;AACA,0BAA0B,sBAAsB,EAAE;AAClD;AACA,0BAA0B,oCAAoC,EAAE;AAChE;AACA;AACA;AACA;AACA;AACA,+EAA+E,aAAa,SAAS,EAAE;AACvG;AACA;AACA,kBAAkB,4DAAM,GAAG,uBAAuB;AAClD;AACA,0BAA0B,qEAAe,iBAAiB,gCAAgC,EAAE,kBAAkB,kDAAkD,EAAE;AAClK,gEAAgE,eAAe,EAAE;AACjF,YAAY,gEAAU;AACtB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kEAAY;AACzB;AACA;AACA;AACA,YAAY,6DAAO;AACnB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,oC;;;;;;;;;;;;AC7FA;AAAA;AAAA;AAAA;AAAiD;AACT;AACxC;AACA;AACA;AACA;AACA,uBAAuB,mDAAI;AAC3B;AACA;AACA;AACA;AACA;AACA,iCAAiC,oBAAoB;AACrD,qCAAqC,wBAA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AACA,QAAQ,4CAAI;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oEAAoB;AACnC;AACA;AACA;AACA,iBAAiB,0DAAU,YAAY;AACvC,eAAe,yDAAS,UAAU;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4CAAI;AACZ;AACA;AACA,CAAC,CAAC,yEAAoB;AACc;AACpC,oD;;;;;;;;;;;;AC3EA;AAAA;AAAA;AAAA;AACoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,0BAA0B,gDAAgD,qBAAqB,EAAE,EAAE,EAAE;AACrG;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,YAAY,6DAAO;AACnB;AACA;AACA,YAAY,8DAAQ;AACpB;AACA,8DAA8D;AAC9D,kEAAkE,2CAA2C,UAAU,qBAAqB,EAAE,EAAE,EAAE,EAAE;AACpJ;AACA;AACA;AACA;AACA;AACA,iBAAiB,IAAI;AACrB,aAAa;AACb;AACA,KAAK;AACL;AACA,6B;;;;;;;;;;;;ACtDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAC2F;AACpF;AACP;AACA;AACA;AACA;AACA,aAAa,uDAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,gBAAgB,gDAAQ;AACxB,aAAa,kDAAU;AACvB,oCAAoC;AACpC;AACO;AACP,sCAAsC,gBAAgB;AACtD,aAAa,yDAAS;AACtB,aAAa,0DAAU;AACvB,YAAY;AACZ;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAO;AAC1B,wCAAwC,wBAAwB,EAAE;AAClE,KAAK;AACL,gBAAgB,+CAAO;AACvB;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,iC;;;;;;;;;;;;ACrDA;AAAA;AAAA;AAAA;AAAuB;AACvB,iC;;;;;;;;;;;;ACDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACiF;AACrC;AACa;AACjB;AACxC;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,8CAA8C,QAAQ,2DAAI,kCAAkC,gDAAgD,EAAE,EAAE,EAAE;AAClJ,6CAA6C,uBAAuB,EAAE;AACtE,6CAA6C,2BAA2B,EAAE;AAC1E;AACA;AACA,oCAAoC,QAAQ,iEAAU,6BAA6B;AACnF,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA,wDAAwD;AACxD,kCAAkC,mEAAQ,4CAA4C;AACtF;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,kDAAkD;AAClD;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,0FAA0F,sBAAsB,EAAE;AAClH;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kEAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mDAAK;AACb,QAAQ,iEAAU;AAClB;AACA;AACA,QAAQ,mDAAK;AACb;AACA;AACA;AACA;AACA,6DAA6D,uBAAuB,EAAE,SAAS,yDAAU,IAAI;AAC7G;AACA,oEAAoE;AACpE;AACA;AACA,iDAAiD,yEAAyE;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yDAAK,0CAA0C,kDAAkD,EAAE;AAC9H;AACA;AACA;AACA;AACA;AACA,qEAAqE,WAAW;AAChF,wEAAwE;AACxE;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,yBAAyB,EAAE;AAC/F;AACA,uCAAuC,SAAS,8DAAO,6BAA6B,EAAE;AACtF,wCAAwC,UAAU,4CAA4C,EAAE,EAAE;AAClG;AACA;AACA,+CAA+C,sBAAsB,EAAE;AACvE,QAAQ,mDAAK;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mDAAK;AACb;AACA,gDAAgD,6DAA6D;AAC7G;AACA,YAAY,mDAAK;AACjB;AACA;AACA;AACA;AACA;AACA,gBAAgB,mDAAK;AACrB;AACA;AACA,YAAY,mDAAK;AACjB,YAAY,iEAAU;AACtB;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA,iCAAiC,wDAAI;AACrC;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA;AACA,oCAAoC,wDAAI,iBAAiB,wDAAI;AAC7D;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,SAAS,qDAAqD,WAAW,EAAE;AAC3E,SAAS,qDAAqD,YAAY,EAAE;AAC5E,SAAS,qDAAqD,cAAc;AAC5E,SAAS,qDAAqD,gBAAgB;AAC9E;AACA;AACA;AACA;AACA,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,8DAAO;AAChB;AACA;AACA;AACA,uCAAuC,sBAAsB;AAC7D;AACA;AACA;AACA;AACA;AACA,2CAA2C,sBAAsB;AACjE;AACA;AACA;AACA,KAAK;AACL;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB,KAAK,oBAAoB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,eAAe;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,6BAA6B;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,wCAAwC,iBAAiB,KAAK,gBAAgB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA;AACA,4DAA4D,iBAAiB;AAC7E;AACA;AACA,4DAA4D,iBAAiB;AAC7E;AACA;AACA,4DAA4D,iBAAiB;AAC7E;AACA;AACA;AACA,kDAAkD,aAAa;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,aAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,8CAA8C;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,6DAAM,GAAG;AACxD;AACA,qBAAqB;AACrB,2CAA2C,6DAAM,GAAG;AACpD;AACA;AACA;AACA,8EAA8E;AAC9E;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,oBAAoB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,eAAe;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,6BAA6B;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,aAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,8CAA8C;AACxF;AACA,4EAA4E,sBAAsB,mDAAI,QAAQ,EAAE,IAAI;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA,8EAA8E;AAC9E;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL;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,+BAA+B,kBAAkB,KAAK,iBAAiB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,qBAAqB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qBAAqB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,mCAAmC;AAC5D;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+DAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,mDAAI;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+DAAQ;AACpC;AACA,4BAA4B,8DAAO;AACnC;AACA;AACA;AACA;AACA;AACA,oCAAoC,+DAAQ;AAC5C;AACA;AACA;AACA,yCAAyC,8DAAO;AAChD;AACA,oCAAoC,8DAAO;AAC3C;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,6CAA6C,kBAAkB;AAC/D;AACA;AACA;AACA;AACA;AACA,4BAA4B,iEAAU;AACtC;AACA;AACA;AACA;AACA,2DAA2D,+BAA+B,uDAAQ,EAAE;AACpG;AACA;AACA,mDAAmD,sBAAsB,EAAE;AAC3E;AACA,wCAAwC,sDAAO;AAC/C;AACA;AACA;AACA,oCAAoC,oDAAK;AACzC,kFAAkF,gDAAgD,EAAE;AACpI,8EAA8E,0CAA0C,EAAE;AAC1H;AACA,kFAAkF,oDAAK;AACvF,8EAA8E,SAAS,8DAAO,kBAAkB,EAAE;AAClH;AACA,qEAAqE,qCAAqC,EAAE;AAC5G,wEAAwE,wCAAwC,EAAE;AAClH,yBAAyB;AACzB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,KAAK;AACL;AACA,2CAAO;AACP;AACA;AACA;AACA;AACA;AACA,2C;;;;;;;;;;;;ACpnBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACkJ;AACvG;AACH;AACe;AACvD;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,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,IAAI;AACJ;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,oCAAoC,gCAAgC;AACpE;AACA,IAAI;AACJ;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2CAAO;AAC/B;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,wBAAwB,2CAAO;AAC/B;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY,gDAAgD,EAAE;AACjF,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,4DAAK;AAC3D;AACA;AACA,gDAAgD,4DAAK;AACrD;AACA,yBAAyB;AACzB;AACA,oBAAoB,oDAAK;AACzB;AACA,0DAA0D,kEAAa;AACvE;AACA;AACA;AACA,wBAAwB,oDAAK;AAC7B;AACA;AACA;AACA,8CAA8C,wBAAwB;AACtE;AACA;AACA;AACA,wBAAwB,oDAAK;AAC7B;AACA,qBAAqB;AACrB;AACA;AACA,4BAA4B,oDAAK;AACjC;AACA;AACA;AACA;AACA,4BAA4B,oDAAK;AACjC;AACA;AACA;AACA;AACA;AACA,4BAA4B,oDAAK;AACjC;AACA;AACA;AACA,6BAA6B;AAC7B;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,mCAAmC,OAAO;AAC1C,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gEAAS;AAC9C;AACA;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,0BAA0B,4DAAK;AAC/B,uBAAuB,4DAAK;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,aAAa,eAAe,mDAAI;AACxE,iDAAiD,6DAAc;AAC/D;AACA,gBAAgB,oDAAK;AACrB;AACA;AACA;AACA;AACA,2CAA2C,2DAAS;AACpD;AACA;AACA,sEAAsE,6DAAM,GAAG,WAAW,oCAAoC;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,oCAAoC;AACtG,gGAAgG,oCAAoC;AACpI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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA2B;AACW;AACN;AACI;AACb;AACe;AACd;AACY;AACd;AACP,0EAAW,EAAC;AACY;AACvB;AACe;AAC/B,iC;;;;;;;;;;;ACbA;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;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;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;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;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;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;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;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,uC;;;;;;;;;;;;ACzTA;AAAA;AAAA;AAAA;AAC2C;AACsC;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,0DAAG;AACrB,QAAQ,2EAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,UAAU,wBAAwB,KAAK,EAAE;AACtH;AACA;AACA,+EAA+E,UAAU,wBAAwB,KAAK,EAAE;AACxH;AACA;AACA,yD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A2B,gCAAgC,EAAE;AAC7D,gBAAgB,sDAAO;AACvB,8BAA8B,8BAA8B,EAAE;AAC9D,wCAAwC,yFAAyF,EAAE;AACnI;AACA;AACA,gDAAgD,0CAA0C,oEAAiB,YAAY;AACvH;AACA;AACA,oCAAoC,QAAQ,6DAAM,wBAAwB,oBAAoB,4BAA4B,EAAE,EAAE,EAAE;AAChI;AACO;AACP;AACA,QAAQ,oDAAK;AACb,KAAK;AACL;AACA;AACA;AACA;AACA,2EAA2E,iCAAiC,EAAE;AAC9G,mDAAmD,YAAY,gEAAe,GAAG,EAAE;AACnF;AACA;AACA;AACA;AACA,sEAAsE,iCAAiC,EAAE;AACzG,uCAAuC,2BAA2B,EAAE;AACpE,wCAAwC,QAAQ,oDAAK,CAAC,EAAE;AACxD;AACA,mEAAmE,EAAE;AACrE,4CAA4C,EAAE;AAC9C,kDAAkD,EAAE;AACpD;AACA;AACO;AACP,wCAAwC,uDAAQ;AAChD;AACA;AACA;AACA;AACA,KAAK;AACL,yBAAyB,yDAAU,IAAI;AACvC;AACA,oC;;;;;;;;;;;;ACzHA;AAAA;AAAA;AAAA;AAAA;AAC0C;AAC1C;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,2CAAO;AACP;AACA;AACA;AACkD;AAClD,wC;;;;;;;;;;;;AC3CA;AAAA;AAAA;AAAA;AACsE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2EAAoB,CAAC,0DAAG,iCAAiC,0DAAG;AACpE;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,sBAAsB,OAAO;AAC7B,oBAAoB,OAAO;AAC3B;AACA,mBAAmB,OAAO,eAAe;AACzC;AACA,yBAAyB,OAAO;AAChC;AACA,sBAAsB,OAAO;AAC7B;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA;AACA;AACA,yBAAyB,OAAO;AAChC;AACA,oBAAoB,OAAO;AAC3B;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,QAAQ;AACR;AACA;AACA;AACA,4BAA4B,+BAA+B;AAC3D,4BAA4B;AAC5B;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,YAAY,+DAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACwB;AACzB,yC;;;;;;;;;;;;ACzIA;AAAA;AAAA;AAAA;AAAA;AACmE;AAC3B;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,qCAAqC,6DAAc;AACnD;AACA,yBAAyB,6DAAM,CAAC,2DAAS,eAAe,sCAAsC;AAC9F,mBAAmB,uDAAQ;AAC3B;AACA;AACA;AACA;AACA,6C;;;;;;;;;;;;ACzBA;AAAA;AAAA;AAAA;AAAA;AAAoK;AACpK;AACO;AACP;AACA;AACA,6CAA6C,uDAAQ;AACrD;AACA;AACA;AACA;AACA,sCAAsC,yCAAyC,eAAe,gEAAS,WAAW,EAAE,SAAS;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,gFAAgF;AAChF,mCAAmC;AACnC;AACA,QAAQ,gEAAS;AACjB;AACA;AACA;AACA,sDAAsD,QAAQ,gEAAS,aAAa,EAAE;AACtF;AACA,kBAAkB,gCAAgC,WAAW,2DAAI;AACjE,IAAI,8DAAO;AACX,+BAA+B,MAAM,cAAc;AACnD;AACA,+BAA+B;AAC/B,YAAY,+DAAQ;AACpB,sBAAsB;AACtB;AACA,iBAAiB,6DAAM,GAAG;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,0DAAW;AACpC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uDAAQ;AACzB,0BAA0B,6DAAc;AACxC,4DAA4D,QAAQ,6DAAM,wBAAwB,EAAE,IAAI;AACxG;AACA;AACA;AACA;AACA;AACA,YAAY,oDAAK;AACjB;AACA,YAAY,6DAAM,0BAA0B,YAAY,kBAAkB,KAAK;AAC/E;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,4BAA4B;AAC7C;AACA;AACA;AACA,aAAa,mEAAY;AACzB;AACA,mBAAmB,uDAAQ;AAC3B,yBAAyB,8DAAO,aAAa,2DAAI;AACjD,6BAA6B,yDAAU;AACvC;AACA;AACA;AACA,CAAC;AACwB;AACzB,iC;;;;;;;;;;;;AC9GA;AAAA;AAAA;AAAA;AAAA;AAC0C;AACmF;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,2CAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,4CAA4C,QAAQ,uDAAQ,sCAAsC,UAAU,gBAAgB,EAAE,EAAE,EAAE;AAClI,6CAA6C,QAAQ,uDAAQ,sCAAsC,UAAU,iBAAiB,EAAE,EAAE,EAAE;AACpI,eAAe,gEAAS;AACxB;AACA,cAAc,gEAAS;AACvB;AACA,kBAAkB,gEAAS;AAC3B;AACA,sBAAsB,gEAAS;AAC/B;AACA,0BAA0B,gEAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA,eAAe,iEAAU;AACzB;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA,eAAe,OAAO;AACtB,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA,YAAY,iEAAU;AACtB;AACA;AACA;AACA;AACA;AACA,2BAA2B,uCAAuC,sBAAsB,EAAE;AAC1F;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA,mBAAmB,uDAAQ;AAC3B,yBAAyB,8DAAO,aAAa,2DAAI;AACjD,6BAA6B,yDAAU;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,gBAAgB,OAAO;AACvB;AACA;AACA,mBAAmB,uDAAQ;AAC3B,yBAAyB,8DAAO,aAAa,2DAAI;AACjD,6BAA6B,yDAAU;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B;AACA,yBAAyB,OAAO;AAChC,qEAAqE;AACrE,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,qBAAqB,2CAAO;AAC5B;AACA;AACA,0BAA0B,kEAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E;AAC9E,4BAA4B,8BAA8B;AAC1D;AACA,uCAAuC,4CAA4C;AACnF;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uDAAQ;AAC1C,oFAAoF;AACpF,kCAAkC,8DAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC0B;AAC3B;AACA;AACA,kBAAkB,uDAAQ,mCAAmC;AAC7D;AACA;AACA,2CAA2C,sDAAO;AAClD;AACA;AACA;AACA;AACA,QAAQ,+DAAQ;AAChB;AACA;AACA;AACA,yCAAyC;AACzC,yEAAyE,gBAAgB;AACzF;AACA,wCAAwC;AACxC;AACA,6BAA6B,0DAA0D,EAAE;AACzF;AACA,kCAAkC,QAAQ,gEAAS,WAAW,8DAAO,WAAW,EAAE;AAClF,YAAY;AACZ,+BAA+B,UAAU,mDAAmD,EAAE,EAAE;AAChG;AACA,2C;;;;;;;;;;;;ACzMA;AAAA;AAAA;AAAA;AAC8C;AACqC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ,uDAAQ,kCAAkC,qDAAqD,EAAE;AAC1I;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,UAAU;AACV,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iEAAU;AACvB;AACA,iCAAiC,eAAe,uDAAQ,0CAA0C;AAClG,uBAAuB,0DAAW,QAAQ,uDAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,YAAY,+DAAQ;AACpB;AACA;AACA,iBAAiB,iEAAU;AAC3B,4CAA4C,aAAa,uDAAQ,0CAA0C,EAAE;AAC7G;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,UAAU;AACV,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8DAAO,aAAa,iEAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC4B;AAC7B,6C;;;;;;;;;;;;ACnMA;AAAA;AAAA;AAC0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA,2CAAO;AACP,sC;;;;;;;;;;;;ACxBY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kCAAkC,SAAS;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,UAAU;AACpD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ,aAAa,mBAAO,CAAC,oDAAW;AAChC,cAAc,mBAAO,CAAC,gDAAS;AAC/B,cAAc,mBAAO,CAAC,oEAAS;;AAE/B;AACA;AACA;;AAEA;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;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB,mDAAmD;AACxE;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;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,mBAAmB,UAAU;AAC7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,uCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;;AAEA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;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;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD,EAAE;AAClD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,wBAAwB,QAAQ;AAChC;AACA,qBAAqB,eAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;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,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,qBAAqB,QAAQ;AAC7B;AACA;AACA,GAAG;AACH;AACA,eAAe,SAAS;AACxB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,YAAY;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;AC5vDA,iBAAiB;;AAEjB;AACA;AACA;;;;;;;;;;;;ACJA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;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;;AAEA;AACA;AACA;;;;;;;;;;;;;;AC1GA;AAAA;AAAe;AACf;AACA;;AAEA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACTA;AAAA;AAAe;AACf;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACdA;AAAA;AAAA;AAAwC;AACzB;AACf,SAAS,gEAAM,GAAG;AAClB,C;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0D;AACW;AACJ;AACQ;AACd;AACQ;AACN;AAC7D;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;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,SAAS;AACT;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,6CAA6C;;AAE7C;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,iEAAe;AAC1B,GAAG;AACH;AACA;AACA,yBAAyB,4EAAc,gBAAgB;;AAEvD,4EAA4E;;AAE5E;AACA;AACA,aAAa,yEAAe;AAC5B,KAAK;;;AAGL;AACA;AACA;AACA,OAAO;AACP,KAAK;;;AAGL,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA,sBAAsB,+EAAiB,OAAO;;AAE9C,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,yEAAe;AAC9B;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,oCAAoC;;AAEpC;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,yEAAe;AAC9B;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,oCAAoC;;AAEpC;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,iEAAe;AAC9B;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,yEAAe;AAC9B;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA,eAAe,wEAAU;;AAEzB;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA,kBAAkB,2EAAa;;AAE/B;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,iEAAe;AAC1B,GAAG;AACH;AACA;AACA,oBAAoB,6EAAe;;AAEnC;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,yEAAe;AAC9B;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,yEAAe;AAC9B;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,yEAAe;AAC9B;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,iEAAe;AAC1B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,iEAAe;AAC1B,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,iEAAe;AAC1B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,WAAW,iEAAe;AAC1B,GAAG;AACH;AACA;AACA,WAAW,iEAAe;AAC1B,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA;AACA;AACA,WAAW,yEAAe;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,4CAA4C,yEAAe;AAC3D;;AAEA;AACA;AACA;AACA,kBAAkB,yEAAe;AACjC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,yEAAe;AAC7B,gBAAgB,yEAAe;AAC/B;AACA;;AAEe,yEAAU,E;;;;;;;;;;;;ACv1BzB;AAAA;AAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;;AAE3C;AACA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA;AACA,+CAA+C,yEAAe;AAC9D,GAAG;AACH;AACA;AACA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA,WAAW,yEAAe;AAC1B,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,WAAW,yEAAe;AAC1B;AACA;AACe,yEAAU,E;;;;;;;;;;;;ACjFzB;AAAA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA,mCAAmC,MAAM,0DAA0D,MAAM;AACzG;;AAEA;AACA;AACA;AACA;AACe,6EAAc,E;;;;;;;;;;;;AC/F7B;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACnBA;AAAA;AAAA;AAA2C;AAC3C,mCAAmC;AACnC;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AChBA;AAAA;AAAA;AAAA;AAAA;AAA2C;AACmB;AACQ;AACtE,qCAAqC;AACrC;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,aAAa,2EAAiB,mBAAmB,+EAAqB,iBAAiB;AACvF;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACjBA;AAAA;AAAA;AAAA;AAA2C;AACmB;AAC9D;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA,wBAAwB,2EAAiB;AACzC;AACA;AACA;AACA,wBAAwB,2EAAiB;;AAEzC;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,C;;;;;;;;;;;;A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ACA;AACA;;AAEA,aAAa,gEAAM;AACnB,eAAe,uEAAS;AACxB;AACA;AACA;AACA,gCAAgC,uEAAS;AACzC,cAAc;AACd;;AAEA,mBAAmB,mEAAS;AAC5B;AACA,SAAS,mEAAS;AAClB;;AAEA;AACA;AACA,C;;;;;;;;;;;;AC3CA;AAAA;AAAA;AAAA;AAAmD;AACX;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,eAAe,uEAAS;AACxB;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAmD;AACO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,yEAAe;AACxB,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAA;AAAA;AAAmD;AACK;AACA;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,wEAAc,YAAY,wEAAc;AACjD,C;;;;;;;;;;;;ACxCA;AAAA;AAAA;AAAA;AAAmD;AACX;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,kBAAkB,gEAAM;AACxB,eAAe,uEAAS;AACxB;AACA,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAA;AAAmD;AACO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,yEAAe;AACxB,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAA;AAAA;AAAmD;AACX;AACgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,eAAe,uEAAS;AACxB;AACA;AACA;AACA;AACA,oBAAoB,wEAAc,uBAAuB;AACzD;;AAEA;AACA;AACA,C;;;;;;;;;;;;AC1CA;AAAA;AAAA;AAAA;AAAmD;AACL;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB;AACA,SAAS,mEAAS;AAClB,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAA;AAAmD;AACO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,yEAAe;AACxB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAmD;AACT;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB;AACA,SAAS,iEAAO;AAChB,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAA;AAAmD;AACL;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,mEAAS;AAClB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAwC;AACxC;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,QAAQ,2DAA2D;AACnE,QAAQ;AACR;AACA;AACA;AACA,WAAW,SAAS,8DAA8D;AAClF,WAAW,SAAS,gEAAgE;AACpF,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA,MAAM,2DAA2D;AACjE,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,2DAA2D;AACjE,MAAM;AACN;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA,sBAAsB,gEAAM;AAC5B,oBAAoB,gEAAM;AAC1B,uBAAuB,gEAAM;AAC7B,qBAAqB,gEAAM,8BAA8B;;AAEzD;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACpFA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,gBAAgB;AAC3B,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,sBAAsB,gEAAM;;AAE5B;AACA;AACA;;AAEA;AACA,iBAAiB;;AAEjB;AACA,oBAAoB;AACpB,GAAG;AACH,iCAAiC;AACjC,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,gEAAM;;AAE5B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,C;;;;;;;;;;;;AC1EA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,gBAAgB;AAC3B,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,sBAAsB,gEAAM;;AAE5B;AACA;AACA;;AAEA;AACA,iBAAiB;;AAEjB;AACA,oBAAoB;AACpB,GAAG;AACH,iCAAiC;AACjC,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,gEAAM;;AAE5B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,C;;;;;;;;;;;;ACxEA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB;;AAEA;AACA;AACA,GAAG;AACH,aAAa,0BAA0B;AACvC,GAAG;AACH;AACA;AACA,C;;;;;;;;;;;;ACtDA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB;;AAEA;AACA;AACA,GAAG;AACH,aAAa,0BAA0B;AACvC,GAAG;AACH;AACA;AACA,C;;;;;;;;;;;;ACtDA;AAAA;AAAA;AAAA;AACA;AACA;AACA,WAAW;AACX;AACA;AACO;AACP;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEO,uB;;;;;;;;;;;;ACdP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0C;AACI;AACN;AACoC;AAClC;AACI;AACK;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB,OAAO,iEAAO,eAAe,iEAAO;AACpC,2BAA2B,kFAAwB;AACnD;AACA,cAAc,uEAAS;AACvB;AACA,cAAc,iEAAO,uBAAuB;;AAE5C,UAAU,mEAAS;AACnB;AACA,cAAc,mEAAS;AACvB,gBAAgB,iEAAO;AACvB;;AAEA;AACA,C;;;;;;;;;;;;ACtDA;AAAA;AAAA;AAAA;AAA+F;AAC/C;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,uBAAuB,oEAAU;AACjC,wBAAwB,oEAAU;AAClC,iDAAiD,6FAA+B;AAChF,mDAAmD,6FAA+B,kBAAkB;AACpG;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACnDA;AAAA;AAAA;AAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,wEAAc,kBAAkB,wEAAc;AACvD,C;;;;;;;;;;;;ACxCA;AAAA;AAAA;AAAA;AAA+F;AACvC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,2BAA2B,wEAAc;AACzC,4BAA4B,wEAAc;AAC1C,qDAAqD,6FAA+B;AACpF,uDAAuD,6FAA+B,sBAAsB;AAC5G;AACA;;AAEA;AACA,C;;;;;;;;;;;;AC5CA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB;AACA;AACA;AACA,C;;;;;;;;;;;;ACrCA;AAAA;AAAA;AAAA;AAAgD;AACR;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB;AACA,oBAAoB,oEAAU,aAAa,oEAAU;AACrD;AACA,C;;;;;;;;;;;;ACtCA;AAAA;AAAA;AAAA;AAAkD;AAC6C;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,wBAAwB,qEAAW;AACnC,yBAAyB,qEAAW;AACpC,kDAAkD,6FAA+B;AACjF,oDAAoD,6FAA+B,mBAAmB;AACtG;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACxDA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB;AACA,C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAAA;AAAA;AAAwC;AACoC;AAC5B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB,aAAa,oEAAU;AACvB,4BAA4B,kFAAwB;AACpD,2DAA2D;AAC3D;;AAEA,yBAAyB,oEAAU;AACnC,sDAAsD;;AAEtD;AACA,C;;;;;;;;;;;;ACrDA;AAAA;AAAA;AAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,kFAAwB;AACrC;AACA,C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAwC;AACoD;AAC5C;AACU;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB,aAAa,oEAAU;AACvB,4BAA4B,0FAAgC;AAC5D,aAAa,yEAAe,8BAA8B;AAC1D;AACA;;AAEA,iCAAiC,oEAAU;AAC3C,8DAA8D;;AAE9D;AACA,C;;;;;;;;;;;;ACtDA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB;AACA,C;;;;;;;;;;;;ACpCA;AAAA;AAAA;AAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,kFAAwB;AACrC;AACA,C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAAA;AAAA;AAAwC;AACwC;AAChC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB,aAAa,oEAAU;AACvB,4BAA4B,oFAA0B;AACtD,6DAA6D;AAC7D;;AAEA,2BAA2B,oEAAU;AACrC,wDAAwD;;AAExD;AACA,C;;;;;;;;;;;;AC1CA;AAAA;AAAA;AAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,4EAAkB;AAC/B;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,kFAAwB;AACrC;AACA,C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,0EAAgB;AAC7B;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAA;AAAA;AAAwC;AACsC;AAC9B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB,aAAa,oEAAU;AACvB,4BAA4B,mFAAyB;AACrD,mEAAmE;AACnE;;AAEA,0BAA0B,oEAAU;AACpC,uDAAuD;;AAEvD;AACA,C;;;;;;;;;;;;AC1CA;AAAA;AAAA;AAAwC;AACxC;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,QAAQ;AACR;AACA;AACA;AACA,WAAW,SAAS,yCAAyC;AAC7D,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA,kBAAkB,gEAAM;AACxB,gBAAgB,gEAAM;AACtB,kCAAkC;;AAElC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,gEAAM;AACrB;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;AC1FA;AAAA;AAAA;AAAA;AAAA;AAA4C;AACM;AACV;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS,yCAAyC;AAC7D,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA,kBAAkB,gEAAM;AACxB,gBAAgB,gEAAM;AACtB,kCAAkC;;AAElC;AACA;AACA;;AAEA,sBAAsB,qEAAW;AACjC,oBAAoB,qEAAW,mBAAmB;;AAElD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,gEAAM;AACrB,kBAAkB,kEAAQ;AAC1B;AACA;;AAEA;AACA,C;;;;;;;;;;;;AC1EA;AAAA;AAAA;AAAA;AAAA;AAA8D;AAClB;AACE;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS,+CAA+C;AACnE,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,qBAAqB,2EAAiB;AACtC;AACA;;AAEA;AACA;;AAEA,QAAQ,mEAAS;AACjB;AACA,UAAU,kEAAQ;AAClB;AACA;;AAEA;AACA,C;;;;;;;;;;;;AClDA;AAAA;AAAA;AAAA;AAAA;AAAsE;AAClB;AACJ;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,kBAAkB,sEAAY;AAC9B;AACA,gBAAgB,oEAAU;AAC1B,SAAS,+EAAqB;AAC9B;AACA;AACA,GAAG;AACH,C;;;;;;;;;;;;AC3CA;AAAA;AAAA;AAAA;AAAA;AAAsE;AACpB;AACJ;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,kBAAkB,qEAAW;AAC7B;AACA,gBAAgB,mEAAS;AACzB,SAAS,+EAAqB;AAC9B;AACA;AACA,GAAG;AACH,C;;;;;;;;;;;;ACxCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,WAAW,OAAO;AAClB,WAAW,MAAM,iEAAiE;AAClF,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACrCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,mEAAS;AAClB;AACA,GAAG;AACH,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAwD;AACA;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,wEAAc;AAC3B;AACA;AACA;AACA,aAAa,wEAAc;AAC3B;AACA;AACA,C;;;;;;;;;;;;AC7CA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf,SAAS,kEAAQ;AACjB,C;;;;;;;;;;;;AC3BA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAwC;AACW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,kBAAkB;AAC9E;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA,6DAA6D,uEAAS;AACtE,0EAA0E,uEAAS,uBAAuB;;AAE1G;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACvDA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0C;AACW;AACK;AAClB;AACoB;AACQ;AAC2B;AAC6B;AACzE;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qFAAqF;AACrF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;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;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;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,iDAAiD,WAAW;AAC5D;AACA,iDAAiD,WAAW;AAC5D;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;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;AACpE,wBAAwB,4CAA4C;AACpE;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,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,WAAW,mDAAmD;AAC1E,YAAY,WAAW,+CAA+C;AACtE,YAAY,WAAW,yDAAyD;AAChF,YAAY,WAAW,2DAA2D;AAClF,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA,iCAAiC,8DAAa;AAC9C;AACA,+EAA+E,uEAAS;AACxF,qGAAqG,uEAAS,gCAAgC;;AAE9I;AACA;AACA;;AAEA;AACA,6DAA6D,uEAAS;AACtE,0EAA0E,uEAAS,uBAAuB;;AAE1G;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qBAAqB,gEAAM;;AAE3B,OAAO,iEAAO;AACd;AACA,GAAG;AACH;AACA;;;AAGA,uBAAuB,6FAA+B;AACtD,gBAAgB,yEAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,2EAAc;AACxC;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,oBAAoB,uEAAU;;AAE9B;AACA,kDAAkD,8FAAwB;AAC1E,QAAQ,yFAAmB;AAC3B;;AAEA,mDAAmD,+FAAyB;AAC5E,QAAQ,yFAAmB;AAC3B;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;AC/aA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAgD;AACgB;AACE;AACb;AACb;AACe;AACwC;AAC/F;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,OAAO,kEAAkE;AACpF,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA,IAAI;AACJ;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA,iCAAiC,8DAAa;;AAE9C;AACA;AACA;;AAEA,mBAAmB,oEAAU;;AAE7B;AACA;AACA;;AAEA,wBAAwB,yEAAW;AACnC;AACA;AACA;AACA;;AAEA;AACA,eAAe,gEAAM;AACrB,gBAAgB,gEAAM;AACtB,GAAG;AACH,eAAe,gEAAM;AACrB,gBAAgB,gEAAM;AACtB;;AAEA,gBAAgB,6EAAmB;AACnC,yBAAyB,6FAA+B,cAAc,6FAA+B;AACrG;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL,GAAG;AACH,uEAAuE;AACvE,GAAG;AACH,oEAAoE;AACpE,GAAG;AACH;AACA,wEAAwE;AACxE,GAAG;AACH,8DAA8D;AAC9D,GAAG;AACH;AACA,iEAAiE;AACjE,GAAG;AACH;AACA;AACA;;AAEA,WAAW,4EAAkB,sBAAsB;;AAEnD;AACA;AACA,2EAA2E;AAC3E,GAAG;AACH;AACA,wCAAwC;;AAExC;AACA,0EAA0E;AAC1E,KAAK;AACL,yEAAyE;AACzE,KAAK;AACL;AACA;AACA;AACA,C;;;;;;;;;;;;ACpNA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA+F;AAC/C;AACR;AAC0B;AACX;AACF;AACrD;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,8CAA8C;AACzD,WAAW,uBAAuB;AAClC,WAAW,OAAO,kEAAkE;AACpF,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA,IAAI;AACJ;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA,iCAAiC,8DAAa;;AAE9C;AACA;AACA;;AAEA,mBAAmB,oEAAU;;AAE7B;AACA;AACA;;AAEA,wBAAwB,yEAAW;AACnC;AACA;AACA;AACA;;AAEA;AACA,eAAe,gEAAM;AACrB,gBAAgB,gEAAM;AACtB,GAAG;AACH,eAAe,gEAAM;AACrB,gBAAgB,gEAAM;AACtB;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA,gBAAgB,6EAAmB;AACnC,yBAAyB,6FAA+B,cAAc,6FAA+B;AACrG;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA,GAAG;;;AAGH;AACA,uEAAuE;AACvE,GAAG;AACH,uEAAuE;AACvE,GAAG;AACH;AACA,mEAAmE;AACnE,GAAG;AACH;AACA,iEAAiE;AACjE,GAAG;AACH;AACA,qEAAqE;AACrE,GAAG;AACH;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACtPA;AAAA;AAAA;AAAyD;AACzD;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,kBAAkB;AACnE;AACA;AACA;AACA;AACA,gDAAgD,kBAAkB;AAClE;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,OAAO,kEAAkE;AACpF,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,wEAAe;AACxB,C;;;;;;;;;;;;AChHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA4E;AACpC;AACa;AACK;AAClB;AACuD;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,iBAAiB,gEAAM;AACvB;AACA,iCAAiC,8DAAa;;AAE9C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,aAAa,kFAAwB;;AAErC;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA,gBAAgB,yEAAe,OAAO,6FAA+B;AACrE,oBAAoB,yEAAe,WAAW,6FAA+B;AAC7E;AACA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;AC1FA;AAAA;AAAA;AAAA;AAAwC;AACW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,uEAAS;AAC1B,SAAS,gEAAM;AACf,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAA;AAAA;AAAwC;AACU;AAC0B;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,aAAa,kFAAwB,OAAO,qEAAW;AACvD;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAAA;AAAwC;AACQ;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;;AAEnB;AACA;AACA;;AAEA,SAAS,oEAAU;AACnB,C;;;;;;;;;;;;ACpCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;;AAEA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACvCA;AAAA;AAAA;AAAA;AAAA;AAAwC;AACgB;AACQ;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,aAAa,wEAAc,mBAAmB,4EAAkB,iBAAiB;AACjF;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACvCA;AAAA;AAAA;AAAA;AAAwC;AACgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA,wBAAwB,wEAAc;AACtC;AACA;AACA;AACA,wBAAwB,wEAAc;;AAEtC;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,C;;;;;;;;;;;;ACvDA;AAAA;AAAA;AAAA;AAAgE;AACpB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,4EAAkB;AACnC,iBAAiB,4EAAkB,CAAC,kEAAQ;AAC5C,qDAAqD;AACrD;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACvCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAwC;AACxC;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,QAAQ,2DAA2D;AACnE,QAAQ;AACR;AACA;AACA;AACA,WAAW,SAAS,8DAA8D;AAClF,WAAW,SAAS,gEAAgE;AACpF,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA,MAAM,2DAA2D;AACjE,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,2DAA2D;AACjE,MAAM;AACN;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA,sBAAsB,gEAAM;AAC5B,oBAAoB,gEAAM;AAC1B,uBAAuB,gEAAM;AAC7B,qBAAqB,gEAAM,8BAA8B;;AAEzD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AC9FA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,oBAAoB,iEAAO;AAC3B,C;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAA;AAAA;AAAkD;AACQ;AAClB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,aAAa,qEAAW,4BAA4B,yEAAe,0BAA0B;AAC7F;AACA;;AAEA;AACA,C;;;;;;;;;;;;AC1DA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0C;AACF;AACY;AACD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA,6DAA6D,uEAAS;AACtE,0EAA0E,uEAAS,uBAAuB;;AAE1G;AACA;AACA;;AAEA,0BAA0B,iEAAO;;AAEjC;AACA;AACA;;AAEA,qBAAqB,gEAAM,CAAC,sEAAY;AACxC;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACpEA;AAAA;AAAA;AAAA;AAAA;AAAkD;AACV;AACW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,kBAAkB;AACvE;AACA;AACA;AACA;AACA,qDAAqD,2BAA2B;AAChF;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA,+EAA+E,uEAAS;AACxF,qGAAqG,uEAAS,gCAAgC;;AAE9I;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,qEAAW;AACnC;AACA;AACA;AACA,wBAAwB,qEAAW;;AAEnC;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,C;;;;;;;;;;;;AChFA;AAAA;AAAA;AAAA;AAAA;AAA8E;AACtB;AACJ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,kBAAkB;AACzE;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,mFAAyB,CAAC,wEAAc,QAAQ,sEAAY;AACrE,C;;;;;;;;;;;;ACzCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,OAAO;AACpB,YAAY,U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ACQ;AACM;AACJ;AACV;AACJ;AAC0C;AACtC;AACA;AACN;AACQ;AACR;AACc;AACN;AACQ;AAChB;AACA;AACE;AACJ;AACE;AACoB;AAClB;AACA;AACgB;AACZ;AACJ;AACJ;AACM;AACE;AACM;AACQ;AACV;AACF;AACI;AACF;AACJ;AACA;AACA;AACJ;AACI;AACM;AACF;AACF;AACI;AACF;AACJ;AACA;AACA;AACN;AACM;AACF;AACJ;AACQ;AACJ;AACc;AACV;AACQ;AACE;AACQ;AACZ;AACI;AACN;AACA;AACJ;AAChB;AACA;AACI;AACM;AAC0B;AAC5B;AACF;AACY;AACR;AACE;AACE;AACQ;AACE;AACV;AACJ;AACI;AACA;AACN;AACQ;AACR;AACM;AACM;AACJ;AACM;AACQ;AACV;AACF;AACI;AACF;AACF;AACM;AACR;AACQ;AACR;AACU;AAClB;AACE;AACc;AACA;AACV;AACF;AACI;AACF;AACJ;AACA;AACJ;;;;;;;;;;;;;ACjLtD;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,sBAAsB,gEAAM;AAC5B;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,sBAAsB,gEAAM;AAC5B;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACe;AACf;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;AC1CA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB;AACA,C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAA;AAAA;AAAwC;AACI;AACI;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,SAAS,kEAAQ,qBAAqB,oEAAU;AAChD,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,2BAA2B,oEAAU;AACrC,4BAA4B,oEAAU;AACtC;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,4BAA4B,qEAAW;AACvC,6BAA6B,qEAAW;AACxC;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,oEAAU;AACnB;AACA,GAAG;AACH,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,4BAA4B,4EAAkB;AAC9C,6BAA6B,4EAAkB;AAC/C;AACA,C;;;;;;;;;;;;ACvCA;AAAA;AAAA;AAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,8BAA8B,uEAAa;AAC3C,+BAA+B,uEAAa;AAC5C;AACA,C;;;;;;;;;;;;ACpCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,+BAA+B,wEAAc;AAC7C,gCAAgC,wEAAc;AAC9C;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,8BAA8B,uEAAa;AAC3C,+BAA+B,uEAAa;AAC5C;AACA,C;;;;;;;;;;;;ACpCA;AAAA;AAAA;AAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEe;AACf;AACA;AACA;;AAEA,4BAA4B,qEAAW;AACvC,6BAA6B,qEAAW;AACxC;AACA,C;;;;;;;;;;;;AC5CA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB,gEAAM;AACvB,kBAAkB,gEAAM;AACxB;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,oEAAU;AACnB,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,uEAAa;AACtB,C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,sEAAY;AACrB,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,qEAAW;AACpB,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,uEAAa;AACtB,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,sEAAY;AACrB,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,oEAAU;AACnB,C;;;;;;;;;;;;AC3CA;AAAA;AAAA;AAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,oEAAU;AACnB,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,mEAAS;AAClB,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAA;AAA0C;AACI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,mEAAS,YAAY,iEAAO;AACrC,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;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,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA,C;;;;;;;;;;;;AClEA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,gEAAM;AACf,C;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAwC;AACxC;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,QAAQ;AACR;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,SAAS;AACpB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA,aAAa,gEAAM;AACnB,kBAAkB,gEAAM;AACxB,gBAAgB,gEAAM,yBAAyB;;AAE/C;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAA8C;AACJ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,QAAQ;AACrB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,mEAAS,YAAY,iEAAO;AACrC,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,uEAAa;AACtB;AACA,GAAG;AACH,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAwD;AACA;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,wEAAc;AAC3B;AACA;AACA;AACA,aAAa,wEAAc;AAC3B;AACA;AACA,C;;;;;;;;;;;;AC7CA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,MAAM,iEAAiE;AAClF,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACtCA;AAAA;AAAA;AAAA;AAAwC;AACW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,kBAAkB;AAClF;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA,6DAA6D,uEAAS;AACtE,0EAA0E,uEAAS,uBAAuB;;AAE1G;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACvDA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAwC;AACyB;AAC8B;AACrD;AACgB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA,qBAAqB,gEAAM;;AAE3B,OAAO,iEAAO;AACd;AACA,GAAG;AACH;AACA;;;AAGA,uBAAuB,6FAA+B;AACtD,gBAAgB,yEAAe;AAC/B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,oBAAoB,4EAAU;;AAE9B;AACA,mDAAmD;AACnD;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;ACxHA;AAAA;AAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACPA;AAAA;AAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,C;;;;;;;;;;;;ACrBA;AAAA;AAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACzCA;AAAA;AAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACxBA;AAAA;AAAA;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B,GAAG;AACH;AACA;AACA,cAAc,OAAO;AACrB,GAAG;AACH;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B,GAAG;AACH;AACA;AACA,cAAc,OAAO;AACrB,GAAG;AACH;AACA;AACA,oBAAoB,OAAO;AAC3B,GAAG;AACH;AACA;AACA,cAAc,OAAO;AACrB,GAAG;AACH;AACA;AACA,cAAc,OAAO;AACrB,GAAG;AACH;AACA;AACA,oBAAoB,OAAO;AAC3B,GAAG;AACH;AACA;AACA,cAAc,OAAO;AACrB,GAAG;AACH;AACA;AACA,oBAAoB,OAAO;AAC3B,GAAG;AACH;AACA;AACA,cAAc,OAAO;AACrB,GAAG;AACH;AACA;AACA,mBAAmB,OAAO;AAC1B,GAAG;AACH;AACA;AACA,qBAAqB,OAAO;AAC5B;AACA;AACe;AACf;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH,0DAA0D,OAAO;AACjE;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;AC5EA;AAAA;AAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM,QAAQ,MAAM;AAC/B,WAAW,MAAM,QAAQ,MAAM;AAC/B,aAAa,MAAM,IAAI,MAAM;AAC7B,YAAY,MAAM,IAAI,MAAM;AAC5B;AACA;AACA,QAAQ,+EAAiB;AACzB;AACA;AACA,GAAG;AACH,QAAQ,+EAAiB;AACzB;AACA;AACA,GAAG;AACH,YAAY,+EAAiB;AAC7B;AACA;AACA,GAAG;AACH;AACe,yEAAU,E;;;;;;;;;;;;ACjCzB;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe;AACf;AACA,C;;;;;;;;;;;;ACVA;AAAA;AAAqE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,OAAO,6EAAe;AACtB;AACA;AACA,GAAG;AACH,WAAW,6EAAe;AAC1B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,SAAS,6EAAe;AACxB;AACA;AACA,GAAG;AACH,OAAO,6EAAe;AACtB;AACA;AACA,GAAG;AACH,aAAa,6EAAe;AAC5B;AACA;AACA;AACA;AACA,GAAG;AACH;AACe,uEAAQ,E;;;;;;;;;;;;ACpJvB;AAAA;AAAA;AAA6E;AACd;AAC/D;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iFAAmB;AACpC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,OAAO,0EAAY;AACnB;AACA;AACA;AACA;AACA,GAAG;AACH,WAAW,0EAAY;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,SAAS,0EAAY;AACrB;AACA;AACA;AACA;AACA,GAAG;AACH,OAAO,0EAAY;AACnB;AACA;AACA;AACA;AACA,GAAG;AACH,aAAa,0EAAY;AACzB;AACA;AACA;AACA;AACA,GAAG;AACH;AACe,oEAAK,E;;;;;;;;;;;;ACjGpB;AAAA;AAAA;AAAA;AAAA;AAAA;AAA4D;AACR;AACQ;AACZ;AACN;AAC1C;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,oCAAoC;AACpC,mCAAmC;AACnC;;AAEA;AACA,kBAAkB,oEAAc;AAChC,cAAc,gEAAU;AACxB,kBAAkB,oEAAc;AAChC,YAAY,8DAAQ;AACpB,SAAS,2DAAK;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACe,qEAAM,E;;;;;;;;;;;;AC5BrB;AAAA;AAAA;AAAwC;AACxC;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,WAAW,gBAAgB;AAC3B,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB;;AAEjB;AACA,iCAAiC;AACjC,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,sBAAsB,gEAAM;;AAE5B;AACA;AACA;AACA,GAAG;AACH;AACA,C;;;;;;;;;;;;AClEA;AAAA;AAAA;AAAwC;AACxC;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,WAAW,gBAAgB;AAC3B,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,iBAAiB;;AAEjB;AACA,iCAAiC;AACjC,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,sBAAsB,gEAAM;;AAE5B;AACA;AACA;AACA,GAAG;AACH;AACA,C;;;;;;;;;;;;AClEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmE;AACV;AACM;AACE;AACN;AACc;AACN;AACnE;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,kBAAkB,IAAI;AACtB;AACA,oBAAoB,IAAI;AACxB;AACA,mBAAmB,IAAI;AACvB;AACA;AACA;AACA;AACA,0BAA0B,IAAI;AAC9B;AACA,4BAA4B,IAAI;AAChC;AACA,2BAA2B,IAAI;;AAE/B;AACA;AACA,oCAAoC,EAAE,KAAK,EAAE;AAC7C,qBAAqB,EAAE,KAAK,EAAE;AAC9B,oCAAoC,EAAE,KAAK,EAAE,MAAM,EAAE;AACrD,wBAAwB,EAAE,MAAM,EAAE;AAClC,uCAAuC,EAAE,MAAM,EAAE,OAAO,EAAE;AAC1D;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kDAAkD,YAAY;AAC9D;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,oDAAoD,YAAY;AAChE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,+EAA+E;;AAE/E;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;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,wBAAwB,4EAAc;;AAEtC;AACA;AACA;AACA;AACA,eAAe,4EAAc;AAC7B;;AAEA;AACA;AACA;AACA,aAAa,4EAAc;AAC3B,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa,+EAAiB;AAC9B,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,aAAa,4EAAc,CAAC,wEAAU;AACtC,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,aAAa,+EAAiB,CAAC,2EAAa;AAC5C,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,aAAa,uEAAS;AACtB;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,aAAa,uEAAS;AACtB;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,aAAa,uEAAS;AACtB;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,aAAa,0EAAY;AACzB;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACe,sEAAO,E;;;;;;;;;;;;AC59CtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqD;AACK;AAClB;AACK;AACuB;AAC2B;AAC6B;AACzE;AACL;AAC9C,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qFAAqF;AACrF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;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;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;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,iDAAiD,WAAW;AAC5D;AACA,iDAAiD,WAAW;AAC5D;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,oEAAoE;AACpE,wBAAwB,4CAA4C;AACpE;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB,YAAY,WAAW,mDAAmD;AAC1E,YAAY,WAAW,+CAA+C;AACtE,YAAY,WAAW,yDAAyD;AAChF,YAAY,WAAW,2DAA2D;AAClF,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC,8DAAa;;AAE9C;AACA;AACA;;AAEA;AACA,+EAA+E,uEAAS;AACxF,qGAAqG,uEAAS,gCAAgC;;AAE9I;AACA;AACA;;AAEA;AACA,6DAA6D,uEAAS;AACtE,0EAA0E,uEAAS,uBAAuB;;AAE1G;AACA;AACA;;AAEA;AACA;AACA,aAAa,gEAAM;AACnB,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA,0BAA0B,2EAAc;AACxC;AACA;;AAEA;AACA,GAAG;AACH;;AAEA,aAAa,mBAAmB;AAChC;;AAEA,gDAAgD,8FAAwB;AACxE,MAAM,yFAAmB;AACzB;;AAEA,iDAAiD,+FAAyB;AAC1E,MAAM,yFAAmB;AACzB;;AAEA;AACA,iBAAiB,6DAAO;;AAExB;AACA;;AAEA;AACA;;AAEA,wBAAwB,wBAAwB;AAChD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,OAAO;;;AAGP;AACA;AACA,OAAO;AACP;AACA,OAAO;;;AAGP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,GAAG;AACH,aAAa,gEAAM;;AAEnB;AACA;AACA,GAAG;AACH;AACA;;;AAGA,gBAAgB,yEAAe,OAAO,6FAA+B;AACrE;;AAEA,aAAa,kCAAkC;AAC/C;;AAEA;AACA;AACA;;AAEA,wEAAwE;;AAExE;AACA;AACA,MAAM,oEAAM,mBAAmB;AAC/B,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;ACniBA;AAAA;AAAA;AAAA;AAAmD;AAC4C;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE;AACxE,sBAAsB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE;AAC1E,gCAAgC,EAAE,UAAU,EAAE;AAC9C;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,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,MAAM;AACjB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sBAAsB;AAC7D;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA,wFAAwF,uEAAS;;AAEjG;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,6FAA+B,eAAe;;AAE3D;AACA;AACA,qBAAqB,6FAA+B;;AAEpD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mCAAmC,EAAE,SAAS,+BAA+B,OAAO,EAAE,SAAS,+BAA+B;AAC9H,yCAAyC;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA6C;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;ACjSA;AAAA;AAAA;AAAA;AAAwC;AACW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,0DAA0D;AAC5E,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,sDAAsD,uEAAS;;AAE/D;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AC9CA;AAAA;AAAA;AAAA;AAAmD;AACX;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,mBAAmB,uEAAS;AAC5B;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAA;AAA0C;AACF;AACW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,kBAAkB;AACnE;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA,6DAA6D,uEAAS;AACtE,0EAA0E,uEAAS,uBAAuB;;AAE1G;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,YAAY,uEAAS;AACrB;AACA;AACA;AACA;AACA,SAAS,iEAAO;AAChB,C;;;;;;;;;;;;ACzDA;AAAA;AAAA;AAAA;AAAmD;AACX;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,kBAAkB,uEAAS;AAC3B;AACA;AACA;AACA,C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAAA;AAAmD;AACX;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,cAAc,uEAAS;AACvB;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmD;AACX;AACE;AACI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,YAAY,uEAAS;AACrB,mBAAmB,mEAAS;AAC5B;AACA,SAAS,iEAAO;AAChB,C;;;;;;;;;;;;ACvCA;AAAA;AAAA;AAAA;AAAA;AAAmD;AACX;AACQ;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,gBAAgB,uEAAS;AACzB,aAAa,oEAAU;AACvB;AACA;AACA,C;;;;;;;;;;;;ACtCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmD;AACX;AACwB;AACY;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,oBAAoB,uEAAS;AAC7B,aAAa,kFAAwB,OAAO,4EAAkB;AAC9D;AACA;AACA;AACA,SAAS,4EAAkB;AAC3B;AACA;AACA,C;;;;;;;;;;;;ACjDA;AAAA;AAAA;AAAA;AAAmD;AACX;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,qBAAqB,uEAAS;AAC9B;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAmD;AACX;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,gBAAgB,uEAAS;AACzB;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAA;AAAmD;AACX;AACgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,cAAc,uEAAS;AACvB;AACA;AACA;AACA;AACA;AACA,oBAAoB,wEAAc,uBAAuB;AACzD;;AAEA;AACA;AACA,C;;;;;;;;;;;;AC3CA;AAAA;AAAA;AAAA;AAAA;AAAmD;AACX;AACI;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,gBAAgB,uEAAS;AACzB;AACA;AACA,SAAS,kEAAQ;AACjB,C;;;;;;;;;;;;ACpCA;AAAA;AAAA;AAAA;AAAmD;AACX;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,gBAAgB,uEAAS;AACzB;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAA;AAA0C;AACF;AACW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,aAAa,uEAAS;AACtB,aAAa,iEAAO;AACpB;AACA;AACA,C;;;;;;;;;;;;AC1DA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA4E;AAClB;AAClB;AACW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA,+EAA+E,uEAAS;AACxF,qGAAqG,uEAAS;AAC9G,aAAa,gEAAM;AACnB,iBAAiB,uEAAS;AAC1B,aAAa,kFAAwB,OAAO,yEAAe;AAC3D;AACA;AACA;AACA,SAAS,yEAAe;AACxB;AACA;AACA,C;;;;;;;;;;;;ACrEA;AAAA;AAAA;AAAA;AAAmD;AACX;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB,aAAa,uEAAS,YAAY;;AAElC;AACA;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;ACvCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,SAAS,qEAAW;AACpB;AACA,GAAG;AACH,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAwD;AACA;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,wEAAc;AAC3B;AACA;AACA;AACA,aAAa,wEAAc;AAC3B;AACA,C;;;;;;;;;;;;ACvCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA,C;;;;;;;;;;;;ACjCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACnCA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf,SAAS,oEAAU;AACnB,C;;;;;;;;;;;;AC3BA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAwC;AACW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,kBAAkB;AAChF;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA,6DAA6D,uEAAS;AACtE,0EAA0E,uEAAS,uBAAuB;;AAE1G;AACA;AACA;;AAEA,aAAa,gEAAM;AACnB;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;ACvDA;AAAA;AAAA;AAAA;AAAA;AAAkD;AACA;AACC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO,kEAAkE;AACpF,WAAW,cAAc;AACzB,WAAW,cAAc;AACzB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB,YAAY,WAAW;AACvB,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEe;AACf;AACA;AACA;;AAEA;AACA;AACA;AACA,+EAA+E,uEAAS;AACxF,qGAAqG,uEAAS;AAC9G,aAAa,qEAAW;AACxB;AACA;AACA;AACA,aAAa,qEAAW;AACxB;AACA,C;;;;;;;;;;;;AC/DA;AAAA;AAAA;AAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,kBAAkB,gEAAM;AACxB;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AClCA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAmD;AACT;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,iEAAO;AAChB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAmD;AACP;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,kEAAQ;AACjB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAmD;AACO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,yEAAe;AACxB,C;;;;;;;;;;;;ACvCA;AAAA;AAAA;AAAA;AAAmD;AACO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,yEAAe;AACxB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAmD;AACH;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,oEAAU;AACnB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAmD;AACL;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,mEAAS;AAClB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAmD;AACD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,qEAAW;AACpB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAmD;AACH;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,oEAAU;AACnB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAmD;AACP;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,kEAAQ;AACjB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AAAA;AAAmD;AACP;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;AACA;;AAEA,eAAe,uEAAS;AACxB,SAAS,kEAAQ;AACjB,C;;;;;;;;;;;;AChCA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,aAAa,KAAK;AAClB,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;;AAEA,wDAAwD;;AAExD;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,kKAAkK;;AAElK;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;;ACpDA;AACA;AACa;AACb,iBAAiB,mBAAO,CAAC,0DAAI;;;;;;;;;;;;ACH7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC,KAA4D;AAC7D,CAAC,SAC+B;AAChC,CAAC,qBAAqB;;AAEtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;AAIA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,gFAAgF;;AAEhF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,sBAAsB;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC,yCAAyC,UAAc;AACxD;AACA,CAAC;AACD;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,IAAI;AACd;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,wBAAwB;AACzC;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,mBAAmB,6CAA6C;AAChE;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,MAAM;AAChB,UAAU,OAAO;AACjB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAU,MAAM;AAChB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,IAAI;AACd;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,UAAU,SAAS;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,UAAU,SAAS;AACnB,UAAU,SAAS;AACnB;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,UAAU,SAAS;AACnB;AACA,WAAW;AACX;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA,YAAY,SAAS;AACrB,aAAa;AACb;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,CAAC;;;;AAID;;;;;;;;;;;;;;ACrpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP;AACA,sCAAsC,QAAQ;AAC9C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA,QAAQ,yBAAyB;AACjC;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;;;;;;;;;;;AC/bA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAA4D;AAChE,IAAI,SACyD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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;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,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,gBAAgB;AAChB,iBAAiB;AACjB;AACA,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB;AACA,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB;AACA,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB,4BAA4B;AAC5C;AACA,gBAAgB,2CAA2C,WAAW;AACtE,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB,4CAA4C;AAC5D,gBAAgB,2BAA2B;AAC3C,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB,oCAAoC;AACpD,gBAAgB;AAChB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD;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,mEAAmE;AACnE;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,SAAS;AACT;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;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;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;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;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,uBAAuB;AACvB;AACA;AACA;AACA,yDAAyD,wDAAwD,EAAE;AACnH;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,wBAAwB;AACxB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,8BAA8B;AACnC;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,iDAAiD;AACzF,qDAAqD,mDAAmD;AACxG;AACA;AACA;AACA,kDAAkD,yCAAyC;AAC3F,kDAAkD,yCAAyC;AAC3F,yCAAyC,qEAAqE;AAC9G,oDAAoD,6BAA6B;AACjF;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,8BAA8B;AAC9B,8BAA8B;AAC9B,wBAAwB;AACxB,4BAA4B;AAC5B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,yBAAyB;AACzB,4BAA4B;AAC5B,qBAAqB;AACrB,qBAAqB;AACrB,uBAAuB;AACvB,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B,qBAAqB;AACrB;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,gCAAgC;AAChC;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;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,gGAAgG,iDAAiD,EAAE;AACnJ,4FAA4F,8CAA8C,EAAE;AAC5I,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;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,wBAAwB;AACxB;AACA;AACA;AACA,wBAAwB;AACxB;AACA,oBAAoB;AACpB;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,KAAK;;AAEL;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;AACb;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,yBAAyB;AACzB;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,KAAK;AACL,6CAA6C,iDAAiD;AAC9F,0CAA0C,8CAA8C;AACxF,yCAAyC,6CAA6C;AACtF,0CAA0C,8CAA8C;AACxF;AACA;AACA;AACA,0CAA0C,kDAAkD;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,oBAAoB,EAAE;AACzD;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,8BAA8B,8BAA8B;;AAE5D;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,6BAA6B;AACvE;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;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;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;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;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;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;AACA;AACA;AACA,KAAK,sEAAsE;;AAE3E;AACA;AACA;AACA;AACA;AACA,KAAK,0CAA0C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mDAAmD,6BAA6B,IAAI;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,yBAAyB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iCAAiC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;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;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;AACA,SAAS;AACT,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;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,gCAAgC,uDAAuD;AACvF,wCAAwC,8DAA8D;AACtG;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,gCAAgC,cAAc,EAAE;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,qBAAqB;AAC3D;AACA,0CAA0C;AAC1C,SAAS;AACT;AACA;AACA;AACA;AACA,qEAAqE,eAAe;AACpF;AACA,SAAS;AACT;AACA;AACA,oEAAoE,eAAe;AACnF;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,8EAA8E,eAAe;AAC7F;AACA,SAAS;AACT;AACA;AACA,oEAAoE,eAAe;AACnF;AACA,SAAS;AACT;AACA;AACA,sEAAsE,eAAe;AACrF;AACA,SAAS;AACT;AACA;AACA,iEAAiE,eAAe;AAChF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;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,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;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,KAAK;AACL;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,qBAAqB;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,qBAAqB,EAAE;AACvF;AACA;AACA,gEAAgE,kFAAkF,EAAE;AACpJ;AACA,iCAAiC;AACjC;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,iCAAiC,EAAE;AAC9G,6EAA6E,kBAAkB,EAAE;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,kEAAkE;AACnH;AACA;AACA,aAAa;AACb;AACA;AACA,KAAK;AACL;AACA,yCAAyC;AACzC;AACA,uCAAuC,oDAAoD;AAC3F,wCAAwC,6BAA6B;AACrE,8CAA8C,gCAAgC;AAC9E,sCAAsC,oCAAoC;AAC1E,gCAAgC,uEAAuE;;AAEvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oCAAoC;AACpE;AACA;AACA;AACA,gCAAgC,wCAAwC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,qFAAqF;AAC5H;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;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,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,oCAAoC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,wCAAwC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,0CAA0C;AAC/C;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,kEAAkE,EAAE;AACvH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,0CAA0C,EAAE;AACpF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,8CAA8C;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,oBAAoB,EAAE;AACjE;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,0CAA0C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,iDAAiD,EAAE;AACvH;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;AACP;AACA;AACA;AACA;;AAEA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA,kCAAkC,sEAAsE;AACxG,KAAK,EAAE;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,oCAAoC;AACzC,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;AACP;AACA;AACA;AACA;;AAEA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;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;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;AACA;AACA;AACA,KAAK,sBAAsB;AAC3B;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;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,gCAAgC;AACrC;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;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,kDAAkD;AACvD;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;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,KAAK,0CAA0C;AAC/C;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;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;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;;AAEA,yCAAyC;AACzC;AACA;AACA;AACA;AACA,KAAK,EAAE;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,4BAA4B;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,sCAAsC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA,KAAK,EAAE;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,gCAAgC;AACrC;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,KAAK,4BAA4B;AACjC;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;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,wCAAwC;AAC7C;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;AACA;AACA;AACA;AACA,iDAAiD,4CAA4C,EAAE,sBAAsB,mBAAmB,EAAE;AAC1I;AACA;AACA;AACA;AACA,iDAAiD,4CAA4C,EAAE,sBAAsB,mBAAmB,EAAE;AAC1I;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;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,gCAAgC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,gCAAgC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;;AAEA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,yCAAyC,8BAA8B,EAAE;AACzE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,oBAAoB,EAAE;AAC9F;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,oBAAoB,EAAE;AAC3F;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,gCAAgC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0CAA0C,4BAA4B;;AAEtE;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,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA,qCAAqC,+CAA+C;AACpF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA,iCAAiC,uCAAuC;AACxE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD;AACA;AACA,6BAA6B,+BAA+B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;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;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;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,kFAAkF,yBAAyB,EAAE;AAC7G;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;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,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL,uCAAuC,gEAAgE;AACvG;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,uBAAuB;AACvB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,gEAAgE,WAAW;AAC3E;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;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,oDAAoD,qDAAqD;AACzG,sCAAsC,yCAAyC;AAC/E,yCAAyC,4CAA4C;AACrF;AACA;AACA;AACA,uCAAuC,8BAA8B;AACrE,uCAAuC,8BAA8B;AACrE,0CAA0C,iCAAiC;AAC3E,yCAAyC,gCAAgC;AACzE,wCAAwC,+BAA+B;AACvE,yCAAyC,gCAAgC;AACzE,2CAA2C,kCAAkC;AAC7E,0CAA0C,+BAA+B;AACzE,2CAA2C,kCAAkC;AAC7E,0CAA0C,iCAAiC;AAC3E,2CAA2C,kCAAkC;AAC7E,6CAA6C,oCAAoC;AACjF,2CAA2C,kCAAkC;;AAE7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,sCAAsC,EAAE;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;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;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;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;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;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,gCAAgC,eAAe;AAC/C;AACA,yHAAyH,8DAA8D,EAAE;AACzL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;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;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;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;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;AACpE;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,2DAA2D,+BAA+B,EAAE;AAC5F,2DAA2D,eAAe,EAAE;AAC5E;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,EAAE,EAAE;AACjB;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,qBAAqB;AACrB;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;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,cAAc;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;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,iDAAiD,OAAO;AACxD;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;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;AACA;AACA,uDAAuD,uDAAuD,EAAE;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK,8CAA8C;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA,sCAAsC,QAAQ;AAC9C;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;AACA;AACA;AACA;AACA,sCAAsC,+BAA+B,+BAA+B,GAAG;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,4BAA4B;AACjC;AACA;AACA,2CAA2C,mBAAmB,EAAE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;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,KAAK;AACL,yCAAyC,4CAA4C;;AAErF;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;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;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,wBAAwB;AAC7B;AACA;AACA,4BAA4B;AAC5B,4BAA4B;AAC5B,wBAAwB;AACxB,wBAAwB;AACxB;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,0CAA0C,qCAAqC;;AAE/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;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,KAAK;AACL;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,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;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,SAAS;AACT;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,oEAAoE;AACvG,8CAA8C,kCAAkC;AAChF;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;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;;AAEtC;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,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;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,8CAA8C,wCAAwC,EAAE,6BAA6B,kCAAkC,EAAE;AACzJ;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,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,yBAAyB,EAAE;AACnG;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4CAA4C,yDAAyD,EAAE;AACvG;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,6BAA6B;AAC7B;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,6BAA6B;AAC7B;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB,aAAa;AACb;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;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,6BAA6B;AAC7B;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;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;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;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,iBAAiB;AACjB,aAAa;AACb;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;AACb;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;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,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,6DAA6D;AAC9F,iCAAiC,iEAAiE;AAClG,iCAAiC,mEAAmE;AACpG,iCAAiC;AACjC;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,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,KAAK;AACL;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,SAAS;AACT;;AAEA;AACA,yCAAyC,gEAAgE;AACzG;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,mCAAmC,6CAA6C;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;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;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,SAAS;AACT,KAAK,EAAE;;AAEP;;AAEA,CAAC;AACD;;;;;;;;;;;;ACz3NA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,KAA4D,4BAA4B,mBAAO,CAAC,4DAAkB,GAAG,mBAAO,CAAC,qDAAO,GAAG,mBAAO,CAAC,mEAAa;AAC7J,CAAC,SACiE;AAClE,CAAC,2CAA2C;;AAE5C;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,+CAA+C,qEAAqE,qEAAqE,2EAA2E,4DAA4D,qDAAqD,4CAA4C;AACja;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,YAAY,8BAA8B;AAC1C;AACA,mBAAmB;AACnB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yBAAyB,4BAA4B,iBAAiB,GAAG;AACzE;AACA,yBAAyB,WAAW;AACpC;AACA,yBAAyB,cAAc;AACvC;AACA,yBAAyB,WAAW;AACpC;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8CAA8C,oDAAoD;AAClG,gDAAgD,wDAAwD;AACxG;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,6BAA6B;AAC7B;;AAEA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,eAAe;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,gDAAgD,qBAAqB;AACrE;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gEAAgE;;AAEhE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,wBAAwB;AACxB;AACA,wBAAwB;AACxB;AACA,iBAAiB;AACjB;AACA,sBAAsB;AACtB;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,cAAc;AACd;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC;AACxC;AACA;AACA,WAAW,EAAE;AACb;AACA;;AAEA;AACA;AACA,wCAAwC;AACxC;AACA;AACA,WAAW,EAAE;AACb;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA;;AAEA;AACA;AACA;;AAEA,yBAAyB,uEAAuE;AAChG;AACA,OAAO;AACP;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF,mBAAmB;AACvG,OAAO;;AAEP;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;;;;;;;;;;;;ACz5BD,WAAW,mBAAO,CAAC,iDAAM;AACzB,UAAU,mBAAO,CAAC,sCAAK;;AAEvB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;A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AA0D,EAAE,sBAAsB,gEAAgE,KAAK,2CAA2C,wBAAwB,yBAAyB,cAAc,0DAA0D,kBAAkB,8CAA8C,YAAY,IAAI,sBAAsB,KAAK,mCAAmC,2DAA2D,QAAQ,8HAA8H,QAAQ,oKAAoK,uDAAuD,oBAAoB,YAAY,IAAI,KAAK,wBAAwB,YAAY,MAAM,OAAO,iBAAiB,GAAG,cAAc,mBAAmB,cAAc,0BAA0B,mRAAmR,GAAG,cAAc,EAAE,IAAI,qBAAqB,U;;;;;;;;;;;;AC7RxyQ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2CAA2C;AAC3C;AACA,2DAA2D;;AAE3D;AACA,+CAA+C;AAC/C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB,yBAAyB;AACzB;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,MAAM,aAAa,OAAO;;AAEpD;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;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;AACA;AACA;AACA,iDAAiD,EAAE;AACnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA2C,EAAE;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,eAAe;AACf,cAAc;AACd,cAAc;AACd,gBAAgB;AAChB,eAAe;AACf;;AAEA;AACA;AACA,UAAU;AACV,SAAS;AACT,SAAS;AACT,WAAW;AACX,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,KAA0B;;AAE9C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,aAAa,EAAE;AACf,aAAa,MAAM;AACnB,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB,aAAa,OAAO;AACpB,eAAe,SAAS;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,MAAM;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,EAAE;AACf,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,EAAE;AACf,aAAa,SAAS;AACtB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,MAAM;AACnB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,aAAa,EAAE;AACf,aAAa,QAAQ;AACrB;AACA,eAAe,EAAE;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,aAAa,EAAE;AACf,aAAa,QAAQ;AACrB;AACA,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,aAAa,OAAO;AACpB,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,EAAE;AACf,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,EAAE;AACf,aAAa,OAAO;AACpB,aAAa,SAAS;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,EAAE;AACf,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B,aAAa,SAAS;AACtB,aAAa,EAAE;AACf,aAAa,QAAQ;AACrB;AACA,aAAa,SAAS;AACtB,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,MAAM;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,SAAS;AACtB,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,MAAM;AACnB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,MAAM;AACnB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,MAAM;AACnB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,MAAM;AACnB,eAAe,OAAO;AACtB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,EAAE;AACf,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,eAAe,EAAE;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,EAAE;AACf,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,EAAE;AACf,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,MAAM;AACnB,aAAa,EAAE;AACf,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,SAAS;AACxB;AACA;AACA,cAAc,2BAA2B;AACzC;AACA;AACA,mBAAmB,gCAAgC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,6BAA6B;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;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;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,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;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;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;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,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB,iBAAiB,MAAM;AACvB;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,eAAe,MAAM;AACrB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA,oCAAoC,6BAA6B,EAAE;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,aAAa;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,aAAa;AAC9B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,iBAAiB,EAAE;AACnB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,MAAM;AACrB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,6BAA6B;AAC5C,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,gBAAgB;AAChB,OAAO;;AAEP;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,EAAE;AACjB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qEAAqE;AACrE;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,MAAM;AACrB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB,YAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,mBAAmB;AAClC,iBAAiB,OAAO;AACxB;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;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB,QAAQ;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;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,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,gBAAgB,QAAQ;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,eAAe,OAAO,WAAW;AACjC,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,4BAA4B;;AAE5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO,WAAW;AACjC,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO,WAAW;AACjC,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;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;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,+CAA+C;AACpF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,MAAM;AACrB;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;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;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,oEAAoE;AACpE;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,MAAM;AACrB;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,eAAe,MAAM;AACrB;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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,eAAe;AACf;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;;AAEA;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,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,0CAA0C;AAC1C,wCAAwC;AACxC,+DAA+D;AAC/D,iEAAiE;AACjE;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,EAAE;AACjB,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,MAAM;AACvB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,KAAK;AACpB,iBAAiB,MAAM;AACvB;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,SAAS,GAAG,SAAS,KAAK,SAAS;AAC3D,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA,uBAAuB,iBAAiB,GAAG,iBAAiB;AAC5D;AACA,mCAAmC,iBAAiB;AACpD,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,MAAM;AACvB;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;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,MAAM;AACvB;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;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C,UAAU,qCAAqC;AAC/C,UAAU;AACV;AACA;AACA,4CAA4C,kBAAkB,EAAE;AAChE;AACA;AACA;AACA,gCAAgC,qCAAqC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA,UAAU,qCAAqC;AAC/C,UAAU,qCAAqC;AAC/C,UAAU;AACV;AACA;AACA,uCAAuC,kBAAkB,EAAE;AAC3D;AACA;AACA;AACA,2BAA2B,oCAAoC;AAC/D;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,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;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;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAU,qCAAqC;AAC/C,UAAU,qCAAqC;AAC/C,UAAU;AACV;AACA;AACA,uCAAuC,2BAA2B,EAAE;AACpE;AACA;AACA;AACA,2BAA2B,kCAAkC;AAC7D;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,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C,UAAU,qCAAqC;AAC/C,UAAU;AACV;AACA;AACA,2CAA2C,4BAA4B,EAAE;AACzE;AACA;AACA;AACA,+BAA+B,mCAAmC;AAClE;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;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;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,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,SAAS,KAAK,SAAS,GAAG,SAAS;AAC7D,eAAe,SAAS;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA,uBAAuB,iBAAiB,GAAG,iBAAiB;AAC5D,sBAAsB,iBAAiB,GAAG,iBAAiB;AAC3D;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;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;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;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,eAAe,MAAM;AACrB,eAAe,KAAK;AACpB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA,qBAAqB,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS;AAClE;AACA,4BAA4B,SAAS,GAAG,SAAS;AACjD;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA,qBAAqB,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB;AAC9E;AACA,8BAA8B,iBAAiB;AAC/C;AACA,eAAe,iBAAiB,GAAG,iBAAiB;AACpD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,qBAAqB;AACpC,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C;AACA,iCAAiC,SAAS,eAAe,YAAY,EAAE;AACvE;AACA;AACA;AACA,iCAAiC,SAAS;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C;AACA,qCAAqC,SAAS,eAAe,YAAY,EAAE;AAC3E;AACA;AACA;AACA,qCAAqC,SAAS;AAC9C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,MAAM;AACvB;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,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,MAAM;AACvB;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;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA,UAAU,oCAAoC;AAC9C,UAAU,qCAAqC;AAC/C,UAAU;AACV;AACA;AACA,4CAA4C,kBAAkB,EAAE;AAChE;AACA;AACA;AACA,gCAAgC,qCAAqC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA,UAAU,qCAAqC;AAC/C,UAAU,qCAAqC;AAC/C,UAAU;AACV;AACA;AACA,uCAAuC,kBAAkB,EAAE;AAC3D;AACA;AACA;AACA,2BAA2B,oCAAoC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS,KAAK,SAAS,GAAG,SAAS;AACtD,eAAe,SAAS,GAAG,SAAS;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA,uBAAuB,iBAAiB,GAAG,iBAAiB;AAC5D,sBAAsB,iBAAiB,GAAG,iBAAiB;AAC3D;AACA;AACA,eAAe,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB;AACxE;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS,GAAG,SAAS,GAAG,SAAS;AACnD,eAAe,SAAS,GAAG,SAAS;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA,uBAAuB,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB;AAChF;AACA;AACA,eAAe,iBAAiB,GAAG,iBAAiB;AACpD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB;AACA,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,KAAK;AACpB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS,KAAK,SAAS,GAAG,SAAS;AACpD,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA,uBAAuB,iBAAiB,GAAG,iBAAiB;AAC5D,sBAAsB,iBAAiB,GAAG,iBAAiB;AAC3D;AACA;AACA,eAAe,iBAAiB,GAAG,iBAAiB;AACpD;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,cAAc,OAAO,QAAQ,SAAS,GAAG,SAAS,GAAG;AACrD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB;AACA,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAU,+BAA+B;AACzC,UAAU,+BAA+B;AACzC,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,iBAAiB,OAAO;AACxB;AACA;AACA,qBAAqB,QAAQ,OAAO,SAAS,EAAE;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,8BAA8B;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAU,8BAA8B;AACxC,UAAU;AACV;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;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,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,cAAc;AACd;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,gBAAgB,OAAO;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,+CAA+C;AACzD,UAAU;AACV;AACA;AACA;AACA,uBAAuB,oCAAoC;AAC3D;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,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA,UAAU,8CAA8C;AACxD,UAAU;AACV;AACA;AACA,oCAAoC,kBAAkB,EAAE;AACxD;AACA;AACA;AACA,wBAAwB,4BAA4B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA,UAAU,+CAA+C;AACzD,UAAU,gDAAgD;AAC1D,UAAU;AACV;AACA;AACA,kCAAkC,mBAAmB,EAAE;AACvD;AACA;AACA;AACA,sBAAsB,2BAA2B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;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,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,sBAAsB;AACrC;AACA,eAAe,KAAK;AACpB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,UAAU,4BAA4B;AACtC,UAAU;AACV;AACA;AACA;AACA;AACA,QAAQ;AACR,cAAc,OAAO,4BAA4B,QAAQ,8BAA8B;AACvF;AACA;AACA,cAAc,UAAU,4BAA4B,YAAY,8BAA8B;AAC9F;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA,UAAU,mBAAmB;AAC7B,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,qCAAqC;AACpD;AACA,eAAe,SAAS;AACxB,gBAAgB,OAAO;AACvB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA,UAAU,8BAA8B;AACxC,UAAU,8BAA8B;AACxC,UAAU,8BAA8B;AACxC,UAAU;AACV;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,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA,UAAU,gDAAgD;AAC1D,UAAU,+CAA+C;AACzD,UAAU;AACV;AACA;AACA,uCAAuC,iBAAiB,EAAE;AAC1D;AACA;AACA;AACA,2BAA2B,4BAA4B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,cAAc,iBAAiB,EAAE;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,eAAe,EAAE;AACjB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,iBAAiB,yBAAyB;AAC1C;AACA;AACA,QAAQ,IAAI;AACZ,cAAc,8BAA8B;AAC5C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,eAAe,EAAE;AACjB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA,UAAU,+CAA+C;AACzD,UAAU;AACV;AACA;AACA,oCAAoC,kBAAkB,EAAE;AACxD;AACA;AACA;AACA,wBAAwB,4BAA4B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;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,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,gBAAgB,OAAO;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,mCAAmC;AAC7C,UAAU;AACV;AACA;AACA;AACA,sBAAsB,oCAAoC;AAC1D;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,eAAe,aAAa;AAC5B,eAAe,yBAAyB;AACxC;AACA,iBAAiB,MAAM;AACvB;AACA;AACA;AACA,UAAU,8BAA8B;AACxC,UAAU,8BAA8B;AACxC,UAAU,8BAA8B;AACxC,UAAU;AACV;AACA;AACA,qCAAqC,eAAe,EAAE;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,oBAAoB,iCAAiC;AACrD,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;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,eAAe,SAAS;AACxB,eAAe,EAAE;AACjB,eAAe,KAAK;AACpB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,KAAK;AACpB,iBAAiB,SAAS;AAC1B;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,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,SAAS;AAC1B;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,SAAS;AAC1B;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,OAAO,YAAY;AAClC,eAAe,QAAQ;AACvB;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,kDAAkD,kBAAkB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,KAAK;AACpB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,KAAK;AACpB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA,qBAAqB;AACrB,oBAAoB;AACpB;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;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;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;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,yBAAyB;AACxC;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,KAAK;AACpB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,KAAK;AACpB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,qBAAqB;AACpC,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;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,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,OAAO,YAAY;AAClC,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,oBAAoB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA,oBAAoB,SAAS;AAC7B,eAAe,SAAS;AACxB;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,iBAAiB,EAAE;AACnB;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;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,iBAAiB,EAAE;AACnB;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA,qBAAqB;AACrB;AACA,6BAA6B,mBAAmB,cAAc,EAAE,EAAE;AAClE;AACA;AACA,6BAA6B,mBAAmB,cAAc,EAAE,EAAE;AAClE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA,qBAAqB;AACrB,oBAAoB;AACpB;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,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,iCAAiC,kBAAkB,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA,kDAAkD,kBAAkB,EAAE;AACtE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;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,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;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,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;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,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA,qBAAqB;AACrB,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;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;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;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,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;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,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;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,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;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,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA,qBAAqB;AACrB;AACA,0BAA0B,SAAS;AACnC;AACA;AACA,0BAA0B,SAAS;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;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,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;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,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,MAAM;AACvB;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;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;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B,cAAc;AACd;AACA,iBAAiB,SAAS;AAC1B,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;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,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B,cAAc;AACd;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS,GAAG,SAAS,GAAG,SAAS;AAClD,cAAc;AACd;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS,GAAG,SAAS,GAAG,SAAS;AAClD,cAAc;AACd;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,qBAAqB;AACpC,iBAAiB,MAAM;AACvB;AACA;AACA,qBAAqB,QAAQ,OAAO,SAAS,EAAE;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,mBAAmB,SAAS,GAAG,SAAS,GAAG,SAAS;AACpD,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,uBAAuB,OAAO,SAAS,EAAE,GAAG,OAAO,iBAAiB,EAAE;AACtE,cAAc,OAAO,iBAAiB;AACtC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA,qBAAqB,4BAA4B;AACjD,qBAAqB,6BAA6B;AAClD,qBAAqB;AACrB;AACA;AACA,qCAAqC,mBAAmB,EAAE;AAC1D;AACA;AACA;AACA,yBAAyB,2BAA2B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA,qBAAqB,4BAA4B;AACjD,qBAAqB,6BAA6B;AAClD,qBAAqB;AACrB;AACA;AACA,yCAAyC,mBAAmB,EAAE;AAC9D;AACA;AACA;AACA,6BAA6B,4BAA4B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,EAAE;AACjB,iBAAiB,EAAE;AACnB;AACA;AACA,qBAAqB,QAAQ,OAAO,SAAS,EAAE;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,iBAAiB,QAAQ;AACzB;AACA;AACA,qBAAqB,OAAO,SAAS;AACrC,6BAA6B,gBAAgB,SAAS,GAAG;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,iBAAiB,QAAQ;AACzB;AACA;AACA,8BAA8B,gBAAgB,SAAS,GAAG;AAC1D;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,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,QAAQ;AACR,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,KAAK;AACpB,iBAAiB,EAAE;AACnB;AACA;AACA,qBAAqB,QAAQ,OAAO,oBAAoB,EAAE;AAC1D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;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,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,kBAAkB,iBAAiB;AACnC;AACA,QAAQ;AACR,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,qBAAqB,+BAA+B;AACpD,qBAAqB;AACrB;AACA;AACA,uCAAuC,cAAc,EAAE;AACvD,cAAc,2BAA2B;AACzC;AACA;AACA;AACA,cAAc,2BAA2B;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,gBAAgB,SAAS,GAAG,SAAS;AACrC;AACA;AACA;AACA,gBAAgB,SAAS,GAAG,SAAS;AACrC;AACA;AACA;AACA,cAAc,QAAQ,iBAAiB,GAAG,iBAAiB;AAC3D;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,oBAAoB;AACpB;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,KAAK;;AAEL;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,qBAAqB;AACpC,iBAAiB,OAAO;AACxB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,qBAAqB;AACpC,iBAAiB,OAAO;AACxB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,cAAc;AACd;AACA;AACA,gCAAgC;AAChC,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,EAAE;AACjB,iBAAiB,EAAE;AACnB;AACA;AACA,qBAAqB,QAAQ,OAAO,+BAA+B,EAAE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,EAAE;AACjB,iBAAiB,OAAO;AACxB;AACA;AACA,qBAAqB,QAAQ,OAAO,SAAS,EAAE;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,EAAE;AACjB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO,WAAW;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,eAAe,EAAE;AACjB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,oBAAoB,yBAAyB;AAC7C;AACA,QAAQ,IAAI;AACZ,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,iBAAiB,QAAQ;AACzB;AACA;AACA,qBAAqB,QAAQ,OAAO,SAAS,EAAE;AAC/C;AACA;AACA;AACA;AACA,cAAc,QAAQ,QAAQ,EAAE;AAChC;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ,QAAQ,EAAE;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA,qBAAqB,QAAQ,OAAO,SAAS,EAAE;AAC/C;AACA,iDAAiD,cAAc,EAAE;AACjE;AACA;AACA;AACA,iDAAiD,sBAAsB,EAAE;AACzE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO,WAAW;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;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,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;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;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;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,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;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,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;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,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;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;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;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;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,eAAe,gBAAgB;AAC/B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;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;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO,YAAY;AAClC,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC,qBAAqB,UAAU;AAC/B;AACA;AACA,sEAAsE,2BAA2B,EAAE;AACnG,iBAAiB,8BAA8B;AAC/C;AACA;AACA;AACA,4DAA4D;AAC5D,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA,qDAAqD,2BAA2B,EAAE;AAClF,wCAAwC,aAAa,eAAe,EAAE;AACtE,iBAAiB,8BAA8B;AAC/C;AACA;AACA;AACA,wDAAwD,qCAAqC;AAC7F;AACA;AACA;AACA;AACA,0DAA0D,qBAAqB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,YAAY;AACvD,0CAA0C,QAAQ;AAClD,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA+B;;AAE/B,mCAAmC;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA,uDAAuD;AACvD;AACA;AACA,6BAA6B,EAAE;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,+BAA+B,iCAAiC;AAChE,cAAc;AACd;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO,YAAY;AAClC,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC;AACjC,aAAa,QAAQ,QAAQ,UAAU,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,gBAAgB,OAAO;AACvB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,KAAK;AACpB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,qBAAqB;AACpC,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B,sBAAsB,kBAAkB;AACxC;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA,aAAa,qBAAqB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,UAAU,iBAAiB;AAC3B,UAAU;AACV;AACA;AACA,qCAAqC,mBAAmB,cAAc,EAAE,EAAE;AAC1E,eAAe,iBAAiB;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,SAAS;AAC1B;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA,eAAe,SAAS,GAAG,SAAS;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,EAAE;AACjB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,EAAE;AACnB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,UAAU,8CAA8C;AACxD,UAAU;AACV;AACA;AACA;AACA,mCAAmC,mCAAmC;AACtE,eAAe,8CAA8C;AAC7D;AACA;AACA;AACA,eAAe,4BAA4B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,UAAU,yBAAyB;AACnC,UAAU;AACV;AACA;AACA,oCAAoC,iBAAiB;AACrD,eAAe,yBAAyB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,EAAE;AACjB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,UAAU,yBAAyB;AACnC,UAAU;AACV;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,eAAe,KAAK;AACpB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,UAAU,OAAO,qBAAqB,EAAE;AACxC,UAAU,OAAO,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,KAAK;AACpB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO,YAAY;AAClC,eAAe,QAAQ;AACvB,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB,GAAG,iBAAiB;AACvD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,qDAAqD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;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,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,UAAU,OAAO,SAAS,EAAE;AAC5B,UAAU,OAAO,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,qBAAqB;AACrB;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,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;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;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,MAAM;AACvB;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;AACA;AACA;AACA,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,EAAE;AACnB;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C;AACA,qCAAqC,YAAY,EAAE;AACnD,cAAc;AACd;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS;AACpE;AACA,sCAAsC,YAAY,EAAE;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,EAAE;AACnB;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C;AACA,qCAAqC,YAAY,EAAE;AACnD,cAAc;AACd;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS;AACpE;AACA,qCAAqC,YAAY,EAAE;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;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;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;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;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;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;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK,MAAM,iBAAiB;;AAE5B;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC,4DAA4D;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,yCAAyC;AACtE;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA,MAAM,IAA0E;AAChF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI,mCAAO;AACX;AACA,KAAK;AAAA,oGAAC;AACN;AACA;AACA,OAAO,EASJ;AACH,CAAC;;;;;;;;;;;;;;ACvthBD,+CAAa;;AAEb;AACA;AACA;AACA;AACA,oBAAoB;AACpB,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;;AC3CA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;ACvLtC;AACA,CAAC;;AAED;AACA,mBAAmB,KAA0B;AAC7C;AACA,kBAAkB,KAAyB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB,cAAc,MAAM;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,MAAM;AAClB,YAAY,SAAS;AACrB;AACA,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,SAAS;AACrB;AACA,cAAc,MAAM;AACpB;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,YAAY,OAAO;AACnB,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,KAAK;AACL,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,MAAM;AAClB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,cAAc,OAAO;AACrB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mCAAmC;AAClE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa,WAAW;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB;;AAExB,yCAAyC,qBAAqB;;AAE9D;AACA;AACA;AACA;AACA;AACA,kCAAkC,oBAAoB;;AAEtD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,0BAA0B,iBAAiB;AAC3C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,cAAc,iBAAiB;AAC/B;;AAEA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B,oBAAoB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE,IAEU;AACZ;AACA,EAAE,mCAAmB;AACrB;AACA,GAAG;AAAA,oGAAC;AACJ,EAAE,MAAM,EAaN;;AAEF,CAAC;;;;;;;;;;;;;;ACphBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,SAAS;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,eAAe;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpFa;;AAEb,iCAAiC,mBAAO,CAAC,0DAAU;AACnD,qCAAqC,mBAAO,CAAC,0DAAU;;;;;;;;;;;;;ACHvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA,WAAW,mBAAO,CAAC,6DAAc;AACjC,gBAAgB,mBAAO,CAAC,0FAAU;AAClC;;AAEA,eAAe,mBAAO,CAAC,kFAAoB;AAC3C,eAAe,mBAAO,CAAC,kFAAoB;;AAE3C;;AAEA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,G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AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iDAAiD,0FAA0F;;AAE3I;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,wCAAwC,mBAAO,CAAC,4EAAiB;AACjE;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,kGAAkG;AAClG,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,4FAA4F;AAC5F,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,gDAAgD;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,mBAAO,CAAC,4EAAiB;AAC/D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,4CAA4C;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;;AAEpB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA,4EAA4E;;AAE5E;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,iBAAiB,yBAAyB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mDAAmD;AACnD;AACA,mDAAmD,iEAAiE;AACpH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA,uCAAuC;AACvC,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gCAAgC,OAAO;AACvC;AACA;AACA;AACA,C;;;;;;;;;;;;;AC1/BA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,aAAa,mBAAO,CAAC,8EAAkB;;AAEvC;AACA,WAAW,mBAAO,CAAC,6DAAc;AACjC,gBAAgB,mBAAO,CAAC,0FAAU;AAClC;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,C;;;;;;;;;;;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEa;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,WAAW,mBAAO,CAAC,6DAAc;AACjC,gBAAgB,mBAAO,CAAC,0FAAU;AAClC;;AAEA;AACA;AACA,aAAa,mBAAO,CAAC,gEAAgB;AACrC;AACA;;AAEA;AACA,aAAa,mBAAO,CAAC,wGAA2B;AAChD;;AAEA;;AAEA,aAAa,mBAAO,CAAC,wDAAa;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kBAAkB,mBAAO,CAAC,kGAA4B;;AAEtD;;AAEA;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iDAAiD,0FAA0F;;AAE3I;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,mBAAO,CAAC,8EAAkB;;AAE/C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iCAAiC;;AAEjC;;AAEA,2CAA2C;AAC3C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,oDAAoD;AACpD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,E;;;;;;;;;;;;;AC9qBa;;AAEb,iDAAiD,0CAA0C,0DAA0D,EAAE;;AAEvJ,aAAa,mBAAO,CAAC,wDAAa;AAClC,WAAW,mBAAO,CAAC,aAAM;;AAEzB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB,gDAAgD;AAChD;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA,C;;;;;;;;;;;;AC9Ea;;AAEb;;AAEA,UAAU,mBAAO,CAAC,0EAAsB;AACxC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,E;;;;;;;;;;;ACzEA,iBAAiB,mBAAO,CAAC,+CAAQ;;;;;;;;;;;;ACAjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1BA,iBAAiB;;AAEjB;AACA;AACA;;;;;;;;;;;;ACJA,2BAA2B,mBAAO,CAAC,yFAA2B;AAC9D;AACA;AACA,mBAAmB,mBAAO,CAAC,yFAA2B;AACtD,iBAAiB,mBAAO,CAAC,qFAAyB;AAClD,oBAAoB,mBAAO,CAAC,2FAA4B;AACxD,sBAAsB,mBAAO,CAAC,+FAA8B;;;;;;;;;;;;ACN5D;AACA,aAAa,mBAAO,CAAC,8CAAQ;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC7DA;AACA;;AAEA;AACA;AACA;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA,kBAAkB;AAClB;AACA;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C,sBAAsB,EAAE;AAClE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,CAAC;;;;;;;;;;;;;ACzLD,kEAAoB,mBAAO,CAAC,gEAAe;AAC3C,eAAe,mBAAO,CAAC,kEAAgB;AACvC,aAAa,mBAAO,CAAC,gDAAO;AAC5B,kBAAkB,mBAAO,CAAC,4EAAsB;AAChD,UAAU,mBAAO,CAAC,sCAAK;;AAEvB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;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,C;;;;;;;;;;;;ACpFA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACxEA,gFAAiB,mBAAO,CAAC,kEAAc;AACvC,eAAe,mBAAO,CAAC,6DAAU;AACjC,eAAe,mBAAO,CAAC,8DAAY;AACnC,aAAa,mBAAO,CAAC,2EAAiB;AACtC,oBAAoB,mBAAO,CAAC,8DAAgB;;AAE5C;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAE;AACF;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,IAAI;AACJ,2CAA2C;AAC3C,IAAI;AACJ,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,GAAG;AACH;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH,EAAE;AACF;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,oCAAoC;;AAEpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;;;;;;;;;;;;;ACtUA,gFAAiB,mBAAO,CAAC,kEAAc;AACvC,eAAe,mBAAO,CAAC,6DAAU;AACjC,aAAa,mBAAO,CAAC,2EAAiB;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,MAAM;AACN,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,IAAI,aAAa;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,wCAAwC,eAAe,IAAI;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC;;AAEA;AACA,KAAK;AACL;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;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC/NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,aAAa,mBAAO,CAAC,wDAAa;AAClC;;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;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B,sCAAsC,sCAAsC;AACzG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;;AAEA;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;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,C;;;;;;;;;;;ACvSA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA,mBAAO,CAAC,iEAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9DA,aAAa,mBAAO,CAAC,8CAAQ;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;;;;;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb,eAAe,mBAAO,CAAC,qDAAU;AACjC,WAAW,mBAAO,CAAC,0CAAQ;;AAE3B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,KAAK;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA,2CAA2C,KAAK;AAChD,0CAA0C,KAAK;AAC/C;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,kBAAkB,mBAAO,CAAC,4DAAa;;AAEvC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,mBAAmB,4BAA4B;AAC/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,mBAAmB;AACrC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;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;;AAEA;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;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;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;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8BAA8B,QAAQ;AACtC;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,MAAM;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3tBa;;AAEb;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;;ACdA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,aAAa,SAAS;AACtB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,aAAa,KAAK;AAClB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AChFA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACtMA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,aAAa;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5EA;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oF;;;;;;;;;;;ACrHA,2BAAe,mBAAO,CAAC,8DAAY;;AAEnC,mBAAO,CAAC,4DAAW;;AAEnB;;AAEA;;AAEA,cAAc;;AAEd;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,cAAc;AAC3B,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA,0BAA0B,qFAAe,IAAS,OAAO,CAAC;AAC1D;AACA,OAAO;AACP;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtCA,iBAAiB,mBAAO,CAAC,kEAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,KAAK;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,4DAA4D;AAC5D;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,KAAK;AACnB,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;AAEA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,KAAK;AACnB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACvJA,gBAAgB,mBAAO,CAAC,sDAAU;;AAElC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;;AAEA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;;AAEA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,+BAA+B,yBAAyB,gCAAgC,IAAI,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,iCAAiC,GAAG;AACpK;AACA,GAAG;;AAEH;AACA;;AAEA,sBAAsB;;AAEtB;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA,sDAAsD,MAAM,QAAQ,KAAK;AACzE,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA,uBAAuB,IAAI;AAC3B;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,MAAM;AACpB,cAAc,MAAM;AACpB,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,MAAM;AACpB,cAAc,MAAM;AACpB,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc;AACd;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,MAAM;AACnB,aAAa,MAAM;AACnB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA,yCAAyC;AACzC;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,kBAAkB;AAChC,cAAc,iBAAiB;AAC/B,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,UAAU;AACvB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,aAAa;AACb,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,OAAO;AACpB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzsBA,YAAY,mBAAO,CAAC,wDAAS;AAC7B,WAAW,mBAAO,CAAC,sDAAQ;AAC3B,aAAa,mBAAO,CAAC,0DAAU;AAC/B,iBAAiB,mBAAO,CAAC,kEAAc;AACvC,qBAAqB,mBAAO,CAAC,wDAAS;;AAEtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,cAAc,QAAQ,mBAAmB;AACzC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iFAAiF,SAAS;AAC1F;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,qEAAqE,SAAS;AAC9E;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,yCAAyC,OAAO,SAAS,EAAE,QAAQ;AACnE;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oCAAoC,OAAO;AAC3C;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,4CAA4C,cAAc,wBAAwB;AAClF;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;;AAGA,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA,kCAAkC,uCAAuC;AACzE;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,GAAG;AACH;AACA;AACA;AACA,cAAc,MAAM;AACpB,cAAc;AACd;AACA;AACA;;AAEA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,MAAM;AACpB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;AACA;AACA,iBAAiB;AACjB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,MAAM;AACpB,cAAc;AACd;AACA;AACA;AACA,uCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,KAAK;AACnB,cAAc,MAAM;AACpB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,QAAQ;AACtB,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,OAAO;AACpB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,cAAc;AAC5B,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,SAAS;AACtB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,aAAa,SAAS;AACtB,cAAc;AACd;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,SAAS;AACvB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,SAAS;AACrB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,SAAS;AACrB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,SAAS;AACrB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,SAAS;AACrB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB,YAAY,SAAS;AACrB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACjpBA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;ACrBA;;AAEA;;AAEA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;AClBA,e;;;;;;;;;;;ACAA,e;;;;;;;;;;;ACAA,qD;;;;;;;;;;;ACAA,6D;;;;;;;;;;;ACAA,8D;;;;;;;;;;;ACAA,+D;;;;;;;;;;;ACAA,uD;;;;;;;;;;;ACAA,oD;;;;;;;;;;;ACAA,uD;;;;;;;;;;;ACAA,oD","file":"pretor.online.app.d363f32e-0b9f-3321-1f9d-ec9297a56449.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"angular\"), require(\"angular-animate\"), require(\"angular-sanitize\"), require(\"angular-ui-router\"), require(\"bootstrap\"), require(\"jQuery\"), require(\"jQuery-ui\"), require(\"Moment\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"angular\", \"angular-animate\", \"angular-sanitize\", \"angular-ui-router\", \"bootstrap\", \"jQuery\", \"jQuery-ui\", \"Moment\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"angular\"), require(\"angular-animate\"), require(\"angular-sanitize\"), require(\"angular-ui-router\"), require(\"bootstrap\"), require(\"jQuery\"), require(\"jQuery-ui\"), require(\"Moment\")) : factory(root[\"angular\"], root[\"angular-animate\"], root[\"angular-sanitize\"], root[\"angular-ui-router\"], root[\"bootstrap\"], root[\"jQuery\"], root[\"jQuery-ui\"], root[\"Moment\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function(__WEBPACK_EXTERNAL_MODULE_angular__, __WEBPACK_EXTERNAL_MODULE_angular_animate__, __WEBPACK_EXTERNAL_MODULE_angular_sanitize__, __WEBPACK_EXTERNAL_MODULE_angular_ui_router__, __WEBPACK_EXTERNAL_MODULE_bootstrap__, __WEBPACK_EXTERNAL_MODULE_jquery__, __WEBPACK_EXTERNAL_MODULE_jquery_ui__, __WEBPACK_EXTERNAL_MODULE_moment__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./Scripts/app/app.js\");\n","(function() {\r\n\t'use strict';\r\n\r\n\tangular.module('pretor.online.core', [ 'ui.bootstrap', 'ngSanitize', 'slick' ]);\r\n})();\r\n","var mobileApiAddress = 'https://ptgweb.pretor.co.za/api/v1/';\nvar pretorOnlineUrl = 'https://online.pretor.co.za/';\nvar authenticationAPIAddress = 'https://ptgweb.pretor.co.za/auth/api/v1/';\nvar pretorDocumentsServerUrl = 'https://ptgwebstorage.pretor.co.za/prod';\nvar PretorCDNAddress = 'https://ptgweblivestaging.pretor.co.za:444/';\nvar pretorInternalUrl = 'http://192.22.208.227/';\n\n//replace ends here\r\n//DO NOT DELETE THE ABOVE COMMENT - ITS BEING USED BY THE BUILD STEP!!!\r\n\r\nimport 'moment';\r\nimport 'bootstrap';\r\nrequire('jquery-ui');\r\nimport _ from 'lodash';\r\nimport 'angular-animate';\r\nrequire('jquery-number');\r\nimport 'angular-sanitize';\r\nconst $ = require('jquery');\r\nimport angular from 'angular';\r\n\r\nimport './app-core';\r\nimport './modules/views-module';\r\nimport './modules/filters-module';\r\nimport './modules/services-module';\r\nimport './modules/directives-module';\r\nimport './modules/controllers-module';\r\n\r\nrequire('angular-files-drop');\r\n\r\nimport { FEATURES } from './common';\r\n\r\n$(() => {\r\n\tlocalStorage.setItem('mobileApiAddress', mobileApiAddress);\r\n});\r\n\r\nexport default angular\r\n\t.module('pretor.online.app', [\r\n\t\t'angular-files-drop',\r\n\t\t'pretor.online.core',\r\n\t\t'pretor.online.views',\r\n\t\t'pretor.online.filters',\r\n\t\t'pretor.online.factories',\r\n\t\t'pretor.online.directives',\r\n\t\t'pretor.online.controllers'\r\n\t])\r\n\t.config(($httpProvider, $sceDelegateProvider) => {\r\n\t\t$sceDelegateProvider.resourceUrlWhitelist([ 'self', '*' ]);\r\n\t\t$httpProvider.interceptors.push('AuthInterceptorService');\r\n\t})\r\n\t.run(($state, $timeout, $window, $transitions, $location, $rootScope, NavigationService, LocalStorageService) => {\r\n\t\t$rootScope.$on('$locationChangeSuccess', (evt, newNav, oldNav) => {\r\n\t\t\t\r\n\t\t});\r\n\t});\r\n","/**\r\n * Enum for user claims\r\n * @readonly\r\n * @enum {string}\r\n */\r\nconst USER_CLAIMS = Object.freeze({\r\n\tMY_PROFILE: 'My Profile',\r\n\tVIEW_PAYMENTS: 'View Payments',\r\n\tVIEW_LEVY_ROLL: 'View Levy Roll',\r\n\tREGISTER_TENANT: 'Register Tenant',\r\n\tVIEW_FINANCIALS: 'View Financials',\r\n\tAPPROVE_PAYMENTS: 'Approve Payments',\r\n\tCLEARANCE_CAPTURE: 'Clearance Capture',\r\n\tVIEW_BALANCE_SHEET: 'View Balance Sheet',\r\n\tVIEW_PAYMENT_BANDS: 'View Payment Bands',\r\n\tVIEW_PROPERTY_LIST: 'View Properties List',\r\n\tVIEW_FIRE_COMPLIANCE: 'View Fire Compliance',\r\n\tVIEW_INCOME_STATEMENT: 'View Income Statement',\r\n\tVIEW_INCOME_VS_BUDGET: 'View Income VS Budget',\r\n\tAPPROVE_PAYMENT_BANDS: 'Approve Payment Bands',\r\n\tVIEW_CONTRACTORS_ROLL: 'View Contractors Roll',\r\n\tVIEW_ACCOUNTS_HISTORY: 'View Accounts History',\r\n\tVIEW_BUILDING_DOCUMENTS: 'View Building Documents',\r\n\tVIEW_CASHFLOW_STATEMENT: 'View Cashflow Statement',\r\n\tVIEW_CASHFLOW_STATEMENT_NEW: 'View Cashflow Statement New',\r\n\tVIEW_PERSONAL_DOCUMENTS: 'View Personal Documents',\r\n\tREJECT_FINANCIAL_SUMMARY: 'Reject Financial Summary',\r\n\tVIEW_CONTRACTUAL_PAYMENTS: 'View Contractual Payments',\r\n\tAPPROVE_FINANCIAL_SUMMARY: 'Approve Financial Summary',\r\n\tQUERY_FIRE_QUOTE_COMPLIANCE: 'Query Fire Quote Compliance',\r\n\tAPPROVE_CONTRACTUAL_PAYMENTS: 'Approve Contractual Payments',\r\n\tAPPROVE_FIRE_QUOTE_COMPLIANCE: 'Approve Fire Quote Compliance',\r\n\tQUERY_MINI_SUB_QUOTE_COMPLIANCE: 'Query Mini-Sub Quote Compliance',\r\n\tAPPROVE_MINI_SUB_QUOTE_COMPLIANCE: 'Approve Mini-Sub Quote Compliance',\r\n UTILITY: 'Utility Info',\r\n VIEW_DOCUMENTS_APPROVAL : 'View Documents Approval',\r\n\tCAPTURE_PAYMENTS: 'Capture Payment',\r\n\tVIEW_LEGAL_COLLECTIONS_ROLL: 'View Collections Legal Roll',\r\n\tRENTALS_CAPTURE: 'Rentals Capture',\r\n AUDITS_CAPTURE: 'Audits Capture',\r\n AUDITORS_DASHBOARD: 'Auditors Dashboard',\r\n\tVIEW_WAGES_ROLL: 'View Wages Roll',\r\n\tDEBTOR_AGE_ANALYSIS: 'Debtor Age Analysis',\r\n\tVIEW_PREVIOUS_FINANCIALS: 'View Previous Financials',\r\n\tSHOW_FIND_A_CONTRACTOR: 'Show Find A Contractor'\r\n\t/*TRUSTEE_DASHBOARD: 'Trustee Dashboard'*/\r\n});\r\n\r\nexport default USER_CLAIMS;\r\n","import { default as FEATURES } from './feature-enum';\r\nimport { default as USER_CLAIMS } from './claim-enum';\r\n\r\nconst _mapUser = (user) => {\r\n\tif (user && user.hasOwnProperty('WebUsername')) {\r\n\t\tuser.UserName = user.WebUsername || user.UserName;\r\n\t}\r\n\r\n\treturn user;\r\n};\r\n\r\nconst _retrieve = (itemName) => {\r\n\tvar item = localStorage.getItem(itemName);\r\n\r\n\tif (item && ((item.indexOf('{') > -1 && item.indexOf('http') == -1) || item.indexOf('[') > -1)) {\r\n\t\titem = JSON.parse(item);\r\n\t}\r\n\tif (itemName === 'userProfile') {\r\n\t\t_mapUser(item);\r\n\t}\r\n\r\n\treturn item;\r\n};\r\n\r\nconst _isAuthorized = (claim) => {\r\n\r\n\tif (claim == \"Trustee Dashboard\") {\r\n\t\treturn true;\r\n }\r\n\r\n\tif (!!!claim) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tclaim = claim.toLowerCase();\r\n\tlet shouldAuthorize = false;\r\n\r\n\tconst userProfile = _retrieve('userProfile');\r\n\tlet selectedBuildingRef = _retrieve('selectedBuildingRef');\r\n\r\n\tif (!!!selectedBuildingRef && !!userProfile) {\r\n\t\tif (!!userProfile.BuildingProfiles && userProfile.BuildingProfiles.length > 0) {\r\n\t\t\tselectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n\t\t}\r\n\t}\r\n\r\n\tif (selectedBuildingRef && userProfile) {\r\n\t\tif (typeof selectedBuildingRef === 'object') {\r\n\t\t\tselectedBuildingRef = selectedBuildingRef.SchemeReference;\r\n\t\t}\r\n\r\n\t\tif (selectedBuildingRef) {\r\n\t\t\tconst selectedBuilding = userProfile.BuildingProfiles.find((buildingProf) => {\r\n\t\t\t\tconst buildingRef = buildingProf.SchemeReference.toLowerCase().trim();\r\n\t\t\t\tif (buildingRef === selectedBuildingRef.toLowerCase().trim()) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (selectedBuilding) {\r\n\t\t\t\tconst hasClaim = selectedBuilding.BuildingClaimMapped.find((desc) => {\r\n const results = desc.Description.toLowerCase().trim() === claim.toLowerCase().trim();\r\n return results;\r\n });\r\n \r\n if (!hasClaim) {\r\n const owner = selectedBuilding.Role.find((role) => role.toLowerCase() === 'owner');\r\n if (!!owner && capitalize(claim) === USER_CLAIMS.VIEW_PERSONAL_DOCUMENTS) {\r\n shouldAuthorize = true;\r\n }\r\n } else {\r\n if (\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\thasClaim.Description.toLowerCase().trim() === USER_CLAIMS.MY_PROFILE.toLowerCase().trim() ||\r\n\t\t\t\t\t\t\thasClaim.Description.toLowerCase().trim() === USER_CLAIMS.REGISTER_TENANT.toLowerCase().trim()\t\r\n\t\t\t\t\t\t) &&\r\n selectedBuilding.BuildingProfileUnit.filter((unit) => {\r\n\t\t\t\t\t\t\treturn !unit.CardCode.includes('9999');\r\n\t\t\t\t\t\t }).length == 0) {\r\n shouldAuthorize = false;\r\n }\r\n else{\r\n shouldAuthorize = !!hasClaim;\r\n }\r\n }\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn shouldAuthorize;\r\n};\r\n\r\nexport const mapPageToFeature = (page) => {\r\n\tlet feature;\r\n\tpage = capitalize(page);\r\n\r\n\tswitch (page) {\r\n\t\tcase USER_CLAIMS.MY_PROFILE:\r\n\t\t\tfeature = FEATURES.MY_PROFILE;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_LEVY_ROLL:\r\n\t\t\tfeature = FEATURES.LEVY_ROLL;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_PAYMENTS:\r\n\t\t\tfeature = FEATURES.PAYMENTS;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.REGISTER_TENANT:\r\n\t\t\tfeature = FEATURES.TENANT;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_FIRE_COMPLIANCE:\r\n\t\t\tfeature = FEATURES.COMPLIANCE;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_ACCOUNTS_HISTORY:\r\n\t\t\tfeature = FEATURES.ACCOUNT_HISTORY;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_BALANCE_SHEET:\r\n\t\t\tfeature = FEATURES.BALANCE_SHEET;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_BUILDING_DOCUMENTS:\r\n\t\t\tfeature = FEATURES.DOCUMENTS;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_CASHFLOW_STATEMENT:\r\n\t\t\tfeature = FEATURES.CASHFLOW_STATEMENT;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_CASHFLOW_STATEMENT_NEW:\r\n\t\t\tfeature = FEATURES.CASHFLOW_STATEMENT_NEW;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_CONTRACTORS_ROLL:\r\n\t\t\tfeature = FEATURES.CONTRACTORS_ROLL;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_FINANCIALS:\r\n\t\t\tfeature = FEATURES.FINANCIAL_SUMMARY;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_INCOME_STATEMENT:\r\n\t\t\tfeature = FEATURES.INCOME_STATEMENT;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_INCOME_VS_BUDGET:\r\n\t\t\tfeature = FEATURES.INCOME_VS_BUDGET;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_PAYMENT_BANDS:\r\n\t\tcase USER_CLAIMS.VIEW_CONTRACTUAL_PAYMENTS:\r\n\t\t\tfeature = FEATURES.PAYMENT_AUTHORISATION;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.VIEW_PERSONAL_DOCUMENTS:\r\n\t\t\tfeature = FEATURES.PERSONAL_DOCUMENTS;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.APPROVE_PAYMENTS:\r\n\t\t\tfeature = FEATURES.PAYMENTS;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.QUERY_FIRE_QUOTE_COMPLIANCE:\r\n\t\tcase USER_CLAIMS.APPROVE_MINI_SUB_QUOTE_COMPLIANCE:\r\n\t\t\tfeature = FEATURES.COMPLIANCE;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.UTILITY:\r\n\t\t\tfeature = FEATURES.UTILITY;\r\n break;\r\n case USER_CLAIMS.VIEW_DOCUMENTS_APPROVAL:\r\n feature = FEATURES.DOCUMENTS_APPROVAL;\r\n break;\r\n case USER_CLAIMS.VIEW_WAGES_ROLL:\r\n feature = FEATURES.WAGES_ROLL;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.TRUSTEE_DASHBOARD:\r\n\t\t\tfeature = FEATURES.TRUSTEE_DASHBOARD;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.DEBTOR_AGE_ANALYSIS:\r\n\t\t\tfeature = FEATURES.DEBTOR_AGE_ANALYSIS;\r\n\t\t\tbreak;\r\n\t\tcase USER_CLAIMS.SHOW_FIND_A_CONTRACTOR:\r\n\t\t\tfeature = FEATURES.SHOW_FIND_A_CONTRACTOR;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn feature;\r\n};\r\n\r\nexport const capitalize = (text) => {\r\n\tif (!!!text) {\r\n\t\treturn text;\r\n\t}\r\n\r\n\tlet mapped;\r\n\tconst fields = text.split(' ');\r\n\tconst transformed = fields.map((val) => {\r\n\t\tlet newText = `${val.substr(0, 1).toUpperCase()}${val.substr(1, val.length - 1).toLowerCase()}`;\r\n\t\treturn newText;\r\n\t});\r\n\r\n\tmapped = transformed.join(' ');\r\n\treturn mapped;\r\n};\r\n\r\n/**\r\n * Checks if a feature should be enabled\r\n * \r\n * @param {any} page \r\n * @param {any} featureSettings \r\n * \r\n * @memberOf MainCtrl\r\n */\r\nexport const checkIfFeatureIsEnable = (page, featureSettings) => {\r\n\tlet isFeatureEnabled = false;\r\n\r\n\tif (!!!featureSettings) {\r\n\t\treturn isFeatureEnabled;\r\n\t}\r\n\r\n\tswitch (page) {\r\n\t\tcase FEATURES.DOCUMENTS:\r\n\t\tcase FEATURES.COMPLIANCE:\r\n\t\t\tisFeatureEnabled = true;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.LEVY_ROLL:\r\n\t\t\tconst { LevyRoll: levyRoll } = featureSettings;\r\n\t\t\tisFeatureEnabled = levyRoll;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.MY_PROFILE:\r\n\t\t\tconst { MyProfile: myProfile } = featureSettings;\r\n\t\t\tisFeatureEnabled = myProfile;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.FINANCIAL_SUMMARY:\r\n\t\t\tconst { Financials: financials } = featureSettings;\r\n\t\t\tisFeatureEnabled = financials;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.BALANCE_SHEET:\r\n\t\t\tconst { BalanceSheet: balanceSheet } = featureSettings;\r\n\t\t\tisFeatureEnabled = balanceSheet;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.TENANT:\r\n\t\t\tconst { RegisterTenant: registerTenant } = featureSettings;\r\n\t\t\tisFeatureEnabled = registerTenant;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.CONTRACTORS_ROLL:\r\n\t\t\tconst { ContractorsRoll: contractorsRoll } = featureSettings;\r\n\t\t\tisFeatureEnabled = contractorsRoll;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.INCOME_STATEMENT:\r\n\t\t\tconst { IncomeStatement: incomeStatement } = featureSettings;\r\n\t\t\tisFeatureEnabled = incomeStatement;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.PAYMENTS:\r\n\t\t\tconst { Payments: payments } = featureSettings;\r\n\t\t\tisFeatureEnabled = payments;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.PERSONAL_DOCUMENTS:\r\n\t\t\tconst { PersonalDocuments: personalDocuments } = featureSettings;\r\n\t\t\tisFeatureEnabled = personalDocuments;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.DASHBOARD:\r\n\t\t\tconst { IsDashboardEnabled: isDashboardEnabled } = featureSettings;\r\n\t\t\tisFeatureEnabled = isDashboardEnabled;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.ACCOUNT_HISTORY:\r\n\t\t\tconst { ViewAccountHistory: viewAccountHistory } = featureSettings;\r\n\t\t\tisFeatureEnabled = viewAccountHistory;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.PAYMENT_AUTHORISATION:\r\n\t\t\tconst { PaymentAuthorisations: paymentAuthorisations } = featureSettings;\r\n\t\t\tisFeatureEnabled = paymentAuthorisations;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.CASHFLOW_STATEMENT:\r\n\t\t\tconst { CashflowStatement: cashflowStatement } = featureSettings;\r\n\t\t\tisFeatureEnabled = cashflowStatement;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.UTILITY:\r\n\t\t\tconst { MyProfile: utility } = featureSettings;\r\n\t\t\tisFeatureEnabled = utility;\r\n break;\r\n case FEATURES.DOCUMENTS_APPROVAL:\r\n const { ViewDocumentsApproval: viewDocumentsApproval } = featureSettings;\r\n isFeatureEnabled = viewDocumentsApproval;\r\n break;\r\n case FEATURES.WAGES_ROLL:\r\n const { WagesRoll: wagesRoll } = featureSettings;\r\n isFeatureEnabled = wagesRoll;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.TRUSTEE_DASHBOARD:\r\n\t\t\tconst { TrusteeDashboard: trusteeDashboard } = featureSettings;\r\n\t\t\tisFeatureEnabled = true;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.CASHFLOW_STATEMENT_NEW:\r\n\t\t\tconst { CashflowStatementNew: cashflowStatementNew } = featureSettings;\r\n\t\t\tisFeatureEnabled = cashflowStatementNew;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.INCOME_VS_BUDGET:\r\n\t\t\tconst { IncomeVSBudget: incomeVSBudget } = featureSettings;\r\n\t\t\tisFeatureEnabled = incomeVSBudget;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.DEBTOR_AGE_ANALYSIS:\r\n\t\t\tconst { DebtorAgeAnalysis: debtorAgeAnalysis } = featureSettings;\r\n\t\t\tisFeatureEnabled = debtorAgeAnalysis;\r\n\t\t\tbreak;\r\n\t\tcase FEATURES.SHOW_FIND_A_CONTRACTOR:\r\n\t\t\tconst { ShowContractor: showContractor } = featureSettings;\r\n\t\t\tisFeatureEnabled = showContractor;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn isFeatureEnabled;\r\n};\r\n\r\nexport const shouldBeEnabled = (page, alsoCheckDashboard = false) => {\r\n\tlet isEnabled = false;\r\n\tconst claim = mapPageToFeature(page);\r\n\tconst isUserAuthorized = _isAuthorized(page);\r\n\tif (isUserAuthorized) {\r\n\t\tlet buildingRef = _retrieve('selectedBuildingRef');\r\n\t\tbuildingRef = !!buildingRef && typeof buildingRef === 'object' ? buildingRef.SchemeReference : buildingRef;\r\n\r\n\t\tif (!!buildingRef) {\r\n\t\t\tlet featureSettings;\r\n\t\t\tconst buildingsFeatures = _retrieve('buildingsFeatures');\r\n\t\t\tif (!!buildingsFeatures) {\r\n\t\t\t\tfeatureSettings = buildingsFeatures[buildingRef];\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tisEnabled = checkIfFeatureIsEnable(claim, featureSettings);\r\n\r\n\t\t\tlet isDashboardEnabled = false;\r\n\t\t\tif (!!featureSettings) {\r\n\t\t\t\tconst { IsDashboardEnabled } = featureSettings;\r\n\t\t\t\tisDashboardEnabled = IsDashboardEnabled;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn alsoCheckDashboard ? isEnabled && isDashboardEnabled : isEnabled;\r\n\t\t}\r\n\t\treturn isUserAuthorized;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nexport const canPerformAction = (action, schemeRef) => {\r\n\tlet userHasRights = false;\r\n\tconst isUserAuthorized = _isAuthorized(action);\r\n\r\n\tif (isUserAuthorized) {\r\n\t\tlet buildingRef = schemeRef ? schemeRef : _retrieve('selectedBuildingRef');\r\n\t\tbuildingRef = !!buildingRef && typeof buildingRef === 'object' ? buildingRef.SchemeReference : buildingRef;\r\n\r\n\t\tif (!!buildingRef) {\r\n\t\t\tlet featureSettings;\r\n\t\t\tconst buildingsFeatures = _retrieve('buildingsFeatures');\r\n\t\t\tif (!!buildingsFeatures) {\r\n\t\t\t\tfeatureSettings = buildingsFeatures[buildingRef];\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif (!!!featureSettings) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tswitch (capitalize(action)) {\r\n\t\t\t\tcase USER_CLAIMS.APPROVE_PAYMENTS:\r\n\t\t\t\t\tconst { PaymentsApproval: paymentsApproval } = featureSettings;\r\n\t\t\t\t\tuserHasRights = paymentsApproval;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn userHasRights;\r\n\t\t}\r\n\t\treturn userHasRights;\r\n\t}\r\n\r\n\treturn userHasRights;\r\n};\r\n\r\nexport const serverfyJSObject = (original) => {\r\n\tif (!!!original) return null;\r\n\tlet mappedObject = {};\r\n\r\n\tObject.keys(original).map((key) => {\r\n\t\tconst temp = original[key];\r\n\t\tdelete original[key];\r\n\t\tconst newKey = `${key.substr(0, 1).toUpperCase()}${key.substr(1)}`;\r\n\t\tmappedObject[newKey] = temp;\r\n\t});\r\n\r\n\treturn mappedObject;\r\n};\r\n","/**\r\n * Enum for Features\r\n * @readonly\r\n * @enum {string}\r\n */\r\nconst FEATURES = Object.freeze({\r\n\tTENANT: 'tenant',\r\n\tREGISTER: 'register',\r\n\tPAYMENTS: 'payments',\r\n\tDASHBOARD: 'dashboard',\r\n\tLEVY_ROLL: 'levy-roll',\r\n\tDOCUMENTS: 'documents',\r\n\tCOMPLIANCE: 'compliance',\r\n\tMY_PROFILE: 'my-profile',\r\n\tBALANCE_SHEET: 'balance-sheet',\r\n\tACCOUNT_HISTORY: 'accounts-history',\r\n\tCONTRACTORS_ROLL: 'contractors-roll',\r\n\tINCOME_STATEMENT: 'income-statement',\r\n\tFINANCIAL_SUMMARY: 'financial-summary',\r\n\tCLEARANCE_CAPTURE: 'clearance-capture',\r\n\tCLEARANCE_REQUEST:\t'clearance-request',\r\n\tCASHFLOW_STATEMENT: 'cashflow-statement',\r\n\tCASHFLOW_STATEMENT_NEW: 'cashflow-statement-new',\r\n\tPERSONAL_DOCUMENTS: 'personal-documents',\r\n\tPAYMENT_AUTHORISATION: 'payment-authorisation',\r\n UTILITY: 'utility',\r\n DOCUMENTS_APPROVAL:'docs-approval',\r\n\tLOGIN:'login',\r\n\tHISTORICAL_LINK:'historical-link',\r\n\tRENTALS_CAPTURE: 'rentals-capture',\r\n AUDITS_CAPTURE: 'audits-capture',\r\n AUDITORS_DASHBOARD: 'auditors-dashboard',\r\n\tWAGES_ROLL: 'wages-roll',\r\n\tTRUSTEE_DASHBOARD: 'trustee-dashboard',\r\n\tINCOME_VS_BUDGET: 'income-vs-budget',\r\n\tDEBTOR_AGE_ANALYSIS: 'debtor-age-analysis',\r\n\tSHOW_FIND_A_CONTRACTOR: 'find-a-contractor'\r\n});\r\n\r\nexport default FEATURES;\r\n","export { capitalize, shouldBeEnabled, canPerformAction, checkIfFeatureIsEnable } from './common';\r\nexport { default as FEATURES } from './feature-enum';\r\nexport { default as USER_CLAIMS } from './claim-enum';\r\n","import { sorting } from './navigation-sorting';\r\nimport { default as FEATURES } from './feature-enum';\r\n\r\nexport const NAVIGATION = Object.freeze({\r\n MyProfile: 'My Details',\r\n Compliance: 'Compliance',\r\n ManageTents: 'Manage Tenants',\r\n PropertyList: 'Property List',\r\n FinancialPack: 'Financial Pack',\r\n AccountHistory: 'Account History',\r\n PaymentApprovals: 'Payment Approvals',\r\n PersonalDocuments: 'Personal Documents',\r\n BuildingDocuments: 'Building Documents',\r\n PaymentAuthorisation: 'Payment Authorisation',\r\n Utility: 'Building Information',\r\n DocumentsApproval: 'Documents Approval',\r\n ShowFindAContractor: 'Find A Contractor',\r\n /* TrusteeDashboard: 'Trustee Dashboard'*/\r\n});\r\n\r\nexport const navigationToClaim = description => {\r\n let claimLink;\r\n\r\n switch (description) {\r\n case NAVIGATION.ManageTenants:\r\n claimLink = FEATURES.TENANT;\r\n break;\r\n case NAVIGATION.PaymentApprovals:\r\n claimLink = FEATURES.PAYMENTS;\r\n break;\r\n case NAVIGATION.BuildingDocuments:\r\n claimLink = FEATURES.DOCUMENTS;\r\n break;\r\n case NAVIGATION.PropertyList:\r\n claimLink = FEATURES.DASHBOARD;\r\n break;\r\n case NAVIGATION.MyProfile:\r\n claimLink = FEATURES.MY_PROFILE;\r\n break;\r\n case NAVIGATION.Compliance:\r\n claimLink = FEATURES.COMPLIANCE;\r\n break;\r\n case NAVIGATION.FinancialPack:\r\n claimLink = FEATURES.FINANCIAL_SUMMARY;\r\n break;\r\n case NAVIGATION.AccountHistory:\r\n claimLink = FEATURES.ACCOUNT_HISTORY;\r\n break;\r\n case NAVIGATION.PersonalDocuments:\r\n claimLink = FEATURES.PERSONAL_DOCUMENTS;\r\n break;\r\n case NAVIGATION.PaymentAuthorisation:\r\n claimLink = FEATURES.PAYMENT_AUTHORISATION;\r\n break;\r\n case NAVIGATION.Utility:\r\n claimLink = FEATURES.UTILITY;\r\n break;\r\n case NAVIGATION.DocumentsApproval:\r\n claimLink = FEATURES.DOCUMENTS_APPROVAL;\r\n break;\r\n case NAVIGATION.ShowFindAContractor:\r\n claimLink = FEATURES.SHOW_FIND_A_CONTRACTOR;\r\n break;\r\n //case NAVIGATION.TrusteeDashboard:\r\n // claimLink = FEATURES.TRUSTEE_DASHBOARD;\r\n // break;\r\n }\r\n\r\n return claimLink;\r\n};\r\n\r\nexport const routeToClaim = routeName => {\r\n let claim;\r\n switch (routeName) {\r\n case NAVIGATION.PropertyList:\r\n claim = {\r\n order: 1,\r\n description: 'View Accounts History'\r\n };\r\n break;\r\n case NAVIGATION.AccountHistory:\r\n claim = {\r\n order: 2,\r\n description: 'View Accounts History'\r\n };\r\n break;\r\n case NAVIGATION.BuildingDocuments:\r\n claim = {\r\n order: 3,\r\n description: 'View Building Documents'\r\n };\r\n break;\r\n case NAVIGATION.Compliance:\r\n claim = {\r\n order: 4,\r\n description: 'View Fire Compliance'\r\n };\r\n break;\r\n case NAVIGATION.FinancialPack:\r\n claim = {\r\n order: 5,\r\n description: 'View Financials'\r\n };\r\n break;\r\n case NAVIGATION.PaymentApprovals:\r\n claim = {\r\n order: 6,\r\n description: 'View Payments'\r\n };\r\n break;\r\n case NAVIGATION.PaymentAuthorisation:\r\n claim = {\r\n order: 7,\r\n description: 'View Payment Bands'\r\n };\r\n break;\r\n case NAVIGATION.PersonalDocuments:\r\n claim = {\r\n order: 8,\r\n description: 'View Personal Documents'\r\n };\r\n break;\r\n case NAVIGATION.ManageTents:\r\n claim = {\r\n order: 9,\r\n description: 'Register Tenant'\r\n };\r\n break;\r\n case NAVIGATION.MyProfile:\r\n claim = {\r\n order: 10,\r\n description: 'My Profile'\r\n };\r\n break;\r\n case NAVIGATION.Utility:\r\n claim = {\r\n order: 11,\r\n description: 'View Building Documents'\r\n };\r\n break;\r\n case NAVIGATION.DocumentsApproval:\r\n claim = {\r\n order: 12,\r\n description: 'View Documents Approval'\r\n };\r\n break;\r\n case NAVIGATION.ShowFindAContractor:\r\n claim = {\r\n order: 13,\r\n description: 'Show Find A Contractor'\r\n };\r\n break;\r\n\r\n //case NAVIGATION.TrusteeDashboard:\r\n // claim = {\r\n // order: 13,\r\n // description: 'Trustee Dashboard'\r\n // };\r\n // break;\r\n }\r\n\r\n return claim;\r\n};\r\n\r\nexport const NAVIGATION_SORTED = originalNavigation => {\r\n const sortedNavigation = originalNavigation.sort(sorting);\r\n return sortedNavigation;\r\n};\r\n","export const sorting = (optionA, optionB) => {\r\n\tlet results = 0;\r\n\tif (optionA.order < optionB.order) {\r\n\t\tresults = -1;\r\n\t}\r\n\tif (optionA.order > optionB.order) {\r\n\t\tresults = 1;\r\n\t}\r\n\r\n\treturn results;\r\n};\r\n","/* @ngInject */\r\nexport default class AccountsHistoryCtrl {\r\n\tconstructor(\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tUserUnitsService,\r\n\t\tNotificationService,\r\n\t\tLocalStorageService,\r\n\t\tAccountsHistoryDataService\r\n\t) {\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.UserUnitsService = UserUnitsService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.AccountsHistoryDataService = AccountsHistoryDataService;\r\n\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.isBusy = false;\r\n\t\tthis.unitList = [];\r\n\t\tthis.isDetailsBusy = false;\r\n\t\tthis.selectedCardCode = null;\r\n\t\tthis.hasSelectedCardCode = false;\r\n\t\tthis.selectedBuildingRef = undefined;\r\n\t\tthis.dateTo = moment().format('YYYY/MM/DD');\r\n\t\tthis.dateFrom = moment().subtract(6, 'months').format('YYYY/MM/DD');\r\n\r\n\t\tthis.$scope.$on('selected-building-changed', (event, newValue) => {\r\n\t\t\tthis.onSelectedBuildingChanged(event, newValue);\r\n\t\t});\r\n\t}\r\n\r\n\tasync activate() {\r\n\t\tconst { cardCode } = this.$state.params;\r\n\t\tthis.accountsHistoryService = this.AccountsHistoryDataService;\r\n\t\tthis.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\tif (cardCode) {\r\n\t\t\tthis.unitList = [ ...this.unitList, { CardCode: cardCode } ];\r\n\t\t\tthis.getAccountsHistorySummary();\r\n\t\t}\r\n\t\tawait this.getUnits();\r\n\t}\r\n\r\n\tasync onSelectedBuildingChanged(event, schemeRef) {\r\n\t\tthis._switchIsBusy(true);\r\n\t\tthis.selectedBuildingRef = schemeRef;\r\n\t\tif (this.selectedBuildingRef && this.selectedBuildingRef.length > 2) {\r\n\t\t\tthis._switchIsBusy(true);\r\n\t\t\tawait this.getUnits();\r\n\t\t}\r\n\t}\r\n\r\n\tasync getUnits() {\r\n\t\tthis.selectedCardCode = null;\r\n\t\tthis.hasSelectedCardCode = false;\r\n\t\tthis.isDetailsBusy = false;\r\n\t\tthis.dateFrom = moment().subtract(12, 'months').format('YYYY/MM/DD');\r\n\t\tthis.dateTo = moment().format('YYYY/MM/DD');\r\n\r\n\t\tthis.unitList = await this.UserUnitsService.getFriendlyUnitNames();\r\n\t\tif (this.unitList && this.unitList.length > 0) {\r\n\t\t\tthis.getAccountsHistorySummary();\r\n\t\t}\r\n\t}\r\n\r\n\tviewDetails(cardCode) {\r\n\t\tthis.selectedCardCode = cardCode;\r\n\t\tif (this.selectedCardCode) {\r\n\t\t\tthis.hasSelectedCardCode = true;\r\n\t\t\tthis.getAccountsHistory();\r\n\t\t}\r\n\t}\r\n\r\n\tsearchAccountsHistory() {\r\n\t\tif (this.selectedCardCode && this.dateFrom && this.dateTo && this.dateFrom < this.dateTo) {\r\n\t\t\tthis.getAccountsHistory();\r\n\t\t}\r\n\t}\r\n\r\n\tasync getAccountsHistorySummary() {\r\n\t\tthis._switchIsBusy(true);\r\n\t\ttry {\r\n\t\t\tawait this.AccountsHistoryDataService.getAccountsHistorySummary(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.unitList.filter(((unit) => {\r\n\t\t\t\t\treturn !unit.CardCode.includes('9999');\r\n\t\t\t\t }))\r\n\t\t\t);\r\n\t\t\tthis.isBusy = false;\r\n\t\t} catch (err) {\r\n\t\t\tthis.NotificationService.error('COULD NOT LOAD ACCOUNTS HISTORY SUMMARY');\r\n\t\t\tconsole.error(err);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusy(false);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getAccountsHistory() {\r\n\t\tthis._switchIsDetailsBusy(true);\r\n\t\ttry {\r\n\t\t\tawait this.AccountsHistoryDataService.getAccountsHistory(this.selectedCardCode, this.dateFrom, this.dateTo);\r\n\t\t} catch (err) {\r\n\t\t\tthis.NotificationService.error('COULD NOT LOAD ACCOUNTS HISTORY');\r\n\t\t\tconsole.error(err);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsDetailsBusy(false);\r\n\t\t\tthis._initializeDatePicker();\r\n\t\t}\r\n\t}\r\n\r\n\t_initializeDatePicker() {\r\n\t\tconst dateFrom = this.dateFrom;\r\n\t\tconst dateTo = this.dateTo;\r\n\r\n\t\tthis.$rootScope.$eval(() => {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tconst id = '#accountsHistoryDates';\r\n\t\t\t\tconst selectorDateFrom = '#dateFromDatePicker';\r\n\t\t\t\tconst selectorDateTo = '#dateToDatePicker';\r\n\t\t\t\tconst $inputDateFrom = $(selectorDateFrom, $(id));\r\n\t\t\t\tconst $inputDateTo = $(selectorDateTo, $(id));\r\n\r\n\t\t\t\tconst optionsDateFrom = {\r\n\t\t\t\t\tdateFrom,\r\n\t\t\t\t\tautoclose: true,\r\n\t\t\t\t\tforceParse: true,\r\n\t\t\t\t\tformat: 'yyyy/mm/dd',\r\n\t\t\t\t\tassumeNearbyYear: true,\r\n\t\t\t\t\tenableOnReadonly: true,\r\n\t\t\t\t\tcontainer: selectorDateFrom\r\n\t\t\t\t};\r\n\r\n\t\t\t\tconst optionsDateTo = {\r\n\t\t\t\t\tdateTo,\r\n\t\t\t\t\tautoclose: true,\r\n\t\t\t\t\tforceParse: true,\r\n\t\t\t\t\tformat: 'yyyy/mm/dd',\r\n\t\t\t\t\tassumeNearbyYear: true,\r\n\t\t\t\t\tenableOnReadonly: true,\r\n\t\t\t\t\tcontainer: selectorDateTo\r\n\t\t\t\t};\r\n\r\n\t\t\t\t$inputDateFrom.datepicker(optionsDateFrom);\r\n\t\t\t\t$inputDateTo.datepicker(optionsDateTo);\r\n\t\t\t}, 250);\r\n\t\t});\r\n\t}\r\n\r\n\tasync viewReport() {\r\n\t\tthis._switchIsDetailsBusy(true);\r\n\t\ttry {\r\n\t\t\tawait this.AccountsHistoryDataService.getAccountsHistoryReport(\r\n\t\t\t\tthis.selectedCardCode,\r\n\t\t\t\tthis.dateFrom,\r\n\t\t\t\tthis.dateTo\r\n\t\t\t);\r\n\t\t} catch (err) {\r\n\t\t\tthis.NotificationService.error('COULD NOT LOAD ACCOUNTS HISTORY');\r\n\t\t\tconsole.error(err);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsDetailsBusy(false);\r\n\t\t\tthis._initializeDatePicker();\r\n\t\t}\r\n\t}\r\n\r\n\tviewInvoices(cardCode) {\r\n\t\tif (cardCode) {\r\n\t\t\tthis.$state.go('personal-documents', { cardCode, folder: 'Monthly Statement' });\r\n\t\t} else {\r\n\t\t\tthis.$state.go('personal-documents');\r\n\t\t}\r\n\t}\r\n\r\n\t_switchIsDetailsBusy(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isDetailsBusy = flag;\r\n\t\t});\r\n\t}\r\n\r\n\t_switchIsBusy(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isBusy = flag;\r\n\t\t});\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass AccountsHistoryDataService {\r\n\tconstructor($http, Utility, $window, $timeout, LocalStorageService, NotificationService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.InternalLinksService.getLinks('/api/accounts/links');\r\n\t\tthis.accountsHistorySummary = [];\r\n\t\tthis.accountsHistory = null;\r\n\t}\r\n\r\n\tasync getAccountsHistorySummary(schemeRef, units) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\t// if (!schemeRef) {\r\n\t\t\t// \tthrow 'no scheme reference supplied';\r\n\t\t\t// }\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetAccountsHistorySummary');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/accounts/links', false);\r\n\t\t\t}\r\n\t\t\tif (!url) {\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetAccountsHistorySummary');\r\n\t\t\t}\r\n\r\n\t\t\tvar cardCodes = [];\r\n\t\t\tunits.forEach((item) => {\r\n\t\t\t\tcardCodes.push(item.CardCode);\r\n\t\t\t});\r\n\r\n\t\t\turl = url.replace('{schemeReference}', schemeRef).trim();\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.post(url, cardCodes, { headers });\r\n\r\n\t\t\tthis.accountsHistorySummary = results.data;\r\n\t\t\tconsole.log(this.accountsHistorySummary);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(this.accountsHistorySummary));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while loading account history summary.`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getAccountsHistory(selectedCardCode, dateFrom, dateTo) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!selectedCardCode) {\r\n\t\t\t\tthrow 'No cardCode supplied';\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetAccountsHistory');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/accounts/links', false);\r\n\t\t\t}\r\n\t\t\tif (!url) {\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetAccountsHistory');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{cardCode}', selectedCardCode).trim();\r\n\t\t\turl = `${url}?dateFrom=${moment(dateFrom).format('L')}&dateTo=${moment(dateTo).format('L')}`;\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\r\n\t\t\tthis.accountsHistory = results.data;\r\n\t\t\tconsole.log(this.accountsHistory);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(this.accountsHistory));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while searching for account history.`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(msg, err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getAccountsHistoryReport(cardCode, dateFrom, dateTo) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tif (!cardCode) {\r\n\t\t\t\tthrow 'No cardCode supplied';\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('AccountsHistoryReport');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/reporting/links', false);\r\n\t\t\t}\r\n\t\t\tif (!url) {\r\n\t\t\t\turl = await this.InternalLinksService.getLink('AccountsHistoryReport');\r\n\t\t\t}\r\n\r\n\t\t\turl = `${url}?cardCode=${cardCode}&dateFrom=${moment(dateFrom).format('L')}&dateTo=${moment(dateTo).format(\r\n\t\t\t\t'L'\r\n\t\t\t)}`;\r\n\r\n\t\t\tthis.openNewTabReport(url, `Account History - ${cardCode}`);\r\n\t\t\tconsole.log(url);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while searching for account history.`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(msg, err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\topenNewTabReport(url, title) {\r\n\t\tconst newTab = this.$window.open(url, '_blank');\r\n\t\tif (newTab) {\r\n\t\t\tthis.NotificationService.error('Please allow pop-ups for this site to view the report');\r\n\t\t}\r\n\r\n\t\tnewTab.document.write(`\r\n ${title}\r\n \r\n \r\n\t\t\t`);\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$http,\r\n\tUtility,\r\n\t$window,\r\n\t$timeout,\r\n\tLocalStorageService,\r\n\tNotificationService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew AccountsHistoryDataService(\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$window,\r\n\t\t$timeout,\r\n\t\tLocalStorageService,\r\n\t\tNotificationService,\r\n\t\tInternalLinksService\r\n\t);\r\n","/* @ngInject */\r\n\r\nexport default class HistoricalLinkCtrl {\r\n\tconstructor(\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$window,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tNavigationService,\r\n\t\tLocalStorageService,\r\n\t\tNotificationService,\r\n\t\tAuthenticationService\r\n\t) {\r\n\t\t'ngInject';\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.NavigationService = NavigationService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.AuthenticationService = AuthenticationService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.isBusy = false;\r\n\t\tthis.url = undefined;\r\n\t\tthis.oldLink = undefined;\r\n\t\tthis.newLink =undefined;\r\n\t\t}\r\n\r\n\tasync Replace(url) {\t\t\r\n\t\tif (url == undefined) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttry {\t\t\r\n\t\t\tthis.isBusy = true;\t\r\n\t\t\tlet incomingUrl = url.toLowerCase().toString();\r\n\t\t\tif (incomingUrl.includes('dashboard')) {\r\n\t\t\t\tlet redirectUrl = incomingUrl.replace('dashboard', '');\r\n\t\t\t\tif (redirectUrl.includes('localhost:57183')) {\r\n\t\t\t\t\tthis.newLink = redirectUrl.replace('http://localhost:57183//', pretorOnlineUrl);\r\n\t\t\t\t\twindow.location.href = this.newLink;\r\n\t\t\t\t}\r\n\t\t\t\tif (redirectUrl.includes('www.pretor.co.za')) {\r\n\t\t\t\t\tthis.newLink = redirectUrl.replace('https://www.pretor.co.za//', pretorOnlineUrl);\r\n\t\t\t\t\twindow.location.href = this.newLink;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\twindow.location.href = redirectUrl;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (err) {\r\n\t\t\tconsole.error(`Error while replacing a link: ${err}`);\r\n\t\t} finally {\r\n\t\t\tthis.isBusy = false;\r\n\t\t}\r\n\t}\r\n}\r\n","/* @ngInject */\r\n\r\nexport default class LoginCtrl {\r\n\tconstructor(\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$window,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tNavigationService,\r\n\t\tLocalStorageService,\r\n\t\tNotificationService,\r\n\t\tAuthenticationService\r\n\t) {\r\n\t\t'ngInject';\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.NavigationService = NavigationService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.AuthenticationService = AuthenticationService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.$rootScope.$broadcast('user-login-busy', {\r\n\t\t\tisBusy: true,\r\n\t\t\terr: null\r\n\t\t});\r\n\r\n\t\tthis.Password = undefined;\r\n\t\tthis.UserName = undefined;\r\n\t\tthis.resetToken = undefined;\r\n\t\tthis.wantToRegister = undefined;\r\n\t\tthis.dontAskMeAgain = undefined;\r\n\t\tthis.isRegisterFormValid = false;\r\n\t\tthis.ConfirmPassword = undefined;\r\n\r\n\t\tthis.Utility.loadLoader();\r\n\r\n\t\tthis.isBusy = false;\r\n\t\tthis.timeBetweenModals = 680;\r\n\r\n this._handleEvents();\r\n this.passwordFieldType = 'password';\r\n this.isNotificationListenerRegistered = false;\r\n\t\tthis.NavigationService.InitialiseNavigation().then(() => {\r\n\t\t\tthis.$rootScope.$broadcast('user-login-busy', {\r\n\t\t\t\tisBusy: false,\r\n\t\t\t\terr: null\r\n\t\t\t});\r\n\t\t\tconst currentUser = this.AuthenticationService.currentUser();\r\n\t\t\tif (currentUser) {\r\n\t\t\t\tthis.$rootScope.$broadcast('user-logged-in', currentUser);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\r\n\t}\r\n\r\n\tchange(evt) {\r\n\t\tthis.isRegisterFormValid =\r\n\t\t\tthis.FirstName &&\r\n\t\t\tthis.LastName &&\r\n\t\t\tthis.Password &&\r\n\t\t\tthis.ConfirmPassword &&\r\n\t\t\tthis.Password === this.ConfirmPassword;\r\n\t}\r\n\r\n\tcontinue(evt) {\r\n\t\tthis.closeRegisterPromptModal();\r\n\r\n\t\tif (this.wantToRegister) {\r\n\t\t\tconst user = this.AuthenticationService.currentUser();\r\n\t\t\tthis.UserName = user.UserName;\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tthis.showRegisterModal();\r\n\t\t\t}, timeBetweenModals);\r\n\t\t} else if (this.dontAskMeAgain) {\r\n\t\t\tthis.AuthenticationService\r\n\t\t\t\t.dontShowRegisterPrompt()\r\n\t\t\t\t.then(\r\n\t\t\t\t\t(results) => { },\r\n\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\tconsole.error('Error while opting out of the register reminder: ' + this.UserName, err);\r\n\t\t\t\t\t}\r\n\t\t\t\t)\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.init();\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tregister() {\r\n\t\tconst payLoad = {\r\n\t\t\tUserName: this.UserName,\r\n\t\t\tPassword: this.Password,\r\n\t\t\tFirstName: this.FirstName,\r\n\t\t\tLastName: this.LastName\r\n\t\t};\r\n\r\n\t\tthis.isBusy = true;\r\n\t\tthis.AuthenticationService\r\n\t\t\t.registerUser(payLoad)\r\n\t\t\t.then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\t\t\tthis.NotificationService.success('REGISTERED SUCCESSFULLY');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.NotificationService.error('REGISTRATION UNSUCCESSFUL');\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tconsole.error('Error while registering user: ' + this.UserName, err);\r\n\t\t\t\t\tthis.NotificationService.error('REGISTRATION UNSUCCESSFUL');\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.init();\r\n\t\t\t\tthis.isBusy = true;\r\n\t\t\t\tthis.closeRegisterModal();\r\n\t\t\t});\r\n\t}\r\n\r\n\tasync login(evt, shouldRedirect) {\r\n this.isLoginBusy = true;\r\n try {\r\n const results = await this.AuthenticationService.loginUser(this.UserName, this.Password);\r\n\r\n if (typeof results === 'object' && results.length === 2) {\r\n if (shouldRedirect) {\r\n this.$state.go('dashboard');\r\n }\r\n } else {\r\n this.NotificationService.success('LOGIN UNSUCCESSFUL');\r\n this.isNotificationListenerRegistered = true;\r\n }\r\n } catch (err) {\r\n this.NotificationService.error('LOGIN UNSUCCESSFUL');\r\n const payLoad = {\r\n isBusy: false,\r\n err: null\r\n };\r\n this.isNotificationListenerRegistered = true;\r\n\t\t\tthis.$rootScope.$broadcast('user-login-busy', payLoad);\r\n\t\t\tconsole.error(`Error while logging in user: ${this.UserName}\\nError: ${err}`);\r\n\t\t} finally {\r\n\t\t\tthis.init();\r\n\t\t\tthis.isLoginBusy = false;\r\n\t\t}\r\n\t}\r\n\r\n\tpreRegisterUser() {\r\n\t\tthis.$state.go('register');\r\n\t}\r\n\t\r\n\tpreShowForgotPasswordModal() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.UserName = '';\r\n\t\t\tthis.showForgotPasswordModal();\r\n\t\t}, this.timeBetweenModals - 300);\r\n\t}\r\n\r\n\tforgotPassword(userName = null) {\r\n\t\tthis.isBusy = true;\r\n\t\tconst promise = this.AuthenticationService.userForgotPassword(userName || this.UserName);\r\n\t\tpromise.finally(() => {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromise\r\n\t\t\t\t\t.then(\r\n\t\t\t\t\t\t(results) => {\r\n\t\t\t\t\t\t\tthis.NotificationService.success('FOLLOW THE EMAIL LINK TO SET A NEW PASSWORD');\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\t\tconsole.error(`Error while resetting a password: ${err}`);\r\n\r\n\t\t\t\t\t\t\tthis.NotificationService.error('PASSWORD RESET FAILED');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\tthis.init();\r\n\t\t\t\t\t\tthis.isBusy = false;\r\n\t\t\t\t\t\tthis.closeForgotPasswordModal();\r\n\t\t\t\t\t});\r\n\t\t\t}, 1200);\r\n\t\t});\r\n\t}\r\n\r\n\tresetPassword() {\r\n\t\tthis.isBusy = true;\r\n\r\n\t\tconst promise = this.AuthenticationService.userResetPassword(this.Password, this.resetToken);\r\n\t\tpromise.finally(() => {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromise\r\n\t\t\t\t\t.then(\r\n\t\t\t\t\t\t(results) => {\r\n\t\t\t\t\t\t\tthis.NotificationService.success('PASSWORD RESET SUCCESSFULLY');\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\t\tthis.NotificationService.error('FAILED. PLEASE CONTACT PRETOR GROUP.');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\tthis.init();\r\n\t\t\t\t\t\tthis.isBusy = false;\r\n\t\t\t\t\t\tthis.closeRestPasswordModal();\r\n\t\t\t\t\t});\r\n\t\t\t}, 1200);\r\n\t\t});\r\n\t}\r\n\r\n\tcloseUnsubscribe() {\r\n\t\tthis.AuthenticationService.unsubscribeMonthlyFinancialDocs().then(\r\n\t\t\t(results) => {\r\n\t\t\t\tthis.NotificationService.success('UNSUBSCRIBED SUCCESSFULLY');\r\n\t\t\t},\r\n\t\t\t(err) => {\r\n\t\t\t\tthis.NotificationService.error('UNSUBSCRIBE FAILED');\r\n\t\t\t\tconsole.error(err);\r\n\t\t\t}\r\n\t\t);\r\n\t\tthis.closeUnsubscribeMonthlyFinancialDocs();\r\n }\r\n\r\n togglePasswordVisibility() {\r\n this.passwordFieldType = this.passwordFieldType === 'password' ? 'text' : 'password';\r\n };\r\n\r\n\t_handleEvents() {\r\n\r\n\t\tthis.$rootScope.$on('auth-modal-set-username', (event, username) => {\r\n\t\t\tthis.UserName = username;\r\n\t\t})\r\n\r\n\t\tthis.$scope.$on('reset-user-password', ($evt, userName) => {\r\n\t\t\tthis.forgotPassword(userName);\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('unsubscribe-monthly-financial-docs', ($event) => {\r\n\t\t\tthis.showUnsubscribeMonthlyFinancialDocs();\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('show-login-auth-modal', (event) => {\r\n\t\t\t//this.showLoginModal();\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('show-reset-password-auth-modal', ($event, token) => {\r\n\t\t\tthis.resetToken = token;\r\n\t\t\tthis.LocalStorageService.save('resetPasswordToken', token);\r\n\t\t\tthis.showRestPasswordModal();\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('user-logged-in', ($event, results) => {\r\n\t\t\tconst profile = results && results.length > 0 ? results[1] : results;\r\n\t\t\tif (profile) {\r\n\t\t\t\tthis.$state.go('dashboard');\r\n\t\t\t}\r\n\t\t});\r\n\r\n if (!this.isNotificationListenerRegistered) {\r\n this.$rootScope.$on('show-notification', ($event, message, error, timeout) => {\r\n if (!$event.defaultPrevented) {\r\n $event.defaultPrevented = true;\r\n }\r\n this.$rootScope.$broadcast('notifications-modal-show', { message, error, timeout });\r\n });\r\n this.isNotificationListenerRegistered = true;\r\n }\r\n\r\n\t\tthis.$rootScope.$on('user-reset-password', (event, data) => {\r\n\t\t\tthis.preShowForgotPasswordModal();\r\n\t\t});\r\n\t}\r\n}\r\n","/* @ngInject */\r\n//@ts-check\r\nimport { serverfyJSObject } from '../../../common/common';\r\n\r\nexport default class ProfileCtrl {\r\n constructor(\r\n $sce,\r\n $scope,\r\n $timeout,\r\n $rootScope,\r\n ProfileService,\r\n UserUnitsService,\r\n BuildingsService,\r\n NavigationService,\r\n NotificationService,\r\n LocalStorageService,\r\n CountriesUtilService\r\n ) {\r\n this.$sce = $sce;\r\n this.$scope = $scope;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.ProfileService = ProfileService;\r\n this.UserUnitsService = UserUnitsService;\r\n this.BuildingsService = BuildingsService;\r\n this.NavigationService = NavigationService;\r\n this.NotificationService = NotificationService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.CountriesUtilService = CountriesUtilService;\r\n\r\n this.init();\r\n this.activate();\r\n }\r\n\r\n async init() {\r\n this.isBusy = true;\r\n this.unitList = null;\r\n\r\n this.emailIndex = null;\r\n this.emailAction = null;\r\n\r\n this.isEditingMobile = false;\r\n this.selectedCardCode = null;\r\n this.isEditingDetails = false;\r\n this.details = {\r\n address: {\r\n lineOne: null,\r\n lineTwo: null,\r\n lineThree: null,\r\n lineFour: null,\r\n postalCode: null\r\n },\r\n userName: null,\r\n lastName: null,\r\n firstName: null,\r\n homeNumber: null,\r\n cellNumber: null,\r\n workNumber: null,\r\n idOrPassportNumber: null\r\n };\r\n\r\n this.isEditContactInfo = false;\r\n this.isEditAddressInfo = false;\r\n this.contactInformation = null;\r\n this.addressInformation = null;\r\n\r\n this.updatableCellphone = undefined;\r\n\r\n this.selectedHomeNumber = undefined;\r\n this.isEditingHomePhoneNumber = false;\r\n this.updatableHomePhoneNumber = undefined;\r\n\r\n this.selectedWorkNumber = undefined;\r\n this.isEditingWorkPhoneNumber = false;\r\n this.updatableWorkPhoneNumber = undefined;\r\n\r\n this.lockEmailAddress = false;\r\n this.isEditingEmailAddress = false;\r\n this.updatableEmailAddress = undefined;\r\n\r\n this.confirmChangeModal = undefined;\r\n this.multipleUnitChangeModal = undefined;\r\n this._handleEvents();\r\n }\r\n\r\n get getOwnerId() {\r\n const { FirstId, AdditionalId } = this.ProfileService.myProfileInformation;\r\n const fields = [FirstId, AdditionalId];\r\n\r\n const mappedIds = fields.map(field => {\r\n let mapped;\r\n if (!!field) {\r\n mapped = `${field},`;\r\n return mapped;\r\n }\r\n });\r\n\r\n return this.$sce.getTrustedHtml(mappedIds.join(''));\r\n }\r\n\r\n get getResidentialAddress() {\r\n const {\r\n AddressLine1,\r\n AddressLine2,\r\n AddressLine3,\r\n AddressLine4,\r\n PostalCode\r\n } = this.ProfileService.myProfileInformation;\r\n const fields = [\r\n AddressLine1,\r\n AddressLine2,\r\n AddressLine3,\r\n AddressLine4,\r\n PostalCode\r\n ];\r\n const add = fields.map(field => {\r\n let mapped;\r\n if (!!field) {\r\n mapped = `${field},`;\r\n return mapped;\r\n }\r\n });\r\n\r\n const html = this.$sce.getTrustedHtml(add);\r\n const addressFields = html.split(',');\r\n const mappedFields = addressFields.map((field, i) => {\r\n let mappedField = field;\r\n\r\n if (!field.endsWith('')) {\r\n mappedField = `${field}`;\r\n }\r\n\r\n if (i === addressFields.length - 1) {\r\n mappedField = mappedField.replace(',', '');\r\n }\r\n\r\n return mappedField;\r\n });\r\n\r\n const trustedHtml = mappedFields.join('');\r\n\r\n return trustedHtml;\r\n }\r\n\r\n get getHomeNumber() {\r\n const { HomeNumber } = this.ProfileService.myProfileInformation;\r\n const mappedHomeNumber = HomeNumber.join(' or
');\r\n\r\n return this.$sce.getTrustedHtml(mappedHomeNumber);\r\n }\r\n\r\n get getCellNumber() {\r\n const { CellPhoneNumber } = this.ProfileService.myProfileInformation;\r\n const mappedCellNumber = CellPhoneNumber.join(' or
');\r\n\r\n return this.$sce.getTrustedHtml(mappedCellNumber);\r\n }\r\n\r\n get getUserName() {\r\n const { EmailUserName } = this.ProfileService.myProfileInformation;\r\n const mappedEmails = EmailUserName;\r\n\r\n return mappedEmails;\r\n }\r\n\r\n get getFirstName() {\r\n const { FirstName } = this.ProfileService.myProfileInformation;\r\n return FirstName;\r\n }\r\n\r\n get getLastName() {\r\n const { LastName } = this.ProfileService.myProfileInformation;\r\n return LastName;\r\n }\r\n\r\n setANewPassword() {\r\n\r\n this.$rootScope.$broadcast('user-reset-password');\r\n }\r\n\r\n editDetails() {\r\n this.isEditingDetails = true;\r\n\r\n const {\r\n FirstId,\r\n AdditionalId,\r\n LastName: lastName,\r\n FirstName: firstName,\r\n AddressLine1: lineOne,\r\n AddressLine2: lineTwo,\r\n HomeNumber: homeNumber,\r\n WorkNumber: workNumber,\r\n AddressLine4: lineFour,\r\n PostalCode: postalCode,\r\n EmailUserName: userName,\r\n AddressLine3: lineThree,\r\n CellPhoneNumber: cellNumber\r\n } = this.ProfileService.myProfileInformation;\r\n const idOrPassportNumber = `${FirstId}/${AdditionalId}`;\r\n\r\n this.details = {\r\n lastName,\r\n userName,\r\n firstName,\r\n homeNumber,\r\n cellNumber,\r\n workNumber,\r\n address: {\r\n lineOne,\r\n lineTwo,\r\n lineFour,\r\n lineThree,\r\n postalCode\r\n },\r\n idOrPassportNumber\r\n };\r\n\r\n if(Array.isArray(this.details.cellNumber)){\r\n this.details.cellNumber = this.details.cellNumber.join(',')\r\n }\r\n\r\n if(Array.isArray(this.details.homeNumber)){\r\n this.details.homeNumber = this.details.homeNumber.join(',')\r\n }\r\n\r\n if(Array.isArray(this.details.workNumber)){\r\n this.details.workNumber = this.details.workNumber.join(',')\r\n }\r\n }\r\n\r\n async saveDetails() {\r\n this.isBusy = true;\r\n this.isEditingDetails = false;\r\n\r\n try {\r\n let cardCode, schemeReference;\r\n if (\r\n !!this.selectedCardCode &&\r\n typeof this.selectedCardCode === 'string'\r\n ) {\r\n //TODO: START HERE...\r\n const temp = JSON.parse(this.selectedCardCode);\r\n const { SchemeReference: schemeRef, CardCode: incomingCardCode } = temp;\r\n cardCode = incomingCardCode;\r\n schemeReference = schemeRef;\r\n //this.selectedCardCode = JSON.parse(this.selectedCardCode);\r\n } else {\r\n const {\r\n SchemeReference: schemeRef,\r\n CardCode: incomingCardCode\r\n } = this.selectedCardCode;\r\n cardCode = incomingCardCode;\r\n schemeReference = schemeRef;\r\n }\r\n\r\n const { idOrPassportNumber } = this.details;\r\n let {\r\n lastName,\r\n userName,\r\n firstName,\r\n homeNumber,\r\n cellNumber,\r\n workNumber,\r\n address: {\r\n postalCode,\r\n lineOne: addressLine1,\r\n lineTwo: addressLine2,\r\n lineFour: addressLine4,\r\n lineThree: addressLine3\r\n }\r\n } = this.details;\r\n\r\n if (!!homeNumber) {\r\n homeNumber = homeNumber.split(',');\r\n }\r\n\r\n if (!!cellNumber) {\r\n cellNumber = cellNumber.split(',');\r\n }\r\n\r\n if (!!workNumber) {\r\n workNumber = workNumber.split(',');\r\n }\r\n\r\n let payload = serverfyJSObject({\r\n cardCode,\r\n lastName,\r\n firstName,\r\n postalCode,\r\n addressLine1,\r\n addressLine2,\r\n addressLine3,\r\n addressLine4,\r\n schemeReference,\r\n emailUserName: userName,\r\n homeNumber: !!homeNumber\r\n ? homeNumber.length > 1\r\n ? homeNumber.join('/')\r\n : homeNumber[0]\r\n : null,\r\n cellNumber: !!cellNumber\r\n ? cellNumber.length > 1\r\n ? cellNumber.join('/')\r\n : cellNumber[0]\r\n : null,\r\n workNumber: !!workNumber\r\n ? workNumber.length > 1\r\n ? workNumber.join('/')\r\n : workNumber[0]\r\n : null\r\n });\r\n\r\n if (!!idOrPassportNumber && idOrPassportNumber.includes('/')) {\r\n const idFields = idOrPassportNumber.split('/');\r\n const FirstId = idFields[0],\r\n AdditionalId = idFields[1];\r\n\r\n payload = {\r\n ...payload,\r\n FirstId,\r\n AdditionalId\r\n };\r\n }\r\n\r\n await this.ProfileService.updateDetails(payload);\r\n const oldUsername = this.ProfileService.myProfileInformation\r\n .EmailUserName;\r\n if (userName != oldUsername) {\r\n this.NotificationService.successModal(\r\n 'Successfully updated user details.'\r\n );\r\n } else {\r\n this.activate();\r\n this.isBusy = false;\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n const msg = 'Error while saving your details.';\r\n this.NotificationService.error(msg);\r\n } finally {\r\n this.isBusy = false;\r\n }\r\n }\r\n\r\n switchEditContactDetails(flag) {\r\n this.isEditContactInfo = flag;\r\n\r\n if (!this.isEditContactInfo) {\r\n this.updatableCellphone = null;\r\n this.updatableEmailAddress = null;\r\n this.updatableHomePhoneNumber = null;\r\n this.updatableWorkPhoneNumber = null;\r\n } else {\r\n this.switchEditAddress(false);\r\n }\r\n }\r\n\r\n applyChangesToAllUnits() {}\r\n\r\n switchEditAddress(flag) {\r\n this.isEditAddressInfo = flag;\r\n if (this.isEditAddressInfo) {\r\n this.switchEditContactDetails(false);\r\n }\r\n }\r\n\r\n async _setInitialUnitInfo() {\r\n let selectedBuildingRefObj;\r\n const selectedBuildingRef = this.LocalStorageService.retrieve(\r\n 'selectedBuildingRef'\r\n );\r\n if (typeof selectedBuildingRef !== 'object') {\r\n const user = this.LocalStorageService.retrieve('userProfile');\r\n if (user) {\r\n const { BuildingProfiles } = user;\r\n if (BuildingProfiles) {\r\n const {\r\n SchemeName,\r\n SchemeReference,\r\n BuildingProfileUnit\r\n } = BuildingProfiles[0];\r\n const { CardCode } = BuildingProfileUnit[0];\r\n selectedBuildingRefObj = {\r\n CardCode,\r\n SchemeName,\r\n SchemeReference\r\n };\r\n }\r\n }\r\n } else {\r\n selectedBuildingRefObj = selectedBuildingRef;\r\n }\r\n\r\n if (\r\n !!selectedBuildingRefObj &&\r\n this.selectedCardCode.CardCode !== selectedBuildingRefObj.CardCode\r\n ) {\r\n this.selectedCardCode = selectedBuildingRefObj;\r\n }\r\n }\r\n\r\n async activate() {\r\n await this.getUnits();\r\n }\r\n\r\n async _onSelectedBuildingChanged(event, schemeRef) {\r\n try {\r\n if (schemeRef) {\r\n this.activate();\r\n }\r\n } catch (err) {\r\n console.error('Error while loading user units:', err);\r\n } finally {\r\n this.isBusy = false;\r\n }\r\n }\r\n\r\n async getUnits() {\r\n this.isBusy = true;\r\n\r\n this.$timeout(async () => {\r\n try {\r\n const selectedBuilding = this.selectedBuilding;\r\n this.unitList = await this.UserUnitsService.getFriendlyUnitNames();\r\n\r\n this.unitList = this.unitList.filter(unit => {\r\n let found = false;\r\n const { CardCode: cardCode } = unit;\r\n if (!!cardCode) {\r\n const extractedSchemeRef = cardCode.substr(1, 3);\r\n const { SchemeReference: selectedBuildingRef } = selectedBuilding;\r\n if (extractedSchemeRef === selectedBuildingRef) {\r\n found = true;\r\n }\r\n }\r\n\r\n return found;\r\n });\r\n\r\n if (this.unitList && this.unitList.length > 0) {\r\n const defaultUnit = this.unitList[0];\r\n delete defaultUnit.$$hashKey;\r\n const json = JSON.stringify(defaultUnit);\r\n\r\n this.selectedCardCode = `${json}`;\r\n }\r\n } catch (err) {\r\n console.error('Error while loading user units:', err);\r\n } finally {\r\n await this.getMyProfileInformation();\r\n this.isBusy = false;\r\n }\r\n });\r\n }\r\n\r\n _setProfileInfo() {\r\n this._setAddressInfo();\r\n this._setContactInfo();\r\n }\r\n\r\n _setAddressInfo() {\r\n const {\r\n PostalCode,\r\n AddressLine1,\r\n AddressLine2,\r\n AddressLine3,\r\n AddressLine4\r\n } = this.ProfileService.myProfileInformation;\r\n\r\n this.addressInformation = {\r\n PostalCode,\r\n AddressLine1,\r\n AddressLine2,\r\n AddressLine3,\r\n AddressLine4\r\n };\r\n\r\n this.switchEditAddress(false);\r\n }\r\n\r\n resetAddressInfo() {\r\n this._setAddressInfo();\r\n this.switchEditAddress(false);\r\n }\r\n\r\n resetContactInfo() {\r\n this._setContactInfo();\r\n this.switchEditContactDetails(false);\r\n }\r\n\r\n _setContactInfo() {\r\n let {\r\n CardCode,\r\n HomeNumber,\r\n WorkNumber,\r\n EmailAddress,\r\n CellPhoneNumber,\r\n EmailAddressChanges\r\n } = this.ProfileService.myProfileInformation;\r\n\r\n HomeNumber = HomeNumber.filter(home => home && home.trim());\r\n WorkNumber = WorkNumber.filter(work => work && work.trim());\r\n EmailAddress = EmailAddress.filter(email => email && email.trim());\r\n CellPhoneNumber = CellPhoneNumber.filter(cell => cell && cell.trim());\r\n\r\n this.contactInformation = {\r\n CardCode,\r\n HomeNumber,\r\n WorkNumber,\r\n EmailAddress,\r\n CellPhoneNumber,\r\n EmailAddressChanges,\r\n selectedWorkNumber: '',\r\n selectedHomeNumber: '',\r\n selectedEmailAddress: '',\r\n selectedCellphoneNumber: ''\r\n };\r\n }\r\n\r\n shouldLogoutUser() {\r\n angular.element('#usernameChangedModal').modal('toggle');\r\n }\r\n\r\n _handleEvents() {\r\n this.$scope.$watch(\r\n 'ProfileVM.selectedCardCode',\r\n (newValue, oldValue) => {\r\n if (this.selectedCardCode) {\r\n this.getMyProfileInformation();\r\n }\r\n },\r\n true\r\n );\r\n\r\n this.$scope.$on('selected-building-changed', (event, newValue) => {\r\n this._onSelectedBuildingChanged(event, newValue);\r\n });\r\n\r\n this.$rootScope.$on('show-success-modal', (evt, msg) => {\r\n this.shouldLogoutUser();\r\n });\r\n\r\n angular.element('#usernameChangedModal').on('hidden.bs.modal', () => {\r\n angular.element('#userMenuItems li:last-child a').trigger('click');\r\n });\r\n\r\n this.$rootScope.$on('auth-modal-shown', (event, data) => {\r\n const $resetPasswordModal = angular.element(data[0]);\r\n const $passwordResetButton = angular.element(\r\n 'button',\r\n $resetPasswordModal\r\n );\r\n const $passwordInput = angular.element(\r\n 'input[ng-model=\"AuthVM.UserName\"]',\r\n $resetPasswordModal\r\n );\r\n const userProfile = this.LocalStorageService.retrieve('userProfile');\r\n let { WebUsername: username, UserName: masterEmail } = userProfile;\r\n\r\n $passwordInput.prop('disabled', 'disabled');\r\n $passwordResetButton.removeAttr('disabled');\r\n\r\n if (!!!username) {\r\n username = masterEmail;\r\n }\r\n\r\n this.$rootScope.$broadcast('auth-modal-set-username', username);\r\n });\r\n\r\n this.$timeout(() => {\r\n const $resetPasswordModal = angular.element(\r\n 'auth-modal[show-modal=\"AuthVM.showForgotPasswordModal\"]'\r\n );\r\n $resetPasswordModal.on('shown.bs.modal', () => {\r\n const $passwordInput = angular.element('input', $resetPasswordModal);\r\n const userProfile = this.LocalStorageService.retrieve('userProfile');\r\n const { WebUsername: username } = userProfile;\r\n\r\n $passwordInput.value(username);\r\n $passwordInput.css('disabled', 'disabled');\r\n });\r\n\r\n $resetPasswordModal.on('hidden.bs.modal', () => {\r\n angular.element('.modal-backdrop.in').hide();\r\n });\r\n }, 8000);\r\n }\r\n\r\n addEditCellNumber() {\r\n if (this.updatableCellphone) {\r\n if (\r\n this.contactInformation.selectedCellphoneNumber &&\r\n this.contactInformation.selectedCellphoneNumber.length > 8\r\n ) {\r\n this.contactInformation.CellPhoneNumber[\r\n this.updatableCellphone.index\r\n ] = this.contactInformation.selectedCellphoneNumber.trim();\r\n }\r\n } else {\r\n const oldNumber = this.contactInformation.CellPhoneNumber.find(\r\n mobileNo =>\r\n mobileNo.trim() ===\r\n this.contactInformation.selectedCellphoneNumber.trim()\r\n );\r\n\r\n if (!oldNumber) {\r\n if (\r\n this.contactInformation.selectedCellphoneNumber &&\r\n this.contactInformation.selectedCellphoneNumber.length > 8\r\n ) {\r\n this.contactInformation.CellPhoneNumber = [\r\n this.contactInformation.selectedCellphoneNumber,\r\n ...this.contactInformation.CellPhoneNumber\r\n ];\r\n }\r\n } else {\r\n this.NotificationService.error('Cellphone number already exists.');\r\n }\r\n }\r\n\r\n this.updatableCellphone = undefined;\r\n this.contactInformation.selectedCellphoneNumber = '';\r\n }\r\n\r\n editCellPhone(cellphoneIndex) {\r\n if (cellphoneIndex !== -1) {\r\n const oldNumber = this.contactInformation.CellPhoneNumber[cellphoneIndex];\r\n\r\n if (oldNumber) {\r\n this.updatableCellphone = {\r\n number: oldNumber,\r\n index: cellphoneIndex\r\n };\r\n this.contactInformation.selectedCellphoneNumber = oldNumber;\r\n } else {\r\n this.NotificationService.error(\r\n 'Cannot find the selected Cellphone number.'\r\n );\r\n }\r\n }\r\n }\r\n\r\n removeCellPhone(index, form) {\r\n this.contactInformation.CellPhoneNumber = this.contactInformation.CellPhoneNumber.filter(\r\n (phone, i) => i !== index\r\n );\r\n\r\n form.$setDirty();\r\n }\r\n\r\n addEditHomeNumber() {\r\n if (this.updatableHomePhoneNumber) {\r\n if (\r\n this.contactInformation.selectedHomeNumber &&\r\n this.contactInformation.selectedHomeNumber.length > 8\r\n ) {\r\n this.contactInformation.HomeNumber[\r\n this.updatableHomePhoneNumber.index\r\n ] = this.contactInformation.selectedHomeNumber.trim();\r\n }\r\n } else {\r\n const oldNumber = this.contactInformation.HomeNumber.find(\r\n homePhoneNo =>\r\n homePhoneNo.trim() ===\r\n this.contactInformation.selectedHomeNumber.trim()\r\n );\r\n\r\n if (!oldNumber) {\r\n if (\r\n this.contactInformation.selectedHomeNumber &&\r\n this.contactInformation.selectedHomeNumber.length > 8\r\n ) {\r\n this.contactInformation.HomeNumber = [\r\n this.contactInformation.selectedHomeNumber,\r\n ...this.contactInformation.HomeNumber\r\n ];\r\n }\r\n } else {\r\n this.NotificationService.error('Home phone number already exists.');\r\n }\r\n }\r\n\r\n this.updatableHomePhoneNumber = undefined;\r\n this.contactInformation.selectedHomeNumber = '';\r\n }\r\n\r\n editHomePhoneNumber(homePhoneNumberIndex) {\r\n if (homePhoneNumberIndex !== -1) {\r\n const oldNumber = this.contactInformation.HomeNumber[\r\n homePhoneNumberIndex\r\n ];\r\n\r\n if (oldNumber) {\r\n this.updatableHomePhoneNumber = {\r\n number: oldNumber,\r\n index: homePhoneNumberIndex\r\n };\r\n this.contactInformation.selectedHomeNumber = oldNumber;\r\n } else {\r\n this.NotificationService.error(\r\n 'Cannot find the selected Home phone number.'\r\n );\r\n }\r\n }\r\n }\r\n\r\n removeHomePhoneNumber(index, form) {\r\n this.contactInformation.HomeNumber = this.contactInformation.HomeNumber.filter(\r\n (phone, i) => i !== index\r\n );\r\n\r\n form.$setDirty();\r\n }\r\n\r\n addEditWorkNumber() {\r\n if (this.updatableWorkPhoneNumber) {\r\n if (\r\n this.contactInformation.selectedWorkNumber &&\r\n this.contactInformation.selectedWorkNumber.length > 8\r\n ) {\r\n this.contactInformation.WorkNumber[\r\n this.updatableWorkPhoneNumber.index\r\n ] = this.contactInformation.selectedWorkNumber.trim();\r\n }\r\n\r\n this.updatableWorkPhoneNumber = undefined;\r\n } else {\r\n const oldNumber = this.contactInformation.WorkNumber.find(\r\n homePhoneNo =>\r\n homePhoneNo.trim() ===\r\n this.contactInformation.selectedWorkNumber.trim()\r\n );\r\n\r\n if (!oldNumber) {\r\n if (\r\n this.contactInformation.selectedWorkNumber &&\r\n this.contactInformation.selectedWorkNumber.length > 8\r\n ) {\r\n this.contactInformation.WorkNumber = [\r\n this.contactInformation.selectedWorkNumber,\r\n ...this.contactInformation.WorkNumber\r\n ];\r\n }\r\n } else {\r\n this.NotificationService.error('Work phone number already exists.');\r\n }\r\n }\r\n\r\n this.updatableWorkPhoneNumber = undefined;\r\n this.contactInformation.selectedWorkNumber = '';\r\n }\r\n\r\n editWorkPhoneNumber(WorkPhoneNumberIndex) {\r\n if (WorkPhoneNumberIndex !== -1) {\r\n const oldNumber = this.contactInformation.WorkNumber[\r\n WorkPhoneNumberIndex\r\n ];\r\n\r\n if (oldNumber) {\r\n this.updatableWorkPhoneNumber = {\r\n number: oldNumber,\r\n index: WorkPhoneNumberIndex\r\n };\r\n this.contactInformation.selectedWorkNumber = oldNumber;\r\n } else {\r\n this.NotificationService.error(\r\n 'Cannot find the selected Work phone number.'\r\n );\r\n }\r\n }\r\n }\r\n\r\n removeWorkPhoneNumber(index, form) {\r\n this.contactInformation.WorkNumber = this.contactInformation.WorkNumber.filter(\r\n (phone, i) => i !== index\r\n );\r\n\r\n form.$setDirty();\r\n }\r\n\r\n editEmail(emailIndex, form) {\r\n console.log(`Editing email ${emailIndex}`);\r\n\r\n if (emailIndex > -1) {\r\n const oldEmailAddress = this.contactInformation.EmailAddress[emailIndex];\r\n\r\n if (oldEmailAddress) {\r\n this.updatableEmailAddress = {\r\n index: emailIndex,\r\n address: oldEmailAddress\r\n };\r\n\r\n this.isEditingEmailAddress = true;\r\n this.contactInformation.selectedEmailAddress = oldEmailAddress;\r\n } else {\r\n this.NotificationService.error(\r\n 'Cannot find the selected Email Address.'\r\n );\r\n }\r\n }\r\n }\r\n\r\n removeEmail(index, form) {\r\n console.log(`Removing email ${index}.`);\r\n\r\n this.contactInformation.EmailAddress = this.contactInformation.EmailAddress.filter(\r\n (email, i) => i !== index\r\n );\r\n form.$setDirty();\r\n }\r\n\r\n addEditEmailAddress() {\r\n console.log(`Adding a new Email`);\r\n if (this.updatableEmailAddress) {\r\n if (\r\n this.contactInformation.selectedEmailAddress &&\r\n this.contactInformation.selectedEmailAddress.length > 2\r\n ) {\r\n this.isEditingEmailAddress = false;\r\n const { index } = this.updatableEmailAddress;\r\n this.contactInformation.EmailAddress[\r\n index\r\n ] = this.contactInformation.selectedEmailAddress.trim();\r\n }\r\n } else {\r\n const oldEmail = this.contactInformation.EmailAddress.find(\r\n email =>\r\n email.trim() === this.contactInformation.selectedEmailAddress.trim()\r\n );\r\n\r\n if (!oldEmail) {\r\n if (this.contactInformation.selectedEmailAddress) {\r\n this.contactInformation.EmailAddress = [\r\n this.contactInformation.selectedEmailAddress,\r\n ...this.contactInformation.EmailAddress\r\n ];\r\n }\r\n } else {\r\n this.NotificationService.error(\r\n 'Cannot find the selected Email Address.'\r\n );\r\n }\r\n }\r\n\r\n this.updatableEmailAddress = undefined;\r\n this.contactInformation.selectedEmailAddress = '';\r\n }\r\n\r\n get canAddEmail() {\r\n let canAdd = false;\r\n\r\n const { EmailAddress } = this.contactInformation;\r\n let emails = EmailAddress.join(';');\r\n if (\r\n !!!this.updatableEmailAddress &&\r\n this.contactInformation.selectedEmailAddress\r\n ) {\r\n emails += `;${this.contactInformation.selectedEmailAddress}`;\r\n }\r\n\r\n if (emails.length < 100) {\r\n canAdd = true;\r\n }\r\n\r\n this.lockEmailAddress = !canAdd;\r\n return canAdd;\r\n }\r\n\r\n preUpdateContactDetails() {\r\n this.switchEditContactDetails(true);\r\n this._toggleMultipleUnitsModal(this._hasMultipleUnits());\r\n }\r\n\r\n closeMultipleUnitChangeModal() {\r\n this.switchEditAddress(false);\r\n this.switchEditContactDetails(false);\r\n\r\n this.requestChangeForMultipleUnits();\r\n\r\n const $modal = this._toggleMultipleUnitsModal(false);\r\n $modal.on('hidden.bs.modal', () => {\r\n this.$timeout(() => {\r\n const $nextModal = angular.element('#multipleUnitChangeFinal');\r\n $nextModal.modal('show');\r\n $modal.off('hidden.bs.modal');\r\n }, 350);\r\n });\r\n }\r\n\r\n preSaveChanges() {\r\n const $modal = angular.element('#confirmationModal');\r\n $modal.modal('show');\r\n }\r\n\r\n async requestChangeForMultipleUnits() {\r\n const cardCode = this.selectedCardCode;\r\n\r\n try {\r\n this.ProfileService.requestChangeForMultipleUnits(cardCode);\r\n } catch (err) {\r\n this.NotificationService.error('ERROR REQUESTING CHANGE.');\r\n } finally {\r\n }\r\n }\r\n\r\n async updateContactDetails() {\r\n this.isBusy = true;\r\n\r\n const {\r\n HomeNumber,\r\n WorkNumber,\r\n EmailAddress,\r\n CellPhoneNumber\r\n } = this.contactInformation;\r\n\r\n const user = this.LocalStorageService.retrieve('userProfile');\r\n const { UserName } = user;\r\n\r\n const payload = {\r\n UserName,\r\n HomeNumber,\r\n WorkNumber,\r\n EmailAddress,\r\n CellPhoneNumber,\r\n EmailUserName: UserName,\r\n RegisteredName: UserName,\r\n CardCode: this.selectedUnitCardCard,\r\n CellPhoneNumberUserName: CellPhoneNumber[0]\r\n };\r\n\r\n try {\r\n await this.ProfileService.updateContactDetails(payload);\r\n await this.getMyProfileInformation();\r\n this.NotificationService.success('UPDATED DETAILS SUCCESSFULLY.');\r\n } catch (err) {\r\n this.NotificationService.error('UPDATING CONTACT DETAILS FAILED.');\r\n } finally {\r\n this.switchEditContactDetails(false);\r\n this.isBusy = false;\r\n }\r\n }\r\n\r\n _hasMultipleUnits() {\r\n let hasMultipleUnits = this.unitList.length > 1;\r\n }\r\n\r\n preUpdateAddressDetails() {\r\n this.switchEditAddress(true);\r\n this._toggleMultipleUnitsModal(this._hasMultipleUnits());\r\n }\r\n\r\n _toggleMultipleUnitsModal(shouldShow) {\r\n const $modal = angular.element('#multipleUnitChange');\r\n\r\n if (!shouldShow) {\r\n $modal.modal('hide');\r\n } else {\r\n $modal.modal('show');\r\n }\r\n\r\n return $modal;\r\n }\r\n\r\n async updateAddressDetails() {\r\n this.isBusy = true;\r\n\r\n try {\r\n const additionalInfo = {\r\n CardCode: this.selectedUnitCardCard,\r\n RegisteredName: this.LocalStorageService.retrieve('userProfile')\r\n .UserName\r\n };\r\n\r\n this.addressInformation = {\r\n ...this.addressInformation,\r\n ...additionalInfo\r\n };\r\n\r\n const results = await this.ProfileService.updateAddressDetails(\r\n this.addressInformation\r\n );\r\n if (!results) {\r\n await this.getMyProfileInformation();\r\n this.NotificationService.success(\r\n 'UPDATED ADDRESS INFORMATION SUCCESSFULLY.'\r\n );\r\n } else {\r\n this.NotificationService.error('UPDATING ADDRESS INFORMATION FAILED.');\r\n }\r\n\r\n this.getMyProfileInformation();\r\n } catch (error) {\r\n this.NotificationService.error('UPDATING ADDRESS INFORMATION FAILED.');\r\n } finally {\r\n this.switchEditAddress(false);\r\n this.isBusy = false;\r\n }\r\n }\r\n\r\n async getMyProfileInformation() {\r\n this.isBusy = true;\r\n\r\n let selectedBuildingRefObj = this.selectedCardCode;\r\n\r\n try {\r\n if (\r\n !!selectedBuildingRefObj &&\r\n typeof selectedBuildingRefObj === 'string' &&\r\n selectedBuildingRefObj.includes('{')\r\n ) {\r\n selectedBuildingRefObj = JSON.parse(selectedBuildingRefObj);\r\n } else if (typeof selectedBuildingRefObj !== 'object') {\r\n selectedBuildingRefObj = await this.getSelectedUnit();\r\n }\r\n await this.ProfileService.getMyProfileInformation(selectedBuildingRefObj);\r\n this._setProfileInfo();\r\n } catch (error) {\r\n console.error(`Error while loading 'User Profile Details':\\n${error}`);\r\n this.NotificationService.error('COULD NOT LOAD PROFILE');\r\n } finally {\r\n this.isBusy = false;\r\n }\r\n }\r\n\r\n async getSelectedUnit() {\r\n let selectedUnit;\r\n const units = await this.UserUnitsService.getFriendlyUnitNames();\r\n\r\n if (units) {\r\n let selectedCardCode = this.selectedCardCode;\r\n if (typeof selectedCardCode === 'object') {\r\n selectedCardCode = this.selectedCardCode.CardCode;\r\n }\r\n selectedUnit = units.find(\r\n unit => this.selectedCardCode === unit.CardCode\r\n );\r\n }\r\n\r\n return selectedUnit;\r\n }\r\n\r\n get selectedUnitCardCard() {\r\n const selectedCardCode = this.unitList.find(unit => {\r\n const { CardCode: cardCode } = unit;\r\n this.CardCode = cardCode;\r\n });\r\n\r\n const { CardCode } = selectedCardCode;\r\n\r\n return CardCode;\r\n }\r\n get selectedUnit() {\r\n if (this.unitList && this.unitList.length > 0) {\r\n let fullName;\r\n const selectedCardCode = this.unitList.find(\r\n unit => unit.CardCode === this.selectedCardCode\r\n );\r\n\r\n if (!!selectedCardCode) {\r\n const { FullName } = selectedCardCode;\r\n\r\n fullName = FullName;\r\n } else {\r\n fullName = '';\r\n }\r\n\r\n return fullName;\r\n } else {\r\n return '';\r\n }\r\n }\r\n\r\n get selectedBuilding() {\r\n let currentBuilding;\r\n let buildingRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n if (!!buildingRef) {\r\n if (typeof buildingRef === 'string') {\r\n const user = this.LocalStorageService.retrieve('userProfile');\r\n const { BuildingProfiles: buildingProfiles } = user;\r\n\r\n const building = buildingProfiles.find(building => {\r\n const { SchemeReference: schemeRef } = building;\r\n const found = schemeRef === buildingRef;\r\n return found;\r\n });\r\n\r\n if (!!building) {\r\n currentBuilding = building;\r\n }\r\n } else {\r\n currentBuilding = buildingRef;\r\n }\r\n } else {\r\n const user = this.LocalStorageService.retrieve('userProfile');\r\n const { BuildingProfiles: buildingProfiles } = user;\r\n\r\n const building = buildingProfiles[0];\r\n\r\n if (!!building) {\r\n const { SchemeReference: schemeRef } = building;\r\n currentBuilding = building;\r\n }\r\n }\r\n\r\n return currentBuilding;\r\n }\r\n\r\n cancelEdit() {\r\n this.isEditingDetails = false;\r\n }\r\n}\r\n","//@ts-check\r\n\r\nclass ProfileService {\r\n\tconstructor($http, Utility, $timeout, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.userDetails = null;\r\n\t\tthis.myProfileInformation = null;\r\n\t}\r\n\r\n\tasync updateDetails(userDetails) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\tpromiseHandler = {\r\n\t\t\t\treject,\r\n\t\t\t\tresolve\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tlet url = await this.InternalLinksService.getLink('UpdateUserDetails');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', false, true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('UpdateUserDetails');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headers;\r\n\r\n\t\t\tlet results = await this.$http.post(url, userDetails, { headers });\r\n\r\n\t\t\tif ('data' in results) {\r\n\t\t\t\tresults = results.data;\r\n\t\t\t}\r\n\r\n\t\t\tconst { WasSuccessful: wasSuccessful, Data: data } = results;\r\n\r\n\t\t\tif (!wasSuccessful) {\r\n\t\t\t\tthrow Error('Error while updating user details.');\r\n\t\t\t}\r\n\r\n\t\t\tpromiseHandler.resolve(data);\r\n\t\t} catch (error) {\r\n\t\t\tpromiseHandler.reject(error);\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getMyProfileInformation(unitInfo) {\r\n\t\tconst msg = 'Error while retrieving profile information';\r\n\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!!!unitInfo) {\r\n\t\t\t\tthrow new Error('No unit information provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetMyProfileInformation');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', false, true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetMyProfileInformation');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headers;\r\n\t\t\tconst { SchemeReference, CardCode } = unitInfo;\r\n\t\t\turl = `${url.replace('{schemeReference}', SchemeReference)}?cardCode=${CardCode}`;\r\n\r\n\t\t\tconsole.warn(`Sending: ${url}`);\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tconst { data } = results;\r\n\t\t\tconsole.warn(`Received: ${JSON.stringify(data)}`);\r\n\t\t\tif (data) {\r\n\t\t\t\tthis.myProfileInformation = this._mapEmails(data);\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(msg);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error received: ${err}`);\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n * @param {object} contactInfo\r\n */\r\n\tasync updateContactDetails(contactInfo) {\r\n\t\tlet promise, promiseHandler;\r\n\t\tconst msg = 'Error while updating contact details';\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('UpdateContactDetails');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', false, true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('UpdateContacts');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headers;\r\n\r\n\t\t\tconst results = await this.$http.post(url, contactInfo, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(msg);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync requestChangeForMultipleUnits(cardCode) {\r\n\t\tconst msg = 'Failed to update contact details.';\r\n\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tlet url = await this.InternalLinksService.getLink('RequestChangeForMultipleUnits');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/accounts/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('RequestChangeForMultipleUnits');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headers;\r\n\t\t\turl = url.replace('{cardCode}', cardCode);\r\n\r\n\t\t\tconst results = await this.$http.post(url, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(msg);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(`${error}:\\n${error}`));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n * @param {object} addressDetails\r\n */\r\n\tasync updateAddressDetails(addressDetails) {\r\n\t\tconst msg = 'Failed to update contact details.';\r\n\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tlet url = await this.InternalLinksService.getLink('UpdateAddressDetails');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/accounts/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('UpdateAddressDetails');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headers;\r\n\t\t\tconst results = await this.$http.post(url, addressDetails, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(msg);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(`${error}:\\n${error}`));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t_mapEmails(data) {\r\n\t\tconst EmailAddressChanges = data.EmailAddress;\r\n\r\n\t\tconst emailAddresses = EmailAddressChanges.map((email) => email.EmailAddress);\r\n\t\tconst EmailAddress = emailAddresses;\r\n\r\n\t\treturn {\r\n\t\t\t...data,\r\n\t\t\tEmailAddress,\r\n\t\t\tEmailAddressChanges\r\n\t\t};\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, Utility, $timeout, LocalStorageService, InternalLinksService) =>\r\n\tnew ProfileService($http, Utility, $timeout, LocalStorageService, InternalLinksService);\r\n","/* @ngInject */\r\n\r\nexport default class RegisterCtrl {\r\n\tconstructor(\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tRegisterService,\r\n\t\tNotificationService,\r\n\t\tLocalStorageService,\r\n\t\tCountriesUtilService,\r\n\t\t$location\r\n\t) {\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.$location = $location;\r\n\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.RegisterService = RegisterService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.CountriesUtilService = CountriesUtilService;\r\n\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n activate() {\r\n let isConfirmed = false;\r\n\r\n\t\tif (\r\n\t\t\tthis.$state.params &&\r\n\t\t\tthis.$state.params.hasOwnProperty('email') &&\r\n\t\t\tthis.$state.params.hasOwnProperty('token')\r\n\t\t) {\r\n\t\t\tthis.LocalStorageService.clear();\r\n const { email, token } = this.$state.params;\r\n if (email && token) {\r\n\r\n this.currentStep = 5;\r\n this.activationStatus = 'busy';\r\n \r\n\t\t\t\tthis.RegisterService.confirmEmail(email, token).then(\r\n (results) => {\r\n this.currentStep = 5;\r\n isConfirmed = true;\r\n\t\t\t\t\t\tthis.activationStatus = 'done';\r\n\t\t\t\t\t\tthis.$rootScope.$digest();\r\n\r\n\t\t\t\t\t},\r\n (err) => {\r\n\t\t\t\t\t\tthis.activationStatus = 'error';\r\n\t\t\t\t\t\tthis.$rootScope.$digest();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.LocalStorageService.clearAll();\r\n\t\t\t\t\r\n }\r\n\r\n }\r\n this.CountriesUtilService.load().then(\r\n (results) => { },\r\n (err) => {\r\n console.error(err);\r\n }\r\n );\r\n if (isConfirmed) {\r\n this.$rootScope.$broadcast('user-logged-out');\r\n }\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.selectedCountryCode = '+27';\r\n\t\tthis.style = {\r\n\t\t\twidth: '25%'\r\n\t\t};\r\n\r\n\t\tthis.showResendButton = false;\r\n\r\n\t\tthis.email = '';\r\n\t\tthis.name = '';\r\n\t\tthis.surname = '';\r\n\t\tthis.cellphone = '';\r\n\t\tthis.password = '';\r\n\t\tthis.confirmPassword = '';\r\n\r\n\t\tthis.progress = 25;\r\n\t\tthis.currentStep = 0;\r\n\t\tthis.error = '';\r\n\r\n\t\tthis.activationStatus = 'busy';\r\n\t\tthis.mobileRegStatus = 'done';\r\n\r\n\t\tthis.isBusy = false;\r\n\t}\r\n\r\n\tgotoBack() {\r\n\t\tthis.currentStep--;\r\n\t\tthis.updateProgress();\r\n\t}\r\n\r\n\tgotoNext() {\r\n\t\tthis._switchIsBusy(false);\r\n\t\tthis.currentStep++;\r\n\t\tthis.updateProgress();\r\n\t}\r\n\r\n\tasync submit(evt) {\r\n\t\ttry {\r\n\t\t\tlet errMsg = '';\r\n\t\t\tif (this.currentStep === 0) {\r\n\t\t\t\tthis._switchIsBusy(true);\r\n\t\t\t\tthis.showResendButton = false;\r\n\r\n\t\t\t\tconst userDoesNotExists = await this.RegisterService.checkIfUserExists(this.email);\r\n\t\t\t\tif (!this.RegisterService.userAlreadyExists) {\r\n\t\t\t\t\tconst results = await this.RegisterService.validateEmail(this.email);\r\n\t\t\t\t\tthis.gotoNext();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!this.RegisterService.isUserConfirmed) {\r\n\t\t\t\t\t\terrMsg = `User with email(${this\r\n\t\t\t\t\t\t\t.email}) is already registered but not confirmed.\\n If you would like to resend the confirmation email click below, else contact Pretor.`;\r\n\t\t\t\t\t\tthis.showResendButton = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\terrMsg = `User with email(${this\r\n\t\t\t\t\t\t\t.email}) is already registered with Pretor.\\n If you forgot your password, request for a password reset, else contact Pretor.`;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (this.currentStep === 2) {\r\n\t\t\t\tlet errMsg = '';\r\n\t\t\t\tthis._switchIsBusy(true);\r\n\t\t\t\tconst mobileNumber = this.getInternationalMobileNumber();\r\n\r\n\t\t\t\tconst results = await this.RegisterService.registerUser(\r\n\t\t\t\t\tthis.email,\r\n\t\t\t\t\tthis.name,\r\n\t\t\t\t\tthis.surname,\r\n\t\t\t\t\tmobileNumber,\r\n\t\t\t\t\tthis.password\r\n\t\t\t\t);\r\n\t\t\t\tthis.gotoNext();\r\n\t\t\t}\r\n\r\n\t\t\tthis.error = errMsg;\r\n\t\t} catch (error) {\r\n\t\t\tthis.showError(error);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusy(false);\r\n\t\t}\r\n\t}\r\n\r\n\tasync resend() {\r\n\t\tlet errMsg = '';\r\n\r\n\t\ttry {\r\n\t\t\tconst results = await this.RegisterService.resend(this.email);\r\n\t\t\terrMsg = '';\r\n\t\t\tthis.NotificationService.success('EMAIL RESENT.');\r\n\t\t} catch (error) {\r\n\t\t\terrMsg = `Error while re-sending your details, please try again or contact Pretor if the error persists.`;\r\n\t\t\tconsole.error(error);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusy(false);\r\n\t\t\tthis.showError(errMsg);\r\n\t\t}\r\n\t}\r\n\r\n\tupdateProgress() {\r\n\t\tthis.progress = 25 * (this.currentStep + 1);\r\n\r\n\t\tthis.style = {\r\n\t\t\twidth: `${this.progress}%`\r\n\t\t};\r\n\t}\r\n\r\n\tshowError(msg) {\r\n\t\tthis.error = msg;\r\n\t}\r\n\r\n\tgetInternationalMobileNumber() {\r\n\t\treturn `${this.selectedCountryCode}${this.cellphone}`;\r\n\t}\r\n\r\n\t_switchIsBusy(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isBusy = flag;\r\n\t\t});\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass RegisterService {\r\n\tconstructor($http, Utility, $timeout, $rootScope, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n init() {\r\n \r\n\t\tthis.buildings = {};\r\n\t\tthis.userAlreadyExists = false;\r\n\t\tthis.isUserConfirmed = true;\r\n\t\tthis.registrationData = {\r\n\t\t\tisMobileRegistered: false,\r\n\t\t\tisWebRegistered: false,\r\n\t\t\tuser: {}\r\n\t\t};\r\n\r\n\t\t/*\r\n\t\t\tthis.mobileAppInfo = [\r\n\t\t\t\t{\r\n\t\t\t\t\tplatform: 'android',\r\n\t\t\t\t\tdetails: {\r\n\t\t\t\t\t\tthumbnailSrc: '',\r\n\t\t\t\t\t\tstoreUrl: 'https://play.google.com/store/apps/details?id=com.gloportal.pretor'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tplatform: 'ios',\r\n\t\t\t\t\tdetails: {\r\n\t\t\t\t\t\tthumbnailSrc: '',\r\n\t\t\t\t\t\tstoreUrl: 'https://play.google.com/store/apps/details?id=com.gloportal.pretor'\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t];\r\n\t\t\t*/\r\n\t}\r\n\r\n\tasync checkIfUserExists(email) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!email) {\r\n\t\t\t\tthrow new Error('Email must be supplied.');\r\n }\r\n \r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetStateOfUser');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetStateOfUser');\r\n\t\t\t}\r\n\r\n\t\t\turl = `${url}?email=${email}`;\r\n\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tconst { Data: data, WasSuccessful: wasSuccessful } = results.data;\r\n\r\n\t\t\tif (!wasSuccessful) {\r\n\t\t\t\tthrow new Error('Error while validating the email.');\r\n\t\t\t}\r\n\r\n\t\t\tif (data === 0) {\r\n\t\t\t\t//NewUser\r\n\t\t\t\tthis.userAlreadyExists = false;\r\n\t\t\t\tthis.isUserConfirmed = false;\r\n\t\t\t} else if (data === 1) {\r\n\t\t\t\t// AuthTokenUser\r\n\t\t\t\tthis.userAlreadyExists = false;\r\n\t\t\t\tthis.isUserConfirmed = false;\r\n\t\t\t} else if (data === 3) {\r\n\t\t\t\t// NotConfirmedRegisteredUser\r\n\t\t\t\tthis.userAlreadyExists = true;\r\n\t\t\t\tthis.isUserConfirmed = false;\r\n\t\t\t} else if (data === 2) {\r\n\t\t\t\t// ConfirmedRegisteredUser\r\n\t\t\t\tthis.userAlreadyExists = true;\r\n\t\t\t\tthis.isUserConfirmed = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(err);\r\n\t\t\tthis.userAlreadyExists = false;\r\n\t\t\tconst msg = `Error while checking whether the user already exists...`;\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(msg, err));\r\n\t\t}\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync confirmEmail(email, token) {\r\n\t\tlet promise, promiseHandler;\r\n \r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!email) {\r\n\t\t\t\tthrow new Error('Email must be supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tif (!token) {\r\n\t\t\t\tthrow new Error('Token must be supplied.');\r\n\t\t\t}\r\n this.InternalLinksService.getLinks('links', true);\r\n let url = await this.InternalLinksService.getLink('ConfirmEmail');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t await this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ConfirmEmail');\r\n\t\t\t}\r\n url += `?email=${email}&token=${token}`;\r\n \r\n\t\t\tconst results = await this.$http.post(url);\r\n \r\n if (results.data && results.data.hasOwnProperty('WasSuccessful') && results.data.WasSuccessful) {\r\n //debugger;\r\n\t\t\t\tthis.registrationData.isWebRegistered = true;\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n } else {\r\n //debugger;\r\n\t\t\t\tthis.isWebRegistered = false;\r\n\t\t\t\tthis.registrationData.user = {};\r\n\t\t\t\tthrow new Error(`Could not confirm email: ${email}`);\r\n\t\t\t}\r\n } catch (err) {\r\n //debugger;\r\n\t\t\tconst msg = `Error while confirming user registration`;\r\n\t\t\tconsole.error(msg), err;\r\n\t\t\tthis.isWebRegistered = false;\r\n\t\t\tthis.registrationData.user = {};\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync registerUser(email, name, surname, cellphone, password) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!email) {\r\n\t\t\t\tthrow new Error('Email must be supplied.');\r\n\t\t\t}\r\n\t\t\tif (!name) {\r\n\t\t\t\tthrow new Error('Name must be supplied.');\r\n\t\t\t}\r\n\t\t\tif (!surname) {\r\n\t\t\t\tthrow new Error('Surname must be supplied.');\r\n\t\t\t}\r\n\t\t\tif (!cellphone) {\r\n\t\t\t\tthrow new Error('Cellphone number must be supplied.');\r\n\t\t\t}\r\n\t\t\tif (!password) {\r\n\t\t\t\tthrow new Error('Password must be supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = this.InternalLinksService.getLink('RegisterUser');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('RegisterUser');\r\n\t\t\t}\r\n\r\n\t\t\tconst payload = {\r\n\t\t\t\tUserName: email,\r\n\t\t\t\tFirstName: name,\r\n\t\t\t\tLastName: surname,\r\n\t\t\t\tPassword: password,\r\n\t\t\t\tCellPhoneNumber: cellphone,\r\n\t\t\t\tBusinessPartnerUnits: this.buildings\r\n\t\t\t};\r\n\r\n\t\t\tconst results = await this.$http.post(url, payload);\r\n\t\t\tif (results.data.WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Error while registering user`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while registering user`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getMobileAppInfo() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tconst url = 'https://play.google.com/store/apps/details?id=com.gloportal.pretor';\r\n\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(`Error while getting the Pretor Mobile App information...`));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync validateEmail(email) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!email) {\r\n\t\t\t\tthrow new Error('Email must be supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ValidateEmail');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ValidateEmail');\r\n\t\t\t}\r\n\r\n\t\t\turl = `${url}?email=${email}`;\r\n\r\n\t\t\tconst results = await this.$http.get(url, email);\r\n\t\t\tthis.buildings = results.data;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while validating email address`;\r\n\t\t\tconsole.error(msg), err;\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(msg));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync registerMobile(email) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('RegisterMobileApp');\r\n\r\n\t\t\tif (!email) {\r\n\t\t\t\tthrow new Error('Email address must be supplied...');\r\n\t\t\t}\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('accounts/links', true, false, true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('RegisterMobileApp');\r\n\t\t\t}\r\n\r\n\t\t\tif (url.indexOf('{email}') > -1) {\r\n\t\t\t\turl = url.replace('{email}', email);\r\n\t\t\t} else {\r\n\t\t\t\turl = `${url}?email=${email}`;\r\n\t\t\t}\r\n\r\n\t\t\tvar msg = 'Error while registering for the mobile application';\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tif (results.data.WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(msg);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(msg));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync resend(email) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!email) {\r\n\t\t\t\tthrow new Error('Email must be supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ResendEmail');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true, false, true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ResendEmail');\r\n\t\t\t}\r\n\r\n\t\t\turl = `${url}/?email=${email}`;\r\n\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tif (results.data.WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(true));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Error while re-sending email`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while re-sending email`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, Utility, $timeout, $rootScope, LocalStorageService, InternalLinksService) =>\r\n\tnew RegisterService($http, Utility, $timeout, $rootScope, LocalStorageService, InternalLinksService);\r\n","/* @ngInject */\r\n\r\nimport { default as FEATURES } from '../../../common/feature-enum';\r\nimport { default as USER_CLAIMS } from '../../../common/claim-enum';\r\n\r\nexport default class TenantCtrl {\r\n constructor(\r\n $scope,\r\n $state,\r\n Utility,\r\n $timeout,\r\n $rootScope,\r\n UserUnitsService,\r\n TenantDataService,\r\n NotificationService,\r\n LocalStorageService,\r\n AuthorizationService\r\n ) {\r\n this.$scope = $scope;\r\n this.$state = $state;\r\n this.Utility = Utility;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.noTenantForUnit = false;\r\n this.UserUnitsService = UserUnitsService;\r\n this.TenantDataService = TenantDataService;\r\n this.NotificationService = NotificationService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.AuthorizationService = AuthorizationService;\r\n\r\n this.init();\r\n this.activate();\r\n }\r\n\r\n init() {\r\n this.email = '';\r\n this.lastName = '';\r\n this.idNumber = '';\r\n this.tenant = null;\r\n this.firstName = '';\r\n this.homeNumber = '';\r\n this.cellNumber = '';\r\n this.workNumber = '';\r\n this.leaseEndDate = '';\r\n this.selectedUnit = '';\r\n this.leaseStartDate = '';\r\n this.userUnits = undefined;\r\n this.isTenantLoading = false;\r\n this.isEditingTenant = false;\r\n this.friendlyUnitNames = null;\r\n this.isMainPageLoading = false;\r\n this.friendlyUnitNamesPromise = null;\r\n this.hasTenantBeenRegistered = false;\r\n\r\n this._handleEvents();\r\n }\r\n\r\n getUserUnits() {\r\n let units;\r\n const userProfile = this.LocalStorageService.retrieve('userProfile');\r\n const dbRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n const { BuildingProfiles: buildingProfiles } = userProfile;\r\n\r\n if (!!dbRef && !!buildingProfiles && buildingProfiles.length > 0) {\r\n const selectedBuilding = buildingProfiles.find(building => {\r\n const { SchemeReference: schemeReference } = building;\r\n const found = schemeReference.toLowerCase() === dbRef.toLowerCase();\r\n return found;\r\n });\r\n\r\n if (!!selectedBuilding) {\r\n const { BuildingProfileUnit: userUnits } = selectedBuilding;\r\n units = userUnits;\r\n }\r\n }\r\n\r\n return units;\r\n }\r\n\r\n async handleUnitChange(newSelectedUnit) {\r\n if (newSelectedUnit && Object.keys(newSelectedUnit).length) {\r\n await this.getTenantByCardCode();\r\n }\r\n }\r\n\r\n activate() {\r\n this.tenantService = this.TenantDataService;\r\n this.initialiseScreen();\r\n }\r\n\r\n async initialiseScreen() {\r\n this.isMainPageLoading = true;\r\n try {\r\n this.friendlyUnitNames = await this.UserUnitsService.getFriendlyUnitNames();\r\n if (this.friendlyUnitNames.length > 0) {\r\n \r\n const defaultUnit = this.friendlyUnitNames[0];\r\n delete defaultUnit.$$hashKey;\r\n const json = JSON.stringify(defaultUnit);\r\n \r\n this.selectedUnit = `${json}`;\r\n }\r\n\r\n await this.getTenantByCardCode();\r\n } catch (err) {\r\n this.NotificationService.error(\r\n 'COULD NOT RETRIEVE YOUR AVAILABLE UNITS.'\r\n );\r\n } finally {\r\n this.$timeout(() => {\r\n this.tenant = null;\r\n this.noTenantForUnit = !!!this.TenantDataService.tenant;\r\n this.isMainPageLoading = false;\r\n });\r\n }\r\n }\r\n\r\n async getTenantByCardCode() {\r\n if (this.selectedUnit) {\r\n this.isTenantLoading = true;\r\n try {\r\n let cardCode;\r\n if (typeof this.selectedUnit === 'string') {\r\n const objUnit = JSON.parse(this.selectedUnit);\r\n const { CardCode } = objUnit;\r\n cardCode = CardCode;\r\n } else {\r\n cardCode = this.selectedUnit.CardCode;\r\n }\r\n\r\n await this.tenantService.getTenantByCardCode(cardCode);\r\n } catch (error) {\r\n this.NotificationService.error(error);\r\n } finally {\r\n this.$timeout(() => {\r\n this.tenant = null;\r\n this.isTenantLoading = false;\r\n this.noTenantForUnit = !!!this.TenantDataService.tenant;\r\n this.isEditingTenant = this.noTenantForUnit;\r\n\r\n this._initializeDatePicker();\r\n });\r\n }\r\n }\r\n }\r\n\r\n async registerTenant() {\r\n try {\r\n this.isTenantLoading = true;\r\n const isUpdating = 'Id' in this.tenant && !!this.tenant.Id;\r\n\r\n let cardCode;\r\n if (typeof this.selectedUnit === 'string') {\r\n const mapped = JSON.parse(this.selectedUnit);\r\n const { CardCode } = mapped;\r\n cardCode = CardCode;\r\n } else {\r\n const { CardCode } = this.selectedUnit;\r\n cardCode = CardCode;\r\n }\r\n\r\n await this.TenantDataService.registerTenant(this.tenant, cardCode);\r\n\r\n if (isUpdating) {\r\n this.NotificationService.success('TENANT UPDATED');\r\n } else {\r\n this.NotificationService.success('TENANT REGISTERED');\r\n }\r\n\r\n await this.getTenantByCardCode();\r\n } catch (error) {\r\n console.error(error);\r\n } finally {\r\n this.$timeout(() => {\r\n this.tenant = null;\r\n this.noTenantForUnit = !!!this.TenantDataService.tenant;\r\n this.isTenantLoading = false;\r\n });\r\n }\r\n }\r\n\r\n async deregisterTenant() {\r\n try {\r\n this.isTenantLoading = true;\r\n await this.tenantService.deregisterTenant(this.tenantService.tenant.Id);\r\n this.NotificationService.success('TENANT DE-REGISTERED');\r\n await this.getTenantByCardCode();\r\n } catch (error) {\r\n console.error(error);\r\n } finally {\r\n this.$timeout(() => {\r\n this.tenant = null;\r\n this.noTenantForUnit = !!!this.TenantDataService.tenant;\r\n this.isTenantLoading = false;\r\n });\r\n }\r\n }\r\n\r\n updateTenantDetails() {\r\n this.isEditingTenant = true;\r\n const { tenant } = this.TenantDataService;\r\n this.tenant = tenant;\r\n }\r\n\r\n _handleEvents() {\r\n this.$scope.$watch(\r\n 'TenantVM.selectedUnit',\r\n newValue => {\r\n if (!!newValue) {\r\n const userUnit =\r\n typeof newValue === 'string'\r\n ? newValue.includes('{')\r\n ? JSON.parse(newValue)\r\n : newValue\r\n : { CardCode: null };\r\n const { CardCode: cardCode } = userUnit;\r\n this.handleUnitChange(cardCode);\r\n }\r\n },\r\n true\r\n );\r\n\r\n this.$scope.$on('selected-building-changed', async (event, newValue) => {\r\n const hasAccess = this.AuthorizationService.isAuthorized(\r\n USER_CLAIMS.REGISTER_TENANT\r\n );\r\n if (!hasAccess) {\r\n this.$state.go(FEATURES.PAYMENTS);\r\n } else {\r\n await this.initialiseScreen();\r\n this.$timeout(() => {\r\n this.userUnits = this.getUserUnits();\r\n });\r\n this.$parent.loadTilesData();\r\n }\r\n\r\n //this.$scope.$emit('selected-building-changed', newValue);\r\n });\r\n\r\n this.$scope.$watch('TenantVM.isTenantLoading', (newValue, oldValue) => {\r\n if (newValue) {\r\n this._initializeDatePicker();\r\n }\r\n });\r\n }\r\n\r\n _initializeDatePicker() {\r\n const leaseEndDate = moment(this.dateTo).format('YYYY/MM/DD');\r\n const leaseStartDate = moment(this.dateFrom).format('YYYY/MM/DD');\r\n\r\n this.$rootScope.$eval(() => {\r\n this.$timeout(() => {\r\n const id = 'form[name=\"registerTenant\"]';\r\n const selectorDateFrom = '#leaseStartDatePicker';\r\n const selectorDateTo = '#leaseEndDatePicker';\r\n\r\n const $inputDateFrom = angular.element(\r\n selectorDateFrom,\r\n angular.element(id)\r\n );\r\n const $inputDateTo = angular.element(\r\n selectorDateTo,\r\n angular.element(id)\r\n );\r\n\r\n const optionsDateFrom = {\r\n leaseStartDate,\r\n autoclose: true,\r\n forceParse: true,\r\n format: 'yyyy/mm/dd',\r\n assumeNearbyYear: true,\r\n enableOnReadonly: true,\r\n container: selectorDateFrom\r\n };\r\n\r\n const optionsDateTo = {\r\n leaseEndDate,\r\n autoclose: true,\r\n forceParse: true,\r\n format: 'yyyy/mm/dd',\r\n assumeNearbyYear: true,\r\n enableOnReadonly: true,\r\n container: selectorDateTo\r\n };\r\n\r\n $inputDateFrom.datepicker(optionsDateFrom);\r\n $inputDateTo.datepicker(optionsDateTo);\r\n }, 250);\r\n });\r\n }\r\n}\r\n","//@ts-check\r\n\r\nclass TenantService {\r\n constructor(\r\n $http,\r\n Utility,\r\n $timeout,\r\n $rootScope,\r\n LocalStorageService,\r\n InternalLinksService\r\n ) {\r\n this.$http = $http;\r\n this.Utility = Utility;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.LocalStorageService = LocalStorageService;\r\n this.InternalLinksService = InternalLinksService;\r\n\r\n this.init();\r\n }\r\n\r\n init() {\r\n this.InternalLinksService.getLinks('/api/tenant/links');\r\n this.friendlyUnitNames = [];\r\n this.tenant = {};\r\n this.noTenantForUnit = true;\r\n }\r\n\r\n async getTenantByCardCode(cardCode) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let {MasterProfileId} = this.LocalStorageService.retrieve('userProfile');\r\n let url = await this.InternalLinksService.getLink('GetTenantForUnit');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('api/tenant/links', false);\r\n url = await this.InternalLinksService.getLink('GetTenantForUnit');\r\n }\r\n\r\n url = `${url}?cardCode=${cardCode}&masterProfileId=${MasterProfileId}`;\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n const results = await this.$http.get(url, { headers });\r\n this.tenant = results.data;\r\n\r\n if (!this.tenant) {\r\n this.noTenantForUnit = true;\r\n } else {\r\n const leaseStartDate = moment(this.tenant.LeaseEndDate).format(\r\n 'YYYY/MM/DD'\r\n );\r\n this.tenant.LeaseStartDate =\r\n leaseStartDate === 'Invalid date' ? '' : leaseStartDate;\r\n\r\n const leaseEndDate = moment(this.tenant.LeaseEndDate).format(\r\n 'YYYY/MM/DD'\r\n );\r\n this.tenant.LeaseEndDate =\r\n leaseEndDate === 'Invalid date' ? '' : leaseEndDate;\r\n this.noTenantForUnit = false;\r\n }\r\n\r\n this.$timeout(() => promiseHandler.resolve(this.tenant));\r\n } catch (error) {\r\n const msg = `Could not get friendly unit names.`;\r\n console.error(msg, error);\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async registerTenant(tenant, cardCode) {\r\n const payload = {\r\n ...tenant,\r\n CardCode: cardCode\r\n };\r\n\r\n let promise, promiseHandler;\r\n tenant.CardCode = cardCode;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink(\r\n 'RegisterTenantForUnit'\r\n );\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('api/tenant/links', false);\r\n url = await this.InternalLinksService.getLink('RegisterTenantForUnit');\r\n }\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n const results = await this.$http.post(url, payload, { headers });\r\n this.tenant = results.data;\r\n this.noTenantForUnit = false;\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (error) {\r\n const msg = `Could not get friendly unit names.`;\r\n console.error(msg, error);\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async deregisterTenant(id) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n let url = await this.InternalLinksService.getLink(\r\n 'DeregisterTenantForUnit'\r\n );\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('api/tenant/links', false);\r\n url = await this.InternalLinksService.getLink(\r\n 'DeregisterTenantForUnit'\r\n );\r\n }\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n url = url.replace('{tenantId}', id);\r\n\r\n const results = await this.$http.post(url, id, { headers });\r\n this.tenant = {};\r\n this.noTenantForUnit = true;\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (error) {\r\n const msg = `Could not deregister unit.`;\r\n console.error(msg, error);\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n extractUnitsFromUserProfile(user) {\r\n let cardCodes = [];\r\n\r\n if (\r\n user &&\r\n user.hasOwnProperty('BuildingProfiles') &&\r\n user.BuildingProfiles\r\n ) {\r\n user.BuildingProfiles.forEach(buildingProfile => {\r\n if (\r\n buildingProfile &&\r\n buildingProfile.hasOwnProperty('BuildingProfileUnit') &&\r\n buildingProfile.BuildingProfileUnit\r\n ) {\r\n buildingProfile.BuildingProfileUnit.forEach(unit => {\r\n cardCodes.push(unit.CardCode);\r\n });\r\n }\r\n });\r\n }\r\n\r\n return cardCodes;\r\n }\r\n}\r\nexport default /* @ngInject */ (\r\n $http,\r\n Utility,\r\n $timeout,\r\n $rootScope,\r\n LocalStorageService,\r\n InternalLinksService\r\n) =>\r\n new TenantService(\r\n $http,\r\n Utility,\r\n $timeout,\r\n $rootScope,\r\n LocalStorageService,\r\n InternalLinksService\r\n );\r\n","/* @ngInject */\r\nexport default class DocumentsApprovalCtrl {\r\n constructor(\r\n $sce,\r\n $scope,\r\n $timeout,\r\n $rootScope,\r\n BuildingsService,\r\n NavigationService,\r\n LocalStorageService,\r\n NotificationService,\r\n AuthorizationService,\r\n DashboardService,\r\n ApprovalDocumentsDataService,\r\n ) {\r\n this.$sce = $sce;\r\n this.$scope = $scope;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.BuildingsService = BuildingsService;\r\n this.NavigationService = NavigationService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.NotificationService = NotificationService;\r\n this.AuthorizationService = AuthorizationService;\r\n this.DashboardService = DashboardService;\r\n this.ApprovalDocumentsDataService = ApprovalDocumentsDataService;\r\n this.hasInitialisedFromSession = false;\r\n\r\n this.$rootScope.$on('user-session-set', () => {\r\n if (!this.hasInitialisedFromSession) {\r\n this.activate();\r\n this.hasInitialisedFromSession = true;\r\n }\r\n });\r\n\r\n this.init();\r\n this.activate();\r\n }\r\n\r\n init() {\r\n this.isBusy = true;\r\n this.query = '';\r\n this.buildingsDataService = this.BuildingsService;\r\n this.webDocumentApprovalIndividual = {\r\n\t\t\tComments: null,\r\n\t\t\tAttachments: []\r\n\t\t};\r\n }\r\n\r\n activate() {\r\n\r\n const userSession = this.LocalStorageService.retrieve('userSession');\r\n\r\n if (!userSession) {\r\n return;\r\n }\r\n\r\n this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n let buildingName = '';\r\n const userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n if (userProfile) {\r\n if (!this.selectedBuildingRef) {\r\n this.selectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n }\r\n const selectedBuilding = userProfile.BuildingProfiles.find((building) => {\r\n return building.SchemeReference.toUpperCase().trim() === this.selectedBuildingRef.toUpperCase().trim();\r\n });\r\n\r\n if (selectedBuilding) {\r\n buildingName = selectedBuilding.SchemeName;\r\n }\r\n }\r\n this.getDocumentApprovals();\r\n }\r\n\r\n async _onSelectedBuildingChanged(event, schemeRef) {\r\n try {\r\n if (schemeRef) {\r\n this.activate();\r\n }\r\n } catch (err) {\r\n console.error('Error while loading document info:', err);\r\n } finally {\r\n this.isBusy = false;\r\n }\r\n }\r\n\r\n getDocumentApprovals() {\r\n this.isBusy = true;\r\n this.$timeout(async () => {\r\n try {\r\n if (this.selectedBuildingRef && this.selectedBuildingRef != null) {\r\n const approvalsData = await this.ApprovalDocumentsDataService.getDocumentApprovals(this.selectedBuildingRef);\r\n this.approvalsData = approvalsData;\r\n }\r\n\r\n } catch (err) {\r\n console.error('Error while loading document info:', err);\r\n } finally { \r\n this.isBusy = false; \r\n }\r\n });\r\n this.isBusy = false;\r\n }\r\n\r\n populateHistoryDocumentViewModal(approval) {\r\n const approvalId = approval.Id;\r\n\r\n for (let i = 0; i < this.approvalsData.length; i++) {\r\n const currApproval = this.approvalsData[i];\r\n if (currApproval.Id == approvalId) {\r\n this.webDocumentApprovalIndividual = currApproval;\r\n for (let j = 0; j < this.webDocumentApprovalIndividual.Attachments.length; j++) {\r\n if (this.webDocumentApprovalIndividual.Attachments[j].Id) {\r\n const path = pretorOnlineUrl + '/documents/byid/' + this.webDocumentApprovalIndividual.Attachments[j].Id.toLowerCase();\r\n this.iframeApprovalDocuments = this.$sce.trustAsResourceUrl(path);\r\n this.selectedDocumentIndex = j;\r\n this.selectedApprovalId = approvalId;\r\n break;\r\n }\r\n }\r\n\r\n return;\r\n }\r\n }\r\n }\r\n\r\n getInvoicePath(index = -1) {\r\n if (index === -1) {\r\n return;\r\n }\r\n const path = pretorOnlineUrl + '/documents/byid/' + this.webDocumentApprovalIndividual.Attachments[index].Id.toLowerCase();\r\n this.iframeApprovalDocuments = this.$sce.trustAsResourceUrl(path);\r\n this.selectedDocumentIndex = index;\r\n //mapping mobileview download button name.\r\n this.selectedDocumentTypeDesc = this.webDocumentApprovalIndividual.Attachments[index].Description;\r\n }\r\n\r\n approveDocument(approvalId) {\r\n this.isBusy = true;\r\n this.DestroyModal('#documentViewModal');\r\n console.log(`Document ${approvalId} is being approved.`);\r\n\r\n this.currentSchemeRef = this.currentSchemeRef ? this.currentSchemeRef : this.BuildingsService.getSelectedBuildingRef();\r\n this.ApprovalDocumentsDataService\r\n .approveDocument(approvalId, this.currentSchemeRef)\r\n .then(\r\n (results) => {\r\n if (results.WasSuccessful) {\r\n this.NotificationService.success('APPROVED');\r\n } else {\r\n this.NotificationService.success('FAILED');\r\n }\r\n },\r\n (err) => {\r\n this.NotificationService.error('FAILED', err);\r\n }\r\n )\r\n .finally(() => {\r\n this.isBusy = false;\r\n this.getDocumentApprovals();\r\n });\r\n }\r\n\r\n DestroyModal(modalId) {\r\n angular.element(modalId).modal('hide');\r\n angular.element('body').removeClass('modal-open');\r\n angular.element('.modal-backdrop').remove();\r\n }\r\n\r\n rejectDocument(approvalId) {\r\n this.isBusy = true;\r\n this.DestroyModal('#documentViewModal');\r\n console.log(`Document ${approvalId} is being rejected.`);\r\n\r\n this.currentSchemeRef = this.currentSchemeRef ? this.currentSchemeRef : this.BuildingsService.getSelectedBuildingRef();\r\n\r\n this.ApprovalDocumentsDataService\r\n .rejectDocument(approvalId, this.currentSchemeRef)\r\n .then(\r\n (results) => {\r\n if (results.WasSuccessful) {\r\n this.NotificationService.success('REJECTED');\r\n } else {\r\n this.NotificationService.success('FAILED');\r\n }\r\n },\r\n (err) => {\r\n this.NotificationService.error('FAILED', err);\r\n }\r\n )\r\n .finally(() => {\r\n this.isBusy = false;\r\n this.getDocumentApprovals();\r\n });\r\n }\r\n\r\n queryDocument(approvalId) {\r\n this.isBusy = true;\r\n this.DestroyModal('#documentViewModal');\r\n console.log(`Document ${approvalId} is being queried.`);\r\n\t\tthis.currentSchemeRef = this.currentSchemeRef? this.currentSchemeRef: this.BuildingsService.getSelectedBuildingRef();\t\r\n\r\n\t\tthis.ApprovalDocumentsDataService\r\n .queryDocument(approvalId,this.query, this.currentSchemeRef)\r\n .then(\r\n (results) => {\r\n if (results.WasSuccessful) {\r\n this.NotificationService.success('QUERIED');\r\n } else {\r\n this.NotificationService.success('FAILED');\r\n }\r\n this.query = '';\r\n },\r\n (err) => {\r\n console.log('Document ' + approvalId + ' query failed with the error: ', err);\r\n this.NotificationService.error('FAILED', err);\r\n }\r\n )\r\n .finally(() => {\r\n this.isBusy = false;\r\n this.getDocumentApprovals();\r\n });\r\n\t}\r\n\r\n}\r\n","//@ts-check\r\n\r\nclass ApprovalDocumentsDataService {\r\n\tconstructor($http, Utility, $timeout, $rootScope, ContentService, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.documentsData = null;\r\n\t\tthis.InternalLinksService.getLinks('/api/documents/links');\r\n\t}\r\n\r\n\tasync getDocumentApprovals(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetDocumentApprovals');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/documents/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetDocumentApprovals');\r\n\t\t\t}\r\n\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tconst approvalsData = results.data ? results.data : results;\r\n\t\t\tthis.approvalsData = approvalsData;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(approvalsData));\r\n\t\t} catch (error) {\r\n\t\t\tconst approvalsData = '';\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync approveDocument(approvalId, schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ApproveDocument');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/documents/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ApproveDocument');\r\n\t\t\t}\r\n\r\n\t\t\tif (!approvalId) {\r\n\t\t\t\tthrow new Error('No approval id provided...');\r\n\t\t\t}\r\n\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\turl = url.replace('{approvalId}', approvalId).trim();\r\n\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tconst { data } = results;\r\n\t\t\tawait this.getDocumentApprovals(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (error) {\r\n\t\t\tconst approvalsData = '';\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync rejectDocument(approvalId, schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!approvalId) {\r\n\t\t\t\tthrow new Error('No approval id provided...');\r\n\t\t\t}\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('RejectDocument');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('RejectDocument');\r\n\t\t\t}\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\turl = url.replace('{approvalId}', approvalId).trim();\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tconst { data } = results;\r\n\t\t\tawait this.getDocumentApprovals(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync queryDocument(approvalId, message, schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('QueryDocument');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/documents/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('QueryDocument');\r\n\t\t\t}\r\n\r\n\t\t\tif (!approvalId) {\r\n\t\t\t\tthrow new Error('No approval id provided...');\r\n\t\t\t}\r\n\r\n\t\t\tif (!message) {\r\n\t\t\t\tthrow new Error('No Query message provided...');\r\n\t\t\t}\r\n\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\turl = url.replace('{approvalId}', approvalId).trim();\r\n\t\t\t\r\n\t\t\tconst docload = {\r\n\t\t\t\tMessage: message\r\n\t\t\t};\r\n\r\n\t\t\tconst results = await this.$http.post(url, docload);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tawait this.getDocumentApprovals(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (error) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew ApprovalDocumentsDataService(\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","const base64js = require('base64-js');\r\nimport Validator from 'validatorjs';\r\n\r\n/* @ngInject */\r\nexport default class AuditorsDashboardCtrl {\r\n\tconstructor($scope, $rootScope, $timeout, AuditorsDashboardService, NotificationService, LocalStorageService) {\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.AuditorsDashboardService = AuditorsDashboardService;\r\n\r\n\t\tthis.init();\r\n\t\tthis.loadDashboard();\r\n\t\tthis._registerEventHandler();\r\n this.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.isBusy = false;\r\n\t\tthis.howToGuideLink;\r\n\t\tthis.auditsToken = {};\r\n\t\tthis.auditorSchemes = [];\r\n\t\tthis.auditorName = {};\r\n\t\tthis.openAuditorSchemeInfo = {};\r\n\t\tthis.newAuditDetailsToken = {};\r\n\r\n\r\n\r\n\t\tvar urlToken = window.location.search;\r\n\t\tconst myArray = urlToken.split(\"=\");\r\n\t\tvar auditsToken = myArray[1];\r\n\t\tthis.auditsToken = auditsToken;\r\n\t\tconsole.log(auditsToken);\r\n\r\n\t}\r\n\r\n\t_registerEventHandler() {\r\n\t\t\r\n\t}\r\n\r\n\tactivate() {\r\n\t\tthis.howToGuideLink = `${PretorCDNAddress}${PretorCDNAddress.endsWith('/')\r\n\t\t\t? ''\r\n : '/'}docs/Audits How-To-Guide.pdf`;\r\n }\r\n\r\n _switchIsBusy(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isBusy = flag;\r\n\t\t});\r\n\t}\r\n\r\n\tloadDashboard() {\r\n\t\tthis._switchIsBusy(true);\r\n\t\tthis.GetAuditorSchemeInformation();\r\n\t}\r\n\r\n\tasync GetAuditorSchemeInformation() {\r\n\t\tvar auditsData = await this.AuditorsDashboardService.GetAuditorSchemes(this.auditsToken); //b7ae2fb6-444d-4ecc-b2a7-d29a4434bcdf\r\n\r\n\r\n\r\n\t\tauditsData.Data.forEach(function (searchResult) {\r\n\r\n\t\t\tvar monthNames = [\r\n\t\t\t\t\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\r\n\t\t\t\t\"July\", \"August\", \"September\", \"October\", \"November\", \"December\"\r\n\t\t\t];\r\n\r\n\r\n\r\n\r\n\t\t\tvar dateChange = searchResult.EndOfFinancialYear.substring(0, 10);\r\n\t\t\tconsole.log(dateChange);\r\n\t\t\t// Convert input string to Date object\r\n\t\t\tvar inputDate = new Date(dateChange);\r\n\t\t\tconsole.log(inputDate);\r\n\r\n\r\n\t\t\t// Get the day, month, and year\r\n\t\t\tvar day = inputDate.getDate();\r\n\t\t\tvar monthIndex = inputDate.getMonth();\r\n\t\t\tvar year = inputDate.getFullYear();\r\n\r\n\t\t\t\r\n\r\n\r\n\t\t\t// Format the Date object to a more readable format\r\n\t\t\tvar parsedDate = day + ' ' + monthNames[monthIndex] + ' ' + year;\r\n\t\t\tconsole.log(parsedDate);\r\n\r\n\t\t\tsearchResult.EndOfFinancialYear = parsedDate;\r\n\r\n\r\n\t\t});\r\n\r\n\r\n\t\tif (auditsData.WasSuccessful == true) {\r\n\t\t\tthis._switchIsBusy(false);\r\n\r\n\t\t}\r\n\t\tvar auditorHeaderId = auditsData.Data[0].AuditorHeaderId;\r\n\t\tvar auditorInfo = await this.AuditorsDashboardService.getAuditorByAuditorHeaderId(auditorHeaderId);\r\n\t\tconsole.log(auditorInfo);\r\n\t\tthis.auditorName = auditorInfo.Auditor;\r\n\t\tthis.auditorSchemes = auditsData.Data;\r\n\t\tconsole.log(this.auditorSchemes);\r\n\t\t$('#auditsSchemesTbl').prop('hidden', false);\r\n\t}\r\n\r\n\tasync showSchemeAuditsInfo(FinancialPeriodHeaderId, DB_Ref) {\r\n\t\tvar auditTokenDetailsToOpen = await this.AuditorsDashboardService.GetAuditDetailsToView(FinancialPeriodHeaderId, DB_Ref);\r\n\t\tthis.newAuditDetailsToken = auditTokenDetailsToOpen.Data[0].Token;\r\n\t\tvar openAuditDetailsResult = await this.AuditorsDashboardService.openAuditsDetails(this.newAuditDetailsToken);\r\n }\r\n\r\n\tasync GetAuditorDashboardToExcel() {\r\n\t\tvar excelDocument = await this.AuditorsDashboardService.GetAuditorDashboardToExcel(this.AuditorsDashboardService.auditorHeaderDetails.Id);\r\n\t\tconst worksheet = XLSX.utils.json_to_sheet(excelDocument);\r\n\t\tconst workbook = XLSX.utils.book_new();\r\n\t\tXLSX.utils.book_append_sheet(workbook, worksheet, \"Dashboard Summary\");\r\n\r\n\t\t/* fix headers */\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, [[\"QueryNumber\", \"DateLogged\", \"WhoLogged\", \"BuildingName\", \"Pretor ID\", \"Message\", \"Assignee\", \"Query Subject\", \"Status\"]], { origin: \"A1\" });\r\n\r\n\t\t/* calculate column width */\r\n\t\tvar wscols = [\r\n\t\t\t{ width: 15 }, // first column\r\n\t\t\t{ width: 20 }, // second column\r\n\t\t\t{ width: 16 },\r\n\t\t\t{ width: 43 },\r\n\t\t\t{ width: 38 },\r\n\t\t\t{ width: 50 },\r\n\t\t\t{ width: 17 },\r\n\t\t\t{ width: 30 },\r\n\t\t\t{ width: 15 }\r\n\t\t];\r\n\t\tworksheet[\"!cols\"] = wscols;\r\n\t\tworksheet['!cols'][4] = { hidden: true };\r\n\t\tXLSX.writeFile(workbook, \"DashboardSummary.xlsx\");\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass AuditorsDashboardService {\r\n\tconstructor($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n init() {\r\n this.auditsHeaderDetails = {};\r\n }\r\n\r\n async GetAuditorSchemes(Token) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n if (!Token) {\r\n throw new Error('auditorHeaderId must be supplied.');\r\n }\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetAuditorDashboard');\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('GetAuditorDashboard');\r\n }\r\n url = `${url}?Token=${Token}`;\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n console.log(data);\r\n this.auditsHeaderDetails = this._map(data);\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching auditors token history data`;\r\n console.error(msg, err);\r\n this.auditsQueryLogs = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n\r\n async openAuditsDetails(Token) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n if (!Token) {\r\n throw new Error('Token must be supplied.');\r\n }\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('OpenAuditsDetails');\r\n var newUrl = url.split(\"audits\");\r\n var startUrl = newUrl[0];\r\n \r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('OpenAuditsDetails');\r\n }\r\n\r\n var urlLink = startUrl + '/?auditsToken';\r\n url = `${startUrl}/?auditsToken=${Token}`;\r\n\r\n window.open(url);\r\n\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getAuditorByAuditorHeaderId(auditorHeaderId) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n if (!auditorHeaderId) {\r\n throw new Error('auditorHeaderId must be supplied.');\r\n }\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetAuditorByAuditorHeaderId');\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('GetAuditorByAuditorHeaderId');\r\n }\r\n url = `${url}?auditorHeaderId=${auditorHeaderId}`;\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n this.auditorHeaderDetails = this._map(data);\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.auditsQueryLogs = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n\r\n\r\n async GetAuditDetailsToView(FinancialPeriodHeaderId, DB_Ref) {\r\n let promise, promiseHandler;\r\n\r\n var payload = {\r\n FinancialPeriodHeaderId: FinancialPeriodHeaderId,\r\n DB_Ref: DB_Ref\r\n }\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n if (!payload) {\r\n throw new Error('The payload must be supplied.');\r\n }\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetAuditDetailsToView');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('GetAuditDetailsToView');\r\n }\r\n \r\n const results = await this.$http.post(url, payload);\r\n const { data } = results;\r\n\r\n this.auditorHeaderDetails = this._map(data);\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n //this.auditTokenHistory = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n\r\n _map(data) {\r\n if (!data) return data;\r\n\r\n //if (!data.IsSubmitted) {\r\n // data = this._formatAndMapDate(data);\r\n //} else {\r\n // data.ValidDate = data.ValidDate.substr(0, 10);\r\n //}\r\n\r\n //data = this._mapSellerInfo(data);\r\n //data = this._mapRejectedDocuments(data);\r\n\r\n return data;\r\n }\r\n\r\n async GetAuditorDashboardToExcel(auditorHeaderId) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n if (!auditorHeaderId) {\r\n throw new Error('auditorHeaderId must be supplied.');\r\n }\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetAuditorDashboardToExcel');\r\n\r\n url = `${url}?auditorsId=${auditorHeaderId}`;\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n}\r\n\r\nexport default /* @ngInject */ ($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) =>\r\n\tnew AuditorsDashboardService($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService);\r\n","const base64js = require('base64-js');\r\nimport Validator from 'validatorjs';\r\n\r\n/* @ngInject */\r\nexport default class AuditsCaptureCtrl {\r\n constructor($scope, $rootScope, $timeout, AuditsCaptureService, NotificationService, LocalStorageService) {\r\n this.$scope = $scope;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.LocalStorageService = LocalStorageService;\r\n this.NotificationService = NotificationService;\r\n this.AuditsCaptureService = AuditsCaptureService;\r\n this.init();\r\n this.activate();\r\n }\r\n\r\n init() {\r\n this.isBusy = false;\r\n this.howToGuideLink;\r\n this.attachment = {};\r\n this.selectedAttachment = {};\r\n this.formsErrors = {\r\n first: [],\r\n second: [],\r\n header: []\r\n };\r\n\r\n this.documentsErrors = {\r\n first: [],\r\n second: [],\r\n header: []\r\n };\r\n\r\n this.hasAuditsDetailBeenSaved = false;\r\n this.AssigneeList = [];\r\n this.retrievedAuditDetails = {};\r\n this.auditorInfo = {};\r\n this.auditsQueryLogs = [];\r\n this.AuditQueryLogsId = {};\r\n this.SelectedAuditQueryLog = {};\r\n this.SpecificAuditQueryMessages = [];\r\n this.messageDate = {};\r\n this.messageTime = {};\r\n this.SpecificAuditQueryMessage = [];\r\n this.hideTextBox = true;\r\n this.auditorContactDetails = {};\r\n this.auditsHeaderDetails = {};\r\n this.auditsHeaderId = {};\r\n this.uploadedFileAttachment = {};\r\n this.savedFinancialPeriodHeaderId = {};\r\n this.queryNum = {};\r\n this.queryNumberForQueryMessage = {};\r\n this.fileInputUrl = {};\r\n this.expansionAttachment = {};\r\n this.expansionAttachmentperQuery = {};\r\n this.ListOfAuditsUploadedDocs = [];\r\n this.ListOfAuditsUploadedLinks = [];\r\n this.ListOfAuditsPerQueryUploadedDocs = [];\r\n this.queryNumberForPerQueryDoc = {};\r\n }\r\n\r\n async activate() {\r\n this.howToGuideLink = `${PretorCDNAddress}${PretorCDNAddress.endsWith('/')\r\n ? ''\r\n : '/'}docs/Audits How-To-Guide.pdf`;\r\n await this.getGeneratedAuditsTokenHistory();\r\n }\r\n\r\n async getGeneratedAuditsTokenHistory() {\r\n this._switchIsBusy(true);\r\n const correlationId = this.LocalStorageService.retrieve('auditsCorrelationId');\r\n\r\n if (correlationId) {\r\n var tokenHistory = await this.AuditsCaptureService.getAuditsTokenHistoryByCorrelationId(correlationId);\r\n var financialPeriodHeaderId = tokenHistory.FinancialPeriodHeaderId;\r\n this.savedFinancialPeriodHeaderId = financialPeriodHeaderId;\r\n var auditsHeaderDetail = await this.AuditsCaptureService.getAuditsHeaderByFinancialPeriodHeaderId(financialPeriodHeaderId);\r\n this.auditsHeaderDetails = auditsHeaderDetail\r\n this.auditsHeaderId = auditsHeaderDetail.Id;\r\n \r\n this.$timeout(() => {\r\n try {\r\n this.fileUpload();\r\n this.populateAuditsDetail();\r\n this.getAuditQueryLogs(this.auditsHeaderId);\r\n this.getAllDocsforLink(financialPeriodHeaderId)\r\n } catch (error) {\r\n console.error(`Audits-controller: Error - ${error}`);\r\n }\r\n }, 100);\r\n }\r\n }\r\n\r\n async getAllDocsforLink(financialPeriodHeaderId) {\r\n var result = await this.AuditsCaptureService.getUploadedDocumentsByFinancialPeriodHeaderId(financialPeriodHeaderId);\r\n //ListOfAuditsUploadedLinks\r\n var valueToRemove = \"Link\";\r\n for (var i = result.Data.length - 1; i >= 0; i--) {\r\n if (result.Data[i].FileType === valueToRemove) {\r\n this.ListOfAuditsUploadedLinks.push(result.Data.splice(i, 1)[0]);\r\n }\r\n }\r\n }\r\n\r\n async getAuditQueryLogs(auditsHeaderId) {\r\n var results = await this.AuditsCaptureService.getAuditQueryLogsById(auditsHeaderId);\r\n let outstandingDays = 'outstandingDays';\r\n results.Data.forEach(function (searchResult) {\r\n\r\n if (searchResult.Status == 0) {\r\n searchResult.Status = 1\r\n }\r\n\r\n switch (searchResult.Status) {\r\n case 0:\r\n searchResult.Status = \"In Progress\"\r\n break;\r\n case 1:\r\n searchResult.Status = \"Queried\"\r\n break;\r\n case 2:\r\n searchResult.Status = \"Closed\"\r\n break;\r\n case 3:\r\n searchResult.Status = \"Completed\"\r\n break;\r\n }\r\n\r\n var dateChange = searchResult.DateLoged.substring(0, 10);\r\n searchResult.DateLoged = dateChange;\r\n var unformattedDate = Date.now();\r\n\r\n // Create a new Date object using the timestamp\r\n let date = new Date(unformattedDate);\r\n let year = date.getFullYear();\r\n let month = String(date.getMonth() + 1).padStart(2, '0'); // Months are zero-based\r\n let day = String(date.getDate()).padStart(2, '0');\r\n\r\n // Form the YYYY-MM-DD string\r\n let formattedDate = `${year}-${month}-${day}`;\r\n let date1 = new Date(dateChange);\r\n let date2 = new Date(formattedDate);\r\n let differenceInMilliseconds = date1 - date2;\r\n\r\n // Convert milliseconds to days (1 day = 24 hours = 86400000 milliseconds)\r\n let differenceInDays = differenceInMilliseconds / (24 * 60 * 60 * 1000);\r\n var newDifferenceInDays = Math.abs(differenceInDays);\r\n searchResult[outstandingDays] = newDifferenceInDays;\r\n });\r\n this.auditsQueryLogs = results.Data;\r\n\r\n this.$timeout(() => {\r\n try {\r\n this.populateAuditsQueryLogs();\r\n } catch (error) {\r\n console.error(`Audits-controller: Error - ${error}`);\r\n }\r\n }, 100);\r\n }\r\n\r\n populateAuditsQueryLogs() {\r\n this.hasAuditsDetailBeenSaved = false;\r\n if (!this.AuditsCaptureService.auditsQueryLogs) {\r\n this._switchIsBusy(false);\r\n return false;\r\n }\r\n this._switchIsBusy(false);\r\n }\r\n\r\n populateAuditsDetail() {\r\n this.hasAuditsDetailBeenSaved = false;\r\n if (!this.AuditsCaptureService.auditsHeaderDetails) {\r\n this._switchIsBusy(false);\r\n return false;\r\n }\r\n this._switchIsBusy(false);\r\n }\r\n\r\n _switchIsBusy(flag) {\r\n this.$timeout(() => {\r\n this.isBusy = flag;\r\n });\r\n }\r\n\r\n async showAddQueryModal() {\r\n var auditsDetails = await this.AuditsCaptureService.auditsHeaderDetails;\r\n this.retrievedAuditDetails = auditsDetails;\r\n var portfolioManger = auditsDetails.Manager;\r\n var bookkeeper = auditsDetails.Bookkeeper;\r\n var auditorHeaderId = auditsDetails.AuditorHeaderId;\r\n var auditorResults = await this.AuditsCaptureService.getAuditorByAuditorHeaderId(auditorHeaderId);\r\n this.auditorInfo = auditorResults;\r\n var auditor = auditorResults.Auditor;\r\n\r\n $(\"#auditQueryBookkeeperText\").text(bookkeeper + \" (Bookkeeper)\");\r\n $(\"#auditQueryPortfolioManagerText\").text(portfolioManger + \" (Portfolio Manager)\");\r\n $(\"#auditQueryAuditorText\").text(auditor + \" (Auditor)\");\r\n $(\"#auditQueryBookkeeper\").text(bookkeeper);\r\n $(\"#auditQueryPortfolioManager\").text(portfolioManger);\r\n $(\"#auditQueryAuditor\").text(auditor);\r\n\r\n this.populateAssigneeList();\r\n var addQueryDoc = document.getElementById('addqueryAttachment');\r\n\r\n addQueryDoc.addEventListener('change', function (event) {\r\n var file = $('input[type=file]#addqueryAttachment')[0].files[0];\r\n var addFrameElement = document.getElementById(\"add_iframeView\");\r\n let reader = new FileReader();\r\n\r\n if (file.type == '.pdf' || file.type == 'application/pdf') {\r\n\r\n var legitFile = checkFile(file); // Looks like this has to be done only for pdfs, so use the if statement above to handle non pdf files \r\n if (legitFile == true) {\r\n\r\n if (file !== undefined) {\r\n reader.readAsArrayBuffer(file);\r\n reader.onload = function () {\r\n AuditsCaptureCtrl.addQueryAttachment = {\r\n FileType: file.type,\r\n Description: file.name,\r\n IsFinalDraftAudit: false,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n addFrameElement.src = URL.createObjectURL(file);\r\n $('#add_iframeDiv').prop('hidden', false);\r\n };\r\n }\r\n }\r\n else {\r\n document.getElementById('addqueryAttachment').value = null;\r\n this.addQueryAttachment = {\r\n FileName: null,\r\n Blob: null,\r\n }\r\n }\r\n } else {\r\n if (file !== undefined) {\r\n reader.readAsArrayBuffer(file);\r\n reader.onload = function () {\r\n AuditsCaptureCtrl.addQueryAttachment = {\r\n FileType: file.type,\r\n Description: file.name,\r\n IsFinalDraftAudit: false,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n addFrameElement.src = \"about:blank\";\r\n addFrameElement.contentWindow.document.write(\"

File to be uploaded: \" + file.name + \"

\")\r\n $('#add_iframeDiv').prop('hidden', false);\r\n };\r\n }\r\n }\r\n });\r\n\r\n var checkFile = (file) => {\r\n if (file.type !== 'application/pdf') {\r\n const errorMsg = 'Wrong file type, only PDFs are allowed.';\r\n\r\n console.error(\r\n `${errorMsg} \"${file.name}\" is not in the correct format - only PDFs are allowed.`\r\n );\r\n\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format - only PDFs are allowed.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else if (file.name.length > 50) {\r\n const errorMsg = 'Filename too long. Please shorten your filename to less than 50 characters.';\r\n\r\n console.error(\r\n `Filename too long. Please shorten your filename to less than 50 characters.`\r\n );\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else if (file.size > 5242880) {\r\n const errorMsg = 'File size too large. Please reduce the size of your file to smaller than 5 mega bytes.';\r\n\r\n console.error(\r\n `File size too large. Please reduce the size of your file to smaller than 5 mega bytes.`\r\n );\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n showAssigneeList() {\r\n var selectedAction = $('input[name=\"auditQueryRadio\"]:checked').val();\r\n if (selectedAction == 4) {\r\n $(\"#possibleAssigneeListDiv\").show();\r\n }\r\n else {\r\n $(\"#possibleAssigneeListDiv\").hide();\r\n }\r\n }\r\n\r\n showReAssigneeList() {\r\n var selectedAction = $('input[name=\"reAssignQueryRadio\"]:checked').val();\r\n if (selectedAction == 4) {\r\n $(\"#possibleReAssigneeListDiv\").show();\r\n }\r\n else {\r\n $(\"#possibleReAssigneeListDiv\").hide();\r\n }\r\n }\r\n\r\n async populateAssigneeList() {\r\n this.AssigneeList = [];\r\n var results = await this.AuditsCaptureService.getListOfAssignees();\r\n this.AssigneeList = results;\r\n for (var x = 0; x < this.AssigneeList.length; x++) {\r\n let newOption = new Option(this.AssigneeList[x], this.AssigneeList[x]);\r\n const selectAssignee = document.getElementById('selectedPossibleAssignee');\r\n selectAssignee.add(newOption, undefined);\r\n }\r\n }\r\n\r\n async populateReAssigneeList() {\r\n this.AssigneeList = [];\r\n var results = await this.AuditsCaptureService.getListOfAssignees();\r\n this.AssigneeList = results;\r\n for (var x = 0; x < this.AssigneeList.length; x++) {\r\n let newOption = new Option(this.AssigneeList[x], this.AssigneeList[x]);\r\n const selectAssignee = document.getElementById('selectedPossibleReAssignee');\r\n selectAssignee.add(newOption, undefined);\r\n }\r\n }\r\n\r\n async addQuery() {\r\n var selectedAction = $('input[name=\"auditQueryRadio\"]:checked').val();\r\n var auditQuerySubjectText = document.getElementById('auditQuerySubjectText').value;\r\n var auditQueryMessageText = document.getElementById('auditQueryMessageText').value;\r\n\r\n var assignee = \"\";\r\n if (selectedAction == 1) {\r\n assignee = this.retrievedAuditDetails.Manager;\r\n }\r\n if (selectedAction == 2) {\r\n assignee = this.retrievedAuditDetails.Bookkeeper;\r\n }\r\n if (selectedAction == 3) {\r\n assignee = this.auditorInfo.Auditor;\r\n }\r\n if (selectedAction == 4) {\r\n var selectedAssignee = $('#selectedPossibleAssignee').find(\":selected\").text();\r\n assignee = selectedAssignee;\r\n }\r\n var username = this.auditorInfo.Auditor;\r\n\r\n var addQuerySelectedDoc = AuditsCaptureCtrl.addQueryAttachment;\r\n\r\n await this.AuditsCaptureService.addAuditQuery(assignee, this.retrievedAuditDetails, auditQuerySubjectText, auditQueryMessageText, selectedAction, username, addQuerySelectedDoc);\r\n this.getAuditQueryLogs(this.auditsHeaderId);\r\n }\r\n\r\n cancelAddQuery() {\r\n document.getElementById('auditQuerySubjectText').value = \"\";\r\n document.getElementById('auditQueryMessageText').value = \"\";\r\n document.getElementById('possibleAssigneeListDiv').style.display = \"none\";\r\n document.getElementById('queryAttachmentSection').hidden = true;\r\n\r\n document.getElementById('auditQueryPortfolioManager').checked = false;\r\n document.getElementById('auditQueryBookkeeper').checked = false;\r\n document.getElementById('auditQueryAuditor').checked = false;\r\n document.getElementById('auditQueryOther').checked = false;\r\n\r\n document.getElementById(\"add_iframeView\").value = \"\";\r\n document.getElementById('queryAttachmentTrue').checked = false;\r\n document.getElementById('queryAttachmentFalse').checked = false;\r\n $('#add_iframeDiv').prop('hidden', true);\r\n }\r\n\r\n\r\n removeCurrentAddQueryAttachment() {\r\n var addQueryFrameElement = document.getElementById(\"add_iframeView\");\r\n addQueryFrameElement.src = \"\";\r\n $('#add_iframeDiv').prop('hidden', true);\r\n }\r\n\r\n removeCurrentOngoingAttachment() {\r\n var ongoingFrameElement = document.getElementById(\"onging_iframeView\");\r\n ongoingFrameElement.src = \"\";\r\n $('#onging_iframeDiv').prop('hidden', true);\r\n $('#buttonSection').prop('hidden', true);\r\n }\r\n\r\n showEditQueryModal(AuditQueryLogsId, WhoLogged, Status) {\r\n this.AuditQueryLogsId = AuditQueryLogsId;\r\n var auditorDetails = this.AuditsCaptureService.auditorHeaderDetails\r\n\r\n if (WhoLogged != auditorDetails.Auditor) {\r\n $('#CloseQueryBtn').prop('disabled', true);\r\n } else {\r\n $('#CloseQueryBtn').prop('disabled', false);\r\n }\r\n\r\n if (Status == \"Closed\") {\r\n $('#ReAssignBtn').prop('disabled', true);\r\n } else {\r\n $('#ReAssignBtn').prop('disabled', false);\r\n }\r\n }\r\n\r\n async viewMessage(AuditQueryLogs) {\r\n var AuditQueryLogsId = AuditQueryLogs.Id;\r\n this.SelectedAuditQueryLog = AuditQueryLogs;\r\n this.AuditQueryLogsId = AuditQueryLogsId;\r\n var queryNumber = AuditQueryLogs.QueryNumber;\r\n this.queryNumberForQueryMessage = queryNumber;\r\n\r\n var financialPeriodHeaderId = this.savedFinancialPeriodHeaderId;\r\n var result = await this.AuditsCaptureService.getUploadedDocumentsByFinancialPeriodHeaderId(financialPeriodHeaderId);\r\n\r\n const attachmentPerQuery = result.Data.filter(MatchedQueries => MatchedQueries.QueryNumber === queryNumber);\r\n this.hideTextBox = false;\r\n\r\n var queryMessages = await this.AuditsCaptureService.getAuditQueryMessage(AuditQueryLogs.Id);\r\n console.log(queryMessages);\r\n queryMessages.Data.forEach(function (searchResult) {\r\n const dateTime = searchResult.DateSent;\r\n const dateTimeParts = dateTime.split('T');\r\n const datePart = dateTimeParts[0]; // Extract the date part\r\n const timePart = dateTimeParts[1].split('.')[0]; // Extract the time part without milliseconds\r\n searchResult.theDate = datePart;\r\n searchResult.theTime = timePart;\r\n });\r\n\r\n attachmentPerQuery.forEach(function (searchResult) {\r\n const dateTime = searchResult.WhenUploaded;\r\n const dateTimeParts = dateTime.split('T');\r\n const datePart = dateTimeParts[0]; // Extract the date part\r\n const timePart = dateTimeParts[1].split('.')[0]; // Extract the time part without milliseconds\r\n searchResult.QueryDate = datePart;\r\n searchResult.QueryTime = timePart;\r\n });\r\n\r\n if (attachmentPerQuery != 0) {\r\n const lastAttachment = attachmentPerQuery.length === 1 ? attachmentPerQuery[0] : attachmentPerQuery[attachmentPerQuery.length - 1];\r\n\r\n queryMessages.Data.forEach(message => {\r\n if (message.WhoSent === lastAttachment.WhoUploaded) {\r\n message.OriginalFileName = lastAttachment.OriginalFileName;\r\n message.QueryDate = lastAttachment.QueryDate;\r\n message.QueryTime = lastAttachment.QueryTime;\r\n } else {\r\n for (let i = attachmentPerQuery.length - 1; i >= 0; i--) {\r\n const currentAttachment = attachmentPerQuery[i];\r\n if (currentAttachment.WhoUploaded === message.WhoSent) {\r\n message.OriginalFileName = currentAttachment.OriginalFileName;\r\n message.QueryDate = currentAttachment.QueryDate;\r\n message.QueryTime = currentAttachment.QueryTime;\r\n break;\r\n }\r\n }\r\n }\r\n });\r\n\r\n this.SpecificAuditQueryMessages = queryMessages.Data;\r\n\r\n } else {\r\n queryMessages.Data.forEach(message => {\r\n\r\n message.OriginalFileName = null;\r\n message.WhenUploaded = null;\r\n message.QueryDate = null;\r\n message.QueryTime = null;\r\n });\r\n\r\n this.SpecificAuditQueryMessages = queryMessages.Data;\r\n }\r\n }\r\n\r\n async sendMessageLine() {\r\n var auditor = this.auditorInfo.Auditor;\r\n var auditsDetails = await this.AuditsCaptureService.auditsHeaderDetails;\r\n this.retrievedAuditDetails = auditsDetails;\r\n\r\n var auditorHeaderId = auditsDetails.AuditorHeaderId;\r\n var auditorResults = await this.AuditsCaptureService.getAuditorByAuditorHeaderId(auditorHeaderId);\r\n this.auditorInfo = auditorResults;\r\n var auditor = auditorResults.Auditor;\r\n\r\n await this.AuditsCaptureService.sendAuditQueryMessage(this.AuditQueryLogsId, this.SpecificAuditQueryMessage, auditor);\r\n this.SpecificAuditQueryMessage = \"\";\r\n this.viewMessage(this.SelectedAuditQueryLog);\r\n }\r\n\r\n async closeAuditQuery() {\r\n //Attempt to keep closed queries closed\r\n $('#ReAssignBtn').prop('disabled', true);\r\n var queryLogsId = this.AuditQueryLogsId;\r\n var queryStatus = 2;\r\n await this.AuditsCaptureService.closeTheAuditQuery(queryLogsId, queryStatus);\r\n location.reload();\r\n }\r\n\r\n async showReAssignSelectionDiv() {\r\n $(\"#reAssignSelectionDiv\").show();\r\n $(\"#confirmReAssignQueryBTNDiv\").show();\r\n var auditsDetails = await this.AuditsCaptureService.auditsHeaderDetails;\r\n this.retrievedAuditDetails = auditsDetails;\r\n var portfolioManger = auditsDetails.Manager;\r\n var bookkeeper = auditsDetails.Bookkeeper;\r\n var auditorHeaderId = auditsDetails.AuditorHeaderId;\r\n var auditorResults = await this.AuditsCaptureService.getAuditorByAuditorHeaderId(auditorHeaderId);\r\n this.auditorInfo = auditorResults;\r\n var auditor = auditorResults.Auditor;\r\n\r\n $(\"#reAssignQueryBookkeeperText\").text(bookkeeper + \" (Bookkeeper)\");\r\n $(\"#reAssignQueryPortfolioManagerText\").text(portfolioManger + \" (Portfolio Manager)\");\r\n $(\"#reAssignQueryAuditorText\").text(auditor + \" (Auditor)\");\r\n $(\"#reAssignQueryBookkeeper\").text(bookkeeper);\r\n $(\"#reAssignQueryPortfolioManager\").text(portfolioManger);\r\n $(\"#reAssignQueryAuditor\").text(auditor);\r\n\r\n this.populateReAssigneeList();\r\n }\r\n\r\n async confirmReAssignQuery() {\r\n var selectedAction = $('input[name=\"reAssignQueryRadio\"]:checked').val();\r\n var auditsDetails = this.retrievedAuditDetails;\r\n var queryLogsId = this.AuditQueryLogsId;\r\n var auditorDetails = this.auditorInfo;\r\n\r\n var reAssignee = \"\";\r\n if (selectedAction == 1) {\r\n reAssignee = auditsDetails.Manager;\r\n }\r\n if (selectedAction == 2) {\r\n reAssignee = auditsDetails.Bookkeeper;\r\n }\r\n if (selectedAction == 3) {\r\n\r\n var auditor = auditorDetails.Auditor;\r\n reAssignee = auditor;\r\n }\r\n if (selectedAction == 4) {\r\n var selectedAssignee = $('#selectedPossibleReAssignee').find(\":selected\").text();\r\n reAssignee = selectedAssignee;\r\n }\r\n\r\n await this.AuditsCaptureService.reAssignAuditQueryById(queryLogsId, reAssignee, selectedAction);\r\n location.reload();\r\n }\r\n\r\n removeExternalSupportingDocAttachment() {\r\n var frameElement = document.getElementById(\"iframeView\");\r\n frameElement.src = \"\";\r\n $('#iframeDiv').prop('hidden', true);\r\n }\r\n\r\n fileUpload() { \r\n $(document).ready(function () {\r\n var stuff = document.getElementById('externalSupportingDoc');\r\n \r\n if (stuff != null) {\r\n stuff.addEventListener('change', function (event) {\r\n $('#uploadDocBtn').prop('disabled', false);\r\n var file2 = $('input[type=file]#externalSupportingDoc')[0].files[0];\r\n var frameElement = document.getElementById(\"iframeView\");\r\n\r\n let reader = new FileReader();\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n AuditsCaptureCtrl.externalSupportDoc = {\r\n FileType: file2.type,\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n frameElement.src = URL.createObjectURL(file2);\r\n $('#iframeDiv').prop('hidden', false);\r\n };\r\n }\r\n }\r\n else {\r\n document.getElementById('externalSupportingDoc').value = null;\r\n this.externalSupportDoc = {\r\n FileName: null,\r\n Blob: null,\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n }\r\n\r\n var check_file_pdf = (file) => {\r\n if (file.type !== 'application/pdf') {\r\n const errorMsg = 'Wrong file type, only PDFs are allowed.';\r\n console.error(\r\n `${errorMsg} \"${file.name}\" is not in the correct format - only PDFs are allowed.`\r\n );\r\n\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format - only PDFs are allowed.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else if (file.name.length > 50) {\r\n const errorMsg = 'Filename too long. Please shorten your filename to less than 50 characters.';\r\n console.error(\r\n `Filename too long. Please shorten your filename to less than 50 characters.`\r\n );\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else if (file.size > 5242880) {\r\n const errorMsg = 'File size too large. Please reduce the size of your file to smaller than 5 mega bytes.';\r\n console.error(\r\n `File size too large. Please reduce the size of your file to smaller than 5 mega bytes.`\r\n );\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n });\r\n }\r\n\r\n async saveFile() {\r\n var auditorInfomat = this.AuditsCaptureService.auditorHeaderDetails;\r\n var documentSelectedAction = $('input[name=\"DocumentRadio\"]:checked').val();\r\n var fileInputInfo = AuditsCaptureCtrl.externalSupportDoc;\r\n var documentType = 0;\r\n\r\n if (documentSelectedAction == \"isFirstDraftAuditRadio\") {\r\n documentType = 1;\r\n\r\n } else if (documentSelectedAction == \"isFinalDraftAuditRadio\") {\r\n documentType = 2;\r\n\r\n } else if (documentSelectedAction == \"isFinalAuditorSignedAuditRadio\") {\r\n documentType = 4;\r\n\r\n } else {\r\n documentType = null;\r\n }\r\n\r\n let filePayload = {\r\n Description: fileInputInfo.FileName,\r\n FileType: fileInputInfo.FileType,\r\n SchemeReference: this.auditsHeaderDetails.DB_Ref,\r\n FinancialPeriodHeaderId: this.savedFinancialPeriodHeaderId,\r\n Blob: fileInputInfo.Blob,\r\n Username: auditorInfomat.Auditor,\r\n DocumentType: documentType,\r\n };\r\n\r\n this._switchIsBusyUploadingDocumentLoading(true);\r\n\r\n await this.AuditsCaptureService.saveUploadedFile(\r\n filePayload\r\n )\r\n .then(\r\n () => {\r\n this._switchIsBusyUploadingDocumentLoading(false);\r\n if (this.AuditsCaptureService.auditsFile != null) {\r\n $(\"#uploadingSuccessModal\").modal('show');\r\n } else {\r\n $(\"#uploadingFailureModal\").modal('show');\r\n }\r\n }, (err) => { }\r\n )\r\n .finally(() => {\r\n this._switchIsBusyUploadingDocumentLoading(false);\r\n\r\n });\r\n }\r\n\r\n uploadQueryAttachmentTrue() {\r\n $(\"[name='uploadQueryAttachmentRadio']\").change(function () {\r\n if ($('#queryAttachmentTrue').is(':checked')) {\r\n $('#queryAttachmentSection').prop('hidden', false);\r\n }\r\n });\r\n }\r\n\r\n uploadQueryAttachmentFalse() {\r\n $(\"[name='uploadQueryAttachmentRadio']\").change(function () {\r\n if ($('#queryAttachmentFalse').is(':checked')) {\r\n $('#queryAttachmentSection').prop('hidden', true);\r\n }\r\n });\r\n }\r\n\r\n async viewUploadedDocuments() {\r\n var financialPeriodHeaderId = this.savedFinancialPeriodHeaderId;\r\n var result = await this.AuditsCaptureService.getUploadedDocumentsByFinancialPeriodHeaderId(financialPeriodHeaderId);\r\n\r\n result.Data.forEach(function (searchResult) {\r\n\r\n const dateTime = searchResult.WhenUploaded;\r\n const dateTimeParts = dateTime.split('T');\r\n const datePart = dateTimeParts[0]; // Extract the date part\r\n const timePart = dateTimeParts[1].split('.')[0]; // Extract the time part without milliseconds\r\n searchResult.WhenUploaded = datePart + ' ' + timePart;\r\n\r\n if (searchResult.DocumentType == 1) {\r\n searchResult.QueryNumber = \"1st Draft\"\r\n }\r\n else if (searchResult.DocumentType == 2) {\r\n searchResult.QueryNumber = \"Final Draft\"\r\n }\r\n else if (searchResult.DocumentType == 3) {\r\n searchResult.QueryNumber = \"Client Signed AFS\"\r\n }\r\n else if (searchResult.DocumentType == 4) {\r\n searchResult.QueryNumber = \"Auditor Signed AFS\"\r\n }\r\n });\r\n\r\n //ListOfAuditsUploadedLinks\r\n var valueToRemove = \"Link\";\r\n for (var i = result.Data.length - 1; i >= 0; i--) {\r\n if (result.Data[i].FileType === valueToRemove) {\r\n this.ListOfAuditsUploadedLinks.push(result.Data.splice(i, 1)[0]);\r\n }\r\n }\r\n this.ListOfAuditsUploadedDocs = result.Data;\r\n $(\"#uploadedDocsHistory\").modal('show');\r\n }\r\n\r\n displayFinancialPackLink() {\r\n console.log(this.ListOfAuditsUploadedLinks[0].OriginalFileName);\r\n var link = this.ListOfAuditsUploadedLinks[0].OriginalFileName;\r\n window.open(link);\r\n }\r\n\r\n async viewUploadedDocumentsPerQuery(queryLog) {\r\n var financialPeriodHeaderId = this.savedFinancialPeriodHeaderId;\r\n var result = await this.AuditsCaptureService.getUploadedDocumentsByFinancialPeriodHeaderId(financialPeriodHeaderId);\r\n result.Data.forEach(function (searchResult) {\r\n const dateTime = searchResult.WhenUploaded;\r\n const dateTimeParts = dateTime.split('T');\r\n const datePart = dateTimeParts[0]; // Extract the date part\r\n const timePart = dateTimeParts[1].split('.')[0]; // Extract the time part without milliseconds\r\n searchResult.WhenUploaded = datePart + ' ' + timePart;\r\n });\r\n\r\n var queryNumber = queryLog.QueryNumber;\r\n this.queryNumberForPerQueryDoc = queryNumber;\r\n const attachmentPerQuery = result.Data.filter(MatchedQueries => MatchedQueries.QueryNumber === queryNumber);\r\n this.ListOfAuditsPerQueryUploadedDocs = attachmentPerQuery;\r\n $(\"#attachmentPerQueryModal\").modal('show');\r\n }\r\n\r\n\r\n\r\n uploadOngoingQueryDoc(queryNumber, status) {\r\n var ongoingQueryDoc = document.getElementById('ongoingQueryAttachment');\r\n\r\n if (status == \"Closed\") {\r\n $(\"#closedQueryModal\").modal('show');\r\n } else {\r\n $(\"#uploadOngoingQueryDoc\").modal('show');\r\n this.queryNum = queryNumber;\r\n\r\n ongoingQueryDoc.addEventListener('change', function (event) {\r\n var file = $('input[type=file]#ongoingQueryAttachment')[0].files[0];\r\n var ongoingFrameElement = document.getElementById(\"onging_iframeView\");\r\n let reader = new FileReader();\r\n if (file.type == '.pdf' || file.type == 'application/pdf') {\r\n var legitFile = checkFile(file);\r\n if (legitFile == true) {\r\n if (file !== undefined) {\r\n reader.readAsArrayBuffer(file);\r\n reader.onload = function () {\r\n AuditsCaptureCtrl.ongoingQueryAttachment = {\r\n FileType: file.type,\r\n Description: file.name,\r\n QueryNumber: this.queryNum,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n ongoingFrameElement.src = URL.createObjectURL(file);\r\n $('#onging_iframeDiv').prop('hidden', false);\r\n $('#buttonSection').prop('hidden', false);\r\n };\r\n }\r\n }\r\n else {\r\n document.getElementById('ongoingQueryAttachment').value = null;\r\n this.ongoingQueryAttachment = {\r\n FileName: null,\r\n Blob: null,\r\n }\r\n }\r\n } else {\r\n if (file !== undefined) {\r\n reader.readAsArrayBuffer(file);\r\n reader.onload = function () {\r\n AuditsCaptureCtrl.ongoingQueryAttachment = {\r\n FileType: file.type,\r\n Description: file.name,\r\n QueryNumber: this.queryNum,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n ongoingFrameElement.src = \"about:blank\";\r\n ongoingFrameElement.contentWindow.document.write(\"

File to be uploaded: \" + file.name + \"

\")\r\n $('#onging_iframeDiv').prop('hidden', false);\r\n $('#buttonSection').prop('hidden', false);\r\n };\r\n }\r\n }\r\n });\r\n }\r\n\r\n var checkFile = (file) => {\r\n if (file.type !== 'application/pdf') {\r\n const errorMsg = 'Wrong file type, only PDFs are allowed.';\r\n console.error(\r\n `${errorMsg} \"${file.name}\" is not in the correct format - only PDFs are allowed.`\r\n );\r\n\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format - only PDFs are allowed.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else if (file.name.length > 50) {\r\n const errorMsg = 'Filename too long. Please shorten your filename to less than 50 characters.';\r\n console.error(\r\n `Filename too long. Please shorten your filename to less than 50 characters.`\r\n );\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else if (file.size > 5242880) {\r\n const errorMsg = 'File size too large. Please reduce the size of your file to smaller than 5 mega bytes.';\r\n console.error(\r\n `File size too large. Please reduce the size of your file to smaller than 5 mega bytes.`\r\n );\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n async saveUploadedOngoingDoc(queryNum) {\r\n var auditorInfomat = this.AuditsCaptureService.auditorHeaderDetails;\r\n var QueryNumber = queryNum;\r\n var fileInputInfo = AuditsCaptureCtrl.ongoingQueryAttachment;\r\n\r\n let filePayload = {\r\n Description: fileInputInfo.Description,\r\n FileType: fileInputInfo.FileType,\r\n SchemeReference: this.auditsHeaderDetails.DB_Ref,\r\n FinancialPeriodHeaderId: this.savedFinancialPeriodHeaderId,\r\n Blob: fileInputInfo.Blob,\r\n Username: auditorInfomat.Auditor,\r\n QueryNumber: QueryNumber,\r\n IsFinalDraftAudit: false\r\n };\r\n await this.AuditsCaptureService.saveUploadedFile(filePayload);\r\n this.removeCurrentOngoingAttachment();\r\n $(\"#uploadOngoingQueryDoc\").modal('hide');\r\n $(\"#uploadingSuccessModal\").modal('show');\r\n }\r\n\r\n previewUploadedDocument(blob, fileType, OriginalFileName) {\r\n console.log(fileType);\r\n if (fileType == \".pdf\") {\r\n var binaryData = atob(blob);\r\n var arrayBuffer = new ArrayBuffer(binaryData.length);\r\n var uint8Array = new Uint8Array(arrayBuffer);\r\n for (var i = 0; i < binaryData.length; i++) {\r\n uint8Array[i] = binaryData.charCodeAt(i);\r\n }\r\n var theBlob = new Blob([arrayBuffer], { type: 'application/pdf' });\r\n var FrameElement = document.getElementById('viewUploadedDocFrame');\r\n FrameElement.src = URL.createObjectURL(theBlob);\r\n this.expansionAttachment = URL.createObjectURL(theBlob);\r\n $('#viewUploadedDocView').prop('hidden', false);\r\n }\r\n else if (fileType == \".zip\")\r\n {\r\n var theBlob = new Blob([blob], { type: 'application/zip' });\r\n\r\n // Create a blob URL for the Blob\r\n var blobUrl = URL.createObjectURL(theBlob);\r\n\r\n // Create a hidden link element\r\n var link = document.createElement('a');\r\n link.href = blobUrl;\r\n link.download = OriginalFileName;\r\n\r\n // Append the link to the document body\r\n document.body.appendChild(link);\r\n\r\n // Trigger a click on the link to start the download\r\n link.click();\r\n\r\n // Remove the link and revoke the blob URL after the download starts\r\n document.body.removeChild(link);\r\n URL.revokeObjectURL(blobUrl);\r\n }\r\n else if (fileType == \".doc\")\r\n {\r\n var theBlob = new Blob([blob], { type: 'application/msword' });\r\n var blobUrl = URL.createObjectURL(theBlob);\r\n\r\n // Create a hidden link element\r\n var link = document.createElement('a');\r\n link.href = blobUrl;\r\n link.download = OriginalFileName;\r\n\r\n document.body.appendChild(link);\r\n link.click();\r\n // Remove the link and revoke the blob URL after the download starts\r\n document.body.removeChild(link);\r\n URL.revokeObjectURL(blobUrl);\r\n\r\n } else if (fileType == \".xls\" || fileType == \".xlsx\") {\r\n var theBlob = new Blob([blob], { type: 'text/xls' });\r\n var blobUrl = URL.createObjectURL(theBlob);\r\n var link = document.createElement('a');\r\n link.href = blobUrl;\r\n link.download = OriginalFileName;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n URL.revokeObjectURL(blobUrl);\r\n }\r\n }\r\n\r\n previewUploadedDocumentPerQuery(blob, fileType, OriginalFileName) {\r\n console.log(fileType);\r\n\r\n if (fileType == \".pdf\") {\r\n var binaryData = atob(blob);\r\n var arrayBuffer = new ArrayBuffer(binaryData.length);\r\n var uint8Array = new Uint8Array(arrayBuffer);\r\n for (var i = 0; i < binaryData.length; i++) {\r\n uint8Array[i] = binaryData.charCodeAt(i);\r\n }\r\n var theBlob = new Blob([arrayBuffer], { type: 'application/pdf' });\r\n var FrameElement = document.getElementById('viewUploadedDocFramePerQuery');\r\n FrameElement.src = URL.createObjectURL(theBlob);\r\n this.expansionAttachmentperQuery = URL.createObjectURL(theBlob);\r\n $('#viewUploadedDocViewPerQuery').prop('hidden', false);\r\n }\r\n else if (fileType == \".zip\") {\r\n var theBlob = new Blob([blob], { type: 'application/zip' });\r\n var blobUrl = URL.createObjectURL(theBlob);\r\n var link = document.createElement('a');\r\n link.href = blobUrl;\r\n link.download = OriginalFileName;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n URL.revokeObjectURL(blobUrl);\r\n }\r\n else if (fileType == \".doc\") {\r\n var theBlob = new Blob([blob], { type: 'application/msword' });\r\n var blobUrl = URL.createObjectURL(theBlob);\r\n var link = document.createElement('a');\r\n link.href = blobUrl;\r\n link.download = OriginalFileName;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n URL.revokeObjectURL(blobUrl);\r\n\r\n } else if (fileType == \".xls\" || fileType == \".xlsx\") {\r\n var theBlob = new Blob([blob], { type: 'application/vnd.ms-excel' });\r\n var blobUrl = URL.createObjectURL(theBlob);\r\n var win = window.open(blobUrl, '_blank');\r\n // Create a hidden link element\r\n var link = document.createElement('a');\r\n link.href = blobUrl;\r\n link.download = OriginalFileName;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n URL.revokeObjectURL(blobUrl);\r\n }\r\n }\r\n\r\n async getExcelDocByCorrelationId(corrId) {\r\n try {\r\n await this.AuditsCaptureService.getExcelDocByCorrelationId(corrId);\r\n } catch (error) {\r\n } finally {\r\n }\r\n }\r\n\r\n showExpandModal() {\r\n var FrameElement = document.getElementById('externalExpansionFrame');\r\n FrameElement.src = this.expansionAttachment;\r\n $(\"#expandCert\").modal('show');\r\n $('#loadAttachment').prop('hidden', false);\r\n }\r\n\r\n showExpandModalPerQuery() {\r\n var FrameElement = document.getElementById('externalExpansionFrame');\r\n FrameElement.src = this.expansionAttachmentperQuery;\r\n $(\"#expandCert\").modal('show');\r\n $('#loadAttachment').prop('hidden', false);\r\n }\r\n\r\n _switchIsBusyUploadingDocumentLoading(flag) {\r\n this.$timeout(() => {\r\n this.isLoading = flag;\r\n });\r\n }\r\n\r\n refresh() {\r\n window.location.reload();\r\n }\r\n}\r\n","//@ts-check\r\n\r\nclass AuditsCaptureService {\r\n\tconstructor($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n init() {\r\n this.auditTokenHistory = {};\r\n this.auditsHeaderDetails = {};\r\n this.auditsQueryLogs = {};\r\n this.auditorHeaderDetails = {};\r\n this.auditorContactDetails = {};\r\n this.auditsFile = {};\r\n this.listOfAssignees = [];\r\n this.auditsMessages = [];\r\n this.uploadedDocs = [];\r\n }\t\r\n\r\n async getAuditsTokenHistoryByCorrelationId(correlationId) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n if (!correlationId) {\r\n throw new Error('Correlation Id must be supplied.');\r\n }\r\n\r\n \r\n \r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetAuditsTokenHistory');\r\n \r\n \r\n if (!url) {\r\n \r\n url = await this.InternalLinksService.getLink('GetAuditsTokenHistory');\r\n }\r\n url = `${url}?correlationId=${correlationId}`;\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n console.log(data);\r\n this.auditTokenHistory = this._map(data);\r\n\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.auditTokenHistory = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n async getAuditsHeaderByFinancialPeriodHeaderId(financialPeriodHeaderId) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n if (!financialPeriodHeaderId) {\r\n throw new Error('financialPeriodHeaderId must be supplied.');\r\n }\r\n\r\n\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetAuditsHeaderDetails');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('GetAuditsHeaderDetails');\r\n }\r\n url = `${url}?financialPeriodHeaderId=${financialPeriodHeaderId}`;\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n this.auditsHeaderDetails = this._map(data);\r\n \r\n this.getAuditorContactDetailsByAuditorHeaderId(this.auditsHeaderDetails.AuditorHeaderId);\r\n var auditorHeaderId = this.auditsHeaderDetails.AuditorHeaderId;\r\n this.getAuditorByAuditorHeaderId(auditorHeaderId);\r\n \r\n\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.auditsHeaderDetails = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n \r\n\r\n async getAuditQueryLogsById(auditsHeaderId) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n if (!auditsHeaderId) {\r\n throw new Error('AuditsHeaderId must be supplied.');\r\n }\r\n\r\n\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetAuditQueryLogsById');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('GetAuditQueryLogsById');\r\n }\r\n url = `${url}?auditsHeaderId=${auditsHeaderId}`;\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n \r\n\r\n this.auditsQueryLogs = this._map(data);\r\n \r\n this.$timeout(() => promiseHandler.resolve(data));\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.auditsQueryLogs = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getAuditorByAuditorHeaderId(auditorHeaderId) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n\r\n\r\n if (!auditorHeaderId) {\r\n throw new Error('auditorHeaderId must be supplied.');\r\n }\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetAuditorByAuditorHeaderId');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('GetAuditorByAuditorHeaderId');\r\n }\r\n url = `${url}?auditorHeaderId=${auditorHeaderId}`;\r\n\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n this.auditorHeaderDetails = this._map(data);\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.auditsQueryLogs = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n\r\n\r\n async getAuditorContactDetailsByAuditorHeaderId(auditorHeaderId) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n\r\n\r\n if (!auditorHeaderId) {\r\n throw new Error('auditorHeaderId must be supplied.');\r\n }\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetAuditorContactDetailsByAuditorHeaderId');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('GetAuditorContactDetailsByAuditorHeaderId');\r\n }\r\n url = `${url}?auditorHeaderId=${auditorHeaderId}`;\r\n\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n this.auditorContactDetails = this._map(data);\r\n \r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.auditorContactDetails = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n\r\n async getListOfAssignees() {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetListOfAssignees');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('GetListOfAssignees');\r\n }\r\n \r\n\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n this.listOfAssignees = this._map(data);\r\n \r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.listOfAssignees = [];\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n\r\n async addAuditQuery(assignee, auditsDetails, auditQuerySubjectText, auditQueryMessageText, selectedAction, username, addQuerySelectedDoc) {\r\n\r\n var payload = {\r\n assignee: assignee,\r\n auditsDetails: auditsDetails,\r\n auditQuerySubjectText: auditQuerySubjectText,\r\n auditQueryMessageText: auditQueryMessageText,\r\n selectedAction: selectedAction,\r\n username: username,\r\n addQuerySelectedDoc: addQuerySelectedDoc\r\n };\r\n\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('AddAuditQuery');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('AddAuditQuery');\r\n }\r\n \r\n\r\n\r\n const results = await this.$http.post(url, payload);\r\n const { data } = results;\r\n \r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.listOfAssignees = [];\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n\r\n async queryTheAuditQuery(queryLogsId, queryStatus) {\r\n\r\n\r\n var payload = {\r\n queryLogsId: queryLogsId,\r\n queryStatus: queryStatus\r\n };\r\n\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n\r\n\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('QueryAuditQuery');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('QueryAuditQuery');\r\n }\r\n \r\n \r\n \r\n\r\n\r\n const results = await this.$http.post(url, payload);\r\n const { data } = results;\r\n \r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n\r\n\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n \r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async closeTheAuditQuery(queryLogsId, queryStatus) {\r\n\r\n\r\n var payload = {\r\n queryLogsId: queryLogsId,\r\n queryStatus: queryStatus\r\n };\r\n\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n\r\n\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('closeAuditQuery');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('QueryAuditQuery');\r\n }\r\n\r\n const results = await this.$http.post(url, payload);\r\n const { data } = results;\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n\r\n\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n\r\n async getAuditQueryMessage(AuditQueryLogsId) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetAuditQueryMessages');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('GetAuditQueryMessages');\r\n }\r\n url = `${url}?AuditQueryLogsId=${AuditQueryLogsId}`;\r\n\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n this.auditsMessages = this._map(data);\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n\r\n async sendAuditQueryMessage(AuditQueryLogsId, messageText, auditor) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('SendAuditQueryMessage');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('SendAuditQueryMessage');\r\n }\r\n url = `${url}?AuditQueryLogsId=${AuditQueryLogsId}&messageText=${messageText}&auditor=${auditor}`;\r\n\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n this.auditsMessages = this._map(data);\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n\r\n async reAssignAuditQueryById(queryLogsId, reAssignee, selectedAction) {\r\n\r\n var payload = {\r\n queryLogsId: queryLogsId,\r\n reAssignee: reAssignee,\r\n selectedAction: selectedAction\r\n }\r\n\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('reAssignAuditQuery');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('reAssignAuditQuery');\r\n }\r\n \r\n\r\n\r\n const results = await this.$http.post(url, payload);\r\n const { data } = results;\r\n \r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise\r\n }\r\n\r\n async saveUploadedFile(filePayload) {\r\n\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n if (!filePayload) {\r\n throw new Error('file must be supplied.');\r\n }\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('SaveUploadedFileAttachment');\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('SaveUploadedFileAttachment');\r\n }\r\n\r\n const results = await this.$http.post(url, filePayload);\r\n const { data } = results;\r\n this.auditsFile = this._map(data);\r\n\r\n this.$timeout(() => promiseHandler.resolve());\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.auditsFile = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getUploadedDocumentsByFinancialPeriodHeaderId(financialPeriodHeaderId) {\r\n\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n if (!financialPeriodHeaderId) {\r\n throw new Error('financialPeriodHeaderId must be supplied.');\r\n }\r\n\r\n\r\n\r\n await this.InternalLinksService.getLinks('audits/links', false);\r\n\r\n let url = await this.InternalLinksService.getLink('GetUploadedDocumentsByFinancialPeriodHeaderId');\r\n\r\n\r\n if (!url) {\r\n\r\n url = await this.InternalLinksService.getLink('GetUploadedDocumentsByFinancialPeriodHeaderId');\r\n }\r\n\r\n\r\n url = `${url}?financialPeriodHeaderId=${financialPeriodHeaderId}`;\r\n\r\n\r\n const results = await this.$http.get(url);\r\n const { data } = results;\r\n this.uploadedDocs = this._map(data);\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n\r\n } catch (err) {\r\n const msg = `Error while fetching audits token history data`;\r\n console.error(msg, err);\r\n this.uploadedDocs = [];\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getExcelDocByCorrelationId(id) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('getExcelDocByCorrelationId');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/reporting/links');\r\n url = await this.InternalLinksService.getLink('getExcelDocByCorrelationId');\r\n }\r\n\r\n url += `?id=${id}`;\r\n this.openNewTabReport(url, `Financial Summary Attachment`);\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (err) {\r\n this.$timeout(() => promiseHandler.reject(`Couldn't load API 'links'`, err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n openNewTabReport(url, title) {\r\n var win = window.open(url, '_blank');\r\n win.focus();\r\n\r\n // const newTab = window.open(url, '_blank');\r\n // newTab.document.write(`\r\n // ${title}\r\n // \r\n // \r\n // `);\r\n }\r\n\r\n\r\n _map(data) {\r\n if (!data) return data;\r\n\r\n //if (!data.IsSubmitted) {\r\n // data = this._formatAndMapDate(data);\r\n //} else {\r\n // data.ValidDate = data.ValidDate.substr(0, 10);\r\n //}\r\n\r\n //data = this._mapSellerInfo(data);\r\n //data = this._mapRejectedDocuments(data);\r\n\r\n return data;\r\n }\r\n}\r\n\r\nexport default /* @ngInject */ ($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) =>\r\n\tnew AuditsCaptureService($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService);\r\n","/* @ngInject */\r\nexport default class BuildingDocumentsCtrl {\r\n\tconstructor(\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\t$window,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$interval,\r\n\t\tTelemetryService,\r\n\t\tBuildingsService,\r\n\t\tNavigationService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService,\r\n\t\tbuildingDocumentsDataService\r\n\t) {\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.$window = $window;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$interval = $interval;\r\n\t\tthis.TelemetryService = TelemetryService;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.NavigationService = NavigationService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\t\tthis.buildingDocumentsDataService = buildingDocumentsDataService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.isBusy = false;\r\n\t\tthis.loading = true;\r\n\t\tthis.content = undefined;\r\n\t\tthis.buildingDocuments = [];\r\n\t\tthis.buildingDocumentsData = [];\r\n\t\tthis.buildingDocumentsFlatFile = [];\r\n\t\tthis.buildingDocumentsBreadCrumbs = [\r\n\t\t\t{\r\n\t\t\t\tTitle: 'Home',\r\n\t\t\t\tLevel: null,\r\n\t\t\t\tTreeId: null,\r\n\t\t\t\tParentId: null\r\n\t\t\t}\r\n\t\t];\r\n\t\tthis.buildingsDataService = this.BuildingsService;\r\n\t\tthis.buildingDocumentsData = this.buildingDocumentsDataService;\r\n\r\n\t\tthis.activate();\r\n\t\tvar vm = this;\r\n\t\tthis._handleEvents();\r\n\t}\r\n\r\n\tactivate() {\r\n\t\tconst promise = this.$interval(() => {\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\tif (selectedBuildingRef) {\r\n\t\t\t\tthis.onSelectedBuildingChanged({}, selectedBuildingRef);\r\n\t\t\t\tthis.$interval.cancel(promise);\r\n\t\t\t}\r\n\t\t}, 350);\r\n\t}\r\n\r\n\t_handleEvents() {\r\n\t\tvar ref = this;\r\n\t\t\r\n\t\tthis.$scope.$on('selected-building-changed', this.onSelectedBuildingChanged.bind(ref));\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'documentsVm.buildingDocumentsData.documentsData.BuildingDocuments',\r\n\t\t\t(newValue) => {\r\n\t\t\t\tthis.buildingDocumentsFlatFile = [];\r\n\t\t\t\tthis.buildingDocuments = [];\r\n\t\t\t\tvar temp = this.$state.params;\r\n\t\t\t\tif (!!newValue) {\r\n\t\t\t\t\tnewValue.forEach((document) => {\r\n\t\t\t\t\t\tif (temp.isItFinancialsSection == true) {\r\n\t\t\t\t\t\t\tthis.buildingDocumentsFlatFile.push(document);\r\n\t\t\t\t\t\t\tthis.buildingDocuments.push(document);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (document.Title != \"Monthly Financial Statements\") {\r\n\t\t\t\t\t\t\t\tthis.buildingDocumentsFlatFile.push(document);\r\n\t\t\t\t\t\t\t\tthis.buildingDocuments.push(document);\r\n }\r\n }\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\t}\r\n\r\n\tonSelectedBuildingChanged(event, schemeRef) {\r\n\t\tlet wasSuccessful = false;\t\t\r\n\t\tschemeRef = schemeRef ? schemeRef : this.BuildingsService.getSelectedBuildingRef();\r\n\t\tif (schemeRef && schemeRef.length > 2) {\r\n\t\t\tthis._switchLoadingIndicator(true);\r\n\t\t\tthis.buildingDocumentsDataService\r\n\t\t\t\t.getBuildingDocuments(schemeRef)\r\n\t\t\t\t.then(\r\n\t\t\t\t\t() => {\r\n\t\t\t\t\t\tthis.buildingDocumentsBreadCrumbs = [\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tTitle: 'Home',\r\n\t\t\t\t\t\t\t\tLevel: null,\r\n\t\t\t\t\t\t\t\tId: null,\r\n\t\t\t\t\t\t\t\tFatherId: null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t];\r\n\r\n\t\t\t\t\t\twasSuccessful = true;\r\n\t\t\t\t\t},\r\n\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\tconsole.error('Error while getting building documents data: ', err);\r\n\t\t\t\t\t}\r\n\t\t\t\t)\r\n\t\t\t\t.finally(async () => {\r\n\t\t\t\t\tawait this._switchLoadingIndicator(false);\r\n\t\t\t\t\tif (wasSuccessful) {\r\n\t\t\t\t\t\tthis.navigate();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tnavigate() {\r\n\t\tlet nav = this.Utility.QueryString('nav');\r\n\t\tif (!!nav) {\r\n\t\t\tnav = decodeURI(nav);\r\n\t\t\tconst $overlay = angular.element('#overlay');\r\n\t\t\tthis.$timeout(() => $overlay.show());\r\n\r\n\t\t\tconst paths = nav.split('>');\r\n\t\t\tpaths.map((path) => {\r\n\t\t\t\tconst clickFolder = angular.element('.document-layout-title p').toArray().find((folder) => {\r\n\t\t\t\t\tconst $folder = angular.element(folder);\r\n\t\t\t\t\treturn $folder.text().trim().toLowerCase() === path.toLowerCase();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (!!clickFolder) {\r\n\t\t\t\t\tconsole.log(`Now Clicking ${path}`);\r\n\t\t\t\t\tangular.element(clickFolder).trigger('click');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.$timeout(() => $overlay.hide(), 1000);\r\n\t\t}\r\n\t}\r\n\r\n\topenFiles() {\r\n\t\tangular.element('.open-docs').trigger('click');\r\n\t}\r\n\r\n\tasync buildingDocumentsFolderClick(id) {\r\n\t\tthis.NavigationService.gotoTop();\r\n\r\n\t\tlet document;\r\n\t\tfor (let i = 0; i < this.buildingDocumentsFlatFile.length; i++) {\r\n\t\t\tdocument = this.buildingDocumentsFlatFile[i];\r\n\t\t\tif (document.TreeId === id) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (document.RecordClassification == 3) {\r\n\t\t\tconst baseURL = this.InternalLinksService.getLink('DocumentsApiById');\r\n\t\t\tconst url = baseURL.replace('{documentId}', document.DatabaseId);\r\n\r\n\t\t\tconst documentTab = this.$window.open(url, '_blank');\r\n\t\t\tdocumentTab.document.title = document.Title;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tconst description = `Document ID: ${id}`;\r\n\t\t\t\tawait this.TelemetryService.logTelemetry('View Building Document', description);\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error(`Error while logging Telemetry for Building Document: ${description}`);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst { Title, Level, TreeId, ParentId } = document;\r\n\r\n\t\tconst tempBreadCrumbs = {\r\n\t\t\tTitle,\r\n\t\t\tLevel,\r\n\t\t\tTreeId,\r\n\t\t\tParentId\r\n\t\t};\r\n\r\n\t\tthis.buildingDocumentsBreadCrumbs.push(tempBreadCrumbs);\r\n\r\n\t\tconsole.log(document);\r\n\r\n\t\tfor (let j = 0; j < this.buildingDocumentsFlatFile.length; j++) {\r\n\t\t\tconst documentOriginal = this.buildingDocumentsFlatFile[j];\r\n\t\t\tif (documentOriginal.TreeId === document.TreeId) {\r\n\t\t\t\tthis.buildingDocumentsFlatFile = documentOriginal.Children;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tbuildingDocumentsBreadCrumbClick(breadCrumb) {\r\n\t\tif (\r\n\t\t\tthis.buildingDocumentsBreadCrumbs[this.buildingDocumentsBreadCrumbs.length - 1].TreeId == breadCrumb.TreeId\r\n\t\t) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst breadCrumbList = this.buildingDocumentsBreadCrumbs;\r\n\t\tbreadCrumbList.shift();\r\n\t\tbreadCrumbList.length = breadCrumb.Level;\r\n\r\n\t\tthis.buildingDocumentsFlatFile = [];\r\n\t\tthis.buildingDocumentsBreadCrumbs = [\r\n\t\t\t{\r\n\t\t\t\tTitle: 'Home',\r\n\t\t\t\tLevel: null,\r\n\t\t\t\tTreeId: null,\r\n\t\t\t\tParentId: null\r\n\t\t\t}\r\n\t\t];\r\n\t\tthis.buildingDocumentsFlatFile = this.buildingDocuments;\r\n\r\n\t\tif (breadCrumb.Level !== null) {\r\n\t\t\tfor (let i = 0; i < breadCrumbList.length; i++) {\r\n\t\t\t\tfor (let j = 0; j < this.buildingDocumentsFlatFile.length; j++) {\r\n\t\t\t\t\tconst documentOrignal = this.buildingDocumentsFlatFile[j];\r\n\t\t\t\t\tif (documentOrignal.TreeId === breadCrumbList[i].TreeId) {\r\n\t\t\t\t\t\tthis.buildingDocumentsFlatFile = documentOrignal.Children;\r\n\t\t\t\t\t\tconst tempInternalDocumentsBreadCrumbs = {\r\n\t\t\t\t\t\t\tTitle: documentOrignal.Title,\r\n\t\t\t\t\t\t\tLevel: documentOrignal.Level,\r\n\t\t\t\t\t\t\tTreeId: documentOrignal.TreeId,\r\n\t\t\t\t\t\t\tParentId: documentOrignal.ParentId\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\tthis.buildingDocumentsBreadCrumbs.push(tempInternalDocumentsBreadCrumbs);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tasync _switchLoadingIndicator(flag) {\r\n\t\treturn this.$timeout(() => {\r\n\t\t\tthis.isBusy = flag;\r\n\t\t});\r\n\t}\r\n\r\n\trenderHtml(htmlString) {}\r\n}\r\n","//@ts-check\r\n\r\nclass BuildingDocumentsDataService {\r\n\tconstructor($http, Utility, $timeout, $rootScope, ContentService, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.documentsData = null;\r\n\t\tthis.InternalLinksService.getLinks('/api/documents/links');\r\n\t}\r\n\r\n\tasync getBuildingDocuments(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('DocumentsApiAll');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/documents/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('DocumentsApiAll');\r\n\t\t\t}\r\n\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tconst documents = {\r\n\t\t\t\tBuildingDocuments: results.hasOwnProperty('data') ? results.data : null\r\n\t\t\t};\r\n\r\n\t\t\tthis.documentsData = documents;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(documents));\r\n\t\t} catch (error) {\r\n\t\t\tconst documents = {\r\n\t\t\t\tBuildingDocuments: []\r\n\t\t\t};\r\n\r\n\t\t\tthis.documentsData = documents;\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getDocumentById(documentId) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('DocumentsApiById');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/documents/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('DocumentsApiById');\r\n\t\t\t}\r\n\r\n\t\t\tif (!documentId) {\r\n\t\t\t\tthrow new Error('No document ID provided...');\r\n\t\t\t}\r\n\r\n\t\t\turl = url + documentId;\r\n\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tconst document = results.hasOwnProperty('data') ? results.data : null;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(document));\r\n\t\t} catch (error) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync loadContent() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst content = await this.ContentService.load('DocumentsContent', '/api/documents/links');\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(content));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew BuildingDocumentsDataService(\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","const base64js = require('base64-js');\r\nimport Validator from 'validatorjs';\r\n\r\n/* @ngInject */\r\nexport default class ClearanceCaptureCtrl {\r\n\tconstructor($scope, $rootScope, $timeout, ClearanceCaptureService, NotificationService, LocalStorageService) {\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.ClearanceCaptureService = ClearanceCaptureService;\r\n\r\n\t\tthis.init();\r\n\t\tthis._registerEventHandler();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.isBusy = false;\r\n\t\tthis.howToGuideLink;\r\n\t\tthis.attachment = {};\r\n\t\tthis.documentType = '0';\r\n\t\tthis.isLegalEntity = false;\r\n\t\tthis.validPurchaser = false;\r\n\t\tthis.isPurchaserBusy = false;\r\n\t\tthis.selectedAttachment = {};\r\n\t\tthis.selectedPurchaserId = '';\r\n\t\tthis.purchaserConfirms = false;\r\n\t\tthis.purchaseDocumentType = '0';\r\n\t\tthis.hasSelectedPurchaser = false;\r\n\t\tthis.isInAddPurchaserMode = false;\r\n\t\tthis.isInEditPurchaserMode = false;\r\n\t\tthis.showOtherMaritalStatus = false;\r\n\t\tthis.hasClearanceHeaderBeenSaved = false;\r\n\t\tthis.formsErrors = {\r\n\t\t\tfirst: [],\r\n\t\t\tsecond: [],\r\n\t\t\theader: []\r\n\t\t};\r\n\r\n\t\tthis.documentsErrors = {\r\n\t\t\tfirst: [],\r\n\t\t\tsecond: [],\r\n\t\t\theader: []\r\n\t\t};\r\n\r\n\t\tthis.purchaser = {\r\n\t\t\tMaritalStatus: undefined,\r\n\t\t\tOtherMaritalStatus: undefined\r\n\t\t};\r\n\r\n\t\tthis.documentTypeList = [\r\n\t\t\t{\r\n\t\t\t\tValue: 1,\r\n\t\t\t\tDescription: 'Id Document'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tValue: 2,\r\n\t\t\t\tDescription: 'Proof Of Residence'\r\n\t\t\t}\r\n\t\t];\r\n\t\tthis.documentTypeListLoaded = [{}];\r\n\t\tthis.headerDocumentsAlreadyUpLoaded = [{}];\r\n\r\n\t\tthis.entityTypes = [\r\n\t\t\t{\r\n\t\t\t\tvalue: 'natural',\r\n\t\t\t\ttext: 'Natural'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tvalue: 'legal-entity',\r\n\t\t\t\ttext: 'Legal Entity'\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\tthis.legalEntities = [\r\n\t\t\t{\r\n\t\t\t\tvalue: 1,\r\n\t\t\t\ttext: 'Close Corporation'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tvalue: 2,\r\n\t\t\t\ttext: 'Trust'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tvalue: 3,\r\n\t\t\t\ttext: 'Company'\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\tthis.purchaserTypes = [\r\n\t\t\t{\r\n\t\t\t\tvalue: 1,\r\n\t\t\t\ttext: 'Occupant (O)'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tvalue: 2,\r\n\t\t\t\ttext: 'Investor (I)'\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\tthis.purchaseDocTypes = [{}];\r\n\r\n\t\tthis.hoaDocument = {\r\n\t\t\tValue: 3,\r\n\t\t\tDescription: 'Hoa Membership Form'\r\n\t\t};\r\n\r\n\t\tthis.acknowledgementOfRules = {\r\n\t\t\tValue: 6,\r\n\t\t\tDescription: 'Acknowledgement of Rules'\r\n\t\t};\r\n\r\n\t\tthis.companyRegistrationDocument = {\r\n\t\t\tValue: 4,\r\n\t\t\tDescription: 'Company Registration Document'\r\n\t\t};\r\n\r\n\t\tthis.clearanceHeader = {\r\n\t\t\tpostCode: null,\r\n\t\t\tvatRegNo: null,\r\n\t\t\tattachments: [],\r\n\t\t\taddressLineOne: '',\r\n\t\t\taddressLineTwo: '',\r\n\t\t\taddressLineFour: '',\r\n\t\t\taddressLineThree: '',\r\n\t\t\tregistrationNo: null,\r\n\t\t\tdateValidUntil: null,\r\n\t\t\tselectedEntityType: null,\r\n\t\t\tselectedLegalEntity: null,\r\n\t\t\tpretorToHandleRental: true,\r\n\t\t\tselectedPurchaserType: null,\r\n\t\t\tdateOfRegistration: null,\t\t\t\r\n\t\t\tSellerBankName: '',\r\n\t\t\tSellerBankAccountName: '',\r\n\t\t\tSellerBankAccountNumber: null,\r\n\t\t\tSellerBankBranchCode: null,\r\n\t\t};\r\n\t}\r\n\r\n\t_registerEventHandler() {\r\n\t\tthis.$scope.$watch('clearanceCaptureVm.purchaser.MaritalStatus', (newVal, oldVal) => {\r\n\t\t\tif (newVal && newVal === '-1') {\r\n\t\t\t\tthis.showOtherMaritalStatus = true;\r\n\t\t\t} else {\r\n\t\t\t\tthis.showOtherMaritalStatus = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.Purchaser',\r\n\t\t\t(newValue, oldValue) => {\r\n\t\t\t\tthis.readyForSubmit();\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\t}\r\n\r\n\tchangeSelectedEntityType() {\r\n\t\tthis.createMainAttachmentList();\r\n\t\tthis.$rootScope.$broadcast('clearance-selected-entity-type-changed', null);\r\n\t}\r\n\r\n\tasync saveClearanceHeader() {\r\n\t\tthis._switchIsBusy(true);\r\n\t\tconst purchaserType = this.purchaserTypes.find((type) => {\r\n\t\t\tif (type.value.toString() === this.clearanceHeader.selectedPurchaserType) {\r\n\t\t\t\treturn type;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst PurchaserStatus = purchaserType ? parseInt(purchaserType.value) : null;\r\n\r\n\t\tconst IsLegalEntity = this.clearanceHeader.selectedEntityType === 'legal-entity' ? true : false;\r\n\r\n\t\tconst { Id, Attorney, CardCode, AttorneyReference } = this.ClearanceCaptureService.clearanceCapture;\r\n\r\n\t\tlet ValidDate =\tmoment(this.ClearanceCaptureService.clearanceCapture.ValidDate).endOf('month').toDate();\r\n\r\n\t\tlet LegalEntity = null;\r\n\t\tif (IsLegalEntity) {\r\n\t\t\tLegalEntity = {\r\n\t\t\t\tId: this.clearanceHeader.legalEntityId,\r\n\t\t\t\tClearanceHeaderId: Id,\r\n\t\t\t\tName: this.clearanceHeader.name,\r\n\t\t\t\tPostCode: this.clearanceHeader.postCode,\r\n\t\t\t\tVatRegNumber: this.clearanceHeader.vatRegNo,\r\n\t\t\t\tAddressOne: this.clearanceHeader.addressLineOne,\r\n\t\t\t\tAddressTwo: this.clearanceHeader.addressLineTwo,\r\n\t\t\t\tAddressFour: this.clearanceHeader.addressLineFour,\r\n\t\t\t\tAddressThree: this.clearanceHeader.addressLineThree,\r\n\t\t\t\tRegistrationNumber: this.clearanceHeader.registrationNo,\r\n\t\t\t\tTypeOfLegalEntity: this.clearanceHeader.selectedLegalEntity\r\n\t\t\t\t\t? this.legalEntities.find((type) => {\r\n\t\t\t\t\t\tif (type.value == this.clearanceHeader.selectedLegalEntity) {\r\n\t\t\t\t\t\t\treturn type;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}).value\r\n\t\t\t\t\t: this.ClearanceCaptureService.clearanceCapture.LegalEntity.TypeOfLegalEntity\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tconst payload = {\r\n\t\t\tId,\r\n\t\t\tAttorney,\r\n\t\t\tCardCode,\r\n\t\t\tValidDate,\r\n\t\t\tLegalEntity,\r\n\t\t\tIsLegalEntity,\r\n\t\t\tPurchaserStatus,\r\n\t\t\tAttorneyReference,\r\n\t\t\tPretorToHandleRental: this.clearanceHeader.pretorToHandleRental,\r\n\t\t\tSellerBankName: this.clearanceHeader.SellerBankName,\r\n\t\t\tSellerBankAccountName: this.clearanceHeader.SellerBankAccountName,\r\n\t\t\tSellerBankAccountNumber: this.clearanceHeader.SellerBankAccountNumber,\r\n\t\t\tSellerBankBranchCode: this.clearanceHeader.SellerBankBranchCode,\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tawait this.ClearanceCaptureService.saveClearanceHeader(payload);\r\n\t\t\tthis.addAttachment();\r\n\r\n\t\t\tthis.submitErrorMessage = '';\r\n\t\t\tthis.headerForm.$setPristine();\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\t\t}\r\n\t}\r\n\r\n\tasync saveClearanceRegHeaderAttachment() {\r\n\t\tthis._switchIsBusy(true);\r\n\t\tconst { Id, DateOfRegistration } = this.ClearanceCaptureService.clearanceCapture;\r\n\t\tconst attachment = this.attachment;\r\n\r\n\t\ttry {\r\n\t\t\tawait this.ClearanceCaptureService.saveClearanceRegHeaderAttachment(DateOfRegistration, attachment);\r\n\t\t\tthis.submitErrorMessage = '';\r\n\t\t\tthis.clearPage();\r\n\t\t\tthis.getClearanceHeaderInformation();\r\n\t\t\tthis.NotificationService.success('REGISTRATION DOCUMENT SUBMITTED');\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\t\t\tthis.NotificationService.error('REGISTRATION DOCUMENT ERROR');\r\n\t\t}\r\n\t\tthis._switchIsBusy(false);\r\n\t}\r\n\r\n\tactivate() {\r\n\t\tthis.howToGuideLink = `${PretorCDNAddress}${PretorCDNAddress.endsWith('/')\r\n\t\t\t? ''\r\n\t\t\t: '/'}docs/Clearance How-To-Guide.pdf`;\r\n\r\n\t\tthis.defineDefaultPurchaser();\r\n\t\tthis.getClearanceHeaderInformation(true);\r\n\t\tthis.setupStyles();\r\n\t\tthis.addMainAttachmentWatch();\r\n\t\tthis.addPersonAttachmentWatch();\r\n\t\tthis.getMaritalStatuses();\r\n\t\tthis.getBankingInstitutionName();\r\n\t\tthis._initializeDatePicker();\r\n\t}\r\n\r\n\tasync getMaritalStatuses() {\r\n\t\tthis.$timeout(async () => {\r\n\t\t\tif (!this.isBusy) {\r\n\t\t\t\tthis._switchIsBusy(true);\r\n\t\t\t}\r\n\r\n\t\t\tawait this.ClearanceCaptureService.getMaritalStatuses();\r\n\t\t\tif (this.isBusy) {\r\n\t\t\t\tthis._switchIsBusy(false);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\tasync getBankingInstitutionName() {\r\n\t\tthis.$timeout(async () => {\r\n\t\t\tif (!this.isBusy) {\r\n\t\t\t\tthis._switchIsBusy(true);\r\n\t\t\t}\r\n\t\t\tawait this.ClearanceCaptureService.getBankingInstitutionName();\r\n\t\t\tif (this.isBusy) {\r\n\t\t\t\tthis._switchIsBusy(false);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetupStyles(tabNumber) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tif (!tabNumber) {\r\n\t\t\t\t$(\r\n\t\t\t\t\t'#purchaserInformation div[ng-if=\"!clearanceCaptureVm.isLegalEntity\"] span.purchaser-tab:last-child'\r\n\t\t\t\t).removeClass('purchaser-tab-selected');\r\n\t\t\t\t$(\r\n\t\t\t\t\t'#purchaserInformation div[ng-if=\"!clearanceCaptureVm.isLegalEntity\"] span.purchaser-tab:nth-child(2)'\r\n\t\t\t\t).addClass('purchaser-tab-selected');\r\n\t\t\t} else {\r\n\t\t\t\t$(\r\n\t\t\t\t\t'#purchaserInformation div[ng-if=\"!clearanceCaptureVm.isLegalEntity\"] span.purchaser-tab:last-child'\r\n\t\t\t\t).addClass('purchaser-tab-selected');\r\n\t\t\t\t$(\r\n\t\t\t\t\t'#purchaserInformation div[ng-if=\"!clearanceCaptureVm.isLegalEntity\"] span.purchaser-tab:nth-child(2)'\r\n\t\t\t\t).removeClass('purchaser-tab-selected');\r\n\t\t\t}\r\n\t\t}, 350);\r\n\t}\r\n\r\n\tasync getClearanceHeaderInformation(isInit) {\r\n\t\tthis._switchIsBusy(true);\r\n\t\tconst isLegalEntity = this.ClearanceCaptureService.clearanceCapture.IsLegalEntity;\r\n\t\tconst selectedPurchaser = this.selectedPurchaserId\r\n\t\t\t? !isLegalEntity\r\n\t\t\t\t? this.ClearanceCaptureService.clearanceCapture.Purchaser.find(\r\n\t\t\t\t\t(purchaser) => purchaser.Id == this.selectedPurchaserId\r\n\t\t\t\t)\r\n\t\t\t\t: this.ClearanceCaptureService.clearanceCapture.LegalEntity.ContactPerson.find(\r\n\t\t\t\t\t(contactPerson) => contactPerson.Id == this.selectedPurchaserId\r\n\t\t\t\t)\r\n\t\t\t: null;\r\n\r\n\t\tthis.clearPage();\r\n\r\n\t\tconst correlationId = this.LocalStorageService.retrieve('clearanceCorrelationId');\r\n\t\tif (correlationId) {\r\n\t\t\tawait this.ClearanceCaptureService.loadClearanceCaptureByCorrelationId(correlationId);\r\n\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.getBuildingImportantInformation();\r\n\t\t\t\t} catch (error) {\r\n\t\t\t\t\tconsole.error(`Clearance-controller: Error - ${error}`);\r\n\t\t\t\t}\r\n\t\t\t\tthis.populateClearanceHeader();\r\n\t\t\t\tconst is2ndTabSelected = !!selectedPurchaser;\r\n\t\t\t\tif (is2ndTabSelected) {\r\n\t\t\t\t\tthis.populatePurchaserForm(selectedPurchaser.Id);\r\n\t\t\t\t\tthis.setupStyles(2);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.setupStyles();\r\n\t\t\t\t}\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getBuildingImportantInformation() {\r\n\t\tthis._switchIsBusy(true);\r\n\t\ttry {\r\n\t\t\tawait this.ClearanceCaptureService.getSchemeInfo();\r\n\t\t\tawait this.ClearanceCaptureService.getUtilityInfo();\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(err);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusy(false);\r\n\t\t}\r\n\t}\r\n\r\n\tpopulateClearanceHeader() {\r\n\t\tthis.hasClearanceHeaderBeenSaved = false;\r\n\t\tif (!this.ClearanceCaptureService.clearanceCapture) {\r\n\t\t\tthis._switchIsBusy(false);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tthis.clearanceHeader.Id = this.ClearanceCaptureService.clearanceCapture.Id;\r\n\t\tthis.clearanceHeader.selectedPurchaserType =\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.PurchaserStatus > 0\r\n\t\t\t\t? this.ClearanceCaptureService.clearanceCapture.PurchaserStatus.toString()\r\n\t\t\t\t: null;\r\n\r\n\t\tif (this.ClearanceCaptureService.clearanceCapture.PurchaserStatus > 0) {\r\n\t\t\tthis.hasClearanceHeaderBeenSaved = true;\r\n\t\t}\r\n\r\n\t\tthis.clearanceHeader.pretorToHandleRental = this.ClearanceCaptureService.clearanceCapture.PretorToHandleRental;\r\n\t\tthis.clearanceHeader.selectedEntityType = this.ClearanceCaptureService.clearanceCapture.IsLegalEntity\r\n\t\t\t? 'legal-entity'\r\n\t\t\t: 'natural';\r\n\t\tthis.isLegalEntity = this.ClearanceCaptureService.clearanceCapture.IsLegalEntity;\r\n\r\n\t\tif (this.ClearanceCaptureService.clearanceCapture.LegalEntity) {\r\n\t\t\tthis.clearanceHeader.legalEntityId = this.ClearanceCaptureService.clearanceCapture.LegalEntity.Id;\r\n\t\t\tthis.clearanceHeader.name = this.ClearanceCaptureService.clearanceCapture.LegalEntity.Name;\r\n\t\t\tthis.clearanceHeader.addressLineOne = this.ClearanceCaptureService.clearanceCapture.LegalEntity.AddressOne;\r\n\t\t\tthis.clearanceHeader.addressLineTwo = this.ClearanceCaptureService.clearanceCapture.LegalEntity.AddressTwo;\r\n\t\t\tthis.clearanceHeader.addressLineThree = this.ClearanceCaptureService.clearanceCapture.LegalEntity.AddressThree;\r\n\t\t\tthis.clearanceHeader.addressLineFour = this.ClearanceCaptureService.clearanceCapture.LegalEntity.AddressFour;\r\n\t\t\tthis.clearanceHeader.postCode = this.ClearanceCaptureService.clearanceCapture.LegalEntity.PostCode;\r\n\t\t\tthis.clearanceHeader.vatRegNo = this.ClearanceCaptureService.clearanceCapture.LegalEntity.VatRegNumber;\r\n\t\t\tthis.clearanceHeader.selectedLegalEntity =\r\n\t\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.TypeOfLegalEntity > 0\r\n\t\t\t\t\t? this.ClearanceCaptureService.clearanceCapture.LegalEntity.TypeOfLegalEntity.toString()\r\n\t\t\t\t\t: null;\r\n\t\t\tthis.clearanceHeader.registrationNo = this.ClearanceCaptureService.clearanceCapture.LegalEntity.RegistrationNumber;\r\n\r\n\t\t\tif (this.clearanceHeader.name) {\r\n\t\t\t\tthis.hasClearanceHeaderBeenSaved = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.Purchaser &&\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.Purchaser.length > 0\r\n\t\t) {\r\n\t\t\tthis.populatePurchaserForm(this.ClearanceCaptureService.clearanceCapture.Purchaser[0].Id);\r\n\t\t\tif (this.clearanceHeader.name) {\r\n\t\t\t\tthis.hasClearanceHeaderBeenSaved = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.$rootScope.$eval(() => {\r\n\t\t\t\tthis.$timeout(() => {\r\n\t\t\t\t\tEQCSS.apply();\r\n\t\t\t\t}, 120);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconst dateValidUntil = moment(this.ClearanceCaptureService.clearanceCapture.ValidDate).format(\r\n\t\t\t'YYYY-MM'\r\n\t\t);\r\n\r\n\t\tthis.clearanceHeader.dateValidUntil = dateValidUntil;\r\n\t\tif (this.ClearanceCaptureService.clearanceCapture.DateOfRegistration != null) {\r\n\t\t\tconst dateOfRegistration = moment(this.ClearanceCaptureService.clearanceCapture.DateOfRegistration).format(\r\n\t\t\t\t'YYYY-MM-DD'\r\n\t\t\t);\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.DateOfRegistration = dateOfRegistration;\r\n\t\t}\r\n\t\tthis.clearanceHeader.AttorneyRef = this.ClearanceCaptureService.clearanceCapture.AttorneyReference;\r\n\t\tthis.clearanceHeader.SellerBankName= this.ClearanceCaptureService.clearanceCapture.SellerBankName;\r\n\t\tthis.clearanceHeader.SellerBankAccountName= this.ClearanceCaptureService.clearanceCapture.SellerBankAccountName;\r\n\t\tthis.clearanceHeader.SellerBankAccountNumber= parseInt(this.ClearanceCaptureService.clearanceCapture.SellerBankAccountNumber);\r\n\t\tthis.clearanceHeader.SellerBankBranchCode= parseInt(this.ClearanceCaptureService.clearanceCapture.SellerBankBranchCode);\r\n\t\tthis._initializeDatePicker();\r\n\r\n\t\tthis._switchIsBusy(false);\r\n\t\tthis.createMainAttachmentList();\r\n\t\tthis.addMainAttachmentWatch();\r\n\t}\r\n\r\n\tcheckForAtLeastOneContactPerson() {\r\n\t\tconst { IsLegalEntity } = this.ClearanceCaptureService.clearanceCapture;\r\n\t\tif (IsLegalEntity) {\r\n\t\t\tif (\r\n\t\t\t\t!(\r\n\t\t\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity &&\r\n\t\t\t\t\t(this.ClearanceCaptureService.clearanceCapture.LegalEntity.ContactPerson &&\r\n\t\t\t\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.ContactPerson.length > 0)\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else if (\r\n\t\t\t!(\r\n\t\t\t\tthis.ClearanceCaptureService.clearanceCapture.Purchaser &&\r\n\t\t\t\tthis.ClearanceCaptureService.clearanceCapture.Purchaser.length > 0\r\n\t\t\t)\r\n\t\t) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n\r\n\treadyForSubmit() {\r\n\t\tif (!this.purchaserConfirms) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tlet isAtLeastOneContactPerson = this.checkForAtLeastOneContactPerson();\r\n\t\tlet canSubmit = false;\r\n\t\tconst { IsLegalEntity } = this.ClearanceCaptureService.clearanceCapture;\r\n\r\n\t\tlet documentsErrors = {\r\n\t\t\tfirst: [],\r\n\t\t\tsecond: [],\r\n\t\t\theader: []\r\n\t\t};\r\n\r\n\t\tconst areDocumentsValid = [];\r\n\r\n\t\tif (IsLegalEntity) {\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.ContactPerson.forEach((contactPerson, index) => {\r\n\t\t\t\tif (!(contactPerson && contactPerson.ContactPersonAttachment)) {\r\n\t\t\t\t\tif (areDocumentsValid.length === 0) {\r\n\t\t\t\t\t\tareDocumentsValid.push(false);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst hasIdDocument = !!contactPerson.ContactPersonAttachment.find(\r\n\t\t\t\t\t(doc) => doc.ClearanceDocumentType == 1\r\n\t\t\t\t);\r\n\r\n\t\t\t\tif (!hasIdDocument) {\r\n\t\t\t\t\tif (index === 0) {\r\n\t\t\t\t\t\tdocumentsErrors.first = [\r\n\t\t\t\t\t\t\t...documentsErrors.first,\r\n\t\t\t\t\t\t\t`The ${this.displayLabelForPurchaser} ID Document is required.`\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdocumentsErrors.second = [\r\n\t\t\t\t\t\t\t...documentsErrors.second,\r\n\t\t\t\t\t\t\t`The ${this.displayLabelForPurchaser} ID Document is required.`\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tareDocumentsValid.push(hasIdDocument);\r\n\r\n\t\t\t\tconst hasProofOfResidence = !!contactPerson.ContactPersonAttachment.find(\r\n\t\t\t\t\t(doc) => doc.ClearanceDocumentType == 2\r\n\t\t\t\t);\r\n\r\n\t\t\t\tif (!hasProofOfResidence) {\r\n\t\t\t\t\tif (index === 0) {\r\n\t\t\t\t\t\tdocumentsErrors.first = [\r\n\t\t\t\t\t\t\t...documentsErrors.first,\r\n\t\t\t\t\t\t\t`The ${this.displayLabelForPurchaser} Proof Of Residence Document is required.`\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdocumentsErrors.second = [\r\n\t\t\t\t\t\t\t...documentsErrors.second,\r\n\t\t\t\t\t\t\t`The ${this.displayLabelForPurchaser} Proof Of Residence Document is required.`\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tareDocumentsValid.push(hasProofOfResidence);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.Purchaser.forEach((purchaser, index) => {\r\n\t\t\t\tconst hasIdDocument = !!purchaser.PurchaserAttachment.find((doc) => doc.ClearanceDocumentType == 1);\r\n\t\t\t\tconst hasProofOfResidence = !!purchaser.PurchaserAttachment.find(\r\n\t\t\t\t\t(doc) => doc.ClearanceDocumentType == 2\r\n\t\t\t\t);\r\n\r\n\t\t\t\tif (!hasIdDocument) {\r\n\t\t\t\t\tif (index === 0) {\r\n\t\t\t\t\t\tdocumentsErrors.first = [\r\n\t\t\t\t\t\t\t...documentsErrors.first,\r\n\t\t\t\t\t\t\t`The ${this.displayLabelForPurchaser} ID Document is required.`\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdocumentsErrors.second = [\r\n\t\t\t\t\t\t\t...documentsErrors.second,\r\n\t\t\t\t\t\t\t`The ${this.displayLabelForPurchaser} ID Document is required.`\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tareDocumentsValid.push(hasIdDocument);\r\n\r\n\t\t\t\tif (!hasProofOfResidence) {\r\n\t\t\t\t\tif (index === 0) {\r\n\t\t\t\t\t\tdocumentsErrors.first = [\r\n\t\t\t\t\t\t\t...documentsErrors.first,\r\n\t\t\t\t\t\t\t`The ${this.displayLabelForPurchaser} Proof Of Residence Document is required.`\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdocumentsErrors.second = [\r\n\t\t\t\t\t\t\t...documentsErrors.second,\r\n\t\t\t\t\t\t\t`The ${this.displayLabelForPurchaser} Proof Of Residence Document is required.`\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tareDocumentsValid.push(hasProofOfResidence);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tlet hasHoaDocument = true;\r\n\t\tlet hasAcknowledgmentOfRules = false;\r\n\t\tlet hasSellerBankingConfirmation = false;\r\n\r\n\t\tif (this.isHoa) {\r\n\t\t\thasHoaDocument = !!this.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment.find(\r\n\t\t\t\t(doc) => doc.ClearanceDocumentType == 3\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (!hasHoaDocument) {\r\n\t\t\tdocumentsErrors.header = [...documentsErrors.header, `The HOA Form Document is required.`];\r\n\t\t}\r\n\t\tareDocumentsValid.push(hasHoaDocument);\r\n\r\n\t\thasAcknowledgmentOfRules = !!this.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment.find(\r\n\t\t\t(doc) => doc.ClearanceDocumentType == 6\r\n\t\t);\r\n\r\n\t\tif (!hasAcknowledgmentOfRules) {\r\n\t\t\tdocumentsErrors.header = [...documentsErrors.header, `The Acknowledgment of Rules Document is required.`];\r\n\t\t}\r\n\t\tareDocumentsValid.push(hasAcknowledgmentOfRules);\r\n\r\n\t\thasSellerBankingConfirmation = !!this.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment.find(\r\n\t\t\t(doc) => doc.ClearanceDocumentType == 8\r\n\t\t);\r\n\r\n\t\tif (!hasSellerBankingConfirmation) {\r\n\t\t\tdocumentsErrors.header = [...documentsErrors.header, `The Seller Banking Confirmation Document is required.`];\r\n\t\t}\r\n\t\tareDocumentsValid.push(hasSellerBankingConfirmation);\r\n\r\n\t\tlet hasCompanyRegistrationDoc = true;\r\n\r\n\t\tif (this.ClearanceCaptureService.clearanceCapture.IsLegalEntity) {\r\n\t\t\thasCompanyRegistrationDoc = !!this.ClearanceCaptureService.clearanceCapture.LegalEntity.LegalEntityAttachment.find(\r\n\t\t\t\t(att) => att.ClearanceDocumentType == 4 && !att.IsRejected\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (!hasCompanyRegistrationDoc) {\r\n\t\t\tdocumentsErrors.header = [...documentsErrors.header, `The Company Registration Document is required.`];\r\n\t\t}\r\n\t\tareDocumentsValid.push(hasCompanyRegistrationDoc);\r\n\r\n\t\tif (areDocumentsValid.length > 0) {\r\n\t\t\tlet countHowManyAreTrue = areDocumentsValid.filter((obj) => obj == true);\r\n\t\t\tif (areDocumentsValid.length == countHowManyAreTrue.length) {\r\n\t\t\t\tcanSubmit = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.formsErrors = this._getAllFormErrors();\r\n\t\tthis.documentsErrors = documentsErrors;\r\n\r\n\t\tlet allowSubmit = isAtLeastOneContactPerson && canSubmit && this.purchaserConfirms;\r\n\t\tif (allowSubmit) {\r\n\t\t\tallowSubmit = !this.areFormsDirty && !this.hasErrors;\r\n\t\t}\r\n\r\n\t\treturn allowSubmit;\r\n\t}\r\n\r\n\t_areFormsValidAndNotDirty() {\r\n\t\tlet allowSubmit =\r\n\t\t\t!(this.headerForm.$error && Object.keys(this.headerForm.$error).length > 0) &&\r\n\t\t\t!(this.inputForm.$error && Object.keys(this.inputForm.$error).length > 0);\r\n\r\n\t\tif (allowSubmit) {\r\n\t\t\tallowSubmit = !this.inputForm.$dirty && !this.headerForm.$dirty;\r\n\t\t\tif (!allowSubmit) {\r\n\t\t\t\tconst error =\r\n\t\t\t\t\t\"Please ensure that you've saved your changes for the \" +\r\n\t\t\t\t\t(this.inputForm.$dirty\r\n\t\t\t\t\t\t? `${this.isLegalEntity ? this.displayLabelForPurchaser : \"Purchaser's\"}`\r\n\t\t\t\t\t\t: `Purchase`);\r\n\t\t\t\tthis.submitErrorMessage = `${error} Information and try again.`;\r\n\t\t\t} else {\r\n\t\t\t\tthis.submitErrorMessage = '';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn allowSubmit;\r\n\t}\r\n\r\n\t_getAllFormErrors() {\r\n\t\tlet results = [];\r\n\r\n\t\tconst customErrorMessages = {\r\n\t\t\tnumeric: ':attribute must be a number.',\r\n\t\t\trequired: ':attribute is required.',\r\n\t\t\temail: ':attribute is not a valid email address.'\r\n\t\t};\r\n\r\n\t\tconst rules = {\r\n\t\t\tIdNumber: 'required',\r\n\t\t\tLastName: 'required',\r\n\t\t\tFirstName: 'required',\r\n\t\t\tAddressLineOne: 'required',\r\n\t\t\tAddressLineTwo: 'required',\r\n\t\t\tPostCode: 'required|numeric',\r\n\t\t\tEmailAddress: 'required|email',\r\n\t\t\tMaritalStatus: 'required|numeric',\r\n\t\t\tCellPhoneNumber: 'required|numeric'\r\n\t\t};\r\n\r\n\t\tif (!this.isLegalEntity) {\r\n\t\t\tresults = this.purchaserValidation(rules, customErrorMessages);\r\n\t\t} else {\r\n\t\t\tresults = this.contactPersonValidation(rules, customErrorMessages);\r\n\t\t}\r\n\r\n\t\tresults = { ...results, header: this.headerValidation(customErrorMessages) };\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\theaderValidation(customErrorMessages) {\r\n\t\tlet results = [];\r\n\t\tconst name = this.clearanceHeader.name,\r\n\t\t\tpostCode = this.clearanceHeader.postCode,\r\n\t\t\tAttorneyRef = this.clearanceHeader.AttorneyRef,\r\n\t\t\tregistrationNo = this.clearanceHeader.registrationNo,\r\n\t\t\taddressLineOne = this.clearanceHeader.addressLineOne,\r\n\t\t\taddressLineTwo = this.clearanceHeader.addressLineTwo,\r\n\t\t\tdateValidUntil = this.clearanceHeader.dateValidUntil,\r\n\t\t\taddressLineThree = this.clearanceHeader.addressLineThree,\r\n\t\t\tselectedEntityType = this.clearanceHeader.selectedEntityType,\r\n\t\t\tselectedLegalEntity = this.clearanceHeader.selectedLegalEntity,\r\n\t\t\tselectedPurchaserType = this.clearanceHeader.selectedPurchaserType,\r\n\t\t\tSellerBankName = this.clearanceHeader.SellerBankName,\r\n\t\t\tSellerBankAccountName = this.clearanceHeader.SellerBankAccountName,\r\n\t\t\tSellerBankAccountNumber = this.clearanceHeader.SellerBankAccountNumber,\r\n\t\t\tSellerBankBranchCode = this.clearanceHeader.SellerBankBranchCode;\r\n\r\n\t\tconst inputs = {\r\n\t\t\tAttorneyRef,\r\n\t\t\tdateValidUntil,\r\n\t\t\tselectedEntityType,\r\n\t\t\tselectedPurchaserType,\r\n\t\t\tSellerBankName,\r\n\t\t\tSellerBankAccountName,\r\n\t\t\tSellerBankAccountNumber,\r\n\t\t\tSellerBankBranchCode,\r\n\t\t};\r\n\r\n\t\tconst otherInputs = {\r\n\t\t\tname,\r\n\t\t\tpostCode,\r\n\t\t\tregistrationNo,\r\n\t\t\taddressLineOne,\r\n\t\t\taddressLineTwo,\r\n\t\t\taddressLineThree,\r\n\t\t\tselectedLegalEntity\r\n\t\t};\r\n\r\n\t\tconst normalRules = {\r\n\t\t\tAttorneyRef: 'required',\r\n\t\t\tdateValidUntil: 'required',\r\n\t\t\tselectedEntityType: 'required',\r\n\t\t\tselectedPurchaserType: 'required',\t\t\t\r\n\t\t\tSellerBankName: 'required',\r\n\t\t\tSellerBankAccountName: 'required',\r\n\t\t\tSellerBankAccountNumber: 'required|numeric',\r\n\t\t\tSellerBankBranchCode: 'required|numeric'\r\n\t\t};\r\n\r\n\t\tconst legalEntityRules = {\r\n\t\t\tname: 'required',\r\n\t\t\tpostCode: 'required',\r\n\t\t\tAttorneyRef: 'required',\r\n\t\t\taddressLineOne: 'required',\r\n\t\t\tregistrationNo: 'required',\r\n\t\t\taddressLineTwo: 'required',\r\n\t\t\tdateValidUntil: 'required',\r\n\t\t\taddressLineThree: 'required',\r\n\t\t\tselectedLegalEntity: 'required',\r\n\t\t\tselectedPurchaserType: 'required',\r\n\t\t\tSellerBankName: 'required',\r\n\t\t\tSellerBankAccountName: 'required',\r\n\t\t\tSellerBankAccountNumber: 'required|numeric',\r\n\t\t\tSellerBankBranchCode: 'required|numeric'\r\n\t\t};\r\n\r\n\t\tconst displayLabels = {\r\n\t\t\tpostCode: 'Postal Code',\r\n\t\t\tdateValidUntil: 'Valid Until',\r\n\t\t\tname: this.displayLabelForName,\r\n\t\t\taddressLineOne: 'Address Line 1',\r\n\t\t\taddressLineTwo: 'Address Line 2',\r\n\t\t\taddressLineThree: 'Address Line 3',\r\n\t\t\tregistrationNo: 'Registration No.',\r\n\t\t\tAttorneyRef: 'Attorney Reference #',\r\n\t\t\tselectedEntityType: 'Type of Purchase',\r\n\t\t\tselectedPurchaserType: 'Type of Entity',\r\n\t\t\tselectedLegalEntity: 'Type of Legal Entity',\r\n\t\t\tSellerBankName: 'Seller Bank Name',\r\n\t\t\tSellerBankAccountName: 'Seller Bank Account Holder Name',\r\n\t\t\tSellerBankAccountNumber: 'Seller Bank Account Number',\r\n\t\t\tSellerBankBranchCode: 'Seller Bank Branch Code'\r\n\t\t};\r\n\r\n\t\tconst rules =\r\n\t\t\tthis.clearanceHeader.selectedLegalEntity == 1 ||\r\n\t\t\t\tthis.clearanceHeader.selectedLegalEntity == 2 ||\r\n\t\t\t\tthis.clearanceHeader.selectedLegalEntity == 3\r\n\t\t\t\t? legalEntityRules\r\n\t\t\t\t: normalRules;\r\n\r\n\t\tconst fieldsForValidation =\r\n\t\t\tthis.clearanceHeader.selectedLegalEntity &&\r\n\t\t\t\t(this.clearanceHeader.selectedLegalEntity == 1 ||\r\n\t\t\t\t\tthis.clearanceHeader.selectedLegalEntity == 2 ||\r\n\t\t\t\t\tthis.clearanceHeader.selectedLegalEntity == 3)\r\n\t\t\t\t? { ...inputs, ...otherInputs }\r\n\t\t\t\t: inputs;\r\n\r\n\t\tconst validator = new Validator(fieldsForValidation, rules, customErrorMessages);\r\n\t\tvalidator.setAttributeNames(displayLabels);\r\n\r\n\t\tvalidator.passes();\r\n\t\tif (validator.errorCount > 0) {\r\n\t\t\tObject.keys(validator.errors.errors).forEach((name) => {\r\n\t\t\t\tconst error = validator.errors.first(name);\r\n\t\t\t\tresults = [...results, error];\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tpurchaserValidation(rules, customErrorMessages) {\r\n\t\tlet results = {\r\n\t\t\tfirst: [],\r\n\t\t\tsecond: []\r\n\t\t};\r\n\r\n\t\tif (\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.Purchaser &&\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.Purchaser.length > 0\r\n\t\t) {\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.Purchaser.forEach((purchaser, index) => {\r\n\t\t\t\tconst {\r\n\t\t\t\t\tPostCode,\r\n\t\t\t\t\tIdNumber,\r\n\t\t\t\t\tLastName,\r\n\t\t\t\t\tFirstName,\r\n\t\t\t\t\tEmailAddress,\r\n\t\t\t\t\tMaritalStatus,\r\n\t\t\t\t\tAddressLineOne,\r\n\t\t\t\t\tAddressLineTwo,\r\n\t\t\t\t\tCellPhoneNumber,\r\n\t\t\t\t\tOtherMaritalStatus\r\n\t\t\t\t} = purchaser;\r\n\t\t\t\tconst inputs = {\r\n\t\t\t\t\tPostCode,\r\n\t\t\t\t\tIdNumber,\r\n\t\t\t\t\tLastName,\r\n\t\t\t\t\tFirstName,\r\n\t\t\t\t\tEmailAddress,\r\n\t\t\t\t\tMaritalStatus,\r\n\t\t\t\t\tAddressLineOne,\r\n\t\t\t\t\tAddressLineTwo,\r\n\t\t\t\t\tCellPhoneNumber\r\n\t\t\t\t};\r\n\t\t\t\tconst inputsDisplayLabels = {\r\n\t\t\t\t\tPostCode: 'Post Code',\r\n\t\t\t\t\tLastName: 'Last Name',\r\n\t\t\t\t\tFirstName: 'First Name',\r\n\t\t\t\t\tEmailAddress: 'Email Address',\r\n\t\t\t\t\tMaritalStatus: 'Marital Status',\r\n\t\t\t\t\tIdNumber: 'ID Number or Passport',\r\n\t\t\t\t\tOtherMaritalStatus: 'Specify other',\r\n\t\t\t\t\tCellPhoneNumber: 'Cell Phone Number',\r\n\t\t\t\t\tAddressLineTwo: 'Postal Address Line 2',\r\n\t\t\t\t\tAddressLineOne: 'Postal Address Line 1'\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif (MaritalStatus == -1) {\r\n\t\t\t\t\trules.OtherMaritalStatus = 'required';\r\n\t\t\t\t\tinputs.OtherMaritalStatus = OtherMaritalStatus;\r\n\t\t\t\t}\r\n\t\t\t\tconst validator = new Validator(inputs, rules, customErrorMessages);\r\n\t\t\t\tvalidator.setAttributeNames(inputsDisplayLabels);\r\n\t\t\t\tvalidator.passes();\r\n\t\t\t\tif (validator.errorCount > 0) {\r\n\t\t\t\t\tObject.keys(validator.errors.errors).forEach((name) => {\r\n\t\t\t\t\t\tconst error = validator.errors.first(name);\r\n\t\t\t\t\t\tif (index === 0) {\r\n\t\t\t\t\t\t\tresults.first = [...results.first, error];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tresults.second = [...results.second, error];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tresults.first = ['Please add one or more purchaser(s)'];\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tcontactPersonValidation(rules, customErrorMessages) {\r\n\t\tlet results = {\r\n\t\t\tfirst: [],\r\n\t\t\tsecond: []\r\n\t\t};\r\n\r\n\t\tif (\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.ContactPerson &&\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.ContactPerson.length > 0\r\n\t\t) {\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.ContactPerson.forEach((purchaser, index) => {\r\n\t\t\t\tconst {\r\n\t\t\t\t\tPostCode,\r\n\t\t\t\t\tIdNumber,\r\n\t\t\t\t\tLastName,\r\n\t\t\t\t\tFirstName,\r\n\t\t\t\t\tEmailAddress,\r\n\t\t\t\t\tMaritalStatus,\r\n\t\t\t\t\tAddressLineOne,\r\n\t\t\t\t\tAddressLineTwo,\r\n\t\t\t\t\tCellPhoneNumber,\r\n\t\t\t\t\tOtherMaritalStatus\r\n\t\t\t\t} = purchaser;\r\n\t\t\t\tconst inputs = {\r\n\t\t\t\t\tPostCode,\r\n\t\t\t\t\tIdNumber,\r\n\t\t\t\t\tLastName,\r\n\t\t\t\t\tFirstName,\r\n\t\t\t\t\tEmailAddress,\r\n\t\t\t\t\tMaritalStatus,\r\n\t\t\t\t\tAddressLineOne,\r\n\t\t\t\t\tAddressLineTwo,\r\n\t\t\t\t\tCellPhoneNumber\r\n\t\t\t\t};\r\n\t\t\t\tconst inputsDisplayLabels = {\r\n\t\t\t\t\tPostCode: 'Post Code',\r\n\t\t\t\t\tLastName: 'Last Name',\r\n\t\t\t\t\tFirstName: 'First Name',\r\n\t\t\t\t\tEmailAddress: 'Email Address',\r\n\t\t\t\t\tMaritalStatus: 'Marital Status',\r\n\t\t\t\t\tIdNumber: 'ID Number or Passport',\r\n\t\t\t\t\tOtherMaritalStatus: 'Specify other',\r\n\t\t\t\t\tCellPhoneNumber: 'Cell Phone Number',\r\n\t\t\t\t\tAddressLineTwo: 'Postal Address Line 2',\r\n\t\t\t\t\tAddressLineOne: 'Postal Address Line 1'\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif (MaritalStatus == -1) {\r\n\t\t\t\t\trules.OtherMaritalStatus = 'required';\r\n\t\t\t\t\tinputs.OtherMaritalStatus = OtherMaritalStatus;\r\n\t\t\t\t}\r\n\t\t\t\tconst validator = new Validator(inputs, rules, customErrorMessages);\r\n\t\t\t\tvalidator.setAttributeNames(inputsDisplayLabels);\r\n\t\t\t\tvalidator.passes();\r\n\t\t\t\tif (validator.errorCount > 0) {\r\n\t\t\t\t\tObject.keys(validator.errors.errors).forEach((name) => {\r\n\t\t\t\t\t\tconst error = validator.errors.first(name);\r\n\t\t\t\t\t\tif (index === 0) {\r\n\t\t\t\t\t\t\tresults.first = [...results.first, error];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tresults.second = [...results.second, error];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tresults.first = [`Please add one or more ${this.displayLabelForPurchaser.replace(`'s`, '')}(s)`];\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tasync submitClearanceCapture() {\r\n\t\tthis._switchIsBusy(true);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.ClearanceCaptureService.submitClearanceCapture(this.ClearanceCaptureService.clearanceCapture.Id);\r\n\t\t\tthis.clearPage();\r\n\t\t\tthis.getClearanceHeaderInformation();\r\n\t\t\tthis.NotificationService.success('CLEARANCE DETAILS SUBMITTED');\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\t\t\tthis._switchIsBusy(false);\r\n\t\t\tthis.NotificationService.error('CLEARANCE DETAILS COULD NOT BE SUBMITTED');\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusy(false);\r\n\t\t}\r\n\t}\r\n\r\n\taddMainAttachmentWatch() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\t$('input[type=file].mainAttachmentBrowseFile').each((i, el) => $(el).off('change'));\r\n\t\t\t$('input[type=file].mainAttachmentBrowseFile').each((i, el) =>\r\n\t\t\t\t$(el).on('change', (evt) => {\r\n\t\t\t\t\tconst $target = $(evt.target);\r\n\t\t\t\t\tconst container = $target.closest('div[files-drop]');\r\n\t\t\t\t\tconst attrs = container.attr('files-drop').toLowerCase();\r\n\r\n\t\t\t\t\tlet type = 0;\r\n\r\n\t\t\t\t\tif (attrs.includes('hoa membership form')) {\r\n\t\t\t\t\t\ttype = 3;\r\n\t\t\t\t\t} else if (attrs.includes('company registration document')) {\r\n\t\t\t\t\t\ttype = 4;\r\n\t\t\t\t\t} else if (attrs.includes('proof of payment')) {\r\n\t\t\t\t\t\ttype = 5;\r\n\t\t\t\t\t} else if (attrs.includes('acknowledgment of rules')) {\r\n\t\t\t\t\t\ttype = 6;\r\n\t\t\t\t\t} else if (attrs.includes('registration document')) {\r\n\t\t\t\t\t\ttype = 7;\r\n\t\t\t\t\t} else if (attrs.includes('seller banking confirmation')) {\r\n\t\t\t\t\t\ttype = 8;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (type == 0) {\r\n\t\t\t\t\t\tconsole.error('Cant determine doc type. All hell is about to break lose.');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst file = evt.target.files[0];\r\n\r\n\t\t\t\t\tthis.readAndStore(file, type);\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t\t}, 1000);\r\n\t}\r\n\r\n\taddPersonAttachmentWatch() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\t$('input[type=file].purchaserAttachmentBrowseFile').each((i, el) => $(el).off('change'));\r\n\t\t\t$('input[type=file].purchaserAttachmentBrowseFile').each((i, el) =>\r\n\t\t\t\t$(el).on('change', (evt) => {\r\n\t\t\t\t\tconst $target = $(evt.target);\r\n\t\t\t\t\tconst container = $target.closest('div[files-drop]');\r\n\t\t\t\t\tconst attrs = container.attr('files-drop').toLowerCase();\r\n\r\n\t\t\t\t\tconst type = this.documentTypeList.find((docType) =>\r\n\t\t\t\t\t\tattrs.includes(docType.Description.toLowerCase())\r\n\t\t\t\t\t).Value;\r\n\r\n\t\t\t\t\tconst file = evt.target.files[0];\r\n\t\t\t\t\tthis.readAndStore(file, type);\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t\t}, 1000);\r\n\t}\r\n\r\n\thandleDrop(files, type) {\r\n\t\tconsole.log('handleDrop');\r\n\t\tif (!this.disableFileUpload()) {\r\n\t\t\tthis.uploadFile(files[0]);\r\n\t\t}\r\n\t}\r\n\r\n\tpopulatePurchaserForm(id, evt) {\r\n\t\tthis._switchIsPurchaserBusy(true);\r\n\t\tthis.isInAddPurchaserMode = false;\r\n\t\tthis.isInEditPurchaserMode = true;\r\n\t\tthis.selectedPurchaserId = id;\r\n\t\tthis.getPurchaser();\r\n\t}\r\n\r\n\tshowAddPurchaser(evt) {\r\n\t\t$('#purchaserInformation span').removeClass('purchaser-tab-selected');\r\n\t\tif (evt) {\r\n\t\t\t$(evt.target).addClass('purchaser-tab-selected');\r\n\t\t}\r\n\r\n\t\tthis.addPersonAttachmentWatch();\r\n\r\n\t\tthis.documentTypeList = [\r\n\t\t\t{\r\n\t\t\t\tValue: 1,\r\n\t\t\t\tDescription: 'Id Document'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tValue: 2,\r\n\t\t\t\tDescription: 'Proof Of Residence'\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\tthis.isInAddPurchaserMode = true;\r\n\t\tthis.isInEditPurchaserMode = false;\r\n\t\tthis.purchaser = {};\r\n\r\n\t\tconst $purchaserInfo = $('#purchaserInformation');\r\n\r\n\t\t$('html, body').animate({\r\n\t\t\tscrollTop: $purchaserInfo.position().top\r\n\t\t});\r\n\t}\r\n\r\n\tcreatePersonAttachmentList() {\r\n\t\tthis.documentTypeList = [\r\n\t\t\t{\r\n\t\t\t\tValue: 1,\r\n\t\t\t\tDescription: 'Id Document'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tValue: 2,\r\n\t\t\t\tDescription: 'Proof Of Residence'\r\n\t\t\t}\r\n\t\t];\r\n\t\tthis.documentTypeListLoaded = [{}];\r\n\t\tthis.documentType = '0';\r\n\t\tif (this.isLegalEntity) {\r\n\t\t\tif (\r\n\t\t\t\tthis.purchaser &&\r\n\t\t\t\tthis.purchaser.ContactPersonAttachment &&\r\n\t\t\t\tthis.purchaser.ContactPersonAttachment.length > 0\r\n\t\t\t) {\r\n\t\t\t\tthis.purchaser.ContactPersonAttachment.forEach((attachment) => {\r\n\t\t\t\t\tconst docType = {\r\n\t\t\t\t\t\tValue: attachment.ClearanceDocumentType,\r\n\t\t\t\t\t\tDescription: attachment.DocumentTypeDescription\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tthis.documentTypeListLoaded.push(docType);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this.purchaser.PurchaserAttachment && this.purchaser.PurchaserAttachment.length > 0) {\r\n\t\t\t\tthis.purchaser.PurchaserAttachment.forEach((attachment) => {\r\n\t\t\t\t\tconst docType = {\r\n\t\t\t\t\t\tValue: attachment.ClearanceDocumentType,\r\n\t\t\t\t\t\tDescription: attachment.DocumentTypeDescription\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tthis.documentTypeListLoaded.push(docType);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.documentTypeList = _.differenceBy(this.documentTypeList, this.documentTypeListLoaded, 'Value');\r\n\t}\r\n\r\n\tcreateMainAttachmentList() {\r\n\t\t// Create list of all docs\r\n\t\tthis.purchaseDocTypes.push(this.acknowledgementOfRules);\r\n\r\n\t\tif (this.isHoa) {\r\n\t\t\tthis.purchaseDocTypes.push(this.hoaDocument);\r\n\t\t}\r\n\r\n\t\tif (this.isLegalEntity) {\r\n\t\t\tthis.purchaseDocTypes = [\r\n\t\t\t\t{\r\n\t\t\t\t\tValue: 4,\r\n\t\t\t\t\tDescription: 'Company Registration Document'\r\n\t\t\t\t}\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\tthis.headerDocumentsAlreadyUpLoaded = [{}];\r\n\t\tthis.documentType = '0';\r\n\t\tif (\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment &&\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment.length > 0\r\n\t\t) {\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment.forEach((attachment) => {\r\n\t\t\t\tconst docType = {\r\n\t\t\t\t\tValue: attachment.ClearanceDocumentType,\r\n\t\t\t\t\tDescription: attachment.DocumentTypeDescription\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.headerDocumentsAlreadyUpLoaded.push(docType);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity &&\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.LegalEntityAttachment &&\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.LegalEntityAttachment.length > 0\r\n\t\t) {\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.LegalEntityAttachment.forEach((attachment) => {\r\n\t\t\t\tconst docType = {\r\n\t\t\t\t\tValue: attachment.ClearanceDocumentType,\r\n\t\t\t\t\tDescription: attachment.DocumentTypeDescription\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.headerDocumentsAlreadyUpLoaded.push(docType);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.purchaseDocTypes = _.differenceBy(this.purchaseDocTypes, this.headerDocumentsAlreadyUpLoaded, 'Value');\r\n\t}\r\n\r\n\tasync getPurchaser() {\r\n\t\tlet promise;\r\n\r\n\t\tif (this.isLegalEntity) {\r\n\t\t\tawait this.ClearanceCaptureService.getContactPerson(this.selectedPurchaserId);\r\n\t\t\tthis.purchaser = this.ClearanceCaptureService.contactPersonData;\r\n\t\t\tthis.createPersonAttachmentList();\r\n\t\t\tthis.addPersonAttachmentWatch();\r\n\t\t\tthis.addMainAttachmentWatch();\r\n\t\t\tthis._switchIsPurchaserBusy(false);\r\n\t\t} else {\r\n\t\t\tawait this.ClearanceCaptureService.getPurchaser(this.selectedPurchaserId);\r\n\t\t\tthis.purchaser = this.ClearanceCaptureService.purchaserData;\r\n\t\t\tthis.createPersonAttachmentList();\r\n\t\t\tthis.addPersonAttachmentWatch();\r\n\t\t\tthis.addMainAttachmentWatch();\r\n\t\t\tthis._switchIsPurchaserBusy(false);\r\n\t\t}\r\n\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis._switchIsBusy(false);\r\n\t\t\tthis.setCurrentPurchaserTabFocus();\r\n\t\t});\r\n\t}\r\n\r\n\tsetCurrentPurchaserTabFocus() {\r\n\t\tconst $tabSection = $('#purchaserInformation');\r\n\t\t$('span.purchaser-tab', $tabSection).each((i, el) => $(el).removeClass('purchaser-tab-selected'));\r\n\r\n\t\tif (!this.purchaser) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst { Id } = this.purchaser;\r\n\r\n\t\t$(`#${Id}`, $tabSection).addClass('purchaser-tab-selected');\r\n\t}\r\n\r\n\tasync savePurchaser() {\r\n\t\tthis.isInAddPurchaserMode = false;\r\n\r\n\t\tthis._switchIsPurchaserBusy(true);\r\n\t\tif (this.isLegalEntity) {\r\n\t\t\tthis.purchaser.LegalEntityId = this.ClearanceCaptureService.clearanceCapture.LegalEntity.Id;\r\n\t\t\tawait this.ClearanceCaptureService.upsertContactPerson(this.purchaser);\r\n\t\t\tthis.purchaser = this.ClearanceCaptureService.contactPersonData;\r\n\t\t\tthis.selectedPurchaserId = this.purchaser.Id;\r\n\t\t\tthis.attachment.ContactPersonId = this.purchaser.Id;\r\n\t\t\tthis.addAttachment();\r\n\t\t} else {\r\n\t\t\tthis.purchaser.ClearanceHeaderId = this.ClearanceCaptureService.clearanceCapture.Id;\r\n\t\t\tawait this.ClearanceCaptureService.upsertPurchaser(this.purchaser);\r\n\t\t\tthis.purchaser = this.ClearanceCaptureService.purchaserData;\r\n\t\t\tthis.selectedPurchaserId = this.purchaser.Id;\r\n\t\t\tthis.attachment.PurchaserId = this.purchaser.Id;\r\n\t\t\tthis.addAttachment();\r\n\t\t}\r\n\r\n\t\tthis.submitErrorMessage = '';\r\n\t\tthis.inputForm.$setPristine();\r\n\r\n\t\tthis.isInEditPurchaserMode = true;\r\n\t}\r\n\r\n\tasync deletePurchaser() {\r\n\t\tthis.hideModal('deletePurchaserNag');\r\n\t\tthis._switchIsPurchaserBusy(true);\r\n\t\tif (this.isLegalEntity) {\r\n\t\t\tawait this.ClearanceCaptureService.deleteContactPerson(this.purchaser.Id);\r\n\t\t\tthis.getClearanceHeaderInformation();\r\n\t\t\tthis.clearPage();\r\n\t\t\tthis._switchIsPurchaserBusy(false);\r\n\t\t} else {\r\n\t\t\tawait this.ClearanceCaptureService.deletePurchaser(this.purchaser.Id);\r\n\t\t\tthis.getClearanceHeaderInformation();\r\n\t\t\tthis.clearPage();\r\n\t\t\tthis._switchIsPurchaserBusy(false);\r\n\t\t}\r\n\t}\r\n\r\n\tselectFile(id) {\r\n\t\tconst file = $('input[type=file]#' + id)[0].files[0];\r\n\t\tthis.uploadFile(file);\r\n\t}\r\n\r\n\tuploadFile(file) {\r\n\t\tif (file) {\r\n\t\t\tthis.readAndStore(file);\r\n\t\t} else {\r\n\t\t\tconsole.error('No file And/Or purchaser', this.purchaser);\r\n\t\t}\r\n\r\n\t\t$('input[type=file]').each((i, el) => $(el).val(''));\r\n\t}\r\n\r\n\treadAndStore(file, type) {\r\n\t\tif (file.type !== 'application/pdf') {\r\n\t\t\tconst errorMsg = 'Wrong file type, only PDFs are allowed.';\r\n\t\t\tthis.NotificationService.error(errorMsg);\r\n\r\n\t\t\tconsole.error(\r\n\t\t\t\t`${errorMsg} \"${file.name}\" is not in the correct format for ${type} - only PDFs are allowed.`\r\n\t\t\t);\r\n\r\n\t\t\tangular.element('[type=file]').each((i, el) => {\r\n\t\t\t\tangular.element(el).off('change');\r\n\t\t\t\tangular.element(el).val(null);\r\n\t\t\t});\r\n\r\n\t\t\tthis.addMainAttachmentWatch();\r\n\t\t\tthis.addPersonAttachmentWatch();\t\t\r\n\t\t}\r\n\t\telse if (file.name.length > 50) {\r\n\t\t\tconst errorMsg = 'Filename too long. Please shorten your filename to less than 50 characters.';\r\n\t\t\tthis.NotificationService.error(errorMsg);\r\n\r\n\t\t\tconsole.error(\r\n\t\t\t\t`Filename too long. Please shorten your filename to less than 50 characters.`\r\n\t\t\t);\r\n\r\n\t\t\tangular.element('[type=file]').each((i, el) => {\r\n\t\t\t\tangular.element(el).off('change');\r\n\t\t\t\tangular.element(el).val(null);\r\n\t\t\t});\r\n\r\n\t\t\tthis.addMainAttachmentWatch();\r\n\t\t\tthis.addPersonAttachmentWatch();\r\n\t\t}\r\n\t\telse if (file.size > 5242880) {\r\n\t\t\tconst errorMsg = 'File size too large. Please reduce the size of your file to smaller than 5 mega bytes.';\r\n\t\t\tthis.NotificationService.error(errorMsg);\r\n\r\n\t\t\tconsole.error(\r\n\t\t\t\t`File size too large. Please reduce the size of your file to smaller than 5 mega bytes.`\r\n\t\t\t);\r\n\r\n\t\t\tangular.element('[type=file]').each((i, el) => {\r\n\t\t\t\tangular.element(el).off('change');\r\n\t\t\t\tangular.element(el).val(null);\r\n\t\t\t});\r\n\r\n\t\t\tthis.addMainAttachmentWatch();\r\n\t\t\tthis.addPersonAttachmentWatch();\r\n\t\t} \r\n\t\telse {\r\n\t\t\tconst reader = new FileReader();\r\n\t\t\treader.onload = () => {\r\n\t\t\t\tconst description = file.name.replace(file.name.substr(file.name.lastIndexOf('.')), '');\r\n\t\t\t\tconst isHeader =\r\n\t\t\t\t\t(this.purchaseDocumentType == 3 ||\r\n\t\t\t\t\t\tthis.purchaseDocumentType == 5 ||\r\n\t\t\t\t\t\tthis.purchaseDocumentType == 6) &&\r\n\t\t\t\t\tthis.documentType == 0;\r\n\t\t\t\tconst docType = type || parseInt(isHeader ? this.purchaseDocumentType : this.documentType);\r\n\r\n\t\t\t\tthis.attachment = {\r\n\t\t\t\t\tFileName: description,\r\n\t\t\t\t\tClearanceDocumentType: docType,\r\n\t\t\t\t\tBlob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif (docType == 1 || docType == 2) {\r\n\t\t\t\t\tthis.savePurchaser();\r\n\t\t\t\t} else if (docType == 4) {\r\n\t\t\t\t\tthis.attachment.LegalEntityId = this.clearanceHeader.legalEntityId;\r\n\t\t\t\t\tthis.saveClearanceHeader();\r\n\t\t\t\t} else if (docType == 3 || docType == 5 || docType == 6 || docType == 8) {\r\n\t\t\t\t\tthis.attachment.ClearanceHeaderId = this.clearanceHeader.Id;\r\n\t\t\t\t\tthis.saveClearanceHeader();\r\n\t\t\t\t} else if (docType == 7) {\r\n\t\t\t\t\tthis.attachment.ClearanceHeaderId = this.clearanceHeader.Id;\r\n\t\t\t\t\tthis.saveClearanceRegHeaderAttachment();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconsole.error('No valid docType');\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\treader.readAsArrayBuffer(file);\r\n\t\t}\r\n\t}\r\n\r\n\tasync addAttachment() {\r\n\t\tif (this.attachment && this.attachment.Blob != undefined) {\r\n\t\t\tconst docType = this.attachment.ClearanceDocumentType;\r\n\t\t\tawait this.ClearanceCaptureService.addAttachment(this.attachment, docType, this.isLegalEntity);\r\n\t\t\tif (docType == 1 || docType == 2) {\r\n\t\t\t\tthis.getPurchaser();\r\n\t\t\t} else if (docType == 3 || docType == 4 || docType == 5 || docType == 6 || docType == 7 || docType == 8) {\r\n\t\t\t\tthis.getClearanceHeaderInformation();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.getClearanceHeaderInformation();\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteAttachmentNag(attachment) {\r\n\t\tthis.selectedAttachment = attachment;\r\n\t}\r\n\r\n\tasync deleteAttachment() {\r\n\t\tthis.hideModal();\r\n\t\tthis._switchIsBusy(true);\r\n\t\tconst docType = this.selectedAttachment.ClearanceDocumentType;\r\n\t\tconst isLegalEntity =\r\n\t\t\tthis.entityTypes.find((type) => {\r\n\t\t\t\tif (type.value.toString() === this.clearanceHeader.selectedEntityType) {\r\n\t\t\t\t\treturn type;\r\n\t\t\t\t}\r\n\t\t\t}).value === 'legal-entity'\r\n\t\t\t\t? true\r\n\t\t\t\t: false;\r\n\r\n\t\tawait this.ClearanceCaptureService.deleteAttachment(this.selectedAttachment, isLegalEntity);\r\n\t\tif (docType == 3 || docType == 4 || docType == 5 || docType == 6 || docType == 7 || docType == 8) {\r\n\t\t\tthis.getClearanceHeaderInformation();\r\n\t\t} else if (docType == 1 || docType == 2) {\r\n\t\t\tthis.getPurchaser();\r\n\t\t}\r\n\t}\r\n\r\n\thideModal(modal = 'deleteAttachmentNag') {\r\n\t\tconst $modal = $(`#${modal}`);\r\n\t\t$modal.on('hide.bs.modal', () => {\r\n\t\t\t$('div.modal-backdrop.fade.in').each((i, el) => {\r\n\t\t\t\tconst $el = $(el);\r\n\t\t\t\tconst id = $el.attr('id');\r\n\r\n\t\t\t\tif (!id) {\r\n\t\t\t\t\t$el.remove();\r\n\t\t\t\t\t$('body').attr('style', `overflow-y:visible !important`);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t$modal.modal('hide');\r\n\t}\r\n\r\n\tgetMarriageStatus(status) {\r\n\t\tif (status === 1) return 'Single';\r\n\t\tif (status === 2) return 'Married';\r\n\t\tif (status === 3) return 'Divorced';\r\n\t\tif (status === 4) return 'Widowed';\r\n\t\treturn 'Unknown';\r\n\t}\r\n\r\n\tformatTextWithNewLine(text, noNewLine) {\r\n\t\tif (text.length > 0) {\r\n\t\t\tif (noNewLine) {\r\n\t\t\t\treturn `${text}`;\r\n\t\t\t}\r\n\r\n\t\t\treturn `${text}\\r\\n`;\r\n\t\t}\r\n\r\n\t\treturn '';\r\n\t}\r\n\r\n\tclearPage() {\r\n\t\tthis._switchIsPurchaserBusy(false);\r\n\t\tthis.isInAddPurchaserMode = false;\r\n\t\tthis.isInEditPurchaserMode = false;\r\n\t\tthis.hasSelectedPurchaser = false;\r\n\t\tthis.selectedPurchaserId = '';\r\n\t\tthis.selectedPurchaser = '';\r\n\t\tthis.validPurchaser = false;\r\n\t\tthis.purchaserConfirms = false;\r\n\t\tthis.documentType = '0';\r\n\t\tthis.selectedAttachment = {};\r\n\t\tthis.documentTypeList = [\r\n\t\t\t{\r\n\t\t\t\tValue: 1,\r\n\t\t\t\tDescription: 'Id Document'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tValue: 2,\r\n\t\t\t\tDescription: 'Proof Of Residence'\r\n\t\t\t}\r\n\t\t];\r\n\t\tthis.documentTypeListLoaded = [{}];\r\n\r\n\t\tthis.defineDefaultPurchaser();\r\n\r\n\t\t$('#purchaserAttachmentBrowseFile').val('');\r\n\t\t$('#mainAttachmentBrowseFile').val('');\r\n\t}\r\n\r\n\tdefineDefaultPurchaser() {\r\n\t\tthis.purchaser = {\r\n\t\t\tId: '',\r\n\t\t\tLastName: '',\r\n\t\t\tIdNumber: '',\r\n\t\t\tPostCode: '',\r\n\t\t\tFirstName: '',\r\n\t\t\tAddressOne: '',\r\n\t\t\tAddressTwo: '',\r\n\t\t\tAddressFour: '',\r\n\t\t\tEmailAddress: '',\r\n\t\t\tAddressThree: '',\r\n\t\t\tContactNumber: '',\r\n\t\t\tClearanceAttachment: {},\r\n\t\t\tMaritalStatus: undefined\r\n\t\t};\r\n\t\tthis.clearanceHeader = {\r\n\t\t\tpostCode: null,\r\n\t\t\tvatRegNo: null,\r\n\t\t\tattachments: [],\r\n\t\t\taddressLineTwo: '',\r\n\t\t\taddressLineOne: '',\r\n\t\t\taddressLineFour: '',\r\n\t\t\taddressLineThree: '',\r\n\t\t\tregistrationNo: null,\r\n\t\t\tdateValidUntil: null,\r\n\t\t\tselectedEntityType: null,\r\n\t\t\tselectedLegalEntity: null,\r\n\t\t\tpretorToHandleRental: true,\r\n\t\t\tselectedPurchaserType: null,\r\n\t\t\tdateOfRegistration: null,\r\n\t\t\tSellerBankName: '',\r\n\t\t\tSellerBankAccountName: '',\r\n\t\t\tSellerBankAccountNumber: '',\r\n\t\t\tSellerBankBranchCode: ''\r\n\t\t};\r\n\t}\r\n\r\n\tdisableFileUpload() {\r\n\t\treturn !(this.documentType != 0 && (this.inputForm && this.inputForm.$valid));\r\n\t}\r\n\r\n\tallowUploadPurchaserDocument(type) {\r\n\t\tif (!type) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (this.isPurchaserBusy) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst purchaseDocTypes = [\r\n\t\t\t{\r\n\t\t\t\tValue: 1,\r\n\t\t\t\tDescription: 'Id Document'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tValue: 2,\r\n\t\t\t\tDescription: 'Proof Of Residence'\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\tconst docType = purchaseDocTypes.find((dt) => dt.Description.toLowerCase() === type.toLowerCase()).Value;\r\n\r\n\t\tlet hasDoc;\r\n\r\n\t\tif (!this.ClearanceCaptureService.clearanceCapture.IsLegalEntity) {\r\n\t\t\thasDoc = !!(this.purchaser && this.purchaser.PurchaserAttachment\r\n\t\t\t\t? this.purchaser.PurchaserAttachment.find((doc) => doc.ClearanceDocumentType == docType)\r\n\t\t\t\t: null);\r\n\t\t} else {\r\n\t\t\thasDoc = !!(this.purchaser && this.purchaser.ContactPersonAttachment\r\n\t\t\t\t? this.purchaser.ContactPersonAttachment.find((doc) => doc.ClearanceDocumentType == docType)\r\n\t\t\t\t: null);\r\n\t\t}\r\n\r\n\t\treturn !hasDoc;\r\n\t}\r\n\r\n\tallowUploadHeaderDocument(type) {\r\n\t\tif (!type) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst headerTypes = [\r\n\t\t\t{\r\n\t\t\t\tValue: 3,\r\n\t\t\t\tDescription: 'Hoa Membership Form'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tValue: 4,\r\n\t\t\t\tDescription: 'Company Registration Document'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tValue: 5,\r\n\t\t\t\tDescription: 'Proof Of Payment'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tValue: 6,\r\n\t\t\t\tDescription: 'Acknowledgment Of Rules'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tValue: 7,\r\n\t\t\t\tDescription: 'Registration Document'\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tValue: 8,\r\n\t\t\t\tDescription: 'Seller Banking Confirmation'\r\n\t\t\t}\r\n\r\n\t\t];\r\n\r\n\t\tconst docType = headerTypes.find((dt) => dt.Description.toLowerCase() === type.toLowerCase()).Value;\r\n\r\n\t\tif (docType === 4) {\r\n\t\t\tif (\r\n\t\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity &&\r\n\t\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.LegalEntityAttachment &&\r\n\t\t\t\t(this.ClearanceCaptureService.clearanceCapture.LegalEntity &&\r\n\t\t\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.LegalEntityAttachment.length > 0)\r\n\t\t\t) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet isDocumentUploaded =\r\n\t\t\t\tthis.ClearanceCaptureService.clearanceCapture &&\r\n\t\t\t\t\tthis.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment &&\r\n\t\t\t\t\tthis.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment.length > 0\r\n\t\t\t\t\t? this.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment.filter(\r\n\t\t\t\t\t\t(dt) => dt.ClearanceDocumentType == docType\r\n\t\t\t\t\t)\r\n\t\t\t\t\t: [];\r\n\t\t\tif (isDocumentUploaded && isDocumentUploaded.length > 0) {\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcanUploadDocumentsNew() {\r\n\t\tconst allow = this.purchaseDocumentType != '0' && (this.headerForm && this.headerForm.$valid);\r\n\r\n\t\treturn allow;\r\n\t}\r\n\r\n\tasync showRules(schemeReference) {\r\n\t\tawait this.ClearanceCaptureService.getConductRulesOrMemoForScheme(schemeReference);\r\n\t}\r\n\r\n\tget isHoa() {\r\n\t\treturn this.ClearanceCaptureService.clearanceCapture.IsHOA;\r\n\t}\r\n\r\n\tget isRegistrationSubmitted() {\r\n\t\tlet returnVal = false;\r\n\r\n\t\tif (this.ClearanceCaptureService.clearanceCapture) {\r\n\t\t\tif (this.ClearanceCaptureService.clearanceCapture.IsRegistrationSubmitted) {\r\n\t\t\t\treturnVal = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturnVal = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn returnVal;\r\n\t}\r\n\r\n\tget isSubmitted() {\r\n\t\tlet returnVal = false;\r\n\r\n\t\tif (this.ClearanceCaptureService.clearanceCapture) {\r\n\t\t\tif (this.ClearanceCaptureService.clearanceCapture.IsSubmitted) {\r\n\t\t\t\treturnVal = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturnVal = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn returnVal;\r\n\t}\r\n\r\n\tget generateRules() {\r\n\t\tconst {\r\n\t\t\tSchemeName,\r\n\t\t\tHOASchemeName,\r\n\t\t\tSchemeReference,\r\n\t\t\tHOASchemeReference\r\n\t\t} = this.ClearanceCaptureService.clearanceCapture;\r\n\r\n\t\tconst schemeRules = `${SchemeName}`;\r\n\t\tconst hoaRules = `${HOASchemeName}`;\r\n\r\n\t\tlet rules;\r\n\t\tif (SchemeReference && HOASchemeReference) {\r\n\t\t\trules = `${schemeRules} as well as ${hoaRules}`;\r\n\t\t} else if (SchemeReference) {\r\n\t\t\trules = schemeRules;\r\n\t\t} else {\r\n\t\t\trules = hoaRules;\r\n\t\t}\r\n\t\treturn rules;\r\n\t}\r\n\tget requiredDocuments() {\r\n\t\tconst docs = this.documentTypeList.filter((dt) => dt.Value != 3);\r\n\t\treturn _.map(docs, 'Description');\r\n\t}\r\n\r\n\tget requiredHeaderDocuments() {\r\n\t\tlet docRequiredForHeader = [this.hoaDocument, this.acknowledgementOfRules, this.companyRegistrationDocument];\r\n\r\n\t\tif (!this.isLegalEntity) {\r\n\t\t\tdocRequiredForHeader = docRequiredForHeader.filter((dt) => dt.Value != 4);\r\n\t\t}\r\n\r\n\t\tif (!this.isHoa) {\r\n\t\t\tdocRequiredForHeader = docRequiredForHeader.filter((dt) => dt.Value != 3);\r\n\t\t}\r\n\r\n\t\tthis.headerDocumentsAlreadyUpLoaded = [{}];\r\n\t\tthis.documentType = '0';\r\n\t\tif (\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment &&\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment.length > 0\r\n\t\t) {\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.ClearanceHeaderAttachment.forEach((attachment) => {\r\n\t\t\t\tconst docType = {\r\n\t\t\t\t\tValue: attachment.ClearanceDocumentType,\r\n\t\t\t\t\tDescription: attachment.DocumentTypeDescription\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.headerDocumentsAlreadyUpLoaded.push(docType);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity &&\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.LegalEntityAttachment &&\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.LegalEntityAttachment.length > 0\r\n\t\t) {\r\n\t\t\tthis.ClearanceCaptureService.clearanceCapture.LegalEntity.LegalEntityAttachment.forEach((attachment) => {\r\n\t\t\t\tconst docType = {\r\n\t\t\t\t\tValue: attachment.ClearanceDocumentType,\r\n\t\t\t\t\tDescription: attachment.DocumentTypeDescription\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.headerDocumentsAlreadyUpLoaded.push(docType);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tlet docs = _.differenceBy(docRequiredForHeader, this.headerDocumentsAlreadyUpLoaded, 'Value');\r\n\t\treturn _.map(docs, 'Description');\r\n\t}\r\n\r\n\tget displayLabelForPurchaser() {\r\n\t\tlet label = `Purchaser's`;\r\n\t\tif (this.clearanceHeader.selectedLegalEntity == '1') {\r\n\t\t\tlabel = \"Member's\";\r\n\t\t} else if (this.clearanceHeader.selectedLegalEntity == '2') {\r\n\t\t\tlabel = \"Contact Person's\";\r\n\t\t} else if (this.clearanceHeader.selectedLegalEntity == '3') {\r\n\t\t\tlabel = \"Director's\";\r\n\t\t}\r\n\r\n\t\treturn label;\r\n\t}\r\n\r\n\tget displayLabelForName() {\r\n\t\tlet label = '';\r\n\t\tif (this.clearanceHeader.selectedLegalEntity == '1') {\r\n\t\t\tlabel = 'Close Corporation';\r\n\t\t} else if (this.clearanceHeader.selectedLegalEntity == '2') {\r\n\t\t\tlabel = 'Trust';\r\n\t\t} else if (this.clearanceHeader.selectedLegalEntity == '3') {\r\n\t\t\tlabel = 'Company';\r\n\t\t}\r\n\r\n\t\treturn `${label || 'Company'} Name`;\r\n\t}\r\n\r\n\tget hasErrors() {\r\n\t\tconst hasFormsErrors =\r\n\t\t\tthis.formsErrors &&\r\n\t\t\tthis.formsErrors.first.length === 0 &&\r\n\t\t\tthis.formsErrors.second.length === 0 &&\r\n\t\t\tthis.formsErrors.header.length === 0;\r\n\r\n\t\tconst hasDocumentsErrors =\r\n\t\t\tthis.documentsErrors &&\r\n\t\t\tthis.documentsErrors.first.length === 0 &&\r\n\t\t\tthis.documentsErrors.second.length === 0 &&\r\n\t\t\tthis.documentsErrors.header.length === 0;\r\n\r\n\t\tconst foundErrors = hasFormsErrors && hasDocumentsErrors;\r\n\t\treturn !foundErrors;\r\n\t}\r\n\r\n\tget areFormsDirty() {\r\n\t\treturn this.inputForm.$dirty || this.headerForm.$dirty;\r\n\t}\r\n\r\n\t_updateDatePicker() {\r\n\t\tthis.$rootScope.$eval(() => {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tconst selector = '.date-picker';\r\n\t\t\t\tconst $input = $(selector);\r\n\r\n\t\t\t\t$input.datepicker('update');\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\t_initializeDatePicker() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tconst selector = '.date-picker';\r\n\t\t\tconst $purchasorInput = $(selector, $('#purchaseInformationForm'));\r\n\r\n\t\t\tlet dateNow = new Date();\r\n\t\t\tlet minimumDate = moment(dateNow).startOf('month').add(2, 'M').toDate();\r\n\t\t\tif (dateNow.getDay() > 15) {\r\n\t\t\t\tminimumDate = moment(minimumDate).add(1, 'M').toDate();\r\n\t\t\t}\r\n\r\n\t\t\tconst startDate = moment(minimumDate).toDate();\r\n\t\t\tconst endDate = '+20y';\r\n\r\n\t\t\tconst purchasorInputOptions = {\r\n\t\t\t\tstartDate,\r\n\t\t\t\tendDate,\r\n\t\t\t\tautoclose: true,\r\n\t\t\t\tforceParse: true,\r\n\t\t\t\tcontainer: selector,\r\n\t\t\t\tformat: \"yyyy-mm\",\r\n\t\t\t\tstartView: \"months\",\r\n\t\t\t\tminViewMode: \"months\",\r\n\t\t\t\tassumeNearbyYear: true,\r\n\t\t\t\tenableOnReadonly: true,\t\t\t\t\r\n\t\t\t};\r\n\r\n\t\t\t$purchasorInput.datepicker(purchasorInputOptions);\r\n\r\n\t\t\tconst selector1 = '#date-picker-reg';\r\n\t\t\tconst $regInput = $(selector1, $('#uploadRegistrationForm'));\r\n\r\n\t\t\tconst regInputOptions = {\r\n\t\t\t\tautoclose: true,\r\n\t\t\t\tforceParse: true,\r\n\t\t\t\tcontainer: selector1,\r\n\t\t\t\tformat: 'yyyy-mm-dd',\r\n\t\t\t\tassumeNearbyYear: true,\r\n\t\t\t\tenableOnReadonly: true\r\n\t\t\t};\r\n\r\n\t\t\t$regInput.datepicker(regInputOptions);\r\n\t\t});\r\n\t}\r\n\r\n\t_switchIsBusy(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isBusy = flag;\r\n\t\t});\r\n\t}\r\n\r\n\t_switchIsPurchaserBusy(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isPurchaserBusy = flag;\r\n\t\t});\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass ClearanceCaptureService {\r\n\tconstructor($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.utilities = [];\r\n\t\tthis.schemeInformation = null;\r\n\t\tthis.purchaserData = {};\r\n\t\tthis.isSubmitted = false;\r\n\t\tthis.maritalStatuses = [];\r\n\t\tthis.clearanceCapture = {};\r\n\t\tthis.contactPersonData = {};\r\n\t\tthis.bankNames = '';\r\n\t}\r\n\r\n\tasync loadClearanceCaptureByCorrelationId(correlationId) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!correlationId) {\r\n\t\t\t\tthrow new Error('Correlation Id must be supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetClearance');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetClearance');\r\n\t\t\t}\r\n\t\t\turl = `${url}?correlationId=${correlationId}`;\r\n\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.clearanceCapture = this._map(data);\r\n\t\t\tconst { IsSubmitted } = data || {\r\n\t\t\t\tIsSubmitted: false\r\n\t\t\t};\r\n\r\n\t\t\tthis.isSubmitted = IsSubmitted;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while fetching clearance data`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.clearanceCapture = {};\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getPurchaser(purchaserId) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!purchaserId) {\r\n\t\t\t\tthrow new Error('No purchaserId.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetPurchaser');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetPurchaser');\r\n\t\t\t}\r\n\r\n\t\t\turl = `${url}?purchaserId=${purchaserId}`;\r\n\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tlet { data } = results;\r\n\r\n\t\t\tconst dataToBeMapped = {\r\n\t\t\t\tPurchaser: [data]\r\n\t\t\t};\r\n\r\n\t\t\tdata = this._mapRejectedPurchasersDocuments(dataToBeMapped).Purchaser[0];\r\n\t\t\tthis._updatePurchaser(data);\r\n\r\n\t\t\tif (data.MaritalStatus == 0) {\r\n\t\t\t\tdata.MaritalStatus = undefined;\r\n\t\t\t}\r\n\r\n\t\t\tthis.purchaserData = data;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.purchaserData = {};\r\n\t\t\tconst msg = `Error while getting purchaser: ${err}`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(msg));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getContactPerson(contactPersonId) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!contactPersonId) {\r\n\t\t\t\tthrow new Error('No contactPersonId.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetContactPerson');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetContactPerson');\r\n\t\t\t}\r\n\r\n\t\t\turl = `${url}?contactPersonId=${contactPersonId}`;\r\n\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tlet { data } = results;\r\n\r\n\t\t\tif (data) {\r\n\t\t\t\tconst LegalEntity = {\r\n\t\t\t\t\tContactPerson: [data]\r\n\t\t\t\t};\r\n\r\n\t\t\t\tdata = this._mapRejectedContactPersonDocuments({\r\n\t\t\t\t\tLegalEntity\r\n\t\t\t\t}).LegalEntity.ContactPerson[0];\r\n\r\n\t\t\t\tthis._updateContactPerson(data);\r\n\r\n\t\t\t\tif (data.MaritalStatus == 0) {\r\n\t\t\t\t\tdata.MaritalStatus = undefined;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.contactPersonData = data;\r\n\t\t\t}\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.contactPersonData = {};\r\n\t\t\tconst msg = `Error while getting purchaser`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getUtilityInfo() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst schemeReference = this.clearanceCapture.SchemeReference;\r\n\t\t\tif (!schemeReference) {\r\n\t\t\t\tthrow 'no scheme reference supplied';\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetImportantBuildingInfo');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t}\r\n\t\t\tif (!url) {\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetImportantBuildingInfo');\r\n\t\t\t}\r\n\t\t\tconst results = await this.$http.get(`${url}/${schemeReference}`);\r\n\r\n\t\t\tconst { Data, WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.utilities = Data;\r\n\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(Data));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Could not load Utility Information for Card Code: ${schemeReference}`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getSchemeInfo() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tconst schemeReference = this.clearanceCapture.SchemeReference;\r\n\t\t\tif (!schemeReference) {\r\n\t\t\t\tthrow 'no scheme reference supplied';\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetSchemeInfo');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetSchemeInfo');\r\n\t\t\t}\r\n\t\t\tconst results = await this.$http.get(`${url}/${schemeReference}`);\r\n\r\n\t\t\tconst { Data, WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.schemeInformation = Data;\r\n\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(Data));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Error Loading Scheme Information for ${schemeReference}`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync uploadPurchaseDocs(attachment, isLegalEntityDoc) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!attachment) {\r\n\t\t\t\tthrow new Error('no attachment');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = isLegalEntityDoc\r\n\t\t\t\t? await this.InternalLinksService.getLink('AddPurchaseAttachment')\r\n\t\t\t\t: await this.InternalLinksService.getLink('SaveClearanceHeaderDoc');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = isLegalEntityDoc\r\n\t\t\t\t\t? await this.InternalLinksService.getLink('AddPurchaseAttachment')\r\n\t\t\t\t\t: await this.InternalLinksService.getLink('SaveClearanceHeaderDoc');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, attachment);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while Adding Attachment`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync saveClearanceHeader(payload) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tif (!payload) {\r\n\t\t\t\tthrow new Error('no attachment');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('SaveClearanceHeader');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('SaveClearanceHeader');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, payload);\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (error) {\r\n\t\t\tconst msg = `Error while saving Clearance Header.`;\r\n\t\t\tconsole.error(msg, error);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync saveClearanceRegHeaderAttachment(dateOfRegistration, attachment) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tif (!attachment) {\r\n\t\t\t\tthrow new Error('no attachment');\r\n\t\t\t}\r\n\t\t\tif (!dateOfRegistration) {\r\n\t\t\t\tthrow new Error('no Date of Registration');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('SubmitRegistrationClearanceHeaderAttachment');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('SubmitRegistrationClearanceHeaderAttachment');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, { dateOfRegistration, attachment });\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (error) {\r\n\t\t\tconst msg = `Error while saving Registration Clearance Header.`;\r\n\t\t\tconsole.error(msg, error);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync saveLegalEntity(payload) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!payload) {\r\n\t\t\t\tthrow new Error('no attachment');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = this.InternalLinksService.getLink('SaveLegalEntity');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('SaveLegalEntity');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{clearanceHeaderId}', payload.ClearanceHeaderId);\r\n\r\n\t\t\tconst results = await this.$http.post(url, payload);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while Adding Attachment`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync upsertContactPerson(contactPerson) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tif (!contactPerson) {\r\n\t\t\t\tthrow new Error('Contact person must be supplied.');\r\n\t\t\t}\r\n\t\t\tlet url = await this.InternalLinksService.getLink('UpsertContactPerson');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('UpsertContactPerson');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, contactPerson);\r\n\t\t\tlet { data } = results;\r\n\r\n\t\t\tif (data) {\r\n\t\t\t\tconst LegalEntity = {\r\n\t\t\t\t\tContactPerson: [data]\r\n\t\t\t\t};\r\n\r\n\t\t\t\tdata = this._mapRejectedContactPersonDocuments({\r\n\t\t\t\t\tLegalEntity\r\n\t\t\t\t}).LegalEntity.ContactPerson[0];\r\n\r\n\t\t\t\tthis._updateContactPerson(data);\r\n\t\t\t\tthis.contactPersonData = data;\r\n\t\t\t}\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while saving contact person`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync upsertPurchaser(purchaser) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!purchaser) {\r\n\t\t\t\tthrow new Error('Purchaser must be supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('UpsertPurchaser');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('UpsertPurchaser');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, purchaser);\r\n\t\t\tlet { data } = results;\r\n\r\n\t\t\tconst dataToBeMapped = {\r\n\t\t\t\tPurchaser: [data]\r\n\t\t\t};\r\n\r\n\t\t\tdata = this._mapRejectedPurchasersDocuments(dataToBeMapped).Purchaser[0];\r\n\r\n\t\t\tthis._updatePurchaser(data);\r\n\t\t\tthis.purchaserData = data;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while saving purchaser`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync deletePurchaser(purchaserId) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!purchaserId) {\r\n\t\t\t\tthrow new Error('no purchaser id.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('DeletePurchaser');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('DeletePurchaser');\r\n\t\t\t}\r\n\r\n\t\t\turl += `?purchaserId=${purchaserId}`;\r\n\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tif (data) {\r\n\t\t\t\tthis._mapDeletedPurchaser(purchaserId);\r\n\t\t\t}\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while deleting Purchaser`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync deleteContactPerson(contactPersonId) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!contactPersonId) {\r\n\t\t\t\tthrow new Error('no Contact Person id.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('DeleteContactPerson');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('DeleteContactPerson');\r\n\t\t\t}\r\n\r\n\t\t\turl += `?contactPersonId=${contactPersonId}`;\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tif (data) {\r\n\t\t\t\tthis._mapDeletedContactPerson(contactPersonId);\r\n\t\t\t}\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while deleting Contact Person`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync addAttachment(attachment, docType, isLegalEntity) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!attachment) {\r\n\t\t\t\tthrow new Error('no attachment');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = '';\r\n\r\n\t\t\tif (docType == 1 || docType == 2) {\r\n\t\t\t\tif (isLegalEntity) {\r\n\t\t\t\t\turl = await this.InternalLinksService.getLink('AddContactPersonAttachment');\r\n\t\t\t\t} else {\r\n\t\t\t\t\turl = await this.InternalLinksService.getLink('AddPurchaserAttachment');\r\n\t\t\t\t}\r\n\t\t\t} else if (docType == 4) {\r\n\t\t\t\turl = await this.InternalLinksService.getLink('AddLegalEntityAttachment');\r\n\t\t\t} else if (docType == 3 || docType == 5 || docType == 6 || docType == 8) {\r\n\t\t\t\turl = await this.InternalLinksService.getLink('AddClearanceHeaderAttachment');\r\n\t\t\t}\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\tif (docType == 1 || docType == 2 || docType == 3) {\r\n\t\t\t\t\tif (isLegalEntity) {\r\n\t\t\t\t\t\turl = await this.InternalLinksService.getLink('AddContactPersonAttachment');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\turl = await this.InternalLinksService.getLink('AddPurchaserAttachment');\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (docType == 4) {\r\n\t\t\t\t\turl = await this.InternalLinksService.getLink('AddLegalEntityAttachment');\r\n\t\t\t\t} else if (docType == 5 || docType == 8) {\r\n\t\t\t\t\turl = await this.InternalLinksService.getLink('AddClearanceHeaderAttachment');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, attachment);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while Adding Attachment`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync deleteAttachment(attachment, isLegalEntity) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!attachment) {\r\n\t\t\t\tthrow new Error('No attachment.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('DeleteAttachment');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('DeleteAttachment');\r\n\t\t\t}\r\n\r\n\t\t\turl = `${url}?attachmentId=${attachment.Id}&isLegalEntity=${isLegalEntity}&clearanceDocumentType=${attachment.ClearanceDocumentType}`;\r\n\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while deleting attachment`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync submitClearanceCapture(clearanceHeaderId) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!clearanceHeaderId) {\r\n\t\t\t\tthrow new Error('No clearance Header Id.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinalizeClearances');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinalizeClearances');\r\n\t\t\t}\r\n\r\n\t\t\turl = `${url}?clearanceHeaderId=${clearanceHeaderId}`;\r\n\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while submitting clearance header`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getConductRulesOrMemoForScheme(schemeReference) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = this.InternalLinksService.getLink('GetConductRulesOrMemoForScheme');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/documents/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetConductRulesOrMemoForScheme');\r\n\t\t\t}\r\n\r\n\t\t\turl += `?schemeReference=${schemeReference}`;\r\n\t\t\tthis.openNewTabReport(url, `Rules - ${schemeReference}`);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(`Couldn't load API 'links'`, err));\r\n\t\t}\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getMaritalStatuses() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetMaritalStatuses');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/clearance/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetMaritalStatuses');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tthis.maritalStatuses = results.data.filter(\r\n\t\t\t\t(maritalStatus) => maritalStatus.status.toLowerCase() !== 'unknown'\r\n\t\t\t);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while fetching Marital Statuses`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\t\r\n\tasync getBankingInstitutionName() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetBankingInstitutionName');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/clearance/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetBankingInstitutionName');\r\n\t\t\t}\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tthis.bankNames = results.data;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while fetching Bank Names`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\t\r\n\topenNewTabReport(url, title) {\r\n\t\tconst newTab = this.$window.open(url, '_blank');\r\n\r\n\t\tnewTab.document.write(`\r\n ${title}\r\n \r\n \r\n `);\r\n\t}\r\n\r\n\t_map(data) {\r\n\t\tif (!data) return data;\r\n\r\n\t\tif (!data.IsSubmitted) {\r\n\t\t\tdata = this._formatAndMapDate(data);\r\n\t\t} else {\r\n\t\t\tdata.ValidDate = data.ValidDate.substr(0, 10);\r\n\t\t}\r\n\r\n\t\tdata = this._mapSellerInfo(data);\r\n\t\tdata = this._mapRejectedDocuments(data);\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t_formatAndMapDate(original) {\r\n\t\tconst mapped = original;\r\n\t\tconst { ValidDate } = mapped;\r\n\r\n\t\tlet momentDate,\r\n\t\t\t// @ts-ignore\r\n\t\t\tinitDate = new moment(new Date()),\r\n\t\t\t// @ts-ignore\r\n\t\t\tmomentInitDate = moment(ValidDate);\r\n\r\n\t\tif (ValidDate && momentInitDate.year() !== 1900) {\r\n\t\t\t// @ts-ignore\r\n\t\t\tmomentDate = moment(ValidDate);\r\n\t\t\tif (initDate.isBefore(momentDate)) {\r\n\t\t\t\tinitDate = momentDate;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// @ts-ignore\r\n\t\t\tconst currentMomentDate = moment(initDate);\r\n\t\t\tconst currentDay = currentMomentDate.date();\r\n\r\n\t\t\tif (currentDay < 15) {\r\n\t\t\t\tinitDate.add(2, 'M');\r\n\t\t\t} else {\r\n\t\t\t\tinitDate.add(3, 'M');\r\n\t\t\t}\r\n\r\n\t\t\t// @ts-ignore\r\n\t\t\tinitDate = moment(`${initDate.format('YYYY/MM/')}${initDate.daysInMonth()}`, 'YYYY/MM/DD');\r\n\t\t}\r\n\r\n\t\tmapped.ValidDate = initDate.format('YYYY/MM/DD');\r\n\r\n\t\treturn mapped;\r\n\t}\r\n\r\n\t_mapRejectedDocuments(data) {\r\n\t\tdata = this._mapRejectedHeaderDocuments(data);\r\n\t\tdata = this._mapRejectedPurchasersDocuments(data);\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t_mapRejectedHeaderDocuments(data) {\r\n\t\tconst ClearanceHeaderRejectedAttachments = data.ClearanceHeaderAttachment\r\n\t\t\t? data.ClearanceHeaderAttachment.filter((attachment) => {\r\n\t\t\t\treturn attachment.IsRejected;\r\n\t\t\t})\r\n\t\t\t: [];\r\n\r\n\t\tconst { IsLegalEntity } = data;\r\n\t\tlet LegalEntityRejectedAttachments;\r\n\t\tif (IsLegalEntity) {\r\n\t\t\tLegalEntityRejectedAttachments = data.LegalEntity.LegalEntityAttachment\r\n\t\t\t\t? data.LegalEntity.LegalEntityAttachment.filter((att) => {\r\n\t\t\t\t\treturn att.IsRejected;\r\n\t\t\t\t})\r\n\t\t\t\t: [];\r\n\t\t}\r\n\r\n\t\tdata = {\r\n\t\t\t...data,\r\n\t\t\tClearanceHeaderRejectedAttachments,\r\n\t\t\tLegalEntityRejectedAttachments\r\n\t\t};\r\n\r\n\t\tif (ClearanceHeaderRejectedAttachments) {\r\n\t\t\tClearanceHeaderRejectedAttachments.map((attachment) => {\r\n\t\t\t\tdata.ClearanceHeaderAttachment = [\r\n\t\t\t\t\t...data.ClearanceHeaderAttachment.filter((attForRemoval) => attForRemoval.Id !== attachment.Id)\r\n\t\t\t\t];\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (LegalEntityRejectedAttachments) {\r\n\t\t\tLegalEntityRejectedAttachments.map((att) => {\r\n\t\t\t\tdata.LegalEntity.LegalEntityAttachment = [\r\n\t\t\t\t\t...data.LegalEntity.LegalEntityAttachment.filter((attForRemoval) => attForRemoval.Id !== att.Id)\r\n\t\t\t\t];\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t_mapRejectedContactPersonDocuments(data) {\r\n\t\tlet { LegalEntity } = data;\r\n\t\tlet { ContactPerson } = LegalEntity;\r\n\r\n\t\tlet mappedContactPerson;\r\n\t\tmappedContactPerson = ContactPerson.map((contactPerson) => {\r\n\t\t\tlet RejectedAttachments;\r\n\r\n\t\t\tRejectedAttachments = contactPerson\r\n\t\t\t\t? contactPerson.ContactPersonAttachment\r\n\t\t\t\t\t? contactPerson.ContactPersonAttachment.filter((attachment) => {\r\n\t\t\t\t\t\treturn attachment.IsRejected;\r\n\t\t\t\t\t})\r\n\t\t\t\t\t: []\r\n\t\t\t\t: null;\r\n\r\n\t\t\tcontactPerson = {\r\n\t\t\t\t...contactPerson,\r\n\t\t\t\tRejectedAttachments\r\n\t\t\t};\r\n\r\n\t\t\treturn contactPerson;\r\n\t\t});\r\n\r\n\t\tmappedContactPerson.forEach((mapped) => (mapped.MaritalStatus += ''));\r\n\r\n\t\tLegalEntity = {\r\n\t\t\t...LegalEntity,\r\n\t\t\tContactPerson: mappedContactPerson\r\n\t\t};\r\n\r\n\t\tLegalEntity.ContactPerson = LegalEntity.ContactPerson.map((contactPerson) => {\r\n\t\t\tif (contactPerson.RejectedAttachments) {\r\n\t\t\t\tcontactPerson.RejectedAttachments.map((attachment) => {\r\n\t\t\t\t\tlet mappedAttachments;\r\n\t\t\t\t\tmappedAttachments = contactPerson.ContactPersonAttachment.filter(\r\n\t\t\t\t\t\t(attForRemoval) => attForRemoval.Id !== attachment.Id\r\n\t\t\t\t\t);\r\n\t\t\t\t\tcontactPerson.ContactPersonAttachment = [...mappedAttachments];\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\treturn contactPerson;\r\n\t\t});\r\n\r\n\t\tdata = {\r\n\t\t\t...data,\r\n\t\t\tLegalEntity\r\n\t\t};\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t_mapRejectedPurchasersDocuments(data) {\r\n\t\tconst { Purchaser } = data;\r\n\t\tlet mappedPurchasers;\r\n\t\tif (Purchaser) {\r\n\t\t\tmappedPurchasers = Purchaser.map((purchaser) => {\r\n\t\t\t\tlet RejectedAttachments;\r\n\t\t\t\tRejectedAttachments = purchaser\r\n\t\t\t\t\t? purchaser.PurchaserAttachment\r\n\t\t\t\t\t\t? purchaser.PurchaserAttachment.filter((attachment) => {\r\n\t\t\t\t\t\t\treturn attachment.IsRejected;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t: []\r\n\t\t\t\t\t: null;\r\n\r\n\t\t\t\tpurchaser = {\r\n\t\t\t\t\t...purchaser,\r\n\t\t\t\t\tRejectedAttachments\r\n\t\t\t\t};\r\n\r\n\t\t\t\treturn purchaser;\r\n\t\t\t});\r\n\r\n\t\t\tmappedPurchasers.forEach((mapped) => (mapped.MaritalStatus += ''));\r\n\r\n\t\t\tdata = {\r\n\t\t\t\t...data,\r\n\t\t\t\tPurchaser: mappedPurchasers\r\n\t\t\t};\r\n\r\n\t\t\tdata.Purchaser = data.Purchaser.map((purchaser) => {\r\n\t\t\t\tif (purchaser.RejectedAttachments) {\r\n\t\t\t\t\tpurchaser.RejectedAttachments.map((attachment) => {\r\n\t\t\t\t\t\tlet mappedAttachments;\r\n\t\t\t\t\t\tmappedAttachments = purchaser.PurchaserAttachment.filter(\r\n\t\t\t\t\t\t\t(attForRemoval) => attForRemoval.Id !== attachment.Id\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tpurchaser.PurchaserAttachment = [...mappedAttachments];\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn purchaser;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t_mapSellerInfo(data) {\r\n\t\tconst oldSellerEmails = data.SellerEmail;\r\n\t\tdata.SellerEmail = '';\r\n\t\tdata.SellerEmail = this._mapSenderEmails(oldSellerEmails);\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t_mapSenderEmails(sellerEmail) {\r\n\t\tconst sellerEmails = sellerEmail.indexOf(';') ? sellerEmail.split(';') : [sellerEmail];\r\n\r\n\t\tlet mappedSellerEmails = '';\r\n\t\tif (sellerEmails.length > 1) {\r\n\t\t\tfor (const email of sellerEmails) {\r\n\t\t\t\tmappedSellerEmails += `${email}\\n`;\r\n\t\t\t}\r\n\t\t\tmappedSellerEmails = mappedSellerEmails.substr(0, mappedSellerEmails.lastIndexOf('\\n'));\r\n\t\t} else {\r\n\t\t\tmappedSellerEmails = sellerEmails[0];\r\n\t\t}\r\n\r\n\t\treturn mappedSellerEmails;\r\n\t}\r\n\r\n\t_updatePurchaser(updatedPurchaser) {\r\n\t\tlet isNew = true;\r\n\t\tconst oldPurchaser = this.clearanceCapture.Purchaser.filter((obj) => obj.Id === updatedPurchaser.Id);\r\n\r\n\t\tif (oldPurchaser && oldPurchaser.length > 0) {\r\n\t\t\tisNew = false;\r\n\t\t}\r\n\r\n\t\tif (!isNew) {\r\n\t\t\tthis.clearanceCapture.Purchaser.forEach((purchaser, i, array) => {\r\n\t\t\t\tif (purchaser.Id === updatedPurchaser.Id) {\r\n\t\t\t\t\tarray[i] = updatedPurchaser;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.clearanceCapture.Purchaser.push(updatedPurchaser);\r\n\t\t}\r\n\t}\r\n\r\n\t_updateContactPerson(updatedPerson) {\r\n\t\tlet isNew = true;\r\n\r\n\t\tconst oldContactPerson = this.clearanceCapture.LegalEntity.ContactPerson.filter(\r\n\t\t\t(obj) => obj.Id === updatedPerson.Id\r\n\t\t);\r\n\t\tif (oldContactPerson && oldContactPerson.length > 0) {\r\n\t\t\tisNew = false;\r\n\t\t}\r\n\r\n\t\tif (!isNew) {\r\n\t\t\tthis.clearanceCapture.LegalEntity.ContactPerson.forEach((person, i, array) => {\r\n\t\t\t\tif (person.Id === updatedPerson.Id) {\r\n\t\t\t\t\tarray[i] = updatedPerson;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.clearanceCapture.LegalEntity.ContactPerson.push(updatedPerson);\r\n\t\t}\r\n\t}\r\n\r\n\t_mapDeletedContactPerson(id) {\r\n\t\tconst deletedContactPerson = this.clearanceCapture.LegalEntity.ContactPerson.find(\r\n\t\t\t(contactPerson) => contactPerson.Id === id\r\n\t\t);\r\n\t\tif (deletedContactPerson) {\r\n\t\t\tthis.clearanceCapture.LegalEntity.ContactPerson = this.clearanceCapture.LegalEntity.ContactPerson.filter(\r\n\t\t\t\t(contactPerson) => contactPerson.Id !== id\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\t_mapDeletedPurchaser(id) {\r\n\t\tconst deletedPurchaser = this.clearanceCapture.Purchaser.find((purchaser) => purchaser.Id === id);\r\n\t\tif (deletedPurchaser) {\r\n\t\t\tthis.clearanceCapture.Purchaser = this.clearanceCapture.Purchaser.filter(\r\n\t\t\t\t(purchaser) => purchaser.Id !== id\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) =>\r\n\tnew ClearanceCaptureService($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService);\r\n","import Validator from 'validatorjs';\r\n/* @ngInject */\r\nexport default class ClearanceRequestCtrl {\r\n\tconstructor($scope, $rootScope, $timeout, ClearanceRequestService, NotificationService, LocalStorageService) {\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.ClearanceRequestService = ClearanceRequestService;\r\n\r\n\t\tthis.testObjects = [\r\n\t\t\t{ id: 1, name: 'Dilip', type: { title: 'a' } },\r\n\t\t\t{ id: 2, name: 'Devendra', type: { title: 'b' } },\r\n\t\t\t{ id: 3, name: 'Jayesh', type: { title: 'a' } },\r\n\t\t\t{ id: 4, name: 'Jekin', type: { title: 'c' } },\r\n\t\t\t{ id: 5, name: 'Gaurang', type: { title: 'a' } },\r\n\t\t\t{ id: 6, name: 'Bhavin', type: { title: 'e' } },\r\n\r\n\t\t];\r\n\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.isBusy = false;\r\n\t\tthis.clearPage();\r\n\t}\r\n\r\n\tactivate() {\r\n\t\tthis.initializeDatePicker();\r\n\t}\r\n\r\n\tasync getAttorneyNames(searchTerm) {\r\n\t\tlet attorneyNameResults = await this.ClearanceRequestService.SearchAvailableAttorneyNames(searchTerm);\r\n\t\tconsole.log(attorneyNameResults);\r\n\r\n\t\tattorneyNameResults = [...attorneyNameResults].splice(0,5);\r\n\r\n\t\treturn attorneyNameResults;\r\n\t}\r\n\r\n\tasync submitInitialClearanceRequest() {\r\n\t\tthis._switchIsBusy(true);\r\n\t\ttry {\r\n\r\n\t\t\tconst figuresDate =\r\n\t\t\t\tmoment(this.ClearanceRequest.FiguresValidUntil).toDate();\r\n\r\n\t\t\tthis.ClearanceRequest.FiguresValidUntil = moment(figuresDate).endOf('month').toDate();\r\n\r\n\t\t\tawait this.ClearanceRequestService.SaveInitialClearanceRequest(this.ClearanceRequest);\r\n\t\t\tthis.NotificationService.success(\r\n\t\t\t\t'Your clearance request has been successfully captured. You should receive correspondence within the next 48 hours.',\r\n\t\t\t\t15000\r\n\t\t\t);\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\t\t\tthis.NotificationService.error('CLEARANCE REQUEST DETAILS COULD NOT BE SUBMITTED');\r\n\t\t}\r\n\t\tthis._switchIsBusy(false);\r\n\t\tthis.clearPage();\r\n\t}\r\n\r\n\tinitializeDatePicker() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tconst selector = '.date-picker';\r\n\t\t\tconst $input = $(selector, $('#propertyInformation'));\r\n\t\t\tconst dateNow = new Date();\r\n\r\n\t\t\tlet startDate = moment(dateNow).startOf('month').add(2, 'M').toDate();\r\n\r\n\t\t\tif (dateNow.getDay() > 15) {\r\n\t\t\t\tstartDate = moment(startDate).add(1, 'M').toDate();\r\n\t\t\t}\r\n\r\n\t\t\tconst endDate = '+1y';\r\n\r\n\t\t\tconst options = {\r\n\t\t\t\tstartDate,\r\n\t\t\t\tendDate,\r\n\t\t\t\tcontainer: selector,\r\n\t\t\t\tautoclose: true,\r\n\t\t\t\tforceParse: true,\r\n\t\t\t\tformat: \"yyyy-mm\",\r\n\t\t\t\tstartView: \"months\",\r\n\t\t\t\tminViewMode: \"months\"\r\n\t\t\t};\r\n\r\n\t\t\t$input.datepicker(options);\r\n\t\t});\r\n\t}\r\n\r\n\tclearPage() {\r\n\t\tthis.ClearanceRequest = {};\r\n\t\tthis.ClearanceRequest.UnitStandNumber = undefined;\r\n\t\tthis.ClearanceRequest.SchemeName = undefined;\r\n\t\tthis.ClearanceRequest.SellerName = undefined;\r\n\t\tthis.ClearanceRequest.PurchaserName = undefined;\r\n\t\tthis.ClearanceRequest.FiguresValidUntil = undefined;\r\n\t\tthis.ClearanceRequest.AttorneyName = undefined;\r\n\t\tthis.ClearanceRequest.AttorneyContactNumber = undefined;\r\n\t\tthis.ClearanceRequest.AttorneyEmail = undefined;\r\n\t\tthis.ClearanceRequest.AttorneyReference = undefined;\r\n\t\tthis.ClearanceRequest.Notes = undefined\r\n\t}\r\n\r\n\treadyForSubmit() {\r\n\t\tthis.formsErrors = this.requestValidation();\r\n\t\tif (!this.formsErrors.length) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\trequestValidation() {\r\n\t\tlet results = [];\r\n\r\n\t\tconst customErrorMessages = {\r\n\t\t\tnumeric: ':attribute must be a number.',\r\n\t\t\trequired: ':attribute is required.',\r\n\t\t\temail: ':attribute is not a valid email address.'\r\n\t\t};\r\n\r\n\t\tconst UnitStandNumber = this.ClearanceRequest.UnitStandNumber,\r\n\t\t\tSchemeName = this.ClearanceRequest.SchemeName,\r\n\t\t\tSellerName = this.ClearanceRequest.SellerName,\r\n\t\t\tFiguresValidUntil = this.ClearanceRequest.FiguresValidUntil,\r\n\t\t\tAttorneyName = this.ClearanceRequest.AttorneyName,\r\n\t\t\tAttorneyContactNumber = this.ClearanceRequest.AttorneyContactNumber,\r\n\t\t\tAttorneyEmail = this.ClearanceRequest.AttorneyEmail,\r\n\t\t\tAttorneyReference = this.ClearanceRequest.AttorneyReference;\r\n\r\n\t\tconst inputs = {\r\n\t\t\tUnitStandNumber,\r\n\t\t\tSchemeName,\r\n\t\t\tSellerName,\r\n\t\t\tFiguresValidUntil,\r\n\t\t\tAttorneyName,\r\n\t\t\tAttorneyContactNumber,\r\n\t\t\tAttorneyEmail,\r\n\t\t\tAttorneyReference\r\n\t\t};\r\n\r\n\t\tconst rules = {\r\n\t\t\tUnitStandNumber: 'required',\r\n\t\t\tSchemeName: 'required',\r\n\t\t\tSellerName: 'required',\r\n\t\t\tFiguresValidUntil: 'required',\r\n\t\t\tAttorneyName: 'required',\r\n\t\t\tAttorneyContactNumber: 'required',\r\n\t\t\tAttorneyEmail: 'required',\r\n\t\t\tAttorneyReference: 'required'\r\n\t\t};\r\n\r\n\t\tconst displayLabels = {\r\n\t\t\tUnitStandNumber: 'Unit /Stand Number',\r\n\t\t\tSchemeName: 'Property Name',\r\n\t\t\tSellerName: 'Seller Name(s)',\r\n\t\t\tFiguresValidUntil: 'Valid Until',\r\n\t\t\tAttorneyName: 'Attorney Name',\r\n\t\t\tAttorneyContactNumber: 'Attorney Contact Number',\r\n\t\t\tAttorneyEmail: 'Attorney Email',\r\n\t\t\tAttorneyReference: 'Attorney File Reference'\r\n\t\t};\r\n\r\n\t\tconst validator = new Validator(inputs, rules, customErrorMessages);\r\n\t\tvalidator.setAttributeNames(displayLabels);\r\n\r\n\t\tvalidator.passes();\r\n\t\tif (validator.errorCount > 0) {\r\n\t\t\tObject.keys(validator.errors.errors).forEach((name) => {\r\n\t\t\t\tconst error = validator.errors.first(name);\r\n\t\t\t\tresults = [...results, error];\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t_switchIsBusy(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isBusy = flag;\r\n\t\t});\r\n\t}\r\n}","//@ts-check\r\n\r\nclass ClearanceRequestService {\r\n\tconstructor($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.clearanceRequest = {};\r\n\t}\r\n\r\n\tasync loadClearanceRequestByCorrelationId(correlationId) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!correlationId) {\r\n\t\t\t\tthrow new Error('Correlation Id must be supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetClearance');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetClearance');\r\n\t\t\t}\r\n\t\t\turl = `${url}?correlationId=${correlationId}`;\r\n\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.clearanceRequest = this._map(data);\r\n\t\t\tconst { IsSubmitted } = data || {\r\n\t\t\t\tIsSubmitted: false\r\n\t\t\t};\r\n\r\n\t\t\tthis.isSubmitted = IsSubmitted;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while fetching clearance data`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.clearanceRequest = {};\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync SaveInitialClearanceRequest(initialRequest) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tif (!initialRequest) {\r\n\t\t\t\tthrow new Error('no initial request data');\r\n\t\t\t}\r\n\t\t\tlet url = await this.InternalLinksService.getLink('SaveInitialClearanceRequest');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('SaveInitialClearanceRequest');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url,initialRequest);\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (error) {\r\n\t\t\tconst msg = `Error while saving Clearance Request.`;\r\n\t\t\tconsole.error(msg, error);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync SearchAvailableAttorneyNames(searchTerm) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif (!searchTerm) {\r\n\t\t\t\tthrow new Error('no initial request data');\r\n\t\t\t}\r\n\t\t\tlet url = await this.InternalLinksService.getLink('SearchAvailableAttorneyNames');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('SearchAvailableAttorneyNames');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url,{SearchTerm: searchTerm});\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data.Data));\r\n\t\t} catch (error) {\r\n\t\t\tconst msg = `Error while searching available attorneyNames.`;\r\n\t\t\tconsole.error(msg, error);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t_map(data) {\r\n\t\tif (!data) return data;\r\n\r\n\t\tif (!data.IsSubmitted) {\r\n\t\t\tdata = this._formatAndMapDate(data);\r\n\t\t} else {\r\n\t\t\tdata.ValidDate = data.ValidDate.substr(0, 10);\r\n\t\t}\r\n\r\n\t\tdata = this._mapSellerInfo(data);\r\n\t\treturn data;\r\n\t}\r\n\t_formatAndMapDate(original) {\r\n\t\tconst mapped = original;\r\n\t\tconst { ValidDate } = mapped;\r\n\r\n\t\tlet momentDate,\r\n\t\t\t// @ts-ignore\r\n\t\t\tinitDate = new moment(new Date()),\r\n\t\t\t// @ts-ignore\r\n\t\t\tmomentInitDate = moment(ValidDate);\r\n\r\n\t\tif (ValidDate && momentInitDate.year() !== 1900) {\r\n\t\t\t// @ts-ignore\r\n\t\t\tmomentDate = moment(ValidDate);\r\n\t\t\tif (initDate.isBefore(momentDate)) {\r\n\t\t\t\tinitDate = momentDate;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// @ts-ignore\r\n\t\t\tconst currentMomentDate = moment(initDate);\r\n\t\t\tconst currentDay = currentMomentDate.date();\r\n\r\n\t\t\tif (currentDay < 15) {\r\n\t\t\t\tinitDate.add(2, 'M');\r\n\t\t\t} else {\r\n\t\t\t\tinitDate.add(3, 'M');\r\n\t\t\t}\r\n\r\n\t\t\t// @ts-ignore\r\n\t\t\tinitDate = moment(`${initDate.format('YYYY/MM/')}${initDate.daysInMonth()}`, 'YYYY/MM/DD');\r\n\t\t}\r\n\r\n\t\tmapped.ValidDate = initDate.format('YYYY/MM/DD');\r\n\r\n\t\treturn mapped;\r\n\t}\r\n\r\n\t_mapSellerInfo(data) {\r\n\t\tconst oldSellerEmails = data.SellerEmail;\r\n\t\tdata.SellerEmail = '';\r\n\t\tdata.SellerEmail = this._mapSenderEmails(oldSellerEmails);\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t_mapSenderEmails(sellerEmail) {\r\n\t\tconst sellerEmails = sellerEmail.indexOf(';') ? sellerEmail.split(';') : [ sellerEmail ];\r\n\r\n\t\tlet mappedSellerEmails = '';\r\n\t\tif (sellerEmails.length > 1) {\r\n\t\t\tfor (const email of sellerEmails) {\r\n\t\t\t\tmappedSellerEmails += `${email}\\n`;\r\n\t\t\t}\r\n\t\t\tmappedSellerEmails = mappedSellerEmails.substr(0, mappedSellerEmails.lastIndexOf('\\n'));\r\n\t\t} else {\r\n\t\t\tmappedSellerEmails = sellerEmails[0];\r\n\t\t}\r\n\r\n\t\treturn mappedSellerEmails;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) =>\r\n\tnew ClearanceRequestService($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService);\r\n","/* @ngInject */\r\nexport default class ComplianceCtrl {\r\n constructor($state, $timeout, $rootScope, ComplianceService, NotificationService, $scope) {\r\n this.$state = $state;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.ComplianceService = ComplianceService;\r\n this.NotificationService = NotificationService;\r\n this.$scope = $scope;\r\n\r\n this.init();\r\n }\r\n\r\n init() {\r\n this.isBusy = false;\r\n this.hasDataLoaded = false;\r\n this.queryReason = '';\r\n this.rejectionReason = '';\r\n this.selectedMiniSubIndex = -1;\r\n this.miniSubTitleForOne = 'Mini-Sub Service Quote';\r\n this.miniSubTitleForMoreThanOne = 'Mini-Sub Service Quotes';\r\n\r\n this.fireCompliance = {\r\n queryReason: '',\r\n rejectionReason: ''\r\n };\r\n this.miniSubsCompliance = {\r\n queryReason: '',\r\n rejectionReason: ''\r\n };\r\n this.liftCompliance = {\r\n queryReason: '',\r\n rejectionReason: ''\r\n };\r\n\r\n this.$rootScope.$on('user-logged-in', ($event, results) => {\r\n this.activate();\r\n });\r\n //this.activate();\r\n }\r\n\r\n async activate() {\r\n this.loadAllData()\r\n }\r\n\r\n async loadAllData() {\r\n if (this.isBusy || this.hasDataLoaded) {\r\n return;\r\n }\r\n this._switchIsBusy(true);\r\n\r\n this.$timeout(async () => {\r\n this.ComplianceService.loadMiniSubTypes()\r\n .then(() => {\r\n this.$timeout(async () => {\r\n await this.loadData();\r\n this._swtichHasDataLoaded(true);\r\n this._switchIsBusy(false);\r\n });\r\n });\r\n });\r\n\r\n }\r\n\r\n async loadMiniSubTypes() {\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.loadMiniSubTypes();\r\n } catch (error) {\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async loadData() {\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.loadData();\r\n const { miniSubQuotes } = this.ComplianceService.compliance;\r\n if (miniSubQuotes && miniSubQuotes.length === 1) {\r\n this.selectedMiniSubIndex = 0;\r\n }\r\n } catch (error) {\r\n const msg = 'Error loading Compliance';\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async approveFireCompliance() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.approveFireQuote();\r\n this.NotificationService.success('Approved.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error approving Compliance';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async rejectFireQuote() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.rejectFireQuote(this.fireCompliance.rejectionReason);\r\n this.NotificationService.success('Rejected.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error rejecting fire quote';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n } \r\n\r\n async queryFireCompliance() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n try {\r\n await this.ComplianceService.queryFireQuote(this.fireCompliance.queryReason);\r\n this.NotificationService.success('Queried.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error querying fire quote';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async cancelApproval() {\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.cancelFireApproval();\r\n this.NotificationService.success('Cancelled Fire Approval.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error cancelling the fire approval Compliance';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async approveMiniSubsQuote() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.approveMiniSubsQuote(this.selectedMiniSubIndex);\r\n this.NotificationService.success('Approved.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error approving Mini-Subs Compliance';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async approveMinisubsCommunications() {\r\n alert();\r\n }\r\n\r\n async rejectMiniSubsQuote() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.rejectMiniSubsQuote(\r\n this.selectedMiniSubIndex,\r\n this.miniSubsCompliance.rejectionReason\r\n );\r\n this.NotificationService.success('Rejected.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error rejecting Mini-Subs quote';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async queryMiniSubsQuote() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n try {\r\n await this.ComplianceService.queryMiniSubsQuote(\r\n this.selectedMiniSubIndex,\r\n this.miniSubsCompliance.queryReason\r\n );\r\n this.NotificationService.success('Queried.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error querying Mini-Subs quote';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async cancelMiniSubsApproval() {\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.cancelMiniSubsApproval();\r\n this.NotificationService.success('Cancelled Mini-Subs Approval.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error cancelling the Mini-Subs Compliance';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async approveMinisubsCommunications() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.approveMinisubsCommunicationsQuote();\r\n this.NotificationService.success('Approved.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error approving Compliance';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async rejectMinisubsCommunications() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.rejectMinisubsCommunicationsQuote();\r\n this.NotificationService.success('rejected.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error approving Compliance';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async updateMinisubQuoteCommunications() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.updateMinisubQuoteStatus();\r\n this.NotificationService.success('Approved.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error approving Compliance';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n get miniSubServiceType() {\r\n const selectedMiniSub = this.ComplianceService.compliance.miniSubQuotes[this.selectedMiniSubIndex];\r\n const rawMiniSubServiceType = this.ComplianceService.compliance.miniSubTypes.find(\r\n (type) => type.value === selectedMiniSub.quoteType\r\n );\r\n if (rawMiniSubServiceType) {\r\n const { description } = rawMiniSubServiceType;\r\n return description;\r\n }\r\n\r\n return 'Unknown';\r\n }\r\n\r\n\r\n showMiniSub(index) {\r\n this.selectedMiniSubIndex = -1;\r\n\r\n if (index > -1) {\r\n this.selectedMiniSubIndex =\r\n index && index > -1 && index < this.ComplianceService.compliance.miniSubs.length ? index : 0;\r\n }\r\n }\r\n\r\n _switchIsBusy(flag) {\r\n this.$timeout(() => (this.isBusy = flag));\r\n }\r\n\r\n _swtichHasDataLoaded(flag) {\r\n this.$timeout(() => (this.hasDataLoaded = flag));\r\n }\r\n\r\n _registerEventHandlers() {\r\n angular.element('.compliance-page #compliance-container div[role=\"dialog\"]').off('hide.bs.modal');\r\n angular.element('.compliance-page #compliance-container div[role=\"dialog\"]').on('hide.bs.modal', () => {\r\n angular.element('.modal-backdrop').remove();\r\n });\r\n\r\n this.$scope.$watch('MainVM.isBusy',\r\n (newVal, oldVal) => {\r\n if (!newVal) {\r\n this.$timeout(() => {\r\n this.isBusy = true;\r\n }, 100);\r\n }\r\n },\r\n true\r\n );\r\n\r\n\r\n }\r\n\r\n async approveLiftCompliance() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.approveLiftQuote();\r\n this.NotificationService.success('Approved.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error approving Compliance';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n \r\n async rejectLiftQuote() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.rejectLiftQuote(this.liftCompliance.rejectionReason);\r\n this.NotificationService.success('Rejected.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error rejecting lift quote';\r\n this.NotificationService.error.msg;\r\n console.error(`${msg}: ${error}`);\r\n\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async queryLiftCompliance() {\r\n this._registerEventHandlers();\r\n this._switchIsBusy(true);\r\n\r\n try {\r\n await this.ComplianceService.queryLiftQuote(this.liftCompliance.queryReason);\r\n this.NotificationService.success('Queried.');\r\n await this.loadData();\r\n } catch (error) {\r\n const msg = 'Error querying lift quote';\r\n this.NotificationService.error(msg);\r\n console.error(`${msg}: ${error}`);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n}\r\n","//@ts-check\r\n\r\nclass ComplianceService {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$window,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tif (this.BuildingsService.getSelectedBuildingRef()) {\r\n\t\t\tthis.compliance = {};\r\n\t\t\tthis.payloadResult = {};\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tasync loadData() {\r\n\t\tlet promise,\r\n\t\t\tpromiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tlet url = await this.InternalLinksService.getLink('LoadQuotes');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('LoadQuotes');\r\n\t\t\t}\r\n\r\n\t\t\tconst schemeReference = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', schemeReference);\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tconst { Data: data, WasSuccessful: wasSuccessful } = results.data;\r\n\t\t\tconsole.log(data);\r\n\t\t\tif (!wasSuccessful) {\r\n\t\t\t\tthrow new Error(`There are is currently no Compliance to be approved for ${schemeReference}`);\r\n\t\t\t}\r\n\r\n const { FireQuote: fireQuote, LiftsQuotes: liftsQuotes, MiniSubQuotes: miniSubQuotes, MinisubCommunicationsQuote: minisubCommsQuote } = data;\r\n\r\n\t\t\tthis.payloadResult = this.Utility.mapForClient(results.data);\r\n\t\t\tconsole.log(fireQuote);\r\n\t\t\tif (fireQuote) {\r\n\t\t\t\tthis.compliance = {\r\n\t\t\t\t\t...this.compliance,\r\n\t\t\t\t\tfireQuote: this._mapFilePath(this.Utility.mapForClient(fireQuote))\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.compliance = {\r\n\t\t\t\t\t...this.compliance,\r\n\t\t\t\t\tfireQuote: undefined\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tif (liftsQuotes) {\r\n\t\t\t\tthis.compliance = {\r\n\t\t\t\t\t...this.compliance,\r\n\t\t\t\t\tliftsQuotes: this._mapFilePath(this.Utility.mapForClient(liftsQuotes)) //The mapFilePath is most probably where the url to getting the file attachment it\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.compliance = {\r\n\t\t\t\t\t...this.compliance,\r\n\t\t\t\t\tliftsQuotes: undefined\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n if (minisubCommsQuote) {\r\n this.compliance = {\r\n ...this.compliance,\r\n minisubCommsQuote: this._mapFilePath(this.Utility.mapForClient(minisubCommsQuote))\r\n\r\n };\r\n alert(minisubCommsQuote.CommunicationsId);\r\n }\r\n else {\r\n this.compliance = {\r\n ...this.compliance,\r\n minisubCommsQuote: undefined\r\n };\r\n }\r\n\r\n if (minisubCommsQuote) {\r\n this.compliance = {\r\n ...this.compliance,\r\n minisubCommsQuote: this._mapFilePath(this.Utility.mapForClient(minisubCommsQuote))\r\n \r\n };\r\n alert(minisubCommsQuote.CommunicationsId);\r\n }\r\n else {\r\n this.compliance = {\r\n ...this.compliance,\r\n minisubCommsQuote: undefined\r\n };\r\n }\r\n\r\n\t\t\tif (miniSubQuotes) {\r\n\t\t\t\tthis.compliance = {\r\n\t\t\t\t\t...this.compliance,\r\n\t\t\t\t\tminiSubQuotes: miniSubQuotes.map((miniSub) =>\r\n\t\t\t\t\t\tthis._mapMiniSub(this._mapFilePath(this.Utility.mapForClient(miniSub)))\r\n\t\t\t\t\t)\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.compliance = {\r\n\t\t\t\t\t...this.compliance,\r\n\t\t\t\t\tminiSubQuotes: undefined\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.compliance = {};\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync loadMiniSubTypes() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\tpromiseHandler = {\r\n\t\t\t\treject,\r\n\t\t\t\tresolve\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tlet url = await this.InternalLinksService.getLink('MiniSubTypes');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('MiniSubTypes');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.get(url, headers);\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.compliance = {\r\n\t\t\t\t...this.compliance,\r\n\t\t\t\tminiSubTypes: this._mapMiniSubTypes(data)\r\n\t\t\t};\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync approveFireQuote() {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ApproveFireQuote');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ApproveFireQuote');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst { fireQuote } = this.compliance;\r\n\t\t\tconst { id } = fireQuote;\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n\t\t\tconst results = await this.$http.post(url, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow Error(`Could not approve Quote: ${id}`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync rejectFireQuote(rejectionReason) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('RejectFireQuote');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('RejectFireQuote');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst { fireQuote } = this.compliance;\r\n\t\t\tconst { id } = fireQuote;\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n\t\t\tconst results = await this.$http.post(url, { RejectionReason: rejectionReason }, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow Error(`Could not reject Fire Quote: ${id}`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync queryFireQuote(queryReason) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('QueryFireQuote');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('QueryFireQuote');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst { fireQuote } = this.compliance;\r\n\t\t\tconst { id } = fireQuote;\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n\t\t\tconst results = await this.$http.post(url, { QueryReason: queryReason }, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow Error(`Could not reject Fire Quote: ${id}`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync queryMiniSubsQuote(index = -1, queryReason) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (index === -1) {\r\n\t\t\t\tthrow new Error('No mini sub index supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('QueryMiniSubQuote');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('QueryMiniSubQuote');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst { miniSubQuotes } = this.compliance;\r\n\t\t\tconst { id } = miniSubQuotes[index];\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n\t\t\tconst results = await this.$http.post(url, { QueryReason: queryReason }, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow Error(`Could not reject Fire Quote: ${id}`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync cancelFireApproval() {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('CancelFireQuoteApproval');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('CancelFireQuoteApproval');\r\n\t\t\t}\r\n\r\n\t\t\tconst { fireQuote } = this.compliance;\r\n\t\t\tconst { id } = fireQuote;\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.post(url, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow Error(`Could not reject Fire Quote: ${id}`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync approveMiniSubsQuote(index = -1) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (index === -1) {\r\n\t\t\t\tthrow new Error('No mini sub index supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ApproveMiniSubQuote');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ApproveMiniSubQuote');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst { miniSubQuotes } = this.compliance;\r\n\t\t\tconst { id } = miniSubQuotes[index];\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n\t\t\tconst results = await this.$http.post(url, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow Error(`Could not approve Quote: ${id}`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync rejectMiniSubsQuote(index = -1, rejectionReason) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (index === -1) {\r\n\t\t\t\tthrow new Error('No mini sub index supplied.');\r\n\t\t\t}\r\n\t\t\tif (rejectionReason === -1) {\r\n\t\t\t\tthrow new Error('No mini sub rejection reason supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tconst rejectionRequest = {\r\n\t\t\t\tActionReason: rejectionReason\r\n\t\t\t};\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('RejectMiniSubQuote');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('RejectMiniSubQuote');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst { miniSubQuotes } = this.compliance;\r\n\t\t\tconst { id } = miniSubQuotes[index];\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n\t\t\tconst results = await this.$http.post(url, rejectionRequest, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow Error(`Could not reject Fire Quote: ${id}`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n }\r\n\r\n async approveMinisubsCommunicationsQuote() {\r\n let promise;\r\n let promiseHandler = {};\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('ApproveMinisubsCommunicationsQuote');\r\n if (!!!url) {\r\n await this.InternalLinksService.getLinks('api/compliance/links', false);\r\n url = await this.InternalLinksService.getLink('ApproveMinisubsCommunicationsQuote');\r\n }\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n const { minisubCommsQuote } = this.compliance;\r\n const { communicationsId } = minisubCommsQuote;\r\n const selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n url = url.replace('{schemeReference}', selectedBuildingRef).replace('{communicationsId}', communicationsId);\r\n\r\n const results = await this.$http.post(url, { headers });\r\n\r\n const { WasSuccessful } = results.data;\r\n\r\n if (WasSuccessful) {\r\n this.$timeout(() => promiseHandler.resolve());\r\n } else {\r\n throw Error(`Could not approve Quote: ${communicationsId}`);\r\n }\r\n } catch (err) {\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n\r\n async rejectMinisubsCommunicationsQuote() {\r\n let promise;\r\n let promiseHandler = {};\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('RejectMinisubsCommunicationsQuote');\r\n if (!!!url) {\r\n await this.InternalLinksService.getLinks('api/compliance/links', false);\r\n url = await this.InternalLinksService.getLink('RejectMinisubsCommunicationsQuote');\r\n }\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n const { minisubCommsQuote } = this.compliance;\r\n const { communicationsId } = minisubCommsQuote;\r\n const selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n url = url.replace('{schemeReference}', selectedBuildingRef).replace('{communicationsId}', communicationsId);\r\n\r\n const results = await this.$http.post(url, { headers });\r\n\r\n const { WasSuccessful } = results.data;\r\n\r\n if (WasSuccessful) {\r\n this.$timeout(() => promiseHandler.resolve());\r\n } else {\r\n throw Error(`Could not approve Quote: ${communicationsId}`);\r\n }\r\n } catch (err) {\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n return promise;\r\n }\r\n\r\n async updateMinisubQuoteStatus() {\r\n let promise;\r\n let promiseHandler = {};\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('UpdateMinisubQuoteStatus');\r\n if (!!!url) {\r\n await this.InternalLinksService.getLinks('api/compliance/links', false);\r\n url = await this.InternalLinksService.getLink('UpdateMinisubQuoteStatus');\r\n }\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n const { minisubCommsQuote } = this.compliance;\r\n const { id } = minisubCommsQuote;\r\n const selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n url = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n const results = await this.$http.post(url, { headers });\r\n const { WasSuccessful } = results.data;\r\n\r\n if (WasSuccessful) {\r\n this.$timeout(() => promiseHandler.resolve());\r\n } else {\r\n throw Error(`Could not approve Quote: ${id}`);\r\n }\r\n } catch (err) {\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n\t_mapFilePath(original) {\r\n\t\tconst mapped = original;\r\n\r\n\t\tif (original) {\r\n\t\t\tconst buildingRef = this.Utility.selectedBuildingRef;\r\n\r\n\t\t\tif (original.additionalQuoteAttachment) {\r\n\t\t\t\tconst { WhenUploaded, Id } = original.additionalQuoteAttachment;\r\n\t\t\t\tconst pathDate = moment(WhenUploaded).format('DDMMYYYY');\r\n\t\t\t\tmapped.attachmentPath = this.$sce.trustAsResourceUrl(\r\n\t\t\t\t\t`${pretorDocumentsServerUrl}/${buildingRef}/quotes/${pathDate}/${Id}.pdf`\r\n\t\t\t\t);\r\n\t\t\t} else if (original.normalQuoteAttachment) {\r\n\t\t\t\tconst { WhenUploaded, Id } = original.normalQuoteAttachment;\r\n\t\t\t\tconst pathDate = moment(WhenUploaded).format('DDMMYYYY');\r\n\t\t\t\tmapped.attachmentPath = this.$sce.trustAsResourceUrl(\r\n\t\t\t\t\t`${pretorDocumentsServerUrl}/${buildingRef}/quotes/${pathDate}/${Id}.pdf`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn mapped;\r\n\t}\r\n\r\n\t_mapMiniSubTypes(original) {\r\n\t\tlet mapped = original.map((type) => {\r\n\t\t\treturn {\r\n\t\t\t\tname: type.Name,\r\n\t\t\t\tvalue: type.Value,\r\n\t\t\t\tdescription: type.Description\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn mapped;\r\n\t}\r\n\r\n\t_mapMiniSub(original) {\r\n\t\tlet mapped = original;\r\n\t\tif (!!!original) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tif (!!this.compliance && 'miniSubTypes' in this.compliance) {\r\n\t\t\tconst currentType = this.compliance.miniSubTypes.find((type) => {\r\n\t\t\t\tconst { value } = type;\r\n\t\t\t\treturn value === original.quoteType;\r\n\t\t\t});\r\n\r\n\t\t\tmapped.mappedQuoteType = currentType;\r\n\t\t}\r\n\r\n\t\treturn mapped;\r\n\t}\r\n\r\n\tasync approveLiftQuote() {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ApproveLiftQuote');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ApproveLiftQuote');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst { liftsQuotes } = this.compliance;\r\n\t\t\tconst { id } = liftsQuotes;\r\n\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n\t\t\tconst results = await this.$http.post(url, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow Error(`Could not approve Quote: ${id}`);\r\n\t\t\t}\r\n\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\r\n\r\n\t}\r\n\r\n\tasync rejectLiftQuote(rejectionReason) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('RejectLiftQuote');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('RejectLiftQuote');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst { liftsQuotes } = this.compliance;\r\n\t\t\tconst { id } = liftsQuotes;\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n\t\t\tconst results = await this.$http.post(url, { RejectionReason: rejectionReason }, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow Error(`Could not reject Lift Quote: ${id}`);\r\n }\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync queryLiftQuote(queryReason) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('QueryLiftQuote');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/compliance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('QueryLiftQuote');\r\n\t\t\t}\r\n\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst { liftsQuotes } = this.compliance;\r\n\t\t\tconst { id } = liftsQuotes;\r\n\t\t\tconst selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\turl = url.replace('{schemeReference}', selectedBuildingRef).replace('{quoteId}', id);\r\n\r\n\t\t\tconst results = await this.$http.post(url, { QueryReason: queryReason }, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow Error(`Could not reject Lift Quote: ${id}`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\r\n\t\t}\r\n\t\treturn promise;\r\n }\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$sce,\r\n\t$http,\r\n\tUtility,\r\n\t$window,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tBuildingsService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew ComplianceService(\r\n\t\t$sce,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$window,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","/* @ngInject */\r\nexport default class FindAContractorCtrl {\r\n constructor(\r\n $sce,\r\n $scope,\r\n $timeout,\r\n $rootScope\r\n ) {\r\n this.$sce = $sce;\r\n this.$scope = $scope;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n\r\n this.init();\r\n this.activate();\r\n }\r\n\r\n async init() {\r\n this.isBusy = true;\r\n }\r\n\r\n async activate() {\r\n window.location.href = \"https://www.pretor.co.za/contractors1.html\";\r\n }\r\n}\r\n","/* @ngInject */\r\n\r\nimport { FEATURES, USER_CLAIMS, capitalize, canPerformAction, shouldBeEnabled } from '../../common';\r\n\r\nexport default class DashboardCtrl {\r\n constructor(\r\n $q,\r\n $http,\r\n $scope,\r\n $window,\r\n Utility,\r\n $timeout,\r\n $interval,\r\n $location,\r\n $rootScope,\r\n UserUnitsService,\r\n DashboardService,\r\n BuildingsService,\r\n NavigationService,\r\n LocalStorageService,\r\n AuthorizationService,\r\n AuthenticationService\r\n ) {\r\n this.$q = $q;\r\n this.$http = $http;\r\n this.$scope = $scope;\r\n this.$window = $window;\r\n this.Utility = Utility;\r\n this.$timeout = $timeout;\r\n this.$interval = $interval;\r\n this.$location = $location;\r\n this.$rootScope = $rootScope;\r\n this.UserUnitsService = UserUnitsService;\r\n this.DashboardService = DashboardService;\r\n this.BuildingsService = BuildingsService;\r\n this.NavigationService = NavigationService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.AuthorizationService = AuthorizationService;\r\n this.AuthenticationService = AuthenticationService;\r\n\r\n this.init();\r\n }\r\n\r\n init() {\r\n this.isBusy = true;\r\n this.timeoutPromise;\r\n this.buildings = [];\r\n this.userUnits = [];\r\n this._timeoutProcess;\r\n this.loginEmail = '';\r\n this.portfolioCount = 0;\r\n this.timeoutDelay = 1500;\r\n this.paymentApprovedCount = 0;\r\n this._timeoutProcessRetry = 0;\r\n this.selectedBuildingRef = undefined;\r\n this.selectedBuilding = undefined;\r\n this.buildingFeatureSetting = null;\r\n this.shouldBeEnabled = shouldBeEnabled;\r\n this.canPerformAction = canPerformAction;\r\n this.dashboardMenuText = 'Please make your selection on the left';\r\n\r\n this.busyProcesses = {\r\n mainProcess: {\r\n show: false,\r\n count: 0\r\n },\r\n subProcesses: {\r\n approvals: { isBulk: false, payments: [] },\r\n bands: { isApproving: false, isQuerying: false }\r\n }\r\n };\r\n\r\n this.tiles = [];\r\n this.staticTiles = [\r\n {\r\n address: '',\r\n front: {\r\n mode: 'single',\r\n title: 'More Coming Soon...😀',\r\n value: '',\r\n styles: {\r\n title: {\r\n 'margin-top': '3.5em'\r\n },\r\n subtitle: {}\r\n }\r\n }\r\n }\r\n ];\r\n\r\n this.buildStaticTiles();\r\n\r\n this._handleEvents();\r\n\r\n this.$timeout(async () => {\r\n this._switchIsBusy(true);\r\n await this.activate();\r\n\r\n this.$timeout(() => {\r\n this._switchIsBusy(false);\r\n }, 800);\r\n });\r\n }\r\n\r\n buildStaticTiles() {\r\n if (this.shouldBeEnabled(USER_CLAIMS.MY_PROFILE)) {\r\n this.staticTiles.push({\r\n address: FEATURES.MY_PROFILE,\r\n front: {\r\n mode: 'single',\r\n title: 'Update My Details',\r\n value: '',\r\n styles: {\r\n title: {\r\n 'margin-top': '3.5em'\r\n },\r\n subtitle: {}\r\n }\r\n }\r\n });\r\n }\r\n\r\n this.staticTiles.push({\r\n address: FEATURES.PERSONAL_DOCUMENTS,\r\n front: {\r\n mode: 'single',\r\n title: 'Personal Documents',\r\n value: '',\r\n styles: {\r\n title: {\r\n 'margin-top': '3.5em'\r\n },\r\n subtitle: {}\r\n }\r\n }\r\n });\r\n\r\n if (this.shouldBeEnabled(USER_CLAIMS.REGISTER_TENANT)) {\r\n this.staticTiles.push({\r\n address: FEATURES.TENANT,\r\n front: {\r\n mode: 'single',\r\n title: 'My Tenant',\r\n value: '',\r\n styles: {\r\n title: {\r\n 'margin-top': '3.5em'\r\n },\r\n subtitle: {}\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n get defaultPayments() {\r\n return {\r\n address: FEATURES.PAYMENTS,\r\n front: {\r\n mode: 'single',\r\n title: 'Payments',\r\n value: 0,\r\n styles: {\r\n subtitle: {\r\n primary: {},\r\n secondary: { 'font-size': '50pt' }\r\n },\r\n title: {\r\n 'font-size': '20pt',\r\n 'margin-top': '1.5em'\r\n },\r\n self: {\r\n display: 'flex',\r\n 'flex-direction': 'column'\r\n }\r\n }\r\n },\r\n back: {\r\n title: 'Payments',\r\n styles: {\r\n title: null,\r\n self: {\r\n display: 'flex',\r\n 'flex-direction': 'column'\r\n }\r\n },\r\n value: []\r\n }\r\n };\r\n }\r\n\r\n get newDefaultPayments() {\r\n return {\r\n address: FEATURES.PAYMENTS,\r\n front: {\r\n mode: 'multiple-subtitles',\r\n title: [],\r\n value: 'R 0.00',\r\n styles: {\r\n title: {\r\n 'margin-top': '0.7em'\r\n },\r\n subtitle: {\r\n primary: {\r\n 'font-size': '18pt',\r\n 'margin-top': '2em',\r\n display: 'inline-block',\r\n 'font-weight': 'bolder',\r\n 'text-transform': 'capitalize'\r\n },\r\n secondary: {\r\n 'font-size': '50pt'\r\n }\r\n },\r\n self: {\r\n display: 'flex',\r\n 'flex-direction': 'column'\r\n }\r\n }\r\n },\r\n back: {\r\n mode: 'multiple-subtitles',\r\n title: 'Awaiting Approval',\r\n styles: {\r\n title: {\r\n 'font-size': '26pt',\r\n 'margin-top': '0.7em'\r\n },\r\n self: {\r\n display: 'flex',\r\n 'flex-direction': 'column'\r\n }\r\n },\r\n value: []\r\n }\r\n };\r\n }\r\n\r\n get defaultAccountHistory() {\r\n return {\r\n address: FEATURES.VIEW_ACCOUNTS_HISTORY,\r\n front: {\r\n mode: 'multiple-subtitles',\r\n title: ['Account Balance', ''],\r\n value: 'R 0.00',\r\n styles: {\r\n title: {\r\n 'margin-top': '0.7em'\r\n },\r\n subtitle: {\r\n primary: {\r\n 'font-size': '18pt',\r\n 'margin-top': '2em',\r\n display: 'inline-block',\r\n 'font-weight': 'bolder'\r\n },\r\n secondary: {}\r\n },\r\n self: {\r\n display: 'flex',\r\n 'flex-direction': 'column'\r\n }\r\n }\r\n },\r\n back: {\r\n mode: 'multiple-subtitles',\r\n title: 'Monthly Charges',\r\n styles: {\r\n title: {\r\n 'font-size': '26pt',\r\n 'margin-top': '0.7em'\r\n },\r\n self: {\r\n display: 'flex',\r\n 'flex-direction': 'column'\r\n }\r\n },\r\n value: []\r\n }\r\n };\r\n }\r\n\r\n async _handleUserUnitsLoad(event, schemeName) {\r\n\r\n if (schemeName) {\r\n const building = this.BuildingsService.buildingsData.allBuildings.find((building) => {\r\n const { SchemeName } = building;\r\n const found = SchemeName === schemeName;\r\n return found;\r\n });\r\n const { SchemeReference: schemeRef } = building;\r\n\r\n for (let index = 0; index < this.staticTiles.length; index++) {\r\n const element = this.staticTiles[index];\r\n element.value = schemeRef;\r\n }\r\n if (!!!this.loginEmail) {\r\n await this.loadMasterEmail();\r\n }\r\n const units = await this.DashboardService.getUserUnitsInformation(schemeRef, this.loginEmail);\r\n this.userUnits = units;\r\n this.getBuildingBackground(schemeRef);\r\n }\r\n }\r\n\r\n async loadMasterEmail() {\r\n this._switchIsBusy(true);\r\n try {\r\n const userProfile = this.LocalStorageService.retrieve('userProfile');\r\n if (userProfile && userProfile != null && 'UserName' in userProfile) {\r\n const { UserName: username } = userProfile;\r\n const results = await this.DashboardService.getMasterEmail(username);\r\n this.loginEmail = results;\r\n }\r\n } catch (error) {\r\n this.NotificationService.error(`Error while loading profile information.`);\r\n console.error(error);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n async _handleBuildingChanged(event, schemeRef, oldSchemeRef) {\r\n let units; \r\n this._switchIsBusy(true);\r\n try {\r\n if (schemeRef !== oldSchemeRef) {\r\n if (!!schemeRef) {\r\n if (!!!this.loginEmail) {\r\n await this.loadMasterEmail();\r\n }\r\n this.selectedBuildingRef = schemeRef;\r\n units = await this.DashboardService.getUserUnitsInformation(schemeRef, this.loginEmail);\r\n }\r\n this.userUnits = units;\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n }\r\n\r\n getBuildingBackground(buildingRef) {\r\n const deferred = this.$q.defer(),\r\n promise = deferred.promise;\r\n\r\n const fallbackUrl =\r\n PretorCDNAddress +\r\n (_.endsWith(PretorCDNAddress, '/') ? '' : '/') +\r\n 'images/buildings/default_bg.png';\r\n\r\n const url = this.BuildingsService.getTrustedBuildingImageUrl(buildingRef);\r\n\r\n this.$http.get(url).then(\r\n () => {\r\n deferred.resolve(url);\r\n },\r\n (err) => {\r\n deferred.resolve(fallbackUrl);\r\n }\r\n );\r\n\r\n return promise;\r\n }\r\n\r\n _handleEvents() {\r\n this.$scope.$on('reload-user-units', (event, data) => {\r\n //$(\"MainVM\").context.all.selectedBuildingTitle.innerText = building.SchemeName;\t\r\n this._handleUserUnitsLoad(event, data);\r\n });\r\n this.$scope.$on('selected-building-changed', (event, newVal, oldVal) => {\r\n if (!this.isBusy) {\r\n this._handleBuildingChanged({}, newVal, oldVal);\r\n }\r\n });\r\n this.$rootScope.$on('user-logged-in', async ($event, results) => {\r\n const profile = results && results.length > 0 ? results[1] : results;\r\n\r\n await this._handleDefaultSchemeRef(profile);\r\n this.$rootScope.$broadcast('show-register-prompt-auth-modal', profile);\r\n\r\n if (\r\n this.selectedBuildingRef &&\r\n ((typeof this.selectedBuildingRef == 'string' && this.selectedBuildingRef.trim().length == 3) ||\r\n this.selectedBuildingRef.hasOwnProperty('SchemeReference'))\r\n ) {\r\n this.$rootScope.$broadcast('force-data-reload', this.selectedBuildingRef);\r\n }\r\n });\r\n\r\n this.$scope.$watch(\r\n 'DashboardVM.busyProcesses.mainProcess.show',\r\n (newValue, oldValue) => {\r\n const isBusyLastShownStr = this.LocalStorageService.retrieve('isBusyLastShown');\r\n const time = this.Utility.apiRetry.value;\r\n\r\n if (!isBusyLastShownStr) {\r\n if (!this._timeoutProcess) {\r\n this._timeoutProcess = this.$timeout(() => {\r\n this.busyProcesses.mainProcess = {\r\n show: false,\r\n count: 0\r\n };\r\n\r\n this.LocalStorageService.save(\r\n 'isBusyLastShown',\r\n moment(new Date()).format(this.Utility.dateTimeFormat)\r\n );\r\n\r\n const buildingRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\r\n this._timeoutProcess = undefined;\r\n this.$rootScope.$broadcast('force-data-reload', buildingRef);\r\n }, time * 1.3);\r\n }\r\n }\r\n },\r\n true\r\n );\r\n }\r\n\r\n unitBalance(unit) {\r\n const mapped =\r\n unit.Balance == 0 ? 'Account Up to date' : 'Account Balance ' + 'R ' + unit.Balance.toFixed(2).toString();\r\n return mapped;\r\n }\r\n\r\n async activate() {\r\n let promise,\r\n promises = [],\r\n promiseHandler;\r\n let units;\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n this.LocalStorageService.save('mainProcessesDone', false);\r\n try {\r\n this._switchIsBusy(true);\r\n this.setSelectedInitialDBRef();\r\n //Getting selectedBuildingRef from building service \r\n this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n await this.loadMasterEmail();\r\n if (this.selectedBuildingRef && this.selectedBuildingRef != null) {\r\n units = await this.DashboardService.getUserUnitsInformation(this.selectedBuildingRef, this.loginEmail);\r\n this.userUnits = units;\r\n }\r\n } catch (error) {\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n finally {\r\n this._switchIsBusy(false);\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async loadTilesData() {\r\n let promise, promiseHandler;\r\n\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n try {\r\n this.$timeout(async () => {\r\n let promises = [];\r\n if (this.canPerformAction(USER_CLAIMS.APPROVE_PAYMENTS)) {\r\n const promise = await this.getPaymentsTileData();\r\n promises.push(promise);\r\n }\r\n\r\n if (this.shouldBeEnabled(USER_CLAIMS.VIEW_ACCOUNTS_HISTORY)) {\r\n const promise = await this.getAccountHistoryTileData();\r\n promises.push(promise);\r\n }\r\n\r\n this.$timeout(async () => {\r\n await Promise.all(promises);\r\n promiseHandler.resolve();\r\n });\r\n });\r\n } catch (error) {\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getPaymentsTileData() {\r\n let promise, promiseHandler;\r\n\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n try {\r\n const buildings = this.BuildingsService.buildingsData.allBuildings;\r\n for (let index = 0; index < buildings.length; index++) {\r\n const building = buildings[index];\r\n const { SchemeName: scheme, SchemeReference: schemeRef } = building;\r\n\r\n const userCanPerformAction = this.canPerformAction(USER_CLAIMS.APPROVE_PAYMENTS, schemeRef);\r\n const isDashboardEnabled = this.shouldBeEnabled(FEATURES.PAYMENTS, true)\r\n\r\n if (!isDashboardEnabled || !userCanPerformAction) {\r\n if (index === buildings.length - 1) {\r\n this.$timeout(() => promiseHandler.resolve());\r\n continue;\r\n } else {\r\n continue;\r\n }\r\n }\r\n\r\n let results = await this.DashboardService.getPayments(schemeRef);\r\n const { Data: data, NumberOfResults: noOfPayments } = results;\r\n\r\n let tile = this.newDefaultPayments;\r\n tile.address = `${FEATURES.PAYMENTS}?dbRef=${schemeRef}`;\r\n tile.front.value = noOfPayments;\r\n tile.front.title = ['Payments', capitalize(scheme)];\r\n\r\n data.map((dashboardPayment) => {\r\n const { title, value } = dashboardPayment;\r\n if (value && value > 0) {\r\n tile.back.value = [...tile.back.value, { title, value: parseFloat(value).toFixed(2) }];\r\n } else {\r\n tile.back.value = 0;\r\n }\r\n });\r\n this.tiles = [tile, ...this.tiles];\r\n\r\n if (index === buildings.length - 1) {\r\n this.$timeout(() => promiseHandler.resolve());\r\n }\r\n }\r\n } catch (error) {\r\n console.error(`Error while loading payments' tile data:\\n${JSON.stringify(error)}`);\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getAccountHistoryTileData() {\r\n let promise,\r\n promises = [],\r\n promiseHandler;\r\n\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n try {\r\n const buildingsWithUnits = await this.UserUnitsService.getFriendlyUnitNamesWithUserBuildingNames();\r\n promises.push(buildingsWithUnits);\r\n this.tiles = this.tiles.filter((tile) => !tile.address.includes(FEATURES.VIEW_ACCOUNTS_HISTORY));\r\n buildingsWithUnits.forEach(async (building) => {\r\n try {\r\n for (let index = 0; index < building.units.length; index++) {\r\n const unitCardCode = building.units[index];\r\n\r\n if (!unitCardCode.includes('9999')) {\r\n const results = await this.DashboardService.getAccountHistory(unitCardCode);\r\n\r\n promises.push(results);\r\n let newTile = this.defaultAccountHistory;\r\n newTile = {\r\n address: `${FEATURES.ACCOUNT_HISTORY}?cardCode=${unitCardCode}`,\r\n front: {\r\n ...newTile.front,\r\n ...results.front\r\n },\r\n back: {\r\n ...newTile.back,\r\n ...results.back\r\n }\r\n };\r\n\r\n this.tiles = [...this.tiles, newTile];\r\n }\r\n if (index === building.units.length - 1) {\r\n this.$timeout(() => promiseHandler.resolve(), 800);\r\n }\r\n }\r\n } catch (error) {\r\n throw error;\r\n }\r\n });\r\n\r\n await promises;\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (error) {\r\n console.error(`Error while loading account history's tile data:\\n${JSON.stringify(error)}`);\r\n\r\n this.$timeout(() => promiseHandler.reject(error));\r\n } finally {\r\n this._switchIsBusy(false);\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n setTileData(index, tileData) {\r\n this.tiles[index].back.value = tileData.Data;\r\n this.tiles[index].front.value = tileData.Data.length;\r\n }\r\n\r\n async _handleDefaultSchemeRef(profile) {\r\n const storedRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n if (this.NavigationService.navigationData.selectedBuildingRef) {\r\n await this._mapSchemeRefToObj(this.NavigationService.navigationData.selectedBuildingRef.toUpperCase());\r\n } else if (storedRef && typeof storedRef != 'object') {\r\n await this._mapSchemeRefToObj(storedRef.toUpperCase());\r\n }\r\n\r\n if (\r\n !this.selectedBuildingRef ||\r\n (this.selectedBuildingRef &&\r\n typeof this.selectedBuildingRef === 'object' &&\r\n !this.selectedBuildingRef.hasOwnProperty('SchemeReference')) ||\r\n (this.selectedBuildingRef &&\r\n typeof this.selectedBuildingRef === 'string' &&\r\n this.selectedBuildingRef.trim().length != 3)\r\n ) {\r\n if (profile && (profile.BuildingProfiles && profile.BuildingProfiles.length > 1)) {\r\n var sorted = _.sortBy(profile.BuildingProfiles, [\r\n (bp) => {\r\n return bp.SchemeName;\r\n }\r\n ]);\r\n this.selectedBuildingRef = sorted[0];\r\n } else if (profile) {\r\n this.selectedBuildingRef = profile.BuildingProfiles[0];\r\n }\r\n }\r\n\r\n let defaultDbRef;\r\n if (this.selectedBuildingRef && typeof this.selectedBuildingRef === 'object') {\r\n defaultDbRef = this.selectedBuildingRef.SchemeReference.trim();\r\n this.$rootScope.$emit('selected-building-changed', defaultDbRef);\r\n } else {\r\n defaultDbRef = this.selectedBuildingRef.trim();\r\n }\r\n\r\n this.$rootScope.$broadcast('set-selected-scheme-active', defaultDbRef);\r\n }\r\n\r\n async _mapSchemeRefToObj(schemeRef) {\r\n const deferred = this.$q.defer();\r\n const promise = deferred.promise;\r\n\r\n try {\r\n const buildingResult = await this.BuildingsService.loadBySchemeRef(schemeRef.toUpperCase());\r\n\r\n this.selectedBuildingRef = buildingResult;\r\n deferred.resolve(buildingResult);\r\n } catch (err) {\r\n deferred.reject(err);\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async setSelectedInitialDBRef() {\r\n if (\r\n this.NavigationService &&\r\n !this.NavigationService.navigated &&\r\n this.NavigationService.navigationData.selectedBuildingRef\r\n ) {\r\n await this.loadSelectedInitialScheme();\r\n\r\n this.selectedBuildingRef = this.NavigationService.navigationData.selectedBuildingRef.toUpperCase().trim();\r\n this.NavigationService.navigate();\r\n } else if (\r\n this.BuildingsService &&\r\n this.BuildingsService.buildingsData &&\r\n this.BuildingsService.buildingsData.hasOwnProperty('selectedBuilding')\r\n ) {\r\n if (typeof this.BuildingsService.buildingsData.selectedBuilding === 'object') {\r\n this.selectedBuildingRef = this.BuildingsService.buildingsData.selectedBuilding.SchemeReference.trim();\r\n } else {\r\n this.selectedBuildingRef = this.BuildingsService.buildingsData.selectedBuilding;\r\n }\r\n }\r\n }\r\n\r\n async loadSelectedInitialScheme() {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n const currentUser = this.LocalStorageService.retrieve('userProfile');\r\n if (!currentUser) {\r\n this.$scope.$on('user-logged-in', ($event, results) => {\r\n this.$timeout(() => promiseHandler.resolve(results[1]));\r\n });\r\n } else {\r\n this.$timeout(() => promiseHandler.resolve(currentUser));\r\n }\r\n } catch (error) {\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n isActive(tabNumber) {\r\n const selectedTab =\r\n this.NavigationService.navigationData && this.NavigationService.navigationData.selectedTab\r\n ? this.NavigationService.navigationData.selectedTab\r\n : '1';\r\n return tabNumber == selectedTab;\r\n }\r\n\r\n _paymentChanged(body, id, type) {\r\n if (body) {\r\n this.busyProcesses.subProcesses.approvals.payments.push({\r\n key: id,\r\n value: body\r\n });\r\n this.$rootScope.$broadcast('payment-is-busy', id, type);\r\n } else {\r\n let indexFound;\r\n this.busyProcesses.subProcesses.approvals.payments.forEach((process, index) => {\r\n if (process.key == id) {\r\n indexFound = index;\r\n return false;\r\n }\r\n });\r\n if (indexFound) {\r\n this.busyProcesses.subProcesses.approvals.payments.splice(indexFound, 1);\r\n this.$rootScope.$broadcast('payment-is-done', id, type);\r\n }\r\n }\r\n }\r\n\r\n _mainProcessChanged(body, id) {\r\n let count = this.busyProcesses.mainProcess.count ? this.busyProcesses.mainProcess.count : 0;\r\n if (body) {\r\n count = count + 1;\r\n } else {\r\n count = count - 1;\r\n }\r\n this.busyProcesses.mainProcess = {\r\n show: count <= 0 ? false : true,\r\n count: count < 0 ? 0 : count\r\n };\r\n }\r\n\r\n hasAccess(claim) {\r\n const isAllowed = this.AuthorizationService.isAuthorized(claim);\r\n return isAllowed;\r\n }\r\n\r\n _setBuildingBackground(buildingRef) {\r\n }\r\n\r\n _switchIsBusy(flag) {\r\n this.$timeout(() => {\r\n this.isBusy = flag;\r\n });\r\n }\r\n}\r\n","//@ts-check\r\n\r\nclass DashboardService {\r\n\tconstructor($http, $filter, Utility, $timeout, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.$filter = $filter;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\t}\r\n\r\n\tasync getPayments(schemeRef) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!!!schemeRef) {\r\n\t\t\t\tthrow Error('The Scheme Reference was not supplied.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentsForDashboard');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentsForDashboard');\r\n\t\t\t}\r\n\r\n\t\t\tconst noOfPayments = 3,\r\n\t\t\t\theaders = this.Utility.headersWithContentType;\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef);\r\n\t\t\turl += `?noOfPayments=${noOfPayments}`;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tconst { data } = this._mapPayments(results);\r\n\t\t\tconst { WasSuccessful } = data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => {\r\n\t\t\t\t\tpromiseHandler.resolve(data);\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error('There are no payments awaiting approval.');\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromiseHandler.reject(err);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getAccountHistory(cardCard) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('AccountHistoryForDashboard');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/accounts/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('AccountHistoryForDashboard');\r\n\t\t\t}\r\n\r\n\t\t\tconst noOfMonthsHistory = 3;\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\turl = url.replace('{cardCode}', cardCard);\r\n\t\t\turl += `?noOfMonthsHistory=${noOfMonthsHistory}`;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tlet { data } = results;\r\n\t\t\tdata = this._mapAccountHistory(data);\r\n\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromiseHandler.resolve(data);\r\n\t\t\t});\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromiseHandler.reject(err);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getMasterEmail(userName) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetMasterEmailByUserNameLink');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/accounts/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetMasterEmailByUserNameLink');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{userName}', userName);\r\n\t\t\t\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\t\r\n\t\t\tlet email;\r\n\t\t\tif ('data' in results) {\r\n\t\t\t\tconst { data: emailResults } = results;\r\n\t\t\t\temail = emailResults;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error('Error while loading profile details.');\r\n\t\t\t}\r\n\t\t\tpromiseHandler.resolve(email);\r\n\t\t} catch (error) {\r\n\t\t\tpromiseHandler.reject(error);\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getUserUnitsInformation(schemeRef, email) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\tpromiseHandler = {\r\n\t\t\t\treject,\r\n\t\t\t\tresolve\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tif (!!!schemeRef) {\r\n\t\t\t\tthrow new Error('scheme Reference must be specified.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('LoadUserUnitsLink');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/dashboard/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('LoadUserUnitsLink');\r\n\t\t\t}\r\n\r\n\t\t\tif (!!!email) {\r\n\t\t\t\tthrow new Error('Username must be provided...');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef);\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\t\r\n\t\t\turl = `${url}?username=${email}`;\r\n\r\n\t\t\tvar results = await this.$http.get(url, { headers });\r\n\r\n\t\t\tlet Data;\r\n\t\t\tif ('data' in results) {\r\n\t\t\t\tconst { data: rawData } = results;\r\n\t\t\t\tData = rawData;\r\n\t\t\t} else {\r\n\t\t\t\tData = results;\r\n\t\t\t}\r\n\t\t\tconst { Data: data, WasSuccessful: wasSuccessful } = Data;\r\n\r\n\t\t\tif (!wasSuccessful) {\r\n\t\t\t\tthrow new Error('Error while loading user units.');\r\n\t\t\t}\r\n\r\n\t\t\tpromiseHandler.resolve(data);\r\n\t\t} catch (error) {\r\n\t\t\tpromiseHandler.reject(error);\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getBuildingUtilityInformation(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\tpromiseHandler = {\r\n\t\t\t\treject,\r\n\t\t\t\tresolve\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tif (!!!schemeRef) {\r\n\t\t\t\tthrow new Error('scheme Reference must be specified.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('LoadUtilitiesLink');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/dashboard/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('LoadUtilitiesLink');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef);\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\t\t\t\r\n\r\n\t\t\tvar results = await this.$http.get(url, { headers });\r\n\r\n\t\t\tlet Data;\r\n\t\t\tif ('data' in results) {\r\n\t\t\t\tconst { data: rawData } = results;\r\n\t\t\t\tData = rawData;\r\n\t\t\t} else {\r\n\t\t\t\tData = results;\r\n\t\t\t}\r\n\t\t\tconst { Data: data, WasSuccessful: wasSuccessful } = Data;\r\n\r\n\t\t\tif (!wasSuccessful) {\r\n\t\t\t\tthrow new Error('Error while loading utilities.');\r\n\t\t\t}\r\n\r\n\t\t\tpromiseHandler.resolve(data);\r\n\t\t} catch (error) {\r\n\t\t\tpromiseHandler.reject(error);\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\t\r\n\t_getSelectedBuildingRef() {\r\n\t\tlet schemeRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\t\tif (typeof schemeRef === 'object') {\r\n\t\t\tschemeRef = schemeRef.SchemeReference;\r\n\t\t}\r\n if (!schemeRef) {\r\n let selectedBuildingRefQueryString = this.Utility.QueryString('DBRef');\r\n if (selectedBuildingRefQueryString) {\r\n this.selectedBuildingRef = selectedBuildingRefQueryString.toUpperCase();\r\n schemeRef = this.selectedBuildingRef;\r\n }\r\n }\r\n\r\n\t\treturn schemeRef;\r\n\t}\r\n\r\n\t_mapPayments(original) {\r\n\t\tlet mapped = original;\r\n\t\tlet { data } = original;\r\n\t\tlet { Data } = data;\r\n\r\n\t\tData = Data.map((payment) => {\r\n\t\t\treturn {\r\n\t\t\t\ttitle: payment.ServiceProviderName,\r\n\t\t\t\tvalue: payment.Amount\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tdata.Data = Data;\r\n\r\n\t\tmapped = {\r\n\t\t\t...original,\r\n\t\t\tdata\r\n\t\t};\r\n\r\n\t\treturn mapped;\r\n\t}\r\n\r\n\t_mapAccountHistory(original) {\r\n\t\tconst mappedAmount = this.$filter('number', 2)(original.CurrentBalance);\r\n\t\tlet mapped = {\r\n\t\t\tfront: {\r\n\t\t\t\ttitle: [ 'Account Balance', original.UnitFriendlyName ],\r\n\t\t\t\tvalue: `R ${mappedAmount}`\r\n\t\t\t},\r\n\t\t\tback: {\r\n\t\t\t\tvalue: original.AccountHistorySummaries.map((summary) => {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttitle: summary.Description,\r\n\t\t\t\t\t\tvalue: summary.TotalCharged\r\n\t\t\t\t\t};\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\treturn mapped;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, $filter, Utility, $timeout, LocalStorageService, InternalLinksService) =>\r\n\tnew DashboardService($http, $filter, Utility, $timeout, LocalStorageService, InternalLinksService);\r\n","import { core } from 'angular-ui-router';\r\n\r\n/* @ngInject */\r\nexport default class BalanceSheetCtrl {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tBalanceSheetService,\r\n\t\tAuthorizationService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.BalanceSheetService = BalanceSheetService;\r\n this.AuthorizationService = AuthorizationService;\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.isFilterActive = true;\r\n\t\tthis.reportModelHeader = '';\r\n\t\tthis.filterYear = undefined;\r\n\t\tthis.filterMonth = undefined;\r\n\t\tthis.selectedBuildingRef = '';\r\n\t\tthis.statusInformation = null;\r\n\t\tthis.selectedBuildingName = '';\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.financialsServiceData = this.FinancialsService;\r\n\t\tthis.today = this.Utility.getFormatedDate(new Date());\r\n\r\n\t\tthis.stickableStyles = `\r\n\t\t\t\ttop: -0.5em;\r\n\t\t\t\tleft: 4.93em;\r\n\t\t\t\twidth: 91.74%;\r\n\t\t\t\tz-index: 10;\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\tbackground-color: #e8e8e8;\r\n\t\t\t`;\r\n\r\n\t\tthis.$scope.$on('selected-building-changed', async (event, newValue) => {\r\n\t\t\tawait this.onSelectedBuildingChanged(this, newValue);\r\n\t\t});\r\n\t}\r\n\r\n\tasync activate() {\r\n\t\tthis.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tlet buildingName = '';\r\n\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n\t\tif (userProfile) {\r\n\t\t\tif (!this.selectedBuildingRef) {\r\n this.selectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n }\r\n\t\t\tconst selectedBuilding = userProfile.BuildingProfiles.find((building) => {\r\n\t\t\t\treturn building.SchemeReference.toUpperCase().trim() === this.selectedBuildingRef.toUpperCase().trim();\r\n\t\t\t});\r\n\r\n\t\t\tif (selectedBuilding) {\r\n\t\t\t\tbuildingName = selectedBuilding.SchemeName;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tawait this.getFinancialYears(true);\r\n\t\tthis.selectedBuildingName = buildingName;\r\n\t}\r\n\r\n\topenFinancials(page) {\r\n this.saveSelectedDate();\r\n this.$rootScope.$broadcast('navigate-changed', page, { date: this.filterMonth });\r\n }\r\n\r\n\tsaveSelectedDate() {\r\n const selectedYear = moment(this.filterYear).toDate();\r\n const selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n this.LocalStorageService.save('selectedReportYear', selectedYear);\r\n this.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n }\r\n\r\n\tgetAccountNameHtmlFromItem(item) {\r\n\t\tif (item.AccountCode == '30005' && item.AccountName.includes('(Loss)')) {\r\n\t\t\tconst replacementString = '(Loss)';\r\n\t\t\tconst stringToReplace = '(Loss)';\r\n\r\n\t\t\tconst accountname = item.AccountName.replace(stringToReplace, replacementString);\r\n\r\n\t\t\treturn this.$sce.trustAsHtml(accountname);\r\n\t\t}\r\n\r\n return item.AccountName;\r\n\t}\r\n\r\n async gotoOldFinancials() {\r\n const date = moment(this.filterMonth).format('MMM YYYY');\r\n let nav = `Monthly Financial Statements>${date}`;\r\n nav = encodeURI(nav);\r\n this.$state.go('documents', { nav });\r\n }\r\n\r\n\tisDesktop() {\r\n\t\tthis.LocalStorageService.save('mediaDevice', 'mobile');\r\n\t\tconst mdvice = this.LocalStorageService.retrieve('mediaDevice');\r\n\t\tif (mdvice == 'mobile') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tasync filterByYear() {\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\t\tawait this.getBalanceSheet();\r\n\t}\r\n\r\n\tasync getReport() {\r\n\t\tconst date = this.Utility.getFormatedDate(this.filterYear);\r\n\t\tthis.reportModelHeader = `${this.selectedBuildingName} - Balance Sheet - ${moment(date).format('MMM YYYY')}`;\r\n\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tawait this.financialsServiceData.getReport(this.selectedBuildingRef, date, 2, this.reportModelHeader);\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Error while generating Balance Sheet Report');\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tasync onSelectedBuildingChanged(event, schemeRef) {\r\n\t\tif (schemeRef && schemeRef['length'] > 2) this.selectedBuildingRef = schemeRef;\r\n\t\telse this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tif (this.selectedBuildingRef && this.selectedBuildingRef.length > 2) {\r\n\t\t\tawait this.activate();\r\n\t\t}\r\n\t}\r\n\r\n async getFinancialYears(isInit) {\r\n this._switchIsBusyLoading(true);\r\n\r\n try {\r\n await this.financialsServiceData.getFinancialYears(this.selectedBuildingRef, this.today);\r\n if (isInit) {\r\n await this.getSelectedDate(true);\r\n } else {\r\n this.filterYear = this.financialsServiceData.financialYears[\r\n this.financialsServiceData.financialYears.length - 1\r\n ].WhenTo;\r\n this.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n await this.getBalanceSheet();\r\n }\r\n } catch (err) {\r\n console.error(`Error while loading Financial Years.`);\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n\r\n\tasync getBalanceSheet() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tawait this.BalanceSheetService.getBalanceSheet(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.Utility.getFormatedDate(this.filterYear)\r\n\t\t\t);\r\n\t\t\tawait this.getFinancialState();\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error loading Balance Sheet Data`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getSelectedDate(isInit) {\r\n\t\tconst selectedDateYear = this.FinancialsService.getSelectedYear();\r\n\t\tif (isInit) {\r\n\t\t\tlet index = 0;\r\n\t\t\tfor (let i = 0; i < this.financialsServiceData.financialYears.length; i++) {\r\n\t\t\t\tconst yearRaw = this.financialsServiceData.financialYears[i];\r\n\r\n\t\t\t\tif (selectedDateYear.isBetween(yearRaw.WhenFrom, yearRaw.WhenTo)) {\r\n\t\t\t\t\tindex = i;\r\n\t\t\t\t\tthis.filterYear = this.financialsServiceData.financialYears[i].WhenTo;\r\n\t\t\t\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tawait this.getBalanceSheet();\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialState() {\r\n\t\tconst type = 2;\r\n\t\tconst schemeRef = this.selectedBuildingRef;\r\n\t\tconst momentDate = moment(this.selectedDateYear, 'YYYY-MM-DD');\r\n\t\tconst formattedDate = momentDate.format('YYYY-MM-DD');\r\n\t\tconst date = `${formattedDate.substr(0, 8)}01`;\r\n\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tconst results = await this.FinancialsService.getFinancialState(schemeRef, date, type);\r\n\r\n\t\t\tconst { status, message } = results;\r\n\t\t\tthis.statusInformation = message;\r\n\t\t} catch (error) {\r\n\t\t\tthis.NotificationService.error('Error loading balance sheet statement status');\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tallowAction(actionName) {\r\n return this.AuthorizationService.isAuthorized(actionName);\r\n }\r\n\r\n\t_switchIsBusyLoading(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isLoading = flag;\r\n\t\t});\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass BalanceSheetDataService {\r\n\tconstructor($sce, $http, Utility, $timeout, $rootScope, ContentService, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.balanceSheetData = undefined;\r\n\t}\r\n\r\n\t/**\r\n\t * @param {string} schemeRef\r\n\t * @param {Date} date\r\n\t */\r\n\tasync getBalanceSheet(schemeRef, date) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiBalanceSheet');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiBalanceSheet');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tif (!!!headers || (!!headers && (!!!headers.userName || !!!headers.sessionToken))) {\r\n\t\t\t\tconst error = `Could not load Balance Sheet as the 'Username' and/or 'Session Token' is missing`;\r\n\t\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, date, { headers });\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.balanceSheetData = data;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$sce,\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew BalanceSheetDataService(\r\n\t\t$sce,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","/* @ngInject */\r\nexport default class CashflowStatementNewCtrl {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tNotificationService,\r\n\t\tCashflowStatementDataNewService,\r\n AuthorizationService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.CashflowStatementDataNewService = CashflowStatementDataNewService;\r\n this.AuthorizationService = AuthorizationService;\r\n this.statusInformation = null;\r\n this._switchIsBusyLoading(true);\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.today = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDate = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.filterYear = this.selectedDate;\r\n this.filterMonth = this.selectedDateYear;\r\n this.reportModelHeader = '';\r\n this.selectedBuildingName = '';\r\n\t}\r\n\r\n\topenFinancials(page) {\r\n this.saveSelectedDate();\r\n this.$rootScope.$broadcast('navigate-changed', page, { date: this.filterMonth });\r\n }\r\n\r\n\tsaveSelectedDate() {\r\n const selectedYear = moment(this.filterYear).toDate();\r\n const selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n this.LocalStorageService.save('selectedReportYear', selectedYear);\r\n this.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n }\r\n\r\n\t_switchIsBusyLoading(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isLoading = flag;\r\n\t\t});\r\n\t}\r\n\r\n\tallowAction(actionName) {\r\n return this.AuthorizationService.isAuthorized(actionName);\r\n }\r\n\r\n\tasync activate() {\r\n\t\tthis.serviceData = this.CashflowStatementDataNewService;\r\n this.financialsServiceData = this.FinancialsService;\r\n this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n }\r\n\r\n async getReport() {\r\n this._switchIsBusyLoading(true);\r\n\r\n try {\r\n this.reportModelHeader = `${this.selectedBuildingName} - Cashflow Statement - ${moment(\r\n this.selectedDate\r\n ).format('MMM YYYY')}`;\r\n await this.FinancialsService.getReport(\r\n this.selectedBuildingRef,\r\n this.selectedDate,\r\n 11,\r\n this.reportModelHeader\r\n );\r\n } catch (err) {\r\n this.NotificationService.error('Error Downloading Report');\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n}\r\n","//@ts-check\r\n\r\nclass CashflowStatementDataNewService {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tasync init() {\r\n\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$sce,\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tFinancialsService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew CashflowStatementDataNewService(\r\n\t\t$sce,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","/* @ngInject */\r\nexport default class CashflowStatementCtrl {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tNotificationService,\r\n\t\tCashflowStatementDataService,\r\n\t\tAuthorizationService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.CashflowStatementDataService = CashflowStatementDataService;\r\n\t\tthis.AuthorizationService = AuthorizationService;\r\n\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\tthis.isMonthlyView = true;\r\n\t\tthis.isFilterActive = true;\r\n\t\tthis.isYearFilterActive = false;\r\n\t\tthis.filterYear = undefined;\r\n\t\tthis.filterMonth = undefined;\r\n\r\n\t\tthis.reportModelHeader = '';\r\n\t\tthis.serviceData = undefined;\r\n\t\tthis.isLoadingReport = false;\r\n\t\tthis.selectedBuildingRef = '';\r\n\t\tthis.selectedBuildingName = '';\r\n\t\tthis.policyDocument = undefined;\r\n\t\tthis.iframePaymentDocuments = '';\r\n\t\tthis.previousMonth = { Date: '' };\r\n\t\tthis.statusInformation = null;\r\n\t\tthis.investmentStatment = undefined;\r\n\r\n\t\tthis.isLoadingTransactionsForYear = {};\r\n\t\tthis.isShowingYearlyTransactions = false;\r\n\r\n\t\tthis.interestAccountCodes = ['41005', '12020'];\r\n\r\n\t\tthis.financialsServiceData = undefined;\r\n\t\tthis.webPaymentApprovalIndividual = undefined;\r\n\t\tthis.today = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDate = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(new Date());\r\n\r\n\t\tthis.stickableStyles = this.monthlyStyles;\r\n\r\n\t\tthis._registerEventHandling();\r\n\t}\r\n\r\n\t_registerEventHandling() {\r\n\t\tthis.$scope.$on('selected-building-changed', async (event, newValue) => {\r\n\t\t\tawait this.onSelectedBuildingChanged(this, newValue);\r\n\t\t});\r\n\r\n\t\tthis.$scope.$watch('cashflowStatementVm.isShowingYearlyTransactions', (newValue, oldValue) => {\r\n\t\t\tif (newValue) {\r\n\t\t\t\tthis.CashflowStatementDataService.yearlyTransactions = {};\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis._registerClicks();\r\n\t}\r\n\r\n\t_registerClicks() {\r\n\t\tconst $elements = angular.element('.list-inline.statement-inner .actualBudget-value');\r\n\t\t$elements.each((i, element) => {\r\n\t\t\tconst $element = $(element);\r\n\t\t\t$element.on('click', (evt) => {\r\n\t\t\t\tthis._removeSelected(true);\r\n\t\t\t\tconst { target } = evt;\r\n\r\n\t\t\t\tconst $selectDiv = $(target);\r\n\t\t\t\tif ($selectDiv.hasClass('actualBudget-value')) {\r\n\t\t\t\t\t$selectDiv.addClass('selected');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$selectDiv.closest('actualBudget-value').addClass('selected');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\t_removeSelected(deselect = false) {\r\n\t\tconst $elements = angular.element('.list-inline.statement-inner .actualBudget-value');\r\n\r\n\t\t$elements.each((i, element) => {\r\n\t\t\tconst $element = $(element);\r\n\t\t\tif (!deselect) {\r\n\t\t\t\t$element.off('click');\r\n\t\t\t}\r\n\t\t\tif ($element.hasClass('selected')) {\r\n\t\t\t\t$element.removeClass('selected');\r\n\t\t\t} else {\r\n\t\t\t\t$element.closest('actualBudget-value').removeClass('selected');\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\topenFinancials(page) {\r\n this.saveSelectedDate();\r\n this.$rootScope.$broadcast('navigate-changed', page, { date: this.filterMonth });\r\n }\r\n\r\n\tsaveSelectedDate() {\r\n const selectedYear = moment(this.filterYear).toDate();\r\n const selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n this.LocalStorageService.save('selectedReportYear', selectedYear);\r\n this.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n }\r\n\r\n async gotoOldFinancials() {\r\n const date = moment(this.filterMonth).format('MMM YYYY');\r\n let nav = `Monthly Financial Statements>${date}`;\r\n nav = encodeURI(nav);\r\n this.$state.go('documents', { nav });\r\n }\r\n\t\r\n\tisDesktop() {\r\n\t\tthis.LocalStorageService.save('mediaDevice', 'mobile');\r\n\t\tconst mdvice = this.LocalStorageService.retrieve('mediaDevice');\r\n\t\tif (mdvice == 'mobile') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\tgetBudgetIssueClass(isOverBudget, accountCode) {\r\n\t\t/* 2019 Sep 10\r\n\t\tif (\r\n\t\t\t(isOverBudget && accountCode.startsWith('6')) ||\r\n\t\t\t(!isOverBudget && accountCode.startsWith('4')) ||\r\n\t\t\t(!isOverBudget && accountCode.startsWith('2')) ||\r\n\t\t\t(!isOverBudget && accountCode.startsWith('1'))\r\n\t\t) {\r\n\t\t\treturn 'budget-issue';\r\n\t\t}\r\n\r\n\t\treturn 'no-budget-issue';\r\n\t\t*/\r\n\t\tconst budgetIssue = isOverBudget ? 'budget-issue' : 'no-budget-issue';\r\n\t\treturn budgetIssue;\r\n\t}\r\n\r\n\tasync filterByCurrentMonth() {\r\n\t\tthis.isFilterActive = true;\r\n\t\tthis.selectedDate = this.Utility.getFormatedDate(new Date());\r\n\t\tawait this.getCashflowStatement();\r\n\t}\r\n\r\n\tasync filterByMonth() {\r\n\t\tthis.CashflowStatementDataService.cashflowData = undefined;\r\n\t\tthis.CashflowStatementDataService.yearlyCashflowData = undefined;\r\n\t\tthis.$timeout(async () => {\r\n\t\t\tif (this.filterMonth) {\r\n\t\t\t\tthis.selectedDate = this.Utility.getFormatedDate(this.filterMonth);\r\n\t\t\t\tawait this.getCashflowStatement();\r\n\t\t\t\tvar temp = await this.FinancialsService.setReportURL(this.selectedBuildingRef, this.selectedDate);\r\n\t\t\t\t$(\"#mobileLink\").attr(\"href\", temp);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetAccountNameHtmlFromItem(item) {\r\n\t\tif (item.AccountCode == '43020' && item.AccountName.includes('Expenses')) {\r\n\t\t\tconst replacementString = '(Expenses)';\r\n\t\t\tconst stringToReplace = 'Expenses';\r\n\r\n\t\t\tconst accountname = item.AccountName.replace(stringToReplace, replacementString);\r\n\r\n\t\t\treturn this.$sce.trustAsHtml(accountname);\r\n\t\t}\r\n\r\n\t\tif (item.Children && item.Children.length > 0) {\r\n\t\t\tconst concatString = '';\r\n\t\t\t\r\n\t\t\tconst accountname = item.AccountName.concat(\" \", concatString);\r\n\r\n\t\t\treturn this.$sce.trustAsHtml(accountname);\r\n\t\t}\r\n\r\n return item.AccountName;\r\n\t}\r\n\r\n\tasync filterByYear() {\r\n\t\tthis.filterMonth = '';\r\n\t\tthis.serviceData.cashflowData = undefined;\r\n\t\tthis.serviceData.yearlyCashflowData = undefined;\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\t\tif (this.isMonthlyView) {\r\n\t\t\tawait this.getFinancialMonths(this.selectedDateYear);\r\n\t\t} else {\r\n\t\t\tthis.selectedDate = this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\tawait this.getYearlyCashflowStatement();\r\n\t\t}\r\n\t}\r\n\r\n\tasync getReport() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\t\t\tthis.reportModelHeader = `${this.selectedBuildingName} - Cashflow Statement - ${moment(\r\n\t\t\t\tthis.selectedDate\r\n\t\t\t).format('MMM YYYY')}`;\r\n\t\t\tawait this.FinancialsService.getReport(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.selectedDate,\r\n\t\t\t\t0,\r\n\t\t\t\tthis.reportModelHeader\r\n\t\t\t);\r\n\t\t} catch (err) {\r\n\t\t\tthis.NotificationService.error('Error Downloading Report');\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\t\r\n\r\n\tasync getAllReports() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\r\n\t\t\tthis.reportModelHeader = `${this.selectedBuildingName} - Cashflow Statement - ${moment(\r\n\t\t\t\tthis.selectedDate\r\n\t\t\t).format('MMM YYYY')}`;\r\n\t\t\tawait this.FinancialsService.getAllReports(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.selectedDate,\r\n\t\t\t\t0,\r\n\t\t\t\tthis.reportModelHeader\r\n\t\t\t);\r\n\r\n\t\t\t\r\n\t\t} catch (err) {\r\n\t\t\tthis.NotificationService.error('Error Downloading Report');\r\n\t\t}\r\n\r\n\t\tfinally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tasync activate() {\r\n\t\tthis.serviceData = this.CashflowStatementDataService;\r\n\t\tthis.financialsServiceData = this.FinancialsService;\r\n\t\tthis.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tlet buildingName = '';\r\n\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n if (userProfile) {\r\n if (!this.selectedBuildingRef) {\r\n this.selectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n }\r\n\t\t\tconst selectedBuilding = userProfile.BuildingProfiles.find((building) => {\r\n\t\t\t\treturn building.SchemeReference.toUpperCase().trim() === this.selectedBuildingRef.toUpperCase().trim();\r\n\t\t\t});\r\n\r\n\t\t\tif (selectedBuilding) {\r\n\t\t\t\tbuildingName = selectedBuilding.SchemeName;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tawait this.getFinancialYears(true);\r\n\t\tthis.selectedBuildingName = buildingName;\r\n\t\tvar temp = await this.FinancialsService.setReportURL(this.selectedBuildingRef, this.selectedDate);\r\n\t\t$(\"#mobileLink\").attr(\"href\", temp);\r\n\t}\r\n\r\n\tasync getFinancialYears(isInit) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.FinancialsService.getFinancialYears(this.selectedBuildingRef, this.today);\r\n\t\t\tif (isInit) {\r\n\t\t\t\tawait this.getSelectedDate(true);\r\n\t\t\t} else {\r\n\t\t\t\tthis.filterYear = this.FinancialsService.financialYears[\r\n\t\t\t\t\t(await this.FinancialsService.financialYears.length) - 1\r\n\t\t\t\t].WhenTo;\r\n\t\t\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\t\tawait this.getFinancialMonths(this.today);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading financial years\\n${err}`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialMonths(date, isInit) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tawait this.FinancialsService.getFinancialMonths(this.selectedBuildingRef, date || new Date());\r\n\t\t\tlet selectedMonthIndex = -1;\r\n\r\n\t\t\tconst selectedDateMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n\t\t\tif (selectedDateMonth) {\r\n\t\t\t\tif (this.FinancialsService.financialMonths && this.FinancialsService.financialMonths.length > 0) {\r\n\t\t\t\t\tconst foundMonth = this.FinancialsService.financialMonths.find((month, index) => {\r\n\t\t\t\t\t\tconst momentMonth = moment(month.WhenFrom);\r\n\t\t\t\t\t\tif (momentMonth.isSame(selectedDateMonth, 'month')) {\r\n\t\t\t\t\t\t\tselectedMonthIndex = index;\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif (selectedMonthIndex > -1 && foundMonth) {\r\n\t\t\t\t\t\tthis.filterMonth = this.FinancialsService.financialMonths[selectedMonthIndex].WhenFrom;\r\n\t\t\t\t\t\tthis._filterOutFutureMonths();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (date && isInit) {\r\n\t\t\t\tthis.FinancialsService.financialMonths.filter(async (month, i) => {\r\n\t\t\t\t\tconst monthDateStr = month.WhenFrom.substr(0, 10);\r\n\t\t\t\t\tconst monthDate = moment(new Date(monthDateStr), 'YYYY-DD-MM');\r\n\t\t\t\t\tconst selectedMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n\t\t\t\t\tif (monthDate.isSame(selectedMonth, 'month')) {\r\n\t\t\t\t\t\tselectedMonthIndex = i;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (selectedMonthIndex === -1) {\r\n\t\t\t\t\tthis.filterMonth = '';\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.filterMonth = this.FinancialsService.financialMonths[selectedMonthIndex].WhenFrom;\r\n\t\t\t\t}\r\n\t\t\t} else if (isInit) {\r\n\t\t\t\tthis.filterMonth = this.FinancialsService.financialMonths[\r\n\t\t\t\t\tthis.FinancialsService.financialMonths.length - 1\r\n\t\t\t\t].WhenFrom;\r\n\t\t\t}\r\n\t\t\tif (this.filterMonth) {\r\n\t\t\t\tthis.selectedDate = this.filterMonth;\r\n\t\t\t\tawait this.getCashflowStatement();\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading financial months\\n${err}`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tasync onSelectedBuildingChanged(event, schemeRef) {\r\n\t\tif (schemeRef && schemeRef['length'] > 2) this.selectedBuildingRef = schemeRef;\r\n\t\telse this.selectedBuildingRef = await this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tif (this.selectedBuildingRef && this.selectedBuildingRef.length > 2) {\r\n\t\t\tawait this.activate();\r\n\t\t}\r\n\t}\r\n\r\n\tasync getCashflowStatement() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\t\t\tthis.selectedDate = await this.FinancialsService.getSelectedDate(this.selectedDate);\r\n\t\t\tawait this.CashflowStatementDataService.getCashflowStatement(this.selectedBuildingRef, this.selectedDate);\r\n\r\n\t\t\tawait this.getFinancialState();\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t\tthis._cleanUp();\r\n\t\t}\r\n\t}\r\n\r\n\tleviesReceivedSummary() {\r\n\t\tif (!this.CashflowStatementDataService.leviesRecievedSummary) {\r\n\t\t\treturn {\r\n\t\t\t\tGrossLeviesRecieved: \"0\",\r\n\t\t\t\tTotalLegalFessPaid: \"0\",\r\n\t\t\t\tNetLeviesRecieved: \"0\"\r\n\t\t\t};\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn this.CashflowStatementDataService.leviesRecievedSummary;\r\n\t}\r\n\r\n\tshouldShowLeviesReceivedSummary() {\r\n\t\tif (\r\n\t\t\tthis.leviesReceivedSummary().GrossLeviesRecieved == \"0\" &&\r\n\t\t\tthis.leviesReceivedSummary().TotalLegalFessPaid == \"0\" &&\r\n\t\t\tthis.leviesReceivedSummary().NetLeviesRecieved == \"0\"\r\n\t\t) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\tasync getYearlyCashflowStatement() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\t\t\tthis.selectedDate = await this.FinancialsService.getSelectedDate(this.selectedDate);\r\n\t\t\tawait this.CashflowStatementDataService.getYearlyCashflowStatement(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.selectedDate\r\n\t\t\t);\r\n\t\t\tthis.$timeout(() => { });\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading yearly cashflow statement\\n${err}`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tsaveSelectedDate() {\r\n\t\tconst selectedYear = moment(this.filterYear).toDate();\r\n\t\tconst selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n\t\tthis.LocalStorageService.save('selectedReportYear', selectedYear);\r\n\t\tthis.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n\t}\r\n\r\n\tsaveSelectedDateWithMonth(month) {\r\n\t\tconst selectedYear = moment(this.filterYear).toDate();\r\n\t\tconst selectedMonth = moment(month).add(3, 'h').toDate();\r\n\t\tthis.LocalStorageService.save('selectedReportYear', selectedYear);\r\n\t\tthis.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n\t}\r\n\r\n\tasync getSelectedDate(isInit) {\r\n\t\tconst selectedDateYear = await this.FinancialsService.getSelectedYear();\r\n\t\tconst selectedDateMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n\t\tif (isInit) {\r\n\t\t\tfor (let i = 0; i < this.FinancialsService.financialYears.length; i++) {\r\n\t\t\t\tconst yearRaw = this.FinancialsService.financialYears[i];\r\n\r\n\t\t\t\tif (selectedDateYear.isBetween(yearRaw.WhenFrom, yearRaw.WhenTo)) {\r\n\t\t\t\t\tthis.filterYear = this.FinancialsService.financialYears[i].WhenTo;\r\n\t\t\t\t\tthis.selectedDateYear = await this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst date = selectedDateYear ? selectedDateYear : new Date();\r\n\t\t\tawait this.getFinancialMonths(date, true);\r\n\t\t}\r\n\t}\r\n\r\n\tcloseTransaction(item, type, event) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tconst accountCode = item.AccountCode;\r\n\t\t\tthis.CashflowStatementDataService.transactions[accountCode] = [];\r\n\t\t\tconst element = angular.element(angular.element(event.currentTarget).parents(`#${type}-${accountCode}`)[0]);\r\n\t\t\tangular.element(element.removeClass('in'));\r\n\t\t});\r\n\t}\r\n\tasync accounttabOpen(accCode) {\r\n\t\tif (accCode == \"62900\") this.openFinancials('wages-roll')\r\n\t}\r\n\r\n\tasync accountClick(accountCode, event, type) {\r\n\t\tconst element = angular.element(event.currentTarget)[0];\r\n\t\tconst { className } = element;\r\n\r\n\t\tif (!className.includes('actualBudget-value') && !className.includes('clickable')) {\r\n\t\t\tthis.CashflowStatementDataService.transactions[accountCode] = [];\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tswitch (accountCode) {\r\n\t\t\tcase '12000':\r\n\t\t\t\tbreak;\r\n\t\t\tcase '12020':\r\n\t\t\t\tthis._handleAccordionToggle(type, accountCode);\r\n\t\t\t\tawait this.getTransactions(accountCode, true);\r\n\t\t\t\tbreak;\r\n\t\t\tcase '12025':\r\n\t\t\t\tawait this.showStatement(accountCode);\r\n\t\t\t\tbreak;\r\n\t\t\tcase '12000':\r\n\t\t\tcase '12050':\r\n\t\t\tcase '13000':\r\n\t\t\t\tthis.CashflowStatementDataService.transactions[accountCode] = [];\r\n\t\t\t\tbreak;\r\n\t\t\tcase '12030':\r\n\t\t\tcase '12035':\r\n\t\t\tcase '12040':\r\n\t\t\tcase '12045':\r\n\t\t\t\tawait this.showStatement(accountCode);\r\n\t\t\t\tbreak;\r\n\t\t\tcase '400000':\r\n\t\t\tcase '400075':\r\n\t\t\tcase '1':\r\n\t\t\t\tthis.saveSelectedDate();\r\n\t\t\t\tangular.element('#nagNavigation').modal('show');\r\n\t\t\t\tbreak;\r\n\t\t\tcase '41005':\r\n\t\t\t\tthis._handleAccordionToggle(type, accountCode);\r\n\t\t\t\tawait this.getTransactions(accountCode, true);\r\n\t\t\t\tbreak;\r\n\t\t\tcase '62700':\r\n\t\t\t\tawait this.showPolicy();\r\n\t\t\t\tbreak;\r\n\t\t\tcase '62900':\r\n\t\t\t\tthis._handleAccordionToggle(type, accountCode);\r\n\t\t\t\tawait this.getTransactions(accountCode);\r\n\t\t\t\t//TODO: show Payslip\r\n\t\t\t\t//TODO: remove getTransactions(accountCode);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tif (accountCode.length === 5) {\r\n\t\t\t\t\tthis._handleAccordionToggle(type, accountCode);\r\n\t\t\t\t\tawait this.getTransactions(accountCode);\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tasync accountClickYear(accountCode, event, type) {\r\n\t\tawait this.getTransactionsForYear(accountCode);\r\n\t\tthis._handleAccordionToggle(type, accountCode);\r\n\t}\r\n\r\n\tasync getTransactions(accountCode, isInterest, selectedDate = null) {\r\n\t\tthis.setIsLoadingTranstactions(accountCode, true);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.CashflowStatementDataService.getTransactions(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tselectedDate ? selectedDate : this.selectedDate,\r\n\t\t\t\taccountCode,\r\n\t\t\t\tisInterest\r\n\t\t\t);\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading transactions\\n${err}`);\r\n\t\t} finally {\r\n\t\t\tthis.setIsLoadingTranstactions(accountCode, false);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getTransactionsForYear(accountCode, selectedDate = null) {\r\n\t\tthis.setIsLoadingTranstactions(accountCode, true);\r\n\r\n\t\ttry {\r\n\t\t\tconst payload = {\r\n\t\t\t\taccountCode,\r\n\t\t\t\tschemeRef: this.selectedBuildingRef,\r\n\t\t\t\tdate: selectedDate ? selectedDate : this.selectedDate\r\n\t\t\t};\r\n\r\n\t\t\tawait this.CashflowStatementDataService.getTransactionsForYear(payload);\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading transactions for year\\n${err}`);\r\n\t\t} finally {\r\n\t\t\tthis.setIsLoadingTranstactions(accountCode, false);\r\n\t\t}\r\n\t}\r\n\r\n\tsetIsLoadingTranstactions(accCode, isBusy) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tif (!this.isLoadingTransactions) {\r\n\t\t\t\tthis.isLoadingTransactions = {};\r\n\t\t\t}\r\n\r\n\t\t\tthis.isLoadingTransactions[accCode] = isBusy;\r\n\t\t});\r\n\t}\r\n\r\n\tsetIsLoadingTranstactionsForYear(accCode, isBusy) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tif (!this.isLoadingTransactionsForYear) {\r\n\t\t\t\tthis.isLoadingTransactionsForYear = {};\r\n\t\t\t}\r\n\r\n\t\t\tthis.isLoadingTransactionsForYear[accCode] = isBusy;\r\n\t\t});\r\n\t}\r\n\r\n\tnavigateToLevyRoll() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tangular.element('#nagNavigation').modal('hide');\r\n\r\n\t\t\tangular.element('#nagNavigation').on('hidden.bs.modal', () => {\r\n\t\t\t\tthis.$rootScope.$broadcast('navigate-changed', 'levy-roll', { date: this.filterMonth });\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\tasync showStatement(accountCode) {\r\n\t\t\r\n\t\tthis.investmentStatment = {\r\n\t\t\tcurrentAttachment: {\r\n\t\t\t\tdocumentsUrl: ''\r\n\t\t\t},\r\n\t\t\tattachments: []\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tconst results = await this.CashflowStatementDataService.loadStatements(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.filterMonth,\r\n\t\t\t\taccountCode\r\n\t\t\t);\r\n\t\t\tthis.investmentStatment.attachments = results.map((file) => {\r\n\t\t\t\tconst attachmentUrl = `${pretorOnlineUrl}${pretorOnlineUrl.endsWith('/')\r\n\t\t\t\t\t? ''\r\n\t\t\t\t\t: '/'}documents/byid/${file.Id}/?handleNotFound=false`;\r\n\t\t\t\tfile.documentsUrl = this.$sce.trustAsResourceUrl(attachmentUrl);\r\n\r\n\t\t\t\treturn file;\r\n\t\t\t});\r\n\r\n\t\t\tthis.investmentStatment.currentAttachment = this.investmentStatment.attachments[0];\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading statement\\n${err}`);\r\n\t\t\tthis.investmentStatment = {\r\n\t\t\t\tcurrentAttachment: {\r\n\t\t\t\t\tdocumentsUrl: 'http://www.notfount.co.za/error'\r\n\t\t\t\t},\r\n\t\t\t\tattachments: []\r\n\t\t\t};\r\n\t\t} finally {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tangular.element('#investmentBankStatementQueryModal').modal('show');\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tasync showPolicy() {\r\n\t\tthis.policyDocument = {\r\n\t\t\tcurrentAttachment: {\r\n\t\t\t\tdocumentsUrl: ''\r\n\t\t\t},\r\n\t\t\tattachments: []\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tconst results = await this.CashflowStatementDataService.loadPolicyDocuments(this.selectedBuildingRef);\r\n\t\t\tthis.policyDocument.attachments = results.map((file) => {\r\n\t\t\t\tconst attachmentUrl = `${pretorOnlineUrl}${pretorOnlineUrl.endsWith('/')\r\n\t\t\t\t\t? ''\r\n\t\t\t\t\t: '/'}documents/byid/${file.Id}/?handleNotFound=false`;\r\n\t\t\t\tfile.documentsUrl = this.$sce.trustAsResourceUrl(attachmentUrl);\r\n\r\n\t\t\t\treturn file;\r\n\t\t\t});\r\n\r\n\t\t\tthis.policyDocument.currentAttachment = this.policyDocument.attachments[0];\r\n\r\n\t\t\tthis.$timeout(() => angular.element('#policyDocumentModal').modal('show'));\r\n\t\t} catch (err) {\r\n\t\t\tthis.policyDocument = {\r\n\t\t\t\tcurrentAttachment: {\r\n\t\t\t\t\tdocumentsUrl: 'http://www.notfound.co.za/error'\r\n\t\t\t\t},\r\n\t\t\t\tattachments: []\r\n\t\t\t};\r\n\t\t} finally {\r\n\t\t}\r\n\t}\r\n\r\n\tgetInvestmentAttachmentPath(statementAttachment) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tif ('CorrelationId' in this.investmentStatment.currentAttachment) {\r\n\t\t\t\tthis.investmentStatment.currentAttachment = this.investmentStatment.attachments.find((attachment) => {\r\n\t\t\t\t\treturn attachment.CorrelationId === statementAttachment.CorrelationId;\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tthis._mapStatements();\r\n\t\t\t\tthis.investmentStatment.currentAttachment = this.investmentStatment.attachments.find((statements) => {\r\n\t\t\t\t\treturn statements.Id === statementAttachment.Id;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetPolicyAttachmentPath(id) {\r\n\t\tthis.policyDocument.currentAttachment = this.policyDocument.attachments.find((attachment) => {\r\n\t\t\treturn attachment.CorrelationId === id;\r\n\t\t});\r\n\t}\r\n\r\n\tasync showPayment(payment) {\r\n\t\tthis.webPaymentApprovalIndividual = undefined;\r\n\t\tthis.iframePaymentDocuments = undefined;\r\n\t\tif (typeof payment != 'undefined' && payment != null) {\r\n\t\t\tthis.webPaymentApprovalIndividual = payment;\r\n\r\n\t\t\tfor (let j = 0; j < this.webPaymentApprovalIndividual.Attachments.length; j++) {\r\n\t\t\t\tif (this.webPaymentApprovalIndividual.Attachments[j].IsInvoice) {\r\n\t\t\t\t\tconst { Path, DocumentExtension } = this.webPaymentApprovalIndividual.Attachments[j];\r\n\t\t\t\t\tconst pathToLowerCase = Path.toLowerCase();\r\n\t\t\t\t\tlet url = '';\r\n\r\n\t\t\t\t\tif (!pathToLowerCase.endsWith(`${DocumentExtension.toLowerCase()}`)) {\r\n\t\t\t\t\t\turl = `${Path}${DocumentExtension ? DocumentExtension.toLowerCase() : ''}`;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\turl = Path;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.iframePaymentDocuments = this.$sce.trustAsResourceUrl(url);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tangular.element('#paymentViewModal').on('show.bs.modal', (evt) => {\r\n\t\t\tif (!!this.iframePaymentDocuments) {\r\n\t\t\t\tthis.getInvoicePath(0);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.$timeout(() => {\r\n\t\t\tangular.element('#paymentViewModal').modal('show');\r\n\t\t});\r\n\t\treturn;\r\n\t}\r\n\r\n\tasync showBankStatement(accountCode, date,lineMemo) {\r\n\t\ttry {\r\n\t\t\tdate = date.split('-');\r\n\t\t\tdate[date.length - 1] = '01';\r\n\t\t\tdate = date.join('-');\r\n\t\t\tconst results = await this.CashflowStatementDataService.getInterestTransactionDetails(accountCode, date);\r\n\r\n\t\t\tawait this.previewBankStatement(results,lineMemo);\r\n\t\t} catch (error) {\r\n\t\t\tthis.investmentStatment = {\r\n\t\t\t\tcurrentAttachment: {\r\n\t\t\t\t\tdocumentsUrl: 'http://www.notfount.co.za/error'\r\n\t\t\t\t},\r\n\t\t\t\tattachments: []\r\n\t\t\t};\r\n\t\t\tconsole.error(`Error while loading Bank Statement: `, error);\r\n\t\t\tthis.NotificationService.error(`Error loading back statement(s): ${accountCode}`);\r\n\t\t} finally {\r\n\t\t}\r\n\t}\r\n\r\n\tasync previewBankStatement(records,lineMemo) {\r\n\t\tthis.investmentStatment = {};\r\n\r\n\t\ttry {\r\n\t\t\tthis.investmentStatment = {\r\n\t\t\t\tcurrentAttachment: {\r\n\t\t\t\t\tdocumentsUrl: ''\r\n\t\t\t\t},\r\n\t\t\t\tattachments: []\r\n\t\t\t};\r\n\t\t\tif (lineMemo) {\r\n\t\t\t\tfor (var i = 0; i < records.length; i++) {\r\n\t\t\t\t\tif (lineMemo.includes(records[i].Description)) {\r\n\t\t\t\t\t\tthis._mapStatements(i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthis._mapStatements();\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\tthis.$timeout(() => angular.element('#investmentBankStatementQueryModal').modal('show'));\r\n\t\t} catch (error) {\r\n\t\t\tconst msg = 'Error loading statement';\r\n\t\t\tconsole.error(`${msg}`, error);\r\n\t\t\tthis.investmentStatment = {};\r\n\t\t\tthis.NotificationService.error(msg);\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tgetInvoicePath(index) {\r\n\t\tthis.iframePaymentDocuments = undefined;\r\n\t\tconst { Path, DocumentExtension } = this.webPaymentApprovalIndividual.Attachments[index];\r\n\t\tconst pathToLowerCase = Path.toLowerCase();\r\n\r\n\t\tlet url;\r\n\t\tif (!!DocumentExtension && !pathToLowerCase.endsWith(`${DocumentExtension.toLowerCase()}`)) {\r\n\t\t\turl = `${Path}${DocumentExtension}`;\r\n\t\t} else {\r\n\t\t\turl = Path;\r\n\t\t}\r\n\r\n\t\tthis.iframePaymentDocuments = this.$sce.trustAsResourceUrl(url);\r\n\t}\r\n\r\n\tisInterest(accountCode) {\r\n\t\tconst isInterest = this.interestAccountCodes.includes(accountCode);\r\n\t\treturn isInterest;\r\n\t}\r\n\r\n\t_handleAccordionToggle(type, accountCode) {\r\n\t\tconst $accordion = angular.element(`#${type}-${accountCode}`);\r\n\t\tconst isExpanded = $accordion.hasClass('in');\r\n\r\n\t\tif (!isExpanded) {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\t$accordion.collapse('show');\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_mapStatements(index = 0) {\r\n\t\tlet { statements } = this.CashflowStatementDataService;\r\n\t\tstatements = statements.map((statement) => {\r\n\t\t\treturn {\r\n\t\t\t\t...statement,\r\n\t\t\t\tdocumentsUrl: this._idToFilePath(statement.Id)\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tconst Attachments = statements;\r\n\t\tthis.investmentStatment = {\r\n\t\t\tAttachments,\r\n\t\t\tattachments: statements,\r\n\t\t\tcurrentAttachment: statements[index]\r\n\t\t};\r\n\t}\r\n\r\n\t_idToFilePath(id) {\r\n\t\tconst path = `${pretorOnlineUrl}${pretorOnlineUrl.endsWith('/')\r\n\t\t\t? ''\r\n\t\t\t: '/'}documents/byid/${id}/?handleNotFound=false`;\r\n\r\n\t\treturn this.$sce.trustAsResourceUrl(path);\r\n\t}\r\n\r\n\tget monthsToDate() {\r\n\t\tif (!!!this.filterMonth) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet results;\r\n\t\tconst selectedYearMoment = moment(this.filterMonth);\r\n\t\tconst selectedYear = this.FinancialsService.financialYears.find((financialYear) => {\r\n\t\t\tconst { WhenTo, WhenFrom } = financialYear;\r\n\t\t\tconst whenToMoment = moment(WhenTo);\r\n\t\t\tconst whenFromMoment = moment(WhenFrom);\r\n\r\n\t\t\tlet isFound =\r\n\t\t\t\twhenFromMoment.isSameOrBefore(selectedYearMoment) && whenToMoment.isSameOrAfter(selectedYearMoment);\r\n\r\n\t\t\treturn isFound;\r\n\t\t});\r\n\r\n\t\tif (selectedYear) {\r\n\t\t\tconst { WhenFrom } = selectedYear;\r\n\t\t\tconst whenFromMoment = moment(WhenFrom);\r\n\t\t\tresults = `${whenFromMoment.format('MMM YYYY')} - ${selectedYearMoment.format('MMM YYYY')}`;\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tget monthlyStyles() {\r\n\t\treturn `\r\n\t\ttop: 6.9em;\r\n\t\tleft: 4.93em;\r\n\t\twidth: 91.74%;\r\n\t\tz-index: 10;\r\n\t\tposition: fixed;\r\n\t\tbackground-color: #e8e8e8;\r\n\t\t`;\r\n\t}\r\n\r\n\tget yearlyStyles() {\r\n\t\treturn `\r\n\t\ttop: 7.9em;\r\n\t\tleft: 4.93em;\r\n\t\twidth: 91.74%;\r\n\t\tz-index: 10;\r\n\t\tposition: fixed;\r\n\t\tbackground-color: #e8e8e8;\r\n\t\t`;\r\n\t}\r\n\r\n\tasync changeView() {\r\n\t\tthis.isMonthlyView = !this.isMonthlyView;\r\n\t\tif (!this.isMonthlyView) {\r\n\t\t\tthis.isYearFilterActive = true;\r\n\t\t\tawait this.getYearlyCashflowStatement();\r\n\t\t\tthis.stickableStyles = this.yearlyStyles;\r\n\t\t} else {\r\n\t\t\tthis.isYearFilterActive = false;\r\n\t\t\tawait this.getCashflowStatement();\r\n\t\t\tthis.stickableStyles = this.monthlyStyles;\r\n\t\t}\r\n\t}\r\n\r\n\tasync level5Selected(item, $event) {\r\n\t\tangular.element('div.highlighted').each((index, element) => {\r\n\t\t\tangular.element(element).removeClass('highlighted');\r\n\t\t});\r\n\r\n\t\tlet shouldShow = false;\r\n\r\n\t\tconsole.log(item);\r\n\t\tconsole.log($event);\r\n\r\n\t\tif ($event.currentTarget.id === 'closeTransactions') {\r\n\t\t\tlet $element;\r\n\r\n\t\t\tconsole.log(\r\n\t\t\t\tangular.element(\r\n\t\t\t\t\tangular.element($event.target)[0].parentNode.parentNode.parentNode.parentNode.parentNode\r\n\t\t\t\t)\r\n\t\t\t);\r\n\r\n\t\t\tif (angular.element($event.target)[0].tagName === 'SPAN') {\r\n\t\t\t\t$element = angular.element(angular.element($event.target).parent()[0]).addClass('highlighted');\r\n\t\t\t} else {\r\n\t\t\t\t$element = angular.element($event.target).addClass('highlighted');\r\n\t\t\t}\r\n\r\n\t\t\tconsole.log($element);\r\n\r\n\t\t\tconst cssSelector = `[id*=-${item.AccountCode}-body].panel-collapse`;\r\n\t\t\tconst $target = angular.element(cssSelector);\r\n\r\n\t\t\t$target.collapse('hide');\r\n\t\t\tthis.previousMonth.Date = '';\r\n\t\t\t$element.removeClass('highlighted');\r\n\t\t}\r\n\r\n\t\tswitch (item.AccountCode) {\r\n\t\t\tcase '12000':\r\n\t\t\tcase '12020':\r\n\t\t\tcase '12025':\r\n\t\t\tcase '12050':\r\n\t\t\tcase '13000':\r\n\t\t\tcase '62700':\r\n\t\t\t\tbreak;\r\n\t\t\tcase '12025':\r\n\t\t\tcase '12030':\r\n\t\t\tcase '12035':\r\n\t\t\tcase '12040':\r\n\t\t\tcase '12045':\r\n\t\t\tcase '41005':\r\n\t\t\t\tshouldShow = true;\r\n\t\t\tcase '400000':\r\n\t\t\tcase '400075':\r\n\t\t\tcase '1':\r\n\t\t\t\tvar date = angular.element($event.target)[0].id;\r\n\t\t\t\tif (typeof date !== 'undefined') {\r\n\t\t\t\t\tthis.saveSelectedDateWithMonth(date);\r\n\t\t\t\t\tthis.previousMonth.Date = date;\r\n\t\t\t\t\tthis.$rootScope.$broadcast('navigate-changed', 'levy-roll');\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase '62700':\r\n\t\t\t\tawait this.showPolicy();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tif (item.AccountCode.length === 5) {\r\n\t\t\t\t\tshouldShow = true;\r\n\t\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (shouldShow) {\r\n\t\t\tthis._handleShowDetails($event, item);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialState() {\r\n\t\tconst type = 0;\r\n\t\tconst schemeRef = this.selectedBuildingRef;\r\n\t\tconst momentDate = moment(this.selectedDate, 'YYYY-MM-DD');\r\n\t\tconst formattedDate = momentDate.format('YYYY-MM-DD');\r\n\t\tconst date = `${formattedDate.substr(0, 8)}01`;\r\n\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tconst results = await this.FinancialsService.getFinancialState(schemeRef, date, type);\r\n\r\n\t\t\tconst { status, message } = results;\r\n\t\t\tthis.statusInformation = message;\r\n\t\t} catch (error) {\r\n\t\t\tthis.NotificationService.error('Error loading cashflow statement status');\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tgetTarget(type, item) {\r\n\t\tlet target = '';\r\n\r\n\t\tif (item.Children && item.Children.length > 0) {\r\n\t\t\ttarget = `#${type}-${item.AccountCode}-body`;\r\n\t\t}\r\n\r\n\t\treturn target;\r\n\t}\r\n\r\n\t_handleShowDetails($event, item) {\r\n\t\tlet $element;\r\n\t\tif (angular.element($event.target)[0].tagName === 'SPAN') {\r\n\t\t\t$element = angular.element(angular.element($event.target).parent()[0]).addClass('highlighted');\r\n\t\t} else {\r\n\t\t\t$element = angular.element($event.target).addClass('highlighted');\r\n\t\t}\r\n\t\tconst date = angular.element($event.target)[0].id;\r\n\t\tif (typeof date !== 'undefined') {\r\n\t\t\tconst cssSelector = `[id*=-${item.AccountCode}-body].panel-collapse`;\r\n\t\t\tconst $target = angular.element(cssSelector);\r\n\t\t\tconst previousDateStr = moment(this.previousMonth.Date).format('DD/MM/YYYY');\r\n\t\t\tconst currentDateStr = moment(date).format('DD/MM/YYYY');\r\n\t\t\tconst previousDate = moment(previousDateStr);\r\n\t\t\tconst currentDate = moment(currentDateStr);\r\n\t\t\tconst shouldHide = previousDate.isSame(currentDate);\r\n\t\t\tif (shouldHide) {\r\n\t\t\t\t$target.collapse('hide');\r\n\t\t\t\tthis.previousMonth.Date = '';\r\n\t\t\t\t$element.removeClass('highlighted');\r\n\t\t\t} else {\r\n\t\t\t\tthis.getTransactions(item.AccountCode, null, date);\r\n\t\t\t\t$target.collapse('show');\r\n\t\t\t\tthis.previousMonth.Date = date;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t_switchIsBusyLoading(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isLoading = flag;\r\n\t\t});\r\n\t}\r\n\r\n\t_switchIsShowingYearlyTransactions(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isShowingYearlyTransactions = flag;\r\n\t\t});\r\n\t}\r\n\r\n\t_cleanUp() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tangular.element('[data-target=\"#administrative-400000\"]').attr('data-target', '');\r\n\r\n\t\t\tthis._registerClicks();\r\n\t\t}, 800);\r\n\t}\r\n\t\r\n\tallowAction(actionName) {\r\n return this.AuthorizationService.isAuthorized(actionName);\r\n }\r\n\r\n\t_filterOutFutureMonths() {\r\n\t\tconst today = new Date();\r\n\t\tconst formatedDate = moment(today).format('YYYY MMMM');\r\n\t\tconst currentYear = formatedDate.split(' ')[0];\r\n\t\tconst currentMonth = formatedDate.split(' ')[1];\r\n\r\n\t\tlet foundIndex = -1;\r\n\t\tconst found = this.FinancialsService.financialMonths.find((month, index) => {\r\n\t\t\tconst fields = month.FriendlyNameMonth.split(' ');\r\n\t\t\tconst yearStr = fields[1];\r\n\t\t\tconst monthStr = fields[0];\r\n\t\t\tconst found = currentYear === yearStr && currentMonth === monthStr;\r\n\r\n\t\t\tif (found) {\r\n\t\t\t\tfoundIndex = index;\r\n\t\t\t}\r\n\t\t\treturn found;\r\n\t\t});\r\n\r\n\t\tif (found && foundIndex > -1) {\r\n\t\t\tconst filteredMonths = this.FinancialsService.financialMonths.filter(\r\n\t\t\t\t(month, index) => index < foundIndex + 1\r\n\t\t\t);\r\n\r\n\t\t\tif (filteredMonths && filteredMonths.length < this.FinancialsService.financialMonths.length) {\r\n\t\t\t\tthis.FinancialsService.financialMonths = filteredMonths;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass CashflowStatementDataService {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tasync init() {\r\n\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\r\n\t\tthis.statements = [];\r\n\t\tthis.transactions = {};\r\n\t\tthis.yearlyTransactions = {};\r\n\t\tthis.cashflowData = undefined;\r\n\t\tthis.yearlyCashflowData = undefined;\r\n\t}\r\n\r\n\tasync getCashflowStatement(schemeRef, date) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiCashflowStatement');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiCashflowStatement');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\tdate = this.FinancialsService.getMapFirstDay(date);\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tif (!!!headers || (!!headers && (!!!headers.userName || !!!headers.sessionToken))) {\r\n\t\t\t\tconst error = `Could not load Cashflow as the 'Username' and/or 'Session Token' is missing`;\r\n\t\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, date, { headers });\r\n\r\n\t\t\tconst { data } = results;\r\n\t\t\t\r\n\t\t\tthis.cashflowData = data;\r\n\t\t\tthis.leviesRecievedSummary = this.cashflowData.LeviesRecievedSummary;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getYearlyCashflowStatement(schemeRef, date) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiYearlyCashflowStatement');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiYearlyCashflowStatement');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\tdate = this.FinancialsService.getMapFirstDay(date);\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.post(url, date, { headers });\r\n\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.yearlyCashflowData = data;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getTransactions(schemeRef, date, accountCode, isInterest) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiTransactions');\r\n\t\t\tif (isInterest) {\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiInterestTransactions');\r\n\t\t\t}\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\tif (isInterest) {\r\n\t\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiInterestTransactions');\r\n\t\t\t\t} else {\r\n\t\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiTransactions');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\turl = `${url}?accountCode=${accountCode}`;\r\n\t\t\tdate = this.FinancialsService.getMapFirstDay(date);\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.post(url, date, { headers });\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tif (`${accountCode}` in this.transactions) {\r\n\t\t\t\tdelete this.transactions[accountCode];\r\n\t\t\t}\r\n\r\n\t\t\tthis.transactions[accountCode] = data;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync loadStatements(selectedBuilding, selectedDate, accountCode) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiRecordAttachment');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiRecordAttachment');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', selectedBuilding).trim();\r\n\t\t\turl += `?date=${selectedDate}&accountCode=${accountCode}`;\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst data = await this.$http.get(url, { headers });\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data.data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync loadPolicyDocuments(selectedBuilding) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetLatestDocumentAttachmentsForBuildingAndType');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/documents/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetLatestDocumentAttachmentsForBuildingAndType');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', selectedBuilding).trim();\r\n\t\t\turl += `?recordTypeDescription=${14}`;\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst data = await this.$http.get(url, { headers });\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data.data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getInterestTransactionDetails(accountCode, date) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('InterestTransactionDetails');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('InterestTransactionDetails');\r\n\t\t\t}\r\n\r\n\t\t\tconst selectedBuilding = this.Utility.selectedBuildingRef;\r\n\r\n\t\t\turl += `?accountCode=${accountCode}&date=${date}`;\r\n\t\t\turl = url.replace('{schemeRef}', selectedBuilding);\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tconst { Data, WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.statements = this._mapStatements(Data);\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(Data));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Could not load Interest Transaction Details Account: ${accountCode}, Date: ${date}`);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tthis.statements = [];\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getTransactionsForYear({ schemeRef, date, accountCode }) {\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiTransactionsForYear');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiInterestTransactions');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\turl = `${url}?accountCode=${accountCode}`;\r\n\t\t\tdate = this.FinancialsService.getMapFirstDay(date);\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.post(url, date, { headers });\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tif (`${accountCode}` in this.transactions) {\r\n\t\t\t\tdelete this.transactions[accountCode];\r\n\t\t\t}\r\n\r\n\t\t\tthis.transactions = {\r\n\t\t\t\t...this.transactions,\r\n\t\t\t\t[accountCode]: this._mapYearlyTransactions(data)\r\n\t\t\t};\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t_mapYearlyTransactions(original) {\r\n\t\tlet transactions = [];\r\n\r\n\t\toriginal.map((trans) => {\r\n\t\t\ttransactions = [ ...transactions, ...trans.Transactions ];\r\n\t\t});\r\n\r\n\t\treturn transactions;\r\n\t}\r\n\r\n\t_mapStatements(original) {\r\n\t\tlet mapped = original.map((attachment) => {\r\n\t\t\tconst { Id, Description } = attachment;\r\n\r\n\t\t\tconst attachmentUrl = `${pretorOnlineUrl}${pretorOnlineUrl.endsWith('/')\r\n\t\t\t\t? ''\r\n\t\t\t\t: '/'}documents/byid/${Id}/?handleNotFound=false`;\r\n\r\n\t\t\treturn {\r\n\t\t\t\tId,\r\n\t\t\t\tDescription,\r\n\t\t\t\tdocumentsUrl: this.$sce.trustAsResourceUrl(attachmentUrl)\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn mapped;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$sce,\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tFinancialsService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew CashflowStatementDataService(\r\n\t\t$sce,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","/* @ngInject */\r\nexport default class ContractorsRollCtrl {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tContractorsRollService,\r\n AuthorizationService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.ContractorsRollService = ContractorsRollService;\r\n this.AuthorizationService = AuthorizationService;\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.isFilterActive = true;\r\n\t\tthis.filterYear = undefined;\r\n\t\tthis.reportModelHeader = '';\r\n\t\tthis.filterMonth = undefined;\r\n\r\n\t\tthis.selectedBuildingRef = '';\r\n\t\tthis.selectedBuildingName = '';\r\n\t\tthis.investmentStatment = undefined;\r\n\t\tthis.financialsServiceData = undefined;\r\n\t\tthis.statusInformation = null;\r\n\r\n\t\tthis.today = this.Utility.getFormatedDate(new Date());\r\n\r\n\t\tconst { date } = this.$state.params;\r\n\r\n\t\tif (date) {\r\n\t\t\tconst strDate = date.substr(0, 10).replace('-', '/').replace('-', '/');\r\n\r\n\t\t\tconst momentDate = moment(strDate, 'YYYY/MM/DD');\r\n\t\t\tthis.selectedDate = this.Utility.getFormatedDate(momentDate.toDate());\r\n\t\t} else {\r\n\t\t\tthis.selectedDate = this.Utility.getFormatedDate(new Date());\r\n\t\t}\r\n\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(new Date());\r\n\r\n\t\tthis.$scope.$on('selected-building-changed', async (event, newValue) => {\r\n\t\t\tawait this.onSelectedBuildingChanged(this, newValue);\r\n\t\t});\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'contractorsRollVm.filterYear',\r\n\t\t\tasync (newValue, oldValue) => {\r\n\t\t\t\tif (newValue && newValue !== oldValue && oldValue) {\r\n\t\t\t\t\tawait this.getFinancialMonths(this.Utility.getFormatedDate(this.filterYear));\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\t}\r\n\r\n\tasync activate() {\r\n\t\tthis.financialsServiceData = this.FinancialsService;\r\n\t\tthis.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tlet buildingName = '';\r\n\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n\t\tif (userProfile) {\r\n\t\t\tif (!this.selectedBuildingRef) {\r\n this.selectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n }\r\n\t\t\tconst selectedBuilding = userProfile.BuildingProfiles.find((building) => {\r\n\t\t\t\treturn building.SchemeReference.toUpperCase().trim() === this.selectedBuildingRef.toUpperCase().trim();\r\n\t\t\t});\r\n\r\n\t\t\tif (selectedBuilding) {\r\n\t\t\t\tbuildingName = selectedBuilding.SchemeName;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tawait this.getFinancialYears(true);\r\n\t\tthis.selectedBuildingName = buildingName;\r\n\t}\r\n\r\n\topenFinancials(page) {\r\n this.saveSelectedDate();\r\n this.$rootScope.$broadcast('navigate-changed', page, { date: this.filterMonth });\r\n }\r\n\r\n\tsaveSelectedDate() {\r\n const selectedYear = moment(this.filterYear).toDate();\r\n const selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n this.LocalStorageService.save('selectedReportYear', selectedYear);\r\n this.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n }\r\n\r\n async gotoOldFinancials() {\r\n const date = moment(this.filterMonth).format('MMM YYYY');\r\n let nav = `Monthly Financial Statements>${date}`;\r\n nav = encodeURI(nav);\r\n this.$state.go('documents', { nav });\r\n }\r\n\r\n\tisDesktop() {\r\n\t\tthis.LocalStorageService.save('mediaDevice', 'mobile');\r\n\t\tconst mdvice = this.LocalStorageService.retrieve('mediaDevice');\r\n\t\tif (mdvice == 'mobile') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tasync filterByCurrentMonth() {\r\n\t\tthis.isFilterActive = true;\r\n\t\tawait this.getContractorsRoll();\r\n\t}\r\n\r\n\tasync filterByMonth() {\r\n\t\tif (this.filterMonth) {\r\n\t\t\tthis.selectedDate = this.Utility.getFormatedDate(this.filterMonth);\r\n\t\t\tawait this.getContractorsRoll();\r\n\t\t}\r\n\t}\r\n\r\n\tasync filterByYear() {\r\n\t\tawait this.filterByMonth();\r\n\t}\r\n\r\n\tasync getReport() {\r\n\t\tthis.reportModelHeader = `${this.selectedBuildingName} - Contractors Roll - ${moment(\r\n\t\t\tthis.Utility.getFormatedDate(this.filterMonth)\r\n\t\t).format('MMM YYYY')}`;\r\n\r\n\t\ttry {\r\n\t\t\tawait this.financialsServiceData.getReport(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.Utility.getFormatedDate(this.filterMonth),\r\n\t\t\t\t4,\r\n\t\t\t\tthis.reportModelHeader\r\n\t\t\t);\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(\"Error while generating Contractor' Roll\");\r\n\t\t}\r\n\t}\r\n\r\n\tasync onSelectedBuildingChanged(event, schemeRef) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tif (schemeRef && schemeRef['length'] > 2) this.selectedBuildingRef = schemeRef;\r\n\t\telse this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tif (this.selectedBuildingRef && this.selectedBuildingRef.length > 2) {\r\n\t\t\tawait this.activate();\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialYears(isInit) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.financialsServiceData.getFinancialYears(this.selectedBuildingRef, this.today);\r\n\t\t\tif (isInit) {\r\n\t\t\t\tawait this.getSelectedDate(true);\r\n\t\t\t} else {\r\n\t\t\t\tthis.filterYear = this.financialsServiceData.financialYears[\r\n\t\t\t\t\tthis.financialsServiceData.financialYears.length - 1\r\n\t\t\t\t].WhenTo;\r\n\t\t\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\t\tawait this.getFinancialMonths(this.today);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Error while loading Financial Years');\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialMonths(date, isInit) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tif (!date || date > this.today) {\r\n\t\t\tdate = this.today;\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tawait this.financialsServiceData.getFinancialMonths(this.selectedBuildingRef, date);\r\n\t\t\tlet selectedMonthIndex = -1;\r\n\r\n\t\t\tconst selectedDateMonth = this.FinancialsService.getSelectedMonth();\r\n\r\n\t\t\tif (selectedDateMonth) {\r\n\t\t\t\tconst foundMonth = this.FinancialsService.financialMonths.find((month, index) => {\r\n\t\t\t\t\tconst momentMonth = moment(month.WhenFrom);\r\n\t\t\t\t\tif (momentMonth.isSame(selectedDateMonth, 'month')) {\r\n\t\t\t\t\t\tselectedMonthIndex = index;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (selectedMonthIndex > -1 && foundMonth) {\r\n\t\t\t\t\tthis.filterMonth = this.FinancialsService.financialMonths[selectedMonthIndex].WhenFrom;\r\n\t\t\t\t}\r\n\t\t\t} else if (date && isInit) {\r\n\t\t\t\tthis.financialsServiceData.financialMonths.filter((month, i) => {\r\n\t\t\t\t\tconst monthDateStr = month.WhenFrom.substr(0, 10);\r\n\t\t\t\t\tconst monthDate = moment(new Date(monthDateStr), 'YYYY-DD-MM');\r\n\t\t\t\t\tconst selectedMonth = this.FinancialsService.getSelectedMonth();\r\n\r\n\t\t\t\t\tif (monthDate.isSame(selectedMonth, 'month')) {\r\n\t\t\t\t\t\tselectedMonthIndex = i;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (selectedMonthIndex === -1) {\r\n\t\t\t\t\tthis.filterMonth = '';\r\n\t\t\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.filterMonth = this.financialsServiceData.financialMonths[selectedMonthIndex].WhenFrom;\r\n\t\t\t\t}\r\n\t\t\t} else if (isInit) {\r\n\t\t\t\tthis.filterMonth = this.financialsServiceData.financialMonths[\r\n\t\t\t\t\tthis.financialsServiceData.financialMonths.length - 1\r\n\t\t\t\t].WhenFrom;\r\n\t\t\t}\r\n\t\t\tif (this.filterMonth) {\r\n\t\t\t\tawait this.getContractorsRoll();\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Error while loading Financial Months', err);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getContractorsRoll() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.selectedDate = this.FinancialsService.getSelectedDate(this.selectedDate);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.ContractorsRollService.getContractorsRoll(this.selectedBuildingRef, this.selectedDate);\r\n\t\t\tawait this.getFinancialState();\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Error while loading Contractors Roll', err);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tsaveSelectedDate() {\r\n\t\tconst selectedYear = moment(this.filterYear).toDate();\r\n\t\tconst selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n\t\tthis.LocalStorageService.save('selectedReportYear', selectedYear);\r\n\t\tthis.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n\t}\r\n\r\n\tasync getSelectedDate(isInit) {\r\n\t\tconst selectedDateYear = await this.FinancialsService.getSelectedYear();\r\n\t\tconst selectedDateMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n\t\tif (isInit) {\r\n\t\t\tfor (let i = 0; i < this.FinancialsService.financialYears.length; i++) {\r\n\t\t\t\tconst yearRaw = this.FinancialsService.financialYears[i];\r\n\r\n\t\t\t\tconst whenFrom = moment(yearRaw.WhenFrom).toDate();\r\n\t\t\t\tconst whenTo = moment(yearRaw.WhenTo).toDate();\r\n\r\n\t\t\t\tif (selectedDateMonth >= whenFrom && selectedDateMonth <= whenTo) {\r\n\t\t\t\t\tthis.filterYear = this.FinancialsService.financialYears[i].WhenTo;\r\n\t\t\t\t\tthis.selectedDateYear = await this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst date = this.selectedDateYear ? this.selectedDateYear : new Date();\r\n\t\t\tawait this.getFinancialMonths(date, true);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialState() {\r\n\t\tconst type = 4;\r\n\t\tconst schemeRef = this.selectedBuildingRef;\r\n\t\tconst momentDate = moment(this.selectedDate, 'YYYY-MM-DD');\r\n\t\tconst formattedDate = momentDate.format('YYYY-MM-DD');\r\n\t\tconst date = `${formattedDate.substr(0, 8)}01`;\r\n\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tconst results = await this.FinancialsService.getFinancialState(schemeRef, date, type);\r\n\r\n\t\t\tconst { status, message } = results;\r\n\t\t\tthis.statusInformation = message;\r\n\t\t} catch (error) {\r\n\t\t\tthis.NotificationService.error('Error contractors roll statement status');\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tallowAction(actionName) {\r\n return this.AuthorizationService.isAuthorized(actionName);\r\n }\r\n\r\n\t_switchIsBusyLoading(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isLoading = flag;\r\n\t\t});\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass ContractorsRollService {\r\n\tconstructor($sce, $http, Utility, $timeout, $rootScope, ContentService, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.contractorsRollData = undefined;\r\n\t\tthis.contractorsRollTotal = undefined;\r\n\t}\r\n\tasync getContractorsRoll(schemeRef, date) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiContractorsRoll');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiContractorsRoll');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tif (!!!headers || (!!headers && (!!!headers.userName || !!!headers.sessionToken))) {\r\n\t\t\t\tconst error = `Could not load Contractors Roll as the 'Username' and/or 'Session Token' is missing`;\r\n\t\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, date, { headers });\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tthis.contractorsRollData = data;\r\n\t\t\tthis.contractorsRollTotal = 0;\r\n\t\t\tthis.contractorsRollData.forEach((value) => {\r\n\t\t\t\tthis.contractorsRollTotal += value.Amount;\r\n\t\t\t});\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.contractorsRollData = null;\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$sce,\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew ContractorsRollService(\r\n\t\t$sce,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","/* @ngInject */\r\nexport default class DebtorAgeAnalysisCtrl {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tPagingService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tDebtorAgeAnalysisService,\r\n\t\tAuthorizationService,\r\n\t\tFinancialSummaryService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.PagingService = PagingService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.DebtorAgeAnalysisService = DebtorAgeAnalysisService;\r\n\t\tthis.AuthorizationService = AuthorizationService;\r\n\t\tthis.FinancialSummaryService = FinancialSummaryService;\r\n\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.selectLevytype = 'DebtorAgeAnalysis';\r\n\t\tthis.buildingWorkflowAndFeatures = {};\r\n\t\tthis.statusInformation = null;\r\n\t\tthis.canFilter = false;\r\n\t\tthis.serviceData = undefined;\r\n\t\tthis.financialsServiceData = undefined;\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.selectedBuildingRef = '';\r\n\t\tthis.selectedBuildingName = '';\r\n\t\tthis.filterMonth = undefined;\r\n\t\tthis.filterYear = undefined;\r\n\t\tthis.today = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDate = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.reportModelHeader = '';\r\n\t\tthis.onlyShowDebtors = false;\r\n\t\tthis.isFilterByOrderByUnitNumber = false;\r\n\t\tthis.orderByUnitNumber = false;\r\n\t\tthis.isFilterByorderByTotal = true;\r\n\t\tthis.orderByTotal = true;\r\n\t\tthis.isFilterByMonthActive = true;\r\n\t\tthis.isFilterByOnlyShowDebtors = false;\r\n\t\tthis.isfilterByShowAllLegalMemos = false;\r\n\t\tthis.isfilterByShowAllLegalAccountData = false;\r\n\r\n\t\tthis.DebtorAgeAnalysisPaging = this.PagingService;\r\n\t\tthis.isPagingNavigationVisible = false;\r\n\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\t\tthis.isShowAllLegalAccountData = false;\r\n\t\tthis.showHideLegalMemos = 'Show all Legal Memos';\r\n\t\tthis.showHideLegalAccountData = 'Show Legal Collection Roll';\r\n\t\tthis.OrderByFilter= 'total'\r\n\r\n\t\tthis.$scope.$on('selected-building-changed', (event, newValue) => {\r\n\t\t\tthis.onSelectedBuildingChanged(this, newValue);\r\n\t\t});\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'debtorAgeAnalysisVm.DebtorAgeAnalysisPaging.pageNumber',\r\n\t\t\t() => {\r\n\t\t\t\tthis.getDebtorAgeAnalysis();\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'debtorAgeAnalysisVm.DebtorAgeAnalysisPaging.maxPage',\r\n\t\t\t() => {\r\n\t\t\t\tthis.DebtorAgeAnalysisPaging.pageNumber = 1;\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'debtorAgeAnalysisVm.DebtorAgeAnalysisPaging.maxPageLegal',\r\n\t\t\t() => {\r\n\t\t\t\tthis.DebtorAgeAnalysisPaging.pageNumber = 1;\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\t}\r\n\r\n\topenFinancials(page) {\r\n\t\tthis.saveSelectedDate();\r\n\t\tthis.$rootScope.$broadcast('navigate-changed', page, { date: this.filterMonth });\r\n\t}\r\n\r\n\tsaveSelectedDate() {\r\n\t\tconst selectedYear = moment(this.filterYear).toDate();\r\n\t\tconst selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n\t\tthis.LocalStorageService.save('selectedReportYear', selectedYear);\r\n\t\tthis.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n\t}\r\n\r\n\tasync gotoOldFinancials() {\r\n\t\tconst date = moment(this.filterMonth).format('MMM YYYY');\r\n\t\tlet nav = `Monthly Financial Statements>${date}`;\r\n\t\tnav = encodeURI(nav);\r\n\t\tthis.$state.go('documents', { nav });\r\n\t}\r\n\r\n\tisDesktop() {\r\n\t\tthis.LocalStorageService.save('mediaDevice', 'mobile');\r\n\t\tconst mediaDevice = this.LocalStorageService.retrieve('mediaDevice');\r\n\t\tif (mediaDevice == 'mobile') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tasync filterByMonth() {\r\n\t\tif (this.filterMonth !== '' && this.filterMonth) {\r\n\t\t\tthis.resetVariables();\r\n\t\t\tthis.selectedDate = this.Utility.getFormatedDate(this.filterMonth);\r\n\t\t\tawait this.getDebtorAgeAnalysis();\r\n\t\t} else {\r\n\t\t\tthis.serviceData.DebtorAgeAnalysisData = {};\r\n\t\t}\r\n\t}\r\n\r\n\tasync filterByYear() {\r\n\t\tthis.filterMonth = '';\r\n\t\tthis.serviceData.DebtorAgeAnalysisData = undefined;\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\t\tawait this.getFinancialMonths(this.selectedDateYear);\r\n\t}\r\n\r\n\tfilterByOrderByUnitNumber() {\r\n\t\tthis.DebtorAgeAnalysisPaging.pageNumber = 1;\r\n\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.isFilterByOnlyShowDebtors = false;\r\n\t\tthis.isFilterByOrderByUnitNumber = true;\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\r\n\t\tthis.onlyShowDebtors = false;\r\n\t\tthis.orderByTotal = false;\r\n\t\tthis.orderByUnitNumber = true;\r\n\r\n\t\tthis.getDebtorAgeAnalysis();\r\n\t}\r\n\r\n\tfilterByorderByTotal() {\r\n\t\tthis.DebtorAgeAnalysisPaging.pageNumber = 1;\r\n\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.isFilterByOnlyShowDebtors = false;\r\n\t\tthis.isFilterByOrderByUnitNumber = false;\r\n\t\tthis.isFilterByorderByTotal = true;\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\r\n\t\tthis.onlyShowDebtors = false;\r\n\t\tthis.orderByTotal = true;\r\n\t\tthis.orderByUnitNumber = false;\r\n\r\n\t\tthis.getDebtorAgeAnalysis();\r\n\t}\r\n\r\n\tfilterByOnlyShowDebtors() {\r\n\t\tthis.DebtorAgeAnalysisPaging.pageNumber = 1;\r\n\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.isFilterByOnlyShowDebtors = true;\r\n\t\tthis.isFilterByOrderByUnitNumber = false;\r\n\t\tthis.isFilterByorderByTotal = false;\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\r\n\t\tthis.orderByUnitNumber = false;\r\n\t\tthis.onlyShowDebtors = true;\r\n\t\tthis.orderByTotal = false;\r\n\r\n\t\tthis.getDebtorAgeAnalysis();\r\n\t}\r\n\r\n\tfilterByHideAllLegalMemos() {\r\n\t\tthis.DebtorAgeAnalysisPaging.pageNumber = 1;\r\n\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.isfilterByShowAllLegalMemos = false;\r\n\t\tthis.isfilterByShowAllLegalAccountData = false;\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\r\n\t\tthis.getDebtorAgeAnalysis();\r\n\t}\r\n\r\n\tfilterByHideAllLegalAccountData() {\r\n\t\tthis.DebtorAgeAnalysisPaging.pageNumber = 1;\r\n\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.isFilterByOnlyShowDebtors = false;\r\n\t\tthis.isFilterByOrderByUnitNumber = false;\r\n\t\tthis.orderByUnitNumber = false;\r\n\t\tthis.onlyShowDebtors = false;\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\r\n\t\tthis.getDebtorAgeAnalysis();\r\n\t}\r\n\r\n\ttoggleShowAllLegalMemos() {\r\n\t\tthis.canFilter = true;\r\n\t\tthis.isShowAllLegalMemos = !this.isShowAllLegalMemos;\r\n\t}\r\n\r\n\ttoggleShowAllLegalAccountData() {\r\n\t\tthis.isShowAllLegalAccountData = !this.isShowAllLegalAccountData;\r\n\t\tif (this.isShowAllLegalAccountData) {\r\n\t\t\tthis.showHideLegalAccountData = 'Hide Legal Collection Roll';\r\n\t\t\tthis.filterByShowAllLegalAccountData();\r\n\t\t} else {\r\n\t\t\tthis.showHideLegalAccountData = 'Show Legal Collection Roll';\r\n\t\t\tthis.filterByHideAllLegalAccountData();\r\n\t\t}\r\n\t}\r\n\r\n toggleFilterByOrderByUnitNumber() {\r\n this.canFilter = true;\r\n this.isFilterByOrderByUnitNumber = !this.isFilterByOrderByUnitNumber;\r\n this.orderByUnitNumber = !this.orderByUnitNumber;\r\n //this.isFilterByorderByTotal = !this.isFilterByorderByTotal;\r\n this.orderByTotal = !this.orderByTotal;\r\n }\r\n\r\n setOrderByUnitNumber() {\r\n this.canFilter = true;\r\n //this.isFilterByOrderByUnitNumber = true;\r\n this.orderByUnitNumber = true;\r\n //this.isFilterByorderByTotal = !this.isFilterByorderByTotal;\r\n this.orderByTotal = false;\r\n }\r\n\r\n setOrderByTotal() {\r\n this.canFilter = true;\r\n this.isFilterByOrderByUnitNumber = false;\r\n this.orderByUnitNumber = false;\r\n this.orderByTotal = true;\r\n }\r\n\r\n\ttoggleFilterByorderByTotal() {\r\n\t\tthis.canFilter = true;\t\t\r\n\t\tthis.orderByTotal = !this.orderByTotal;\r\n\t\tthis.OrderByUnitNumber = !this.OrderByUnitNumber;\r\n\t}\r\n\r\n\ttoggleFilterByOnlyShowDebtors() {\r\n\t\tthis.canFilter = true;\r\n\t\tthis.isFilterByOnlyShowDebtors = !this.isFilterByOnlyShowDebtors;\r\n\t\tthis.onlyShowDebtors = !this.onlyShowDebtors;\r\n\t}\r\n\r\n\tselectFilter() {\r\n\t\tthis.DebtorAgeAnalysisPaging.pageNumber = 1;\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.getDebtorAgeAnalysis();\r\n\t}\r\n\r\n\tgetReport() {\r\n\t\tthis.reportModelHeader =\r\n\t\t\tthis.selectedBuildingName + ' - Debtor Age Analysis - ' + moment(this.selectedDate).format('MMM YYYY');\r\n\t\tthis.FinancialsService\r\n\t\t\t.getReport(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.selectedDate,\r\n\t\t\t\t9,\r\n\t\t\t\tthis.reportModelHeader\r\n\t\t\t)\r\n\t\t\t.then(() => { }, (err) => { })\r\n\t\t\t.finally(() => { });\r\n\t}\r\n\r\n\tgetLegalCollectionRollReport() {\r\n\t\tthis.reportModelHeader =\r\n\t\t\tthis.selectedBuildingName + ' - Legal Collection Roll Report - ' + moment(this.selectedDate).format('MMM YYYY');\r\n\t\tthis.FinancialsService\r\n\t\t\t.getReport(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.selectedDate,\r\n\t\t\t\t7,\r\n\t\t\t\tthis.reportModelHeader,\r\n\t\t\t\tthis.orderByUnitNumber,\r\n\t\t\t\tthis.onlyShowDebtors,\r\n\t\t\t\tthis.isShowAllLegalMemos,\r\n\t\t\t\tthis.isShowAllLegalAccountData\r\n\t\t\t)\r\n\t\t\t.then(() => { }, (err) => { })\r\n\t\t\t.finally(() => { });\r\n\t}\r\n\r\n\tgetLegalReport(cardCode) {\r\n\t\tcardCode = `B${this.selectedBuildingRef}${cardCode}`;\r\n\t\tthis.FinancialsService.getLegalReport(cardCode).then(() => { }, (err) => { }).finally(() => { });\r\n\t}\r\n\r\n\tgetAllLegalReport() {\r\n\t\tvar numberOfMonths = document.getElementById(\"legalReportMonthOptions\").value;\r\n\t\tvar numberOfDays = numberOfMonths * 30.436875;\r\n\t\tnumberOfDays = Math.floor(numberOfDays);\r\n\r\n\t\tthis.FinancialsService.getAllLegalReport(this.selectedBuildingRef, numberOfDays).then(() => { }, (err) => { }).finally(() => { });\r\n\t}\r\n\r\n\tresetVariables() {\r\n\t\tthis.DebtorAgeAnalysisPaging.pageNumber = 1;\r\n\t\tthis.isFilterByMonthActive = true;\r\n\t\tthis.isFilterByOnlyShowDebtors = false;\r\n\t\tthis.isFilterByOrderByUnitNumber = false;\r\n\t\tthis.orderByUnitNumber = false;\r\n\t\tthis.onlyShowDebtors = false;\r\n\t\tthis.isfilterByShowAllLegalAccountData = false;\r\n\t}\r\n\r\n\tasync activate() {\r\n\t\tthis.serviceData = this.DebtorAgeAnalysisService;\r\n\t\tthis.financialsServiceData = this.FinancialsService;\r\n\t\tthis.financialsSummaryServiceData = this.FinancialSummaryService;\r\n\t\tthis.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tvar buildingName = '';\r\n\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n\t\tif (userProfile) {\r\n\t\t\tif (!this.selectedBuildingRef) {\r\n\t\t\t\tthis.selectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n\t\t\t}\r\n\t\t\tconst selectedBuilding = userProfile.BuildingProfiles.find((building) => {\r\n\t\t\t\treturn building.SchemeReference.toUpperCase().trim() === this.selectedBuildingRef.toUpperCase().trim();\r\n\t\t\t});\r\n\r\n\t\t\tif (selectedBuilding) {\r\n\t\t\t\tbuildingName = selectedBuilding.SchemeName;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.selectedBuildingName = buildingName;\r\n\t\tif (this.financialsSummaryServiceData.buildingWorkflowAndFeatures = {}) {\r\n\t\t\tawait this.getbuildingWorkflowAndFeatures();\r\n\t\t}\r\n\t\tawait this.getFinancialYears(true);\r\n\t}\r\n\r\n\tonSelectedBuildingChanged(event, schemeRef) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.selectedBuildingRef = schemeRef;\r\n\t\tif (this.selectedBuildingRef && this.selectedBuildingRef.length > 2) {\r\n\t\t\tthis.activate();\r\n\t\t}\r\n\t}\r\n\tasync getbuildingWorkflowAndFeatures() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.financialsSummaryServiceData.getbuildingWorkflowAndFeatures(this.selectedBuildingRef);\r\n\t\t\tthis.buildingWorkflowAndFeatures = this.financialsSummaryServiceData.buildingWorkflowAndFeatures;\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading workflow and features: ${err}`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialYears(isInit) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.FinancialsService.getFinancialYears(this.selectedBuildingRef, this.today);\r\n\t\t\tif (isInit) {\r\n\t\t\t\tawait this.getSelectedDate(true);\r\n\t\t\t} else {\r\n\t\t\t\tthis.filterYear = this.FinancialsService.financialYears[\r\n\t\t\t\t\t(await this.FinancialsService.financialYears.length) - 1\r\n\t\t\t\t].WhenTo;\r\n\t\t\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\t\tawait this.getFinancialMonths(this.today);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading financial years\\n${err}`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\tasync getFinancialMonths(date, isInit) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tawait this.FinancialsService.getFinancialMonths(this.selectedBuildingRef, date || new Date());\r\n\t\t\tlet selectedMonthIndex = -1;\r\n\r\n\t\t\tconst selectedDateMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n\t\t\tif (selectedDateMonth) {\r\n\t\t\t\tif (this.FinancialsService.financialMonths && this.FinancialsService.financialMonths.length > 0) {\r\n\t\t\t\t\tconst foundMonth = this.FinancialsService.financialMonths.find((month, index) => {\r\n\t\t\t\t\t\tconst momentMonth = moment(month.WhenFrom);\r\n\t\t\t\t\t\tif (momentMonth.isSame(selectedDateMonth, 'month')) {\r\n\t\t\t\t\t\t\tselectedMonthIndex = index;\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif (selectedMonthIndex > -1 && foundMonth) {\r\n\t\t\t\t\t\tthis.filterMonth = this.FinancialsService.financialMonths[selectedMonthIndex].WhenFrom;\r\n\t\t\t\t\t\tthis._filterOutFutureMonths();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (date && isInit) {\r\n\t\t\t\tthis.FinancialsService.financialMonths.filter(async (month, i) => {\r\n\t\t\t\t\tconst monthDateStr = month.WhenFrom.substr(0, 10);\r\n\t\t\t\t\tconst monthDate = moment(new Date(monthDateStr), 'YYYY-DD-MM');\r\n\t\t\t\t\tconst selectedMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n\t\t\t\t\tif (monthDate.isSame(selectedMonth, 'month')) {\r\n\t\t\t\t\t\tselectedMonthIndex = i;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (selectedMonthIndex === -1) {\r\n\t\t\t\t\tthis.filterMonth = '';\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.filterMonth = this.FinancialsService.financialMonths[selectedMonthIndex].WhenFrom;\r\n\t\t\t\t}\r\n\t\t\t} else if (isInit) {\r\n\t\t\t\tthis.filterMonth = this.FinancialsService.financialMonths[\r\n\t\t\t\t\tthis.FinancialsService.financialMonths.length - 1\r\n\t\t\t\t].WhenFrom;\r\n\t\t\t}\r\n\t\t\tif (this.filterMonth) {\r\n\t\t\t\tthis.selectedDate = this.filterMonth;\r\n\t\t\t\tawait this.getDebtorAgeAnalysis();\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading financial months\\n${err}`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\tasync getSelectedDate(isInit) {\r\n\t\tconst selectedDateYear = await this.FinancialsService.getSelectedYear();\r\n\t\tconst selectedDateMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n\t\tif (isInit) {\r\n\t\t\tfor (let i = 0; i < this.FinancialsService.financialYears.length; i++) {\r\n\t\t\t\tconst yearRaw = this.FinancialsService.financialYears[i];\r\n\r\n\t\t\t\tif (selectedDateYear.isBetween(yearRaw.WhenFrom, yearRaw.WhenTo)) {\r\n\t\t\t\t\tthis.filterYear = this.FinancialsService.financialYears[i].WhenTo;\r\n\t\t\t\t\tthis.selectedDateYear = await this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst date = selectedDateYear ? selectedDateYear : new Date();\r\n\t\t\tawait this.getFinancialMonths(date, true);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getDebtorAgeAnalysis() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.selectedDate = await this.FinancialsService.getSelectedDate(this.selectedDate);\r\n\r\n\t\tawait this.serviceData\r\n\t\t\t.getDebtorAgeAnalysis(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.selectedDate,\r\n\t\t\t\tthis.orderByUnitNumber,\r\n\t\t\t\tthis.orderByTotal,\r\n\t\t\t\tthis.DebtorAgeAnalysisPaging.pageNumber\r\n\t\t\t)\r\n\t\t\t.then(\r\n\t\t\t\tasync () => {\r\n this.DebtorAgeAnalysisPaging.numberOfResults = this.serviceData.numberOfResults;\r\n\r\n\t\t\t\t\tthis.DebtorAgeAnalysisPaging.limit = 20;\r\n\r\n\t\t\t\t\tif (this.DebtorAgeAnalysisPaging.pageNumber === 1) {\r\n\t\t\t\t\t\tthis.DebtorAgeAnalysisPaging.firstItemIndex = 1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.DebtorAgeAnalysisPaging.firstItemIndex =\r\n\t\t\t\t\t\t\t(this.DebtorAgeAnalysisPaging.pageNumber - 1) * this.DebtorAgeAnalysisPaging.limit + 1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.DebtorAgeAnalysisPaging.lastItemIndex =\r\n\t\t\t\t\t\tthis.DebtorAgeAnalysisPaging.firstItemIndex + this.DebtorAgeAnalysisPaging.limit - 1;\r\n\r\n\t\t\t\t\tif (this.DebtorAgeAnalysisPaging.numberOfResults > 0) {\r\n\t\t\t\t\t\tthis.DebtorAgeAnalysisPaging.maxPage = Math.ceil(\r\n\t\t\t\t\t\t\tthis.DebtorAgeAnalysisPaging.numberOfResults / this.DebtorAgeAnalysisPaging.limit\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (this.DebtorAgeAnalysisPaging.maxPage > 1) {\r\n\t\t\t\t\t\t\tif (this.DebtorAgeAnalysisPaging.maxPage === this.DebtorAgeAnalysisPaging.pageNumber) {\r\n\t\t\t\t\t\t\t\tthis.DebtorAgeAnalysisPaging.lastItemIndex = this.DebtorAgeAnalysisPaging.numberOfResults;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tthis.isPagingNavigationVisible = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.isPagingNavigationVisible = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.DebtorAgeAnalysisPaging.maxPage = 1;\r\n\t\t\t\t\t\tthis.isPagingNavigationVisible = false;\r\n\t\t\t\t\t\tthis.DebtorAgeAnalysisPaging.pageNumber = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => { }\r\n\t\t\t)\r\n\t\t\t.finally(async () => {\r\n\t\t\t\tawait this.getFinancialState();\r\n\t\t\t\tthis.canFilter = false;\r\n\t\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t\t});\r\n }\r\n\r\n\tasync getUnitLegalMemo(UnitItemCode) {\r\n\t\tvar panalId = `#${UnitItemCode}`;\r\n\r\n\t\tif ($({UnitItemCode}).hasClass('in')) {\r\n\r\n\t\t\t$(panalId).collapse('hide');\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.serviceData.DebtorAgeAnalysisUnitMemoData = {};\r\n\t\t\tconst schemeRef = this.selectedBuildingRef;\r\n\t\t\tvar CardCode = UnitItemCode;\r\n\t\t\tthis._switchIsBusyLoadingMemo(true);\r\n\t\t\tawait this.serviceData.getUnitLegalMemo(\r\n\t\t\t\tCardCode,\r\n\t\t\t\tthis.selectedDate,\r\n\t\t\t\tUnitItemCode\r\n\t\t\t)\r\n\t\t\t\t.then(\r\n\t\t\t\t\t() => {\r\n\t\t\t\t\t\t\t$(panalId).collapse('show');\r\n\t\t\t\t\t}, (err) => { }\r\n\t\t\t\t)\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis._switchIsBusyLoadingMemo(false);\r\n\t\t\t\t});\r\n\t\t}\r\n }\r\n\r\n getSubstring (code) {\r\n return code ? code.substring(4) : 'N/A';\r\n };\r\n\r\n trimStart (input) {\r\n if (!input) return ''; \r\n return input.replace(/^\\s+/, ''); \r\n };\r\n\r\n\tasync getFinancialState() {\r\n\t\tconst type = 8;\r\n\t\tconst schemeRef = this.selectedBuildingRef;\r\n\t\tconst momentDate = moment(this.selectedDate, 'YYYY-MM-DD');\r\n\t\tconst formattedDate = momentDate.format('YYYY-MM-DD');\r\n\t\tconst date = `${formattedDate.substr(0, 8)}01`;\r\n\r\n\t\ttry {\r\n\t\t\tconst results = await this.FinancialsService.getFinancialState(schemeRef, date, type);\r\n\r\n\t\t\tconst { status, message } = results;\r\n\t\t\tthis.statusInformation = message;\r\n\t\t} catch (error) {\r\n\t\t\tthis.NotificationService.error('Error loading debtor age statement status');\r\n\t\t} finally {\r\n\t\t}\r\n\t}\r\n\r\n\t_filterOutFutureMonths() {\r\n\t\tconst today = new Date();\r\n\t\tconst formatedDate = moment(today).format('YYYY MMMM');\r\n\t\tconst currentYear = formatedDate.split(' ')[0];\r\n\t\tconst currentMonth = formatedDate.split(' ')[1];\r\n\r\n\t\tlet foundIndex = -1;\r\n\t\tconst found = this.FinancialsService.financialMonths.find((month, index) => {\r\n\t\t\tconst fields = month.FriendlyNameMonth.split(' ');\r\n\t\t\tconst yearStr = fields[1];\r\n\t\t\tconst monthStr = fields[0];\r\n\t\t\tconst found = currentYear === yearStr && currentMonth === monthStr;\r\n\r\n\t\t\tif (found) {\r\n\t\t\t\tfoundIndex = index;\r\n\t\t\t}\r\n\t\t\treturn found;\r\n\t\t});\r\n\r\n\t\tif (found && foundIndex > -1) {\r\n\t\t\tconst filteredMonths = this.FinancialsService.financialMonths.filter(\r\n\t\t\t\t(month, index) => index < foundIndex + 1\r\n\t\t\t);\r\n\r\n\t\t\tif (filteredMonths && filteredMonths.length < this.FinancialsService.financialMonths.length) {\r\n\t\t\t\tthis.FinancialsService.financialMonths = filteredMonths;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tallowAction(actionName) {\r\n\t\treturn this.AuthorizationService.isAuthorized(actionName);\r\n\t}\r\n\r\n\t_switchIsBusyLoading(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isLoading = flag;\r\n\t\t});\r\n\t}\r\n\r\n\t_switchIsBusyLoadingMemo(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isLoadingMemo = flag;\r\n\t\t})\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass DebtorAgeAnalysisService {\r\n\tconstructor(\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.numberOfResults = 0;\r\n\t\tthis.numberOfResultsLegal = 0;\r\n\t\tthis.debtorAgeAnalysisData = undefined;\r\n\t}\r\n\r\n\tasync getDebtorAgeAnalysis(schemeRef, date, sortByUnitNumber, sortByTotal, pageNumber) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiDebtorAgeAnalysis');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiDebtorAgeAnalysis');\r\n\t\t\t}\r\n\r\n\t\t\tdate = this.FinancialsService.getMapFirstDay(date);\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\turl += `?date=${moment(date).format(\r\n\t\t\t\t'L'\r\n\t\t\t)}&sortByUnitNumber=${sortByUnitNumber}&sortByTotal=${sortByTotal}&pageNumber=${pageNumber}`;\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tif (!!!headers || (!!headers && (!!!headers.userName || !!!headers.sessionToken))) {\r\n\t\t\t\tconst error = `Could not load Levy as the 'Username' and/or 'Session Token' is missing`;\r\n\t\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers: headers });\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.debtorAgeAnalysisData = data.Data[0];\r\n\t\t\tthis.numberOfResults = data.NumberOfResults;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (error) {\r\n\t\t\tthis.debtorAgeAnalysisData = [];\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getUnitLegalMemo(CardCode, date, UnitItemCode) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiLevyRollMemo');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiLevyRollMemo');\r\n\t\t\t}\r\n\r\n\t\t\tdate = this.FinancialsService.getMapFirstDay(date);\r\n\t\t\turl = url.replace('{CardCode}', CardCode).trim();\r\n\t\t\turl += `?date=${moment(date).format(\r\n\t\t\t\t'L'\r\n\t\t\t)}`;\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers: headers });\r\n\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.DebtorAgeAnalysisUnitMemoData = data.Data;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (error) {\r\n\t\t\tthis.DebtorAgeAnalysisUnitMemoData = [];\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\t\treturn promise\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tFinancialsService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew DebtorAgeAnalysisService(\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","const base64js = require('base64-js');\r\n\r\n/* @ngInject */\r\nexport default class FinancialSummaryCtrl {\r\n constructor(\r\n $scope,\r\n $state,\r\n Utility,\r\n $timeout,\r\n $rootScope,\r\n BuildingsService,\r\n FinancialsService,\r\n LocalStorageService,\r\n NotificationService,\r\n AuthorizationService,\r\n FinancialSummaryService\r\n ) {\r\n this.$scope = $scope;\r\n this.$state = $state;\r\n this.Utility = Utility;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.BuildingsService = BuildingsService;\r\n this.FinancialsService = FinancialsService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.NotificationService = NotificationService;\r\n this.AuthorizationService = AuthorizationService;\r\n this.FinancialSummaryService = FinancialSummaryService;\r\n\r\n this.init();\r\n this.activate(true);\r\n }\r\n\r\n async activate(isInit = false) {\r\n let { date } = this.$state.params;\r\n if (date) {\r\n this.navigateDate = moment(date, 'YYYY/MM/DD').add(3, 'h');\r\n }\r\n this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n let buildingName = '';\r\n const userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n if (userProfile) {\r\n if (!!!this.selectedBuildingRef) {\r\n this.selectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n }\r\n\r\n const selectedBuilding = userProfile.BuildingProfiles.find((building) => {\r\n return building.SchemeReference.toUpperCase().trim() === this.selectedBuildingRef.toUpperCase().trim();\r\n });\r\n\r\n if (selectedBuilding) {\r\n buildingName = selectedBuilding.SchemeName;\r\n }\r\n }\r\n this.selectedBuildingName = buildingName;\r\n await this.getbuildingWorkflowAndFeatures();\r\n await this.getFinancialYears(isInit);\r\n \r\n this.dateLastReportMonth = await this.FinancialsService.getLastFinancialMonth(this.selectedBuildingRef);\r\n if (this.navigateDate)\r\n {\r\n this.filterDate = this.Utility.getFormatedDate(this.navigateDate);\r\n }\r\n else {\r\n this.filterDate = this.Utility.getFormatedDate(this.dateLastReportMonth);\r\n }\r\n \r\n if (!this.navigateDate) {\r\n var yearsAmount = this.FinancialsService.financialYears.length;\r\n var whenFrom2 = this.FinancialsService.financialYears;\r\n for (var x = yearsAmount - 1; x >= 0; x--) {\r\n if (this.dateLastReportMonth >= whenFrom2[x].WhenFrom && this.dateLastReportMonth <= whenFrom2[x].WhenTo) {\r\n this.filterYear = whenFrom2[x].WhenTo;\r\n var temp = this.filterYear;\r\n var temp2 = this.Utility.getFormatedDate(temp);\r\n await this.getFinancialMonths(temp2, isInit);\r\n }\r\n }\r\n }\r\n else {\r\n await this.getFinancialMonths(this.Utility.getFormatedDate(this.navigateDate), isInit);\r\n }\r\n this.filterMonth = this.filterDate;\r\n if (!!this.filterMonth) {\r\n await this.getFinancialSummary();\r\n }\r\n this.saveSelectedDate();\r\n if (!this.navigateDate) {\r\n $('#filter-month option[value=\"string:' + this.dateLastReportMonth + '\"]').attr('selected', true);\r\n }\r\n else {\r\n var temp = new Date(this.navigateDate);\r\n var navDate = new Date(temp.setHours(2, 0, 0));\r\n navDate = navDate.toISOString();\r\n navDate = navDate.slice(0, -5);\r\n $('#filter-month option[value=\"string:' + navDate + '\"]').attr('selected', true);\r\n }\r\n\r\n }\r\n\r\n init() {\r\n this.message = '';\r\n this.isInit = true;\r\n this.mailingList = {\r\n emails: [],\r\n schemeRef: null,\r\n isLoading: false\r\n };\r\n this.selectedEmailListItems = [];\r\n\r\n this.editedEmails = [];\r\n this.deletedEmails = [];\r\n\r\n this.isFilterActive = true;\r\n\r\n this.filterYear = undefined;\r\n this.filterMonth = undefined;\r\n\r\n this.selectedBuildingRef = '';\r\n this.navigateDate = undefined; \r\n this.filterDate = undefined;\r\n this.dateLastReportMonth = undefined;\r\n this.selectedBuildingName = '';\r\n this._switchIsBusyLoading(false);\r\n this.today = this.Utility.getFormatedDate(new Date());\r\n\r\n this.$scope.$on('selected-building-changed', async (event, newValue) => {\r\n await this.onSelectedBuildingChanged(this, newValue);\r\n });\r\n\r\n this.activate(true);\r\n }\r\n\r\n async onSelectedBuildingChanged(event, schemeRef) {\r\n this._switchIsBusyLoading(true);\r\n if (schemeRef && schemeRef['length'] > 2) this.selectedBuildingRef = schemeRef;\r\n else this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n if (this.selectedBuildingRef && this.selectedBuildingRef.length > 2) {\r\n await this.activate();\r\n }\r\n }\r\n\r\n async filterByMonth() {\r\n if (this.filterMonth !== '' && this.filterMonth) {\r\n await this.getFinancialSummary();\r\n } else {\r\n this.FinancialSummaryService.financialSummary = {};\r\n }\r\n }\r\n\r\n async filterByYear() {\r\n this.filterMonth = '';\r\n this.FinancialSummaryService.financialSummary = undefined;\r\n this.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n await this.getFinancialMonths(this.selectedDateYear);\r\n }\r\n\r\n async getFinancialYears(isInit = false) {\r\n this._switchIsBusyLoading(true);\r\n\r\n try {\r\n let date = this.today;\r\n if (this.filterDate) {\r\n date = this.filterDate;\r\n }\r\n await this.FinancialsService.getFinancialYears(this.selectedBuildingRef, date);\r\n this.filterYear = this.FinancialsService.financialYears[\r\n this.FinancialsService.financialYears.length - 1\r\n ].WhenTo;\r\n\r\n await this.getFinancialMonths(date, isInit);\r\n } catch (err) {\r\n console.error(`Error while loading financial years: ${err}`);\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n\r\n async getFinancialMonths(date, isInit) {\r\n this._switchIsBusyLoading(true);\r\n if (date > this.today) {\r\n date = this.today;\r\n }\r\n\r\n try {\r\n await this.FinancialsService.getFinancialMonths(this.selectedBuildingRef, date);\r\n const lastDate = this.FinancialsService.financialMonths[this.FinancialsService.financialMonths.length - 1]\r\n .WhenFrom;\r\n if (isInit || this.filterDate) {\r\n this.filterMonth = lastDate;\r\n } else {\r\n this.filterMonth = '';\r\n }\r\n if (this.filterMonth) {\r\n\t\t\t\tawait this.getFinancialSummary();\r\n\t\t\t}\r\n } catch (error) {\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n\r\n async downloadAllAttachments() {\r\n const modalSelector = '#gettingDocuments';\r\n const modalTimeout = 50;\r\n\r\n this.isBusyFetchingDocuments = true;\r\n this.$timeout(() => {\r\n angular.element(modalSelector).modal('show');\r\n }, modalTimeout);\r\n\r\n const date = this.Utility.getFormatedDate(this.filterMonth);\r\n let zipFileResult = await this.FinancialSummaryService.downloadAllAttachments(date);\r\n\r\n let zipFile = zipFileResult.data.Data;\r\n\r\n var zipBytes = base64js.toByteArray(zipFile.FileBytes);\r\n\r\n let contentType = 'application/zip';\r\n let urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;\r\n if (urlCreator) {\r\n let blob = new Blob([zipBytes], { type: contentType });\r\n let url = urlCreator.createObjectURL(blob);\r\n let a = document.createElement('a');\r\n document.body.appendChild(a);\r\n a.style = 'display: none';\r\n a.href = url;\r\n a.download = `${zipFile.Name}${zipFile.Extension}`;\r\n\r\n this.isBusyFetchingDocuments = false;\r\n\r\n a.click();\r\n window.URL.revokeObjectURL(url);\r\n a.remove();\r\n\r\n this.$timeout(() => {\r\n angular.element(modalSelector).modal('hide');\r\n }, modalTimeout);\r\n }\r\n }\r\n\r\n async getAllReports() {\r\n this._switchIsBusyLoading(true);\r\n\r\n try {\r\n const date = this.Utility.getFormatedDate(this.filterMonth);\r\n this.reportModelHeader = `${this.selectedBuildingName} - Cashflow Statement - ${moment(\r\n date\r\n ).format('MMM YYYY')}`;\r\n await this.FinancialsService.getAllReports(\r\n this.selectedBuildingRef,\r\n date,\r\n 0,\r\n this.reportModelHeader\r\n );\r\n\r\n\r\n } catch (err) {\r\n this.NotificationService.error('Error Downloading Report');\r\n }\r\n\r\n finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n\r\n async getFinancialSummary() {\r\n this._switchIsBusyLoading(true);\r\n\r\n try {\r\n const date = this.Utility.getFormatedDate(this.filterMonth);\r\n await this.FinancialSummaryService.getFinancialSummary(this.selectedBuildingRef, date);\r\n const { Message } = this.FinancialSummaryService.financialSummary;\r\n\r\n this.message = Message;\r\n } catch (error) {\r\n this.NotificationService.error('Error loading Financial Summary');\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n var twatyear = this.FinancialsService.financialYears[this.FinancialsService.financialYears.length - 1];\r\n var twatmonth = this.FinancialsService.financialMonths[this.FinancialsService.financialMonths.length - 1];\r\n //$('#filter-year option[value=\"string:' + twatyear.WhenTo + '\"]').attr('selected', true);\r\n\r\n }\r\n\r\n async gotoOldFinancials() {\r\n const date = moment(this.filterMonth).format('MMM YYYY');\r\n let nav = `Monthly Financial Statements>${date}`;\r\n let isItFinancialsSection = true;\r\n nav = encodeURI(nav);\r\n this.$state.go('documents', { isItFinancialsSection, nav });\r\n }\r\n\r\n async getFinancialSummaryAttachment(id) {\r\n this._switchIsBusyLoading(true);\r\n try {\r\n await this.FinancialSummaryService.getFinancialSummaryAttachment(id);\r\n } catch (error) {\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n\r\n async preApprove() {\r\n this.editedEmails = [];\r\n this.deletedEmails = [];\r\n\r\n this.$timeout(async () => {\r\n angular.element('#mailingList').modal('show');\r\n await this.loadEmails();\r\n });\r\n }\r\n\r\n async approve() {\r\n this._switchIsBusyLoading(true);\r\n\r\n try {\r\n const payload = this._serverfyFinancialSummary();\r\n await this.FinancialSummaryService.approve(payload);\r\n this.NotificationService.success('Approved Successfully');\r\n await this.getFinancialSummary();\r\n } catch (error) {\r\n console.error(error);\r\n this.NotificationService.error('Could Not Accept');\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n\r\n async reject() {\r\n this._switchIsBusyLoading(true);\r\n\r\n try {\r\n await this.FinancialSummaryService.reject(this.rejectionReason, this.filterMonth);\r\n this.NotificationService.success('Rejected Successfully');\r\n await this.getFinancialSummary();\r\n } catch (error) {\r\n this.NotificationService.error('Could Not Reject');\r\n console.error(error);\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n\r\n async loadEmails() {\r\n this._switchMailingListLoading(true);\r\n\r\n try {\r\n var results = await this.FinancialSummaryService.getMailingList();\r\n const { EmailListItems, Id } = results;\r\n this.mailingList = {\r\n ...this.mailingList,\r\n TrusteeMailingListItems: EmailListItems.filter(x => { return x.IsTrustee == true; }),\r\n AdHocMailingListItems: EmailListItems.filter(x => { return x.IsTrustee == false; }),\r\n schemeRef: this.selectedBuildingRef,\r\n isEdit: false,\r\n Id: Id\r\n };\r\n } catch (error) {\r\n this.mailingList = {\r\n TrusteeMailingListItems: [],\r\n AdHocMailingListItems: [],\r\n isEdit: false,\r\n schemeRef: null,\r\n isLoading: false,\r\n Id: null\r\n };\r\n this.NotificationService.error('Error Fetching Mailing List.');\r\n console.error('Error Fetching Mailing List.', error);\r\n } finally {\r\n this._switchMailingListLoading(false);\r\n }\r\n }\r\n\r\n async addEmail() {\r\n this.mailingList.AdHocMailingListItems.push({\r\n isEdit: true,\r\n isDeleted: false,\r\n CommunicationChannel: '0',\r\n MailingListHeaderId: this.mailingList.Id,\r\n CommunicationChannelDescription: 'Email'\r\n });\r\n }\r\n\r\n async editEmail(id) {\r\n await this.editEmailCore(id, this.mailingList.AdHocMailingListItems);\r\n }\r\n\r\n async editTrusteeEmail(id) {\r\n await this.editEmailCore(id, this.mailingList.TrusteeMailingListItems);\r\n }\r\n\r\n\r\n async editEmailCore(id, mailingList) {\r\n let index = -1;\r\n mailingList.find((mail, i) => {\r\n if (mail.Id === id) {\r\n index = i;\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n if (index > -1) {\r\n const email = this.editedEmails.find((mail) => mail.Id === id);\r\n if (!!!email) {\r\n const newEmail = { ...mailingList[index] };\r\n this.editedEmails = [...this.editedEmails, newEmail];\r\n\r\n mailingList[index].CommunicationChannel =\r\n mailingList[index].CommunicationChannel + '';\r\n mailingList[index].isEdit = true;\r\n }\r\n }\r\n }\r\n\r\n deleteEmail(id) {\r\n let index = -1;\r\n\r\n const email = this.mailingList.AdHocMailingListItems.find((mail, i) => {\r\n if (mail.Id === id) {\r\n index = i;\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n if (index > -1) {\r\n const newEmail = JSON.parse(JSON.stringify(this.mailingList.AdHocMailingListItems[index]));\r\n this.deletedEmails = [...this.deletedEmails, newEmail];\r\n this.mailingList.AdHocMailingListItems[index].isEdit = false;\r\n this.mailingList.AdHocMailingListItems[index].IsDeleted = true;\r\n\r\n const { UserName } = this.LocalStorageService.retrieve('userProfile');\r\n this.mailingList.AdHocMailingListItems[index].WhoActioned = UserName;\r\n }\r\n }\r\n\r\n cancelOutMailingList() {\r\n this.editedEmails.concat(this.deletedEmails).forEach((mail) => {\r\n let index = -1;\r\n const editedMail = this.mailingList.AdHocMailingListItems.find((x, i) => {\r\n if (x.Id === mail.Id) {\r\n index = i;\r\n return x;\r\n }\r\n return false;\r\n });\r\n\r\n if (!!editedMail) {\r\n this.mailingList.AdHocMailingListItems[index] = mail;\r\n this.editedEmails = this.editedEmails.filter((x) => x.Id !== mail.Id);\r\n this.deletedEmails = this.deletedEmails.filter((x) => x.Id !== mail.Id);\r\n }\r\n });\r\n }\r\n\r\n cancelEditEmail(id) {\r\n let index = -1;\r\n\r\n if (id && (id + '').includes('-')) {\r\n this.mailingList.AdHocMailingListItems.find((mail, i) => {\r\n if (mail.Id === id) {\r\n index = i;\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n if (index > -1) {\r\n const email = this.editedEmails.find((mail, i) => mail.Id === id);\r\n this.mailingList.AdHocMailingListItems[index] = email;\r\n\r\n this.editedEmails = this.editedEmails.filter((mail) => mail.Id !== id);\r\n }\r\n } else {\r\n this.mailingList.AdHocMailingListItems.splice(id, 1);\r\n }\r\n }\r\n\r\n saveEmailCore(id, mailingList) {\r\n let index = -1;\r\n\r\n if (id && (id + '').includes('-')) {\r\n const email = mailingList.find((mail, i) => {\r\n if (mail.Id === id) {\r\n index = i;\r\n return true;\r\n }\r\n\r\n return false;\r\n });\r\n\r\n if (index > -1) {\r\n mailingList[index].isEdit = false;\r\n mailingList[index].IsDeleted = false;\r\n\r\n const { UserName } = this.LocalStorageService.retrieve('userProfile');\r\n mailingList[index].WhoActioned = UserName;\r\n }\r\n } else {\r\n index = id;\r\n mailingList[index].isEdit = false;\r\n mailingList[index].IsDeleted = false;\r\n\r\n const { UserName } = this.LocalStorageService.retrieve('userProfile');\r\n mailingList[index].WhoActioned = UserName;\r\n }\r\n\r\n mailingList[index].CommunicationChannelDescription =\r\n mailingList[index].CommunicationChannel === '0' ? 'PDFs' : 'Online';\r\n }\r\n\r\n saveEmail(id) {\r\n this.saveEmailCore(id, this.mailingList.AdHocMailingListItems);\r\n }\r\n\r\n saveTrusteeEmail(id) {\r\n this.saveEmailCore(id, this.mailingList.TrusteeMailingListItems);\r\n }\r\n\r\n async preSaveMailingList() {\r\n\r\n const { AdHocMailingListItems: AdHocMailingListItems, TrusteeMailingListItems: TrusteeMailingListItems } = this.mailingList;\r\n const selectedTrusteeMailingListItems = TrusteeMailingListItems.filter(x => { return x.include == true; });\r\n const selectedAdHocMailingListItems = AdHocMailingListItems.filter(x => { return x.IsDeleted == false; });\r\n this.selectedEmailListItems = [...selectedTrusteeMailingListItems, ...selectedAdHocMailingListItems];\r\n\r\n angular.element('#mailingList').modal('hide');\r\n\r\n this.$timeout(() => {\r\n angular.element('#confirm').modal('show');\r\n }, 500);\r\n }\r\n\r\n async saveMailingList() {\r\n this._switchMailingListLoading(true);\r\n\r\n try {\r\n const payload = this._serverfyMailingList();\r\n const results = await this.FinancialSummaryService.saveMailingList(payload);\r\n\r\n this.NotificationService.success('Mailing list saved.');\r\n angular.element('#mailingList').modal('hide');\r\n\r\n await this.approve();\r\n } catch (error) {\r\n const msg = 'Error saving mailing list.';\r\n console.error(msg, error);\r\n this.NotificationService.error(msg);\r\n } finally {\r\n this._switchMailingListLoading(false);\r\n }\r\n }\r\n\r\n async getbuildingWorkflowAndFeatures() {\r\n this._switchIsBusyLoading(true);\r\n try {\r\n await this.FinancialSummaryService.getbuildingWorkflowAndFeatures(this.selectedBuildingRef);\r\n var buildingWorkflowAndFeatures = this.FinancialSummaryService.buildingWorkflowAndFeatures;\r\n var hideLegacyDocuments = buildingWorkflowAndFeatures[0].Data.HideLegacyFinancialDocuments; \r\n if (hideLegacyDocuments == true) {\r\n $('#legacyDocumentsFolder').hide();\r\n }\r\n else {\r\n $('#legacyDocumentsFolder').show();\r\n }\r\n } catch (err) {\r\n console.error(`Error while loading building workflow data: ${err}`);\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n\r\n get canApproveFinancials() {\r\n let isAllowed = this.AuthorizationService.isAuthorized('Approve Financial Summary');\r\n\r\n try {\r\n\r\n if (this.FinancialSummaryService.financialSummary) {\r\n const { Date } = this.FinancialSummaryService.financialSummary;\r\n const momentDate = moment(Date);\r\n const year = momentDate.year() > 2017;\r\n isAllowed =\r\n year &&\r\n isAllowed &&\r\n this.FinancialSummaryService &&\r\n this.FinancialSummaryService.financialSummary &&\r\n this.FinancialSummaryService.financialSummary.Status === 3;\r\n }\r\n else {\r\n isAllowed = false;\r\n }\r\n } catch (error) {\r\n isAllowed = false;\r\n console.error('Error while checking the \"Approve Financials\" claim');\r\n }\r\n\r\n return isAllowed;\r\n }\r\n\r\n get canRejectFinancials() {\r\n let isAllowed = this.AuthorizationService.isAuthorized('Reject Financial Summary');\r\n\r\n try {\r\n if (this.FinancialSummaryService.financialSummary) {\r\n const { Date } = this.FinancialSummaryService.financialSummary;\r\n const momentDate = moment(Date);\r\n const year = momentDate.year() > 2017;\r\n isAllowed =\r\n year &&\r\n isAllowed &&\r\n this.FinancialSummaryService &&\r\n this.FinancialSummaryService.financialSummary &&\r\n this.FinancialSummaryService.financialSummary.Status === 3;\r\n }\r\n else {\r\n isAllowed = false;\r\n }\r\n } catch (error) {\r\n isAllowed = false;\r\n console.error('Error while checking the \"Reject Financials\" claim');\r\n }\r\n\r\n return isAllowed;\r\n }\r\n\r\n get isBuildingLogin() {\r\n let isBuilding =\r\n this.AuthorizationService.isAuthorized('Approve Financial Summary') &&\r\n this.AuthorizationService.isAuthorized('Reject Financial Summary');\r\n return isBuilding;\r\n }\r\n\r\n get hasSummary() {\r\n let flag =\r\n this.FinancialSummaryService.financialSummary && this.FinancialSummaryService.financialSummary.Summary;\r\n\r\n return flag;\r\n }\r\n\r\n allowAction(actionName) {\r\n return this.AuthorizationService.isAuthorized(actionName);\r\n }\r\n\r\n isDesktop() {\r\n this.LocalStorageService.save('mediaDevice', 'mobile');\r\n const mdvice = this.LocalStorageService.retrieve('mediaDevice');\r\n if (mdvice == 'mobile') {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n openFinancials(page) {\r\n this.saveSelectedDate();\r\n this.$rootScope.$broadcast('navigate-changed', page, { date: this.filterMonth });\r\n }\r\n\r\n async getReportCashAvailability() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n this.selectedDate = this.filterMonth;\r\n\t\ttry {\r\n\t\t\tthis.reportModelHeader = `${this.selectedBuildingName} - Cash Availability Report - ${moment(\r\n\t\t\t\tthis.selectedDate\r\n\t\t\t).format('MMM YYYY')}`;\r\n this.saveSelectedDate();\r\n\t\t\tawait this.FinancialsService.getReport(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.selectedDate,\r\n\t\t\t\t6,\r\n\t\t\t\tthis.reportModelHeader\r\n\t\t\t);\r\n\t\t} catch (err) {\r\n\t\t\tthis.NotificationService.error('Error Downloading Cash Availability Report');\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n saveSelectedDate() {\r\n const selectedYear = moment(this.filterYear).toDate();\r\n const selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n this.LocalStorageService.save('selectedReportYear', selectedYear);\r\n this.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n }\r\n\r\n async printPreviewSummaryWriteUp() {\r\n //'{date}/RenderPdf'\r\n\r\n const date = moment(this.filterMonth).add(3, 'h');\r\n await this.FinancialSummaryService.printPreviewSummaryWriteUp(date);\r\n }\r\n\r\n _switchIsBusyLoading(flag) {\r\n this.$timeout(() => {\r\n this.isBusy = flag;\r\n });\r\n }\r\n\r\n _switchMailingListLoading(flag) {\r\n this.$timeout(() => {\r\n this.mailingList.isLoading = flag;\r\n });\r\n }\r\n\r\n _serverfyMailingList() {\r\n const { Id, AdHocMailingListItems: AdHocMailingListItems, TrusteeMailingListItems: TrusteeMailingListItems, schemeRef: SchemeReference } = this.mailingList;\r\n const selectedTrusteeMailingListItems = TrusteeMailingListItems.filter(x => { return x.include == true; });\r\n const selectedAdHocMailingListItems = AdHocMailingListItems.filter(x => { return x.IsDeleted == false; });\r\n const mapped = {\r\n Id,\r\n EmailListItems: [...selectedTrusteeMailingListItems, ...selectedAdHocMailingListItems],\r\n SchemeReference\r\n };\r\n\r\n for (let index = 0; index < mapped.EmailListItems.length; index++) {\r\n mapped.EmailListItems[index].HasBeenSent = false;\r\n }\r\n\r\n return mapped;\r\n }\r\n\r\n _serverfyFinancialSummary() {\r\n const ApprovalDate = moment(this.filterMonth).format('MM/DD/YYYY');\r\n const { IsNewProcess, SchemeReference } = this.FinancialSummaryService.financialSummary;\r\n const { UserName: WhoApproved } = this.LocalStorageService.retrieve('userProfile');\r\n\r\n const mapped = {\r\n WhoApproved,\r\n ApprovalDate,\r\n IsNewProcess,\r\n SchemeReference\r\n };\r\n\r\n return mapped;\r\n }\r\n\r\n async getAllReports() {\r\n this._switchIsBusyLoading(true);\r\n\r\n try {\r\n\r\n this.reportModelHeader = `${this.selectedBuildingName} - All Financial Reports Statement - ${moment(\r\n this.selectedDate\r\n ).format('MMM YYYY')}`;\r\n await this.FinancialsService.getAllReports(\r\n this.selectedBuildingRef,\r\n this.filterMonth,\r\n 0,\r\n this.reportModelHeader\r\n );\r\n\r\n\r\n } catch (err) {\r\n this.NotificationService.error('Error Downloading Report');\r\n }\r\n\r\n finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n}\r\n","//@ts-check\r\n\r\nimport html2pdf from 'html2pdf.js';\r\n\r\nclass FinancialSummaryService {\r\n\tconstructor($http, Utility, $timeout, $rootScope, InternalLinksService, LocalStorageService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.financialSummary = {};\r\n\t\tthis.buildingWorkflowAndFeatures = {};\r\n\t}\r\n\r\n\tasync approve(financialSummaryApproval) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('Approve');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('Approve');\r\n\t\t\t}\r\n\r\n\t\t\tconst building = this._getSelectedBuildingRef();\r\n\t\t\turl = url.replace(`{schemeRef}`, building);\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.post(url, financialSummaryApproval, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(\r\n\t\t\t\t\t`Could not approve the financial summary for Building: ${building}, financialSummaryApproval: ${JSON.stringify(\r\n\t\t\t\t\t\tfinancialSummaryApproval\r\n\t\t\t\t\t)}`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync reject(RejectionReason, RejectionDate) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('Reject');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('Reject');\r\n\t\t\t}\r\n\r\n\t\t\tconst building = this._getSelectedBuildingRef();\r\n\t\t\turl = url.replace(`{schemeRef}`, building);\r\n\r\n\t\t\tconst { IsNewProcess } = this.financialSummary;\r\n\r\n\t\t\tconst summaryRejection = {\r\n\t\t\t\tIsNewProcess,\r\n\t\t\t\tRejectionDate,\r\n\t\t\t\tRejectionReason\r\n\t\t\t};\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.post(url, summaryRejection, { headers });\r\n\t\t\tconst { WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(\r\n\t\t\t\t\t`Could not reject the financial summary for Building: ${building}, Date: ${RejectionDate}`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getFinancialSummary(schemeRef, date) {\r\n\t\tlet promiseHandler = {};\r\n\t\tconst promise = new Promise((resolve, reject) => {\r\n\t\t\tpromiseHandler = {\r\n\t\t\t\treject,\r\n\t\t\t\tresolve\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiFinancialSummary');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiFinancialSummary');\r\n\t\t\t}\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.post(url, date, { headers });\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.financialSummary = !!data ? data : {};\r\n\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromiseHandler.resolve();\r\n\t\t\t});\r\n\t\t} catch (err) {\r\n\t\t\tthis.financialSummary = {};\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromiseHandler.reject(err);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getFinancialSummaryAttachment(id) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialSummaryAttachment');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/reporting/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialSummaryAttachment');\r\n\t\t\t}\r\n\r\n\t\t\turl += `?id=${id}`;\r\n\t\t\tthis.openNewTabReport(url, `Financial Summary Attachment`);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(`Couldn't load API 'links'`, err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getMailingList() {\r\n\t\tlet promiseHandler;\r\n\r\n\t\tconst promise = new Promise((resolve, reject) => {\r\n\t\t\tpromiseHandler = {\r\n\t\t\t\treject,\r\n\t\t\t\tresolve\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiMailingList');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiMailingList');\r\n\t\t\t}\r\n\r\n\t\t\tconst building = this._getSelectedBuildingRef();\r\n\t\t\turl = url.replace(`{schemeRef}`, building);\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tconst { Data, WasSuccessful, Messages } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(this._mapCommunicationChannelDescription(Data)));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Error while loading 'Distribution Mail List with: ${JSON.stringify(Messages)}`);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync saveMailingList(mailingList) {\r\n\t\tlet promiseHandler;\r\n\t\tconst promise = new Promise((resolve, reject) => {\r\n\t\t\tpromiseHandler = {\r\n\t\t\t\treject,\r\n\t\t\t\tresolve\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiSaveMailingList');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiSaveMailingList');\r\n\t\t\t}\r\n\r\n\t\t\tconst building = this._getSelectedBuildingRef();\r\n\t\t\turl = url.replace(`{schemeRef}`, building);\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst mailingListDetails = mailingList;\r\n\r\n\t\t\tconst results = await this.$http.post(url, mailingListDetails, { headers });\r\n\r\n\t\t\tconst { Data, WasSuccessful } = results.data;\r\n\r\n\t\t\tif (WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Error while saving mailing list: ${JSON.stringify(mailingList)}`);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync printPreviewSummaryWriteUp(date) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\tpromiseHandler = {\r\n\t\t\t\treject,\r\n\t\t\t\tresolve\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tif (!date) {\r\n\t\t\t\tthrow new Error(`Date not provided for the Financial Summary Write-Up Preview`);\r\n\t\t\t}\r\n\r\n\t\t\tconst building = this._getSelectedBuildingRef();\r\n\t\t\tconst momentDateString = date.format('MMMM-YYYY');\r\n\t\t\tconst title = `${building} ${momentDateString} - Financial Summary Write-Up Preview`;\r\n\t\t\tconst htmlContent = this.financialSummary.Summary;\r\n\r\n\t\t\tthis._renderPdf(htmlContent, title);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (error) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync downloadAllAttachments(dateOfFinancials) {\r\n\t\tlet promiseHandler;\r\n\t\tconst promise = new Promise((resolve, reject) => {\r\n\t\t\tpromiseHandler = {\r\n\t\t\t\treject,\r\n\t\t\t\tresolve\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tconst schemeRef = this._getSelectedBuildingRef();\r\n\t\tlet url = await this.InternalLinksService.getLink('FinancialsDownloadAllAttachments');\r\n\t\tif (!url) {\r\n\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\turl = await this.InternalLinksService.getLink('FinancialsDownloadAllAttachments');\r\n\t\t}\r\n\r\n\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\turl = url.replace('{dateOfFinancials}', moment(dateOfFinancials).format('YYYY-MM-DD'));\r\n\r\n\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\tconst results = await this.$http.get(url, { headers });\r\n\r\n\t\tconst { Data, WasSuccessful } = results.data;\r\n\r\n\t\tif (WasSuccessful) {\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t} else {\r\n\t\t\tthrow new Error(`Error while getting attachments: ${JSON.stringify(dateOfFinancials)}`);\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n }\r\n\r\n async getbuildingWorkflowAndFeatures(schemeRef) {\r\n let promiseHandler = {};\r\n const promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n try {\r\n let url = await this.InternalLinksService.getLink('BuildingWorkflowAndFeatures');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/financial/links');\r\n url = await this.InternalLinksService.getLink('BuildingWorkflowAndFeatures');\r\n }\r\n url = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n\r\n const results = await this.$http.get(url, { headers });\r\n\t\t\tconst {data }= results;\r\n this.buildingWorkflowAndFeatures = !!data ? data : {};\r\n\r\n this.$timeout(() => {\r\n promiseHandler.resolve();\r\n });\r\n } catch (err) {\r\n this.buildingWorkflowAndFeatures = {};\r\n this.$timeout(() => {\r\n promiseHandler.reject(err);\r\n });\r\n }\r\n return promise;\r\n }\r\n\t\r\n\t_renderPdf(content, title) {\r\n\t\tconst pdfWorker = html2pdf();\r\n\t\tconst options = {\r\n\t\t\tmargin: [ 20, 20, 22, 20 ],\r\n\t\t\tfilename: title,\r\n\t\t\tjsPDF: { units: 'px', format: 'a4', orientation: 'landscape' }\r\n\t\t};\r\n\r\n\t\tpdfWorker.set(options).from(content).toPdf().get('pdf').then((pdf) => {\r\n\t\t\twindow.open(pdf.output('bloburl'), '_blank');\r\n\t\t});\r\n\t}\r\n\r\n\topenNewTabReport(url, title) {\r\n\t\tvar win = window.open(url, '_blank');\r\n\t\twin.focus();\r\n\t\t\r\n\t\t// const newTab = window.open(url, '_blank');\r\n\t\t// newTab.document.write(`\r\n // ${title}\r\n // \r\n // \r\n // `);\r\n\t}\r\n\r\n\topenPrintPreviewSummaryWriteUp(pdfContent, title) {\r\n\t\tlet pdfWindow = window.open('', '_blank');\r\n\t\tpdfWindow.document.write(\r\n\t\t\t``\r\n\t\t);\r\n\t}\r\n\r\n\t_getSelectedBuildingRef() {\r\n\t\tlet selectedBuildingRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\r\n\t\tif (selectedBuildingRef && typeof selectedBuildingRef === 'object')\r\n\t\t\tselectedBuildingRef = selectedBuildingRef.SchemeReference;\r\n\r\n\t\treturn selectedBuildingRef;\r\n\t}\r\n\r\n\t_mapCommunicationChannelDescription(original) {\r\n\t\tconst mapped = original;\r\n\t\tvar temp = mapped.EmailListItems.map((mailItem) => {\r\n\t\t\tconst { CommunicationChannel } = mailItem;\r\n\t\t\tif (CommunicationChannel === 0) {\r\n\t\t\t\tmailItem.CommunicationChannelDescription = 'PDFs';\r\n\t\t\t} else if (CommunicationChannel === 1) {\r\n\t\t\t\tmailItem.CommunicationChannelDescription = 'Online';\r\n\t\t\t}\r\n\r\n\t\t\tmailItem.isEdit = false;\r\n\t\t\tmailItem.MailingListHeaderId = mapped.Id;\r\n\r\n\t\t\treturn mailItem;\r\n\t\t});\r\n\r\n\t\tif (temp) {\r\n\t\t\tmapped.EmailListItems = temp;\r\n\t\t}\r\n\r\n\t\treturn mapped;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, Utility, $timeout, $rootScope, InternalLinksService, LocalStorageService) =>\r\n\tnew FinancialSummaryService($http, Utility, $timeout, $rootScope, InternalLinksService, LocalStorageService);\r\n","//@ts-check\r\n\r\nconst onResize = () => {\r\n const $win = $(window);\r\n const mobileWidth = 991;\r\n let isMobile = $win.width() <= mobileWidth;\r\n $win.on('resize', (evt) => {\r\n isMobile = $win.width() <= mobileWidth;\r\n console.log(`Width: ${$win.width()} is ${isMobile ? ' ' : ' not '}a Mobile.`);\r\n });\r\n};\r\n\r\nclass FinancialsService {\r\n constructor(\r\n $sce,\r\n $http,\r\n Utility,\r\n $window,\r\n $timeout,\r\n $rootScope,\r\n $templateCache,\r\n TelemetryService,\r\n NotificationService,\r\n LocalStorageService,\r\n InternalLinksService\r\n ) {\r\n this.$sce = $sce;\r\n this.$http = $http;\r\n this.Utility = Utility;\r\n this.$window = $window;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.$templateCache = $templateCache;\r\n this.TelemetryService = TelemetryService;\r\n this.NotificationService = NotificationService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.InternalLinksService = InternalLinksService;\r\n\r\n this.init();\r\n }\r\n\r\n init() {\r\n this.$win = $(this.$window);\r\n this.financialYears = undefined;\r\n this.financialMonths = undefined;\r\n this.LastFinancialMonth = undefined;\r\n this.iframeReportUrl = undefined;\r\n this.Utility.safeApply(this.$rootScope, onResize);\r\n this.mobileViewText =\r\n 'Kindly download the PDF report as we do not have a mobile view for this report as of yet.';\r\n this.buildingWorkflowAndFeatures = {};\r\n }\r\n\r\n getSelectedDate(originalDate) {\r\n if (originalDate) {\r\n return originalDate;\r\n }\r\n\r\n let selectedDate;\r\n if (this.LocalStorageService.retrieve('selectedReportMonth')) {\r\n const rawSelectedReportMonth = this.LocalStorageService.retrieve('selectedReportMonth');\r\n selectedDate = moment(rawSelectedReportMonth, 'YYYY-MM-DD');\r\n } else {\r\n selectedDate = moment(new Date(), 'YYYY-MM-DD');\r\n }\r\n\r\n return selectedDate;\r\n }\r\n\r\n getSelectedYear(originalDate) {\r\n if (originalDate) {\r\n return originalDate;\r\n }\r\n\r\n let selectedDate;\r\n if (this.LocalStorageService.retrieve('selectedReportYear')) {\r\n const rawSelectedReportYear = this.LocalStorageService.retrieve('selectedReportYear');\r\n selectedDate = moment(rawSelectedReportYear, 'YYYY-MM-DD');\r\n } else {\r\n selectedDate = moment(new Date(), 'YYYY-MM-DD');\r\n }\r\n\r\n return selectedDate;\r\n }\r\n\r\n getSelectedMonth(originalDate) {\r\n if (originalDate) {\r\n return originalDate;\r\n }\r\n\r\n let selectedDate;\r\n if (this.LocalStorageService.retrieve('selectedReportMonth')) {\r\n const rawSelectedReportMonth = this.LocalStorageService.retrieve('selectedReportMonth');\r\n selectedDate = moment(rawSelectedReportMonth, 'YYYY-MM-DD');\r\n } else {\r\n selectedDate = moment(new Date(), 'YYYY-MM-DD');\r\n }\r\n\r\n return selectedDate;\r\n }\r\n\r\n async setReportURL(schemeRef, date) {\r\n let url = await this.InternalLinksService.getLink('FinancialsReport');\r\n let formattedDate;\r\n try {\r\n\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/reporting/links');\r\n url = await this.InternalLinksService.getLink('FinancialsReport');\r\n }\r\n if (typeof date === 'object') {\r\n if ('getDate' in date) {\r\n const intDay = date.getDate();\r\n const intMonth = date.getMonth() + 1;\r\n const year = date.getFullYear();\r\n\r\n let strDay = `${intDay}`.length > 1 ? `${intDay}` : `0${intDay}`;\r\n let strMonth = `${intMonth}`.length > 1 ? `${intMonth}` : `0${intMonth}`;\r\n formattedDate = `${strMonth}/${strDay}/${year}`;\r\n } else {\r\n formattedDate = date.format('MM/DD/YYYY');\r\n }\r\n } else {\r\n const strDate = date.substr(0, 10);\r\n formattedDate = moment(strDate).format('MM/DD/YYYY');\r\n }\r\n url += `?schemeRef=${schemeRef}&date=${formattedDate}&type=${0}`;\r\n\r\n } catch (err) {\r\n this.NotificationService.error('Error Downloading Report');\r\n } finally {\r\n return url;\r\n }\r\n }\r\n\r\n getMapFirstDay(originalDate) {\r\n if (!originalDate.year) {\r\n originalDate = moment(originalDate);\r\n }\r\n\r\n const todayMoment = moment(`${originalDate.year()}-01-${originalDate.month() + 1}`, 'YYYY-DD-MM').add(3, 'h');\r\n\r\n return todayMoment.toDate();\r\n }\r\n\r\n async getFinancialYears(schemeRef, date) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n let url = await this.InternalLinksService.getLink('FinancialApiFinancialYears');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/financial/links');\r\n url = await this.InternalLinksService.getLink('FinancialApiFinancialYears');\r\n }\r\n\r\n url = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n const results = await this.$http.post(url, date, { headers: headers });\r\n const { data } = results;\r\n\r\n this.financialYears = data;\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (err) {\r\n this.financialYears = {};\r\n this.$timeout(() => promiseHandler.resolve());\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getLastFinancialMonth(schemeRef) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('FinancialApiLastFinancialMonth');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/financial/links');\r\n url = await this.InternalLinksService.getLink('FinancialApiLastFinancialMonth');\r\n }\r\n\r\n url = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n const results = await this.$http.post(url, { headers });\r\n const { data } = results;\r\n\r\n this.financialMonths = data;\r\n this.$timeout(() => promiseHandler.resolve(data));\r\n } catch (err) {\r\n this.financialMonths = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n\r\n async getFinancialMonths(schemeRef, date) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('FinancialApiFinancialMonths');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/financial/links');\r\n url = await this.InternalLinksService.getLink('FinancialApiFinancialMonths');\r\n }\r\n\r\n url = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n const results = await this.$http.post(url, date, { headers });\r\n const { data } = results;\r\n\r\n this.financialMonths = data;\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (err) {\r\n this.financialMonths = {};\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getReport(schemeRef, date, type, title, orderByUnitNumber, onlyShowDebtors, showLegalMemos, showAllLegalAccounts) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('FinancialsReport');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/reporting/links');\r\n url = await this.InternalLinksService.getLink('FinancialsReport');\r\n }\r\n let formattedDate;\r\n\r\n if (typeof date === 'object') {\r\n if ('getDate' in date) {\r\n const intDay = date.getDate();\r\n const intMonth = date.getMonth() + 1;\r\n const year = date.getFullYear();\r\n\r\n let strDay = `${intDay}`.length > 1 ? `${intDay}` : `0${intDay}`;\r\n let strMonth = `${intMonth}`.length > 1 ? `${intMonth}` : `0${intMonth}`;\r\n formattedDate = `${strMonth}/${strDay}/${year}`;\r\n } else {\r\n formattedDate = date.format('MM/DD/YYYY');\r\n }\r\n } else {\r\n const strDate = date.substr(0, 10);\r\n formattedDate = moment(strDate).format('MM/DD/YYYY');\r\n }\r\n\r\n if (type === 3 || type === 7) {\r\n url += `?schemeRef=${schemeRef}&date=${formattedDate}&type=${type}&orderByUnitNumber=${orderByUnitNumber ||\r\n false}&onlyShowDebtors=${onlyShowDebtors || false}&showLegalMemos=${showLegalMemos || false}&showAllLegalAccounts=${showAllLegalAccounts || false}`;\r\n } else {\r\n url += `?schemeRef=${schemeRef}&date=${formattedDate}&type=${type}`;\r\n }\r\n this.openNewTabReport(url, title);\r\n\r\n await this.TelemetryService.logTelemetry(\r\n `Download Financial Report`,\r\n `Report Type: ${type}, Scheme Ref: ${schemeRef}, Date: ${formattedDate}`\r\n );\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (error) {\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getAllReports(schemeRef, date, type, title, orderByUnitNumber, onlyShowDebtors, showLegalMemos, showAllLegalAccounts) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('AllFinancialsReport');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/reporting/links');\r\n url = await this.InternalLinksService.getLink('AllFinancialsReport');\r\n }\r\n let formattedDate;\r\n\r\n if (typeof date === 'object') {\r\n if ('getDate' in date) {\r\n const intDay = date.getDate();\r\n const intMonth = date.getMonth() + 1;\r\n const year = date.getFullYear();\r\n\r\n let strDay = `${intDay}`.length > 1 ? `${intDay}` : `0${intDay}`;\r\n let strMonth = `${intMonth}`.length > 1 ? `${intMonth}` : `0${intMonth}`;\r\n formattedDate = `${strMonth}/${strDay}/${year}`;\r\n } else {\r\n formattedDate = date.format('MM/DD/YYYY');\r\n }\r\n } else {\r\n const strDate = date.substr(0, 10);\r\n formattedDate = moment(strDate).format('MM/DD/YYYY');\r\n }\r\n\r\n if (type === 3) {\r\n url += `?schemeRef=${schemeRef}&date=${formattedDate}&type=${type}&orderByUnitNumber=${orderByUnitNumber ||\r\n false}&onlyShowDebtors=${onlyShowDebtors || false}&showLegalMemos=${showLegalMemos || false}&showAllLegalAccounts=${showAllLegalAccounts || false}`;\r\n } else {\r\n url += `?schemeRef=${schemeRef}&date=${formattedDate}&type=${type}`;\r\n }\r\n this.openNewTabReport(url, title);\r\n\r\n await this.TelemetryService.logTelemetry(\r\n `Download All Financial Report`,\r\n `Report Type: ${type}, Scheme Ref: ${schemeRef}, Date: ${formattedDate}`\r\n );\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (error) {\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n //TODO: async-await\r\n async getLegalReport(cardCode) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('FinancialsLegalReport');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/reporting/links');\r\n url = await this.InternalLinksService.getLink('FinancialsLegalReport');\r\n }\r\n url += `?cardCode=${cardCode}`;\r\n this.openNewTabReport(url, `Legal Report - ${cardCode}`);\r\n\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (error) {\r\n console.error(`Error while Getting Legal Report: ${cardCode}`);\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getAllLegalReport(schemeRef, numberOfDays) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('FinancialsLegalReportAll');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/reporting/links');\r\n url = await this.InternalLinksService.getLink('FinancialsLegalReportAll');\r\n }\r\n url += `?schemeRef=${schemeRef}&numberOfDays=${numberOfDays}`;\r\n this.openNewTabReport(url, `Legal Report`);\r\n\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (error) {\r\n console.error(`Error while Getting All Legal Report: ${schemeRef}`);\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n async getFinancialState(schemeRef, date, type) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('FinancialState');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/reporting/links');\r\n url = await this.InternalLinksService.getLink('FinancialState');\r\n }\r\n\r\n url = url.replace('{date}', date).replace('{type}', type).replace('{schemeRef}', schemeRef);\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n if (!!!headers || (!!headers && (!!!headers.userName || !!!headers.sessionToken))) {\r\n const error = `Could not load Financial State the 'Username' and/or 'Session Token' is missing`;\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n var rawResults = await this.$http.get(url, { headers });\r\n const { Data: httpCallResults, WasSuccessful } = rawResults.data;\r\n\r\n let status;\r\n if (WasSuccessful) {\r\n const { FinancialStatus } = httpCallResults;\r\n status = FinancialStatus;\r\n } else {\r\n status = -1;\r\n }\r\n\r\n const momentDate = moment(date, 'YYYY-MM-DD');\r\n const results = this._generateFinancialStatusResults(status, momentDate.format('MMM YYYY'), type);\r\n this.$timeout(() => promiseHandler.resolve(results));\r\n } catch (error) {\r\n console.error(`Error while retrieving financial details type (${type}) current state for date ${date}`);\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n return promise;\r\n }\r\n\r\n _generateFinancialStatusResults(status, month, type) {\r\n /*\r\n No Financial Release = -1\r\n Initial = 0,\r\n Approved = 1,\r\n Rejected = 2,\r\n SentForApproval = 3\r\n */\r\n\r\n /*\r\n CashflowStatment = 0,\r\n IncomeStatment = 1,\r\n BalanceSheet = 2,\r\n LevyRoll = 3,\r\n ContractorsRoll = 4,\r\n LegalReport = 5,\r\n CashAvailability = 6\r\n */\r\n\r\n let message, financialType;\r\n\r\n switch (type) {\r\n case 0:\r\n financialType = 'Cashflow Statement';\r\n break;\r\n case 1:\r\n financialType = 'Income Statement';\r\n break;\r\n case 2:\r\n financialType = 'Balance Sheet';\r\n break;\r\n case 3:\r\n financialType = 'Levy Roll';\r\n break;\r\n case 4:\r\n financialType = 'Contractors Roll';\r\n break;\r\n case 5:\r\n financialType = 'Legal Report';\r\n break;\r\n case 6:\r\n financialType = 'Cash Availability Report';\r\n break;\r\n case 7:\r\n financialType = 'Wages Roll';\r\n break;\r\n case 8:\r\n financialType = 'Debtor Age Analysis';\r\n break;\r\n }\r\n\r\n switch (status) {\r\n case 0:\r\n case 2:\r\n case 3:\r\n message = `Please take note, the ${financialType} for ${month} has not yet been finalized.`;\r\n break;\r\n case -1:\r\n message = `Please take note, the ${financialType} for ${month} has not yet been published.`;\r\n break;\r\n }\r\n\r\n return {\r\n status,\r\n message\r\n };\r\n }\r\n\r\n openNewTabReport(url, title) {\r\n const newTab = this.$window.open(url, '_blank');\r\n if (newTab) {\r\n this.NotificationService.error('Please allow pop-ups for this site to view the report');\r\n }\r\n newTab.document.write(`\r\n \r\n \r\n ${title}\r\n \r\n \r\n \r\n
\r\n \"Loading...\"\r\n
\r\n \r\n \r\n \r\n `);\r\n newTab.document.close();\r\n var iframeTest = newTab.document.getElementById('spinnerTest');\r\n setTimeout(function () {\r\n var iframeDoc = iframeTest.contentDocument || iframeTest.contentWindow.document;\r\n if (iframeDoc.readyState == 'complete') {\r\n iframeTest.contentWindow.onload = function () {\r\n var spinnerDisplay = newTab.document.getElementById('loadSpinner');\r\n spinnerDisplay.remove();\r\n iframeTest.removeAttribute('hidden');\r\n };\r\n }\r\n return;\r\n });\r\n }\r\n\r\n getTemplate(templatePath) {\r\n const htmlTemplate = this.$templateCache.get(templatePath);\r\n return htmlTemplate;\r\n }\r\n\r\n\r\n async getbuildingWorkflowAndFeatures(schemeRef) {\r\n let promiseHandler = {};\r\n const promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n try {\r\n let url = await this.InternalLinksService.getLink('BuildingWorkflowAndFeatures');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/financial/links');\r\n url = await this.InternalLinksService.getLink('BuildingWorkflowAndFeatures');\r\n }\r\n url = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n\r\n const results = await this.$http.get(url, { headers });\r\n const { data } = results;\r\n this.buildingWorkflowAndFeatures = !!data ? data : {};\r\n\r\n this.$timeout(() => {\r\n promiseHandler.resolve();\r\n });\r\n } catch (err) {\r\n this.buildingWorkflowAndFeatures = {};\r\n this.$timeout(() => {\r\n promiseHandler.reject(err);\r\n });\r\n }\r\n return promise;\r\n }\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n $sce,\r\n $http,\r\n Utility,\r\n $window,\r\n $timeout,\r\n $rootScope,\r\n $templateCache,\r\n TelemetryService,\r\n NotificationService,\r\n LocalStorageService,\r\n InternalLinksService\r\n) =>\r\n new FinancialsService(\r\n $sce,\r\n $http,\r\n Utility,\r\n $window,\r\n $timeout,\r\n $rootScope,\r\n $templateCache,\r\n TelemetryService,\r\n NotificationService,\r\n LocalStorageService,\r\n InternalLinksService\r\n );\r\n","/* @ngInject */\r\nexport default class IncomeStatementCtrl {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tIncomeStatementService,\r\n\t\tAuthorizationService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.IncomeStatementService = IncomeStatementService;\r\n this.AuthorizationService = AuthorizationService;\r\n\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.financialsServiceData = this.FinancialsService;\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.selectedBuildingRef = '';\r\n\t\tthis.selectedBuildingName = '';\r\n\t\tthis.statusInformation = null;\r\n\t\tthis.today = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.reportModelHeader = '';\r\n\r\n\t\tthis.isFilterActive = true;\r\n\t\tthis.filterYear = undefined;\r\n\t\tthis.isMonthlyView = true;\r\n\t\tthis.filterMonth = undefined;\r\n\t\tthis.selectedDate = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(new Date());\r\n\r\n\t\tthis.stickableStyles = `\r\n\t\t\t\ttop: -0.5em;\r\n\t\t\t\tleft: 4.93em;\r\n\t\t\t\twidth: 91.74%;\r\n\t\t\t\tz-index: 10;\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\tbackground-color: #e8e8e8;\r\n\t\t\t`;\r\n\r\n\t\tthis.$scope.$on('selected-building-changed', async (event, newValue) => {\r\n\t\t\tawait this.onSelectedBuildingChanged(this, newValue);\r\n\t\t});\r\n\t}\r\n\r\n\tasync activate() {\r\n\t\tthis.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tvar buildingName = '';\r\n\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n\t\tif (userProfile) {\r\n\t\t\tif (!this.selectedBuildingRef) {\r\n this.selectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n }\r\n\t\t\tconst selectedBuilding = userProfile.BuildingProfiles.find((building) => {\r\n\t\t\t\treturn building.SchemeReference.toUpperCase().trim() === this.selectedBuildingRef.toUpperCase().trim();\r\n\t\t\t});\r\n\r\n\t\t\tif (selectedBuilding) {\r\n\t\t\t\tbuildingName = selectedBuilding.SchemeName;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tawait this.getFinancialYears(true);\r\n\t\tthis.selectedBuildingName = buildingName;\r\n\t}\r\n\r\n\topenFinancials(page) {\r\n this.saveSelectedDate();\r\n this.$rootScope.$broadcast('navigate-changed', page, { date: this.filterMonth });\r\n }\r\n\r\n\tsaveSelectedDate() {\r\n const selectedYear = moment(this.filterYear).toDate();\r\n const selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n this.LocalStorageService.save('selectedReportYear', selectedYear);\r\n this.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n }\r\n\r\n async gotoOldFinancials() {\r\n const date = moment(this.filterMonth).format('MMM YYYY');\r\n let nav = `Monthly Financial Statements>${date}`;\r\n nav = encodeURI(nav);\r\n this.$state.go('documents', { nav });\r\n }\r\n\r\n\tisDesktop() {\r\n\t\tthis.LocalStorageService.save('mediaDevice', 'mobile');\r\n\t\tconst mdvice = this.LocalStorageService.retrieve('mediaDevice');\r\n\t\tif (mdvice == 'mobile') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tasync filterByCurrentMonth() {\r\n\t\tthis.isFilterActive = true;\r\n\t\tthis.selectedDate = this.Utility.getFormatedDate(new Date());\r\n\t\tawait this.getIncomeStatement();\r\n\t}\r\n\r\n\tasync filterByMonth() {\r\n\t\tthis.$timeout(async () => {\r\n\t\t\tif (this.filterMonth) {\r\n\t\t\t\tthis.selectedDate = this.Utility.getFormatedDate(this.filterMonth);\r\n\t\t\t\tawait this.getIncomeStatement();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\tasync filterByYear() {\r\n\t\tthis.filterMonth = '';\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\t\tif (this.isMonthlyView) {\r\n\t\t\tawait this.getFinancialMonths(this.selectedDateYear);\r\n\t\t} else {\r\n\t\t\tthis.selectedDate = this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\tawait this.getIncomeStatement();\r\n\t\t}\r\n\t}\r\n\r\n\tasync getReport() {\r\n\t\tthis.reportModelHeader =\r\n\t\t\tthis.selectedBuildingName + ' - Income Statement - ' + moment(this.selectedDate).format('MMM YYYY');\r\n\t\tawait this.financialsServiceData.getReport(\r\n\t\t\tthis.selectedBuildingRef,\r\n\t\t\tthis.selectedDate || moment(this.selectedDateYear),\r\n\t\t\t1,\r\n\t\t\tthis.reportModelHeader\r\n\t\t);\r\n\t}\r\n\r\n\tasync onSelectedBuildingChanged(event, schemeRef) {\r\n\t\tif (schemeRef && schemeRef['length'] > 2) this.selectedBuildingRef = schemeRef;\r\n\t\telse this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tif (this.selectedBuildingRef && this.selectedBuildingRef.length > 2) {\r\n\t\t\tawait this.activate();\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialYears(isInit) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.financialsServiceData.getFinancialYears(this.selectedBuildingRef, this.today);\r\n\t\t\tif (isInit) {\r\n\t\t\t\tawait this.getSelectedDate(true);\r\n\t\t\t} else {\r\n\t\t\t\tthis.filterYear = this.financialsServiceData.financialYears[\r\n\t\t\t\t\tthis.financialsServiceData.financialYears.length - 1\r\n\t\t\t\t].WhenTo;\r\n\t\t\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\t\tawait this.getIncomeStatement();\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error loading Financial Years`, err);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\t\t\r\n\tasync getFinancialMonths(date, isInit) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tawait this.financialsServiceData.getFinancialMonths(this.selectedBuildingRef, date || new Date());\r\n\t\t\tlet selectedMonthIndex = -1;\r\n\r\n\t\t\tconst selectedDateMonth = await this.financialsServiceData.getSelectedMonth();\r\n\r\n\t\t\tif (selectedDateMonth) {\r\n\t\t\t\tif (this.financialsServiceData.financialMonths && this.financialsServiceData.financialMonths.length > 0) {\r\n\t\t\t\t\tconst foundMonth = this.financialsServiceData.financialMonths.find((month, index) => {\r\n\t\t\t\t\t\tconst momentMonth = moment(month.WhenFrom);\r\n\t\t\t\t\t\tif (momentMonth.isSame(selectedDateMonth, 'month')) {\r\n\t\t\t\t\t\t\tselectedMonthIndex = index;\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif (selectedMonthIndex > -1 && foundMonth) {\r\n\t\t\t\t\t\tthis.filterMonth = this.financialsServiceData.financialMonths[selectedMonthIndex].WhenFrom;\r\n\t\t\t\t\t\tthis._filterOutFutureMonths();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (date && isInit) {\r\n\t\t\t\tthis.financialsServiceData.financialMonths.filter(async (month, i) => {\r\n\t\t\t\t\tconst monthDateStr = month.WhenFrom.substr(0, 10);\r\n\t\t\t\t\tconst monthDate = moment(new Date(monthDateStr), 'YYYY-DD-MM');\r\n\t\t\t\t\tconst selectedMonth = await this.financialsServiceData.getSelectedMonth();\r\n\r\n\t\t\t\t\tif (monthDate.isSame(selectedMonth, 'month')) {\r\n\t\t\t\t\t\tselectedMonthIndex = i;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (selectedMonthIndex === -1) {\r\n\t\t\t\t\tthis.filterMonth = '';\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.filterMonth = this.financialsServiceData.financialMonths[selectedMonthIndex].WhenFrom;\r\n\t\t\t\t}\r\n\t\t\t} else if (isInit) {\r\n\t\t\t\tthis.filterMonth = this.financialsServiceData.financialMonths[\r\n\t\t\t\t\tthis.financialsServiceData.financialMonths.length - 1\r\n\t\t\t\t].WhenFrom;\r\n\t\t\t}\r\n\t\t\tif (this.filterMonth) {\r\n\t\t\t\tthis.selectedDate = this.filterMonth;\r\n\t\t\t\tawait this.getIncomeStatement();\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading financial months\\n${err}`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\t_filterOutFutureMonths() {\r\n\t\tconst today = new Date();\r\n\t\tconst formatedDate = moment(today).format('YYYY MMMM');\r\n\t\tconst currentYear = formatedDate.split(' ')[0];\r\n\t\tconst currentMonth = formatedDate.split(' ')[1];\r\n\r\n\t\tlet foundIndex = -1;\r\n\t\tconst found = this.financialsServiceData.financialMonths.find((month, index) => {\r\n\t\t\tconst fields = month.FriendlyNameMonth.split(' ');\r\n\t\t\tconst yearStr = fields[1];\r\n\t\t\tconst monthStr = fields[0];\r\n\t\t\tconst found = currentYear === yearStr && currentMonth === monthStr;\r\n\r\n\t\t\tif (found) {\r\n\t\t\t\tfoundIndex = index;\r\n\t\t\t}\r\n\t\t\treturn found;\r\n\t\t});\r\n\r\n\t\tif (found && foundIndex > -1) {\r\n\t\t\tconst filteredMonths = this.financialsServiceData.financialMonths.filter(\r\n\t\t\t\t(month, index) => index < foundIndex + 1\r\n\t\t\t);\r\n\r\n\t\t\tif (filteredMonths && filteredMonths.length < this.financialsServiceData.financialMonths.length) {\r\n\t\t\t\tthis.financialsServiceData.financialMonths = filteredMonths;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tasync getIncomeStatement() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tawait this.IncomeStatementService.getIncomeStatement(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.Utility.getFormatedDate(this.filterMonth)\r\n\t\t\t);\r\n\t\t\tawait this.getFinancialState();\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading Income Statement`, err);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getSelectedDate(isInit) {\r\n\t\tconst selectedDateYear = this.financialsServiceData.getSelectedYear();\r\n\t\tif (isInit) {\r\n\t\t\tlet index = 0;\r\n\t\t\tfor (let i = 0; i < this.financialsServiceData.financialYears.length; i++) {\r\n\t\t\t\tconst yearRaw = this.financialsServiceData.financialYears[i];\r\n\r\n\t\t\t\tif (selectedDateYear.isBetween(yearRaw.WhenFrom, yearRaw.WhenTo)) {\r\n\t\t\t\t\tindex = i;\r\n\t\t\t\t\tthis.filterYear = this.financialsServiceData.financialYears[i].WhenTo;\r\n\t\t\t\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst date = selectedDateYear ? selectedDateYear : new Date();\r\n\t\t\tawait this.getFinancialMonths(date, true);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialState() {\r\n\t\tconst type = 1;\r\n\t\tconst schemeRef = this.selectedBuildingRef;\r\n\t\tconst momentDate = moment(this.selectedDate, 'YYYY-MM-DD');\r\n\t\tconst formattedDate = momentDate.format('YYYY-MM-DD');\r\n\t\tconst date = `${formattedDate.substr(0, 8)}01`;\r\n\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tconst results = await this.FinancialsService.getFinancialState(schemeRef, date, type);\r\n\r\n\t\t\tconst { status, message } = results;\r\n\t\t\tthis.statusInformation = message;\r\n\t\t} catch (error) {\r\n\t\t\tthis.NotificationService.error('Error loading income statement status');\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tallowAction(actionName) {\r\n return this.AuthorizationService.isAuthorized(actionName);\r\n }\r\n\r\n\t_switchIsBusyLoading(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isLoading = flag;\r\n\t\t});\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass IncomeStatementService {\r\n\tconstructor($http, Utility, $timeout, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tasync init() {\r\n\t\tthis.incomeStatementData = undefined;\r\n\t}\r\n\r\n\tasync getIncomeStatement(schemeRef, date) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiIncomeStatement');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiIncomeStatement');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\r\n\t\t\tif (!!!headers || (!!headers && (!!!headers.userName || !!!headers.sessionToken))) {\r\n\t\t\t\tconst error = `Could not load Levy as the 'Username' and/or 'Session Token' is missing`;\r\n\t\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, date, { headers: headers });\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.incomeStatementData = data;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(`Error fetching Income Statement Data`, err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, Utility, $timeout, LocalStorageService, InternalLinksService) =>\r\n\tnew IncomeStatementService($http, Utility, $timeout, LocalStorageService, InternalLinksService);\r\n","/* @ngInject */\r\nexport default class IncomeVSBudgetCtrl {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tNotificationService,\r\n\t\tIncomeVSBudgetService,\r\n\t\tAuthorizationService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.IncomeVSBudgetService = IncomeVSBudgetService;\r\n\t\tthis.AuthorizationService = AuthorizationService;\r\n\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.today = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDate = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.filterYear = this.selectedDate;\r\n\t\tthis.filterMonth = this.selectedDateYear;\r\n\t}\r\n\r\n\topenFinancials(page) {\r\n this.saveSelectedDate();\r\n this.$rootScope.$broadcast('navigate-changed', page, { date: this.filterMonth });\r\n }\r\n\r\n\tsaveSelectedDate() {\r\n const selectedYear = moment(this.filterYear).toDate();\r\n const selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n this.LocalStorageService.save('selectedReportYear', selectedYear);\r\n this.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n }\r\n\r\n\t_switchIsBusyLoading(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isLoading = flag;\r\n\t\t});\r\n\t}\r\n\r\n\tallowAction(actionName) {\r\n return this.AuthorizationService.isAuthorized(actionName);\r\n }\r\n\t\r\n\tasync activate() {\r\n\t\tthis.serviceData = this.IncomeVSBudgetService;\r\n\t\tthis.financialsServiceData = this.FinancialsService;\r\n\t}\r\n\t\r\n}\r\n","//@ts-check\r\n\r\nclass IncomeVSBudgetService {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tasync init() {\r\n\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$sce,\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tFinancialsService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew IncomeVSBudgetService(\r\n\t\t$sce,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","/* @ngInject */\r\nexport default class LevyRollCtrl {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tBuildingsService,\r\n\t\tPagingService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tLevyRollService,\r\n\t\tAuthorizationService,\r\n\t\tFinancialSummaryService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.PagingService = PagingService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.LevyRollService = LevyRollService;\r\n this.AuthorizationService = AuthorizationService;\r\n\t\tthis.FinancialSummaryService = FinancialSummaryService;\r\n\t\t\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.selectLevytype = 'levyRoll';\r\n\t\tthis.isLegalCollectionRollEnabled = this.AuthorizationService.isAuthorized('View Collections Legal Roll');\r\n\t\tthis.isConsolidatedLevyRollEnabled = this.AuthorizationService.isAuthorized('View Consolidated Levy Roll');\r\n\t\tthis.buildingWorkflowAndFeatures = {};\r\n\t\tthis.statusInformation = null;\r\n\t\tthis.canFilter = false;\r\n\t\tthis.serviceData = undefined;\r\n\t\tthis.financialsServiceData = undefined;\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.selectedBuildingRef = '';\r\n\t\tthis.selectedBuildingName = '';\r\n\t\tthis.filterMonth = undefined;\r\n\t\tthis.filterYear = undefined;\r\n\t\tthis.today = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDate = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(new Date());\r\n\t\tthis.reportModelHeader = '';\r\n\t\tthis.onlyShowDebtors = false;\r\n\t\tthis.orderByUnitNumber = false;\r\n\t\tthis.orderByHighestDebtor = true;\r\n\t\tthis.isFilterByMonthActive = true;\r\n\t\tthis.isFilterByOnlyShowDebtors = false;\r\n\t\tthis.isFilterByOrderByUnitNumber = false;\r\n\t\tthis.isFilterByOrderByHighestDebtor = true;\r\n\t\tthis.isfilterByShowAllLegalMemos = false;\r\n\t\tthis.isfilterByShowAllLegalAccountData = false;\r\n\r\n\t\tthis.levyRollPaging = this.PagingService;\r\n\t\tthis.isPagingNavigationVisible = false;\r\n\t\tthis.isPagingNavigationVisibleLegal = false;\r\n\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\t\tthis.isShowAllLegalAccountData = false;\r\n\t\tthis.showHideLegalMemos = 'Show all Legal Memos';\r\n\t\tthis.showHideLegalAccountData = 'Show Legal Collection Roll';\r\n\r\n\t\tthis.$scope.$on('selected-building-changed', (event, newValue) => {\r\n\t\t\tthis.onSelectedBuildingChanged(this, newValue);\r\n\t\t});\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'levyRollVm.levyRollPaging.pageNumber',\r\n\t\t\t() => {\r\n\t\t\t\tthis.getLevyRoll();\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'levyRollVm.levyRollPaging.maxPage',\r\n\t\t\t() => {\r\n\t\t\t\tthis.levyRollPaging.pageNumber = 1;\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'levyRollVm.levyRollPaging.maxPageLegal',\r\n\t\t\t() => {\r\n\t\t\t\tthis.levyRollPaging.pageNumber = 1;\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\t}\r\n\r\n\topenFinancials(page) {\r\n\t\tthis.saveSelectedDate();\r\n\t\tthis.$rootScope.$broadcast('navigate-changed', page, { date: this.filterMonth });\r\n\t}\r\n\r\n\tsaveSelectedDate() {\r\n\t\tconst selectedYear = moment(this.filterYear).toDate();\r\n\t\tconst selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n\t\tthis.LocalStorageService.save('selectedReportYear', selectedYear);\r\n\t\tthis.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n\t}\r\n\r\n\tasync gotoOldFinancials() {\r\n\t\tconst date = moment(this.filterMonth).format('MMM YYYY');\r\n\t\tlet nav = `Monthly Financial Statements>${date}`;\r\n\t\tnav = encodeURI(nav);\r\n\t\tthis.$state.go('documents', { nav });\r\n\t}\r\n\r\n\tisDesktop() {\r\n\t\tthis.LocalStorageService.save('mediaDevice', 'mobile');\r\n\t\tconst mediaDevice = this.LocalStorageService.retrieve('mediaDevice');\r\n\t\tif (mediaDevice == 'mobile') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tasync filterByMonth() {\r\n\t\tif (this.filterMonth !== '' && this.filterMonth) {\r\n\t\t\tthis.resetVariables();\r\n\t\t\tthis.selectedDate = this.Utility.getFormatedDate(this.filterMonth);\r\n\t\t\tawait this.getLevyRoll();\r\n\t\t} else {\r\n\t\t\tthis.serviceData.levyRollData = {};\r\n\t\t}\r\n\t}\r\n\r\n\tasync filterByYear() {\r\n\t\tthis.filterMonth = '';\r\n\t\tthis.serviceData.levyRollData = undefined;\r\n\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\t\tawait this.getFinancialMonths(this.selectedDateYear);\r\n\t}\r\n\r\n\tfilterByOrderByUnitNumber() {\r\n\t\tthis.levyRollPaging.pageNumber = 1;\r\n\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.isFilterByOnlyShowDebtors = false;\r\n\t\tthis.isFilterByOrderByUnitNumber = true;\r\n\t\tthis.isFilterByOrderByHighestDebtor = false;\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\r\n\t\tthis.onlyShowDebtors = false;\r\n\t\tthis.orderByHighestDebtor = false;\r\n\t\tthis.orderByUnitNumber = true;\r\n\r\n\t\tthis.getLevyRoll();\r\n\t}\r\n\r\n\tfilterByOrderByHighestDebtor() {\r\n\t\tthis.levyRollPaging.pageNumber = 1;\r\n\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.isFilterByOnlyShowDebtors = false;\r\n\t\tthis.isFilterByOrderByUnitNumber = false;\r\n\t\tthis.isFilterByOrderByHighestDebtor = true;\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\r\n\t\tthis.onlyShowDebtors = false;\r\n\t\tthis.orderByHighestDebtor = true;\r\n\t\tthis.orderByUnitNumber = false;\r\n\r\n\t\tthis.getLevyRoll();\r\n\t}\r\n\r\n\tfilterByOnlyShowDebtors() {\r\n\t\tthis.levyRollPaging.pageNumber = 1;\r\n\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.isFilterByOnlyShowDebtors = true;\r\n\t\tthis.isFilterByOrderByUnitNumber = false;\r\n\t\tthis.isFilterByOrderByHighestDebtor = false;\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\r\n\t\tthis.orderByUnitNumber = false;\r\n\t\tthis.onlyShowDebtors = true;\r\n\t\tthis.orderByHighestDebtor = false;\r\n\r\n\t\tthis.getLevyRoll();\r\n\t}\r\n\r\n\tfilterByHideAllLegalMemos() {\r\n\t\tthis.levyRollPaging.pageNumber = 1;\r\n\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.isfilterByShowAllLegalMemos = false;\r\n\t\tthis.isfilterByShowAllLegalAccountData = false;\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\r\n\t\tthis.getLevyRoll();\r\n\t}\r\n\r\n\tfilterByHideAllLegalAccountData() {\r\n\t\tthis.levyRollPaging.pageNumber = 1;\r\n\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.isFilterByOnlyShowDebtors = false;\r\n\t\tthis.isFilterByOrderByUnitNumber = false;\r\n\t\tthis.orderByUnitNumber = false;\r\n\t\tthis.onlyShowDebtors = false;\r\n\t\tthis.isShowAllLegalMemos = false;\r\n\r\n\t\tthis.getLevyRoll();\r\n\t}\r\n\r\n\ttoggleShowAllLegalMemos() {\r\n\t\tthis.canFilter = true;\r\n\t\tthis.isShowAllLegalMemos = !this.isShowAllLegalMemos;\r\n\t}\r\n\r\n\ttoggleShowAllLegalAccountData() {\r\n\t\tthis.isShowAllLegalAccountData = !this.isShowAllLegalAccountData;\r\n\t\tif (this.isShowAllLegalAccountData) {\r\n this.showHideLegalAccountData = 'Hide Legal Collection Roll';\r\n\t\t\tthis.filterByShowAllLegalAccountData();\r\n\t\t} else {\r\n this.showHideLegalAccountData = 'Show Legal Collection Roll';\r\n\t\t\tthis.filterByHideAllLegalAccountData();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleFilterByOrderByUnitNumber() {\r\n\t\tthis.canFilter = true;\r\n\t\tthis.isFilterByOrderByUnitNumber = !this.isFilterByOrderByUnitNumber;\r\n\t\tthis.orderByUnitNumber = !this.orderByUnitNumber;\r\n\t}\r\n\r\n\ttoggleFilterByOrderByHighestDebtor() {\r\n\t\tthis.canFilter = true;\r\n\r\n\t\tthis.isFilterByOrderByHighestDebtor = !this.isFilterByOrderByHighestDebtor;\r\n\t\tthis.isFilterByOrderByUnitNumber = !this.isFilterByOrderByUnitNumber;\r\n\r\n\t\tthis.orderByHighestDebtor = !this.orderByHighestDebtor;\r\n\t\tthis.orderByUnitNumber = !this.orderByUnitNumber;\r\n\t}\r\n\r\n\ttoggleFilterByOnlyShowDebtors() {\r\n\t\tthis.canFilter = true;\r\n\t\tthis.isFilterByOnlyShowDebtors = !this.isFilterByOnlyShowDebtors;\r\n\t\tthis.onlyShowDebtors = !this.onlyShowDebtors;\r\n\t}\r\n\r\n\tselectFilter() {\r\n\t\tthis.levyRollPaging.pageNumber = 1;\r\n\t\tthis.isFilterByMonthActive = false;\r\n\t\tthis.getLevyRoll();\r\n\t}\r\n\r\n\tgetReport() {\r\n\t\tthis.reportModelHeader =\r\n\t\t\tthis.selectedBuildingName + ' - Levy Roll - ' + moment(this.selectedDate).format('MMM YYYY');\r\n\t\tthis.FinancialsService\r\n\t\t\t.getReport(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.selectedDate,\r\n\t\t\t\t3,\r\n\t\t\t\tthis.reportModelHeader,\r\n\t\t\t\tthis.orderByUnitNumber,\r\n\t\t\t\tthis.onlyShowDebtors,\r\n\t\t\t\tthis.isShowAllLegalMemos,\r\n\t\t\t\tthis.isShowAllLegalAccountData\r\n\t\t\t)\r\n\t\t\t.then(() => { }, (err) => { })\r\n\t\t\t.finally(() => { });\r\n }\r\n\r\n getLegalCollectionRollReport() {\r\n this.reportModelHeader =\r\n this.selectedBuildingName + ' - Legal Collection Roll Report - ' + moment(this.selectedDate).format('MMM YYYY');\r\n this.FinancialsService\r\n .getReport(\r\n this.selectedBuildingRef,\r\n this.selectedDate,\r\n 7,\r\n this.reportModelHeader,\r\n this.orderByUnitNumber,\r\n this.onlyShowDebtors,\r\n this.isShowAllLegalMemos,\r\n this.isShowAllLegalAccountData\r\n )\r\n .then(() => { }, (err) => { })\r\n .finally(() => { });\r\n }\r\n\r\n\tgetLegalReport(cardCode) {\r\n\t\tcardCode = `B${this.selectedBuildingRef}${cardCode}`;\r\n\t\tthis.FinancialsService.getLegalReport(cardCode).then(() => { }, (err) => { }).finally(() => { });\r\n\t}\r\n\r\n\tgetAllLegalReport() {\r\n var numberOfMonths = document.getElementById(\"legalReportMonthOptions\").value;\r\n var numberOfDays = numberOfMonths * 30.436875;\r\n numberOfDays = Math.floor(numberOfDays);\r\n\r\n this.FinancialsService.getAllLegalReport(this.selectedBuildingRef, numberOfDays).then(() => { }, (err) => { }).finally(() => { });\r\n\t}\r\n\r\n\tresetVariables() {\r\n\t\tthis.levyRollPaging.pageNumber = 1;\r\n\t\tthis.isFilterByMonthActive = true;\r\n\t\tthis.isFilterByOnlyShowDebtors = false;\r\n\t\tthis.isFilterByOrderByUnitNumber = false;\r\n\t\tthis.orderByUnitNumber = false;\r\n\t\tthis.onlyShowDebtors = false;\r\n\t\tthis.isfilterByShowAllLegalAccountData = false;\r\n\t}\r\n\r\n\ttoggleLegalMemos() {\r\n\t\tif (this.isShowAllLegalMemos) {\r\n\t\t\tconst $collapsable = $('ui-view:first-child .levy-roll-page .levy-roll-panel-group .collapse');\r\n $collapsable.each((i, toggleAllLegalMemos) => {\r\n const $collapse = $(toggleAllLegalMemos);\r\n\t\t\t\tif (!$collapse.hasClass('in')) {\r\n\t\t\t\t\tconst $clickable = $($collapse.parent()[0].children[0]);\r\n\t\t\t\t\t$clickable.trigger('click');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tthis.filterByShowAllLegalMemos();\r\n\t\t} else {\r\n\t\t\tconst $collapsable = $('ui-view:first-child .levy-roll-page .levy-roll-panel-group .collapse.in');\r\n $collapsable.each((i, toggleAllLegalMemos) => {\r\n const $collapse = $(toggleAllLegalMemos);\r\n\t\t\t\tconst $clickable = $($collapse.parent()[0].children[0]);\r\n\t\t\t\t$clickable.trigger('click');\r\n\t\t\t});\r\n\t\t\tthis.filterByHideAllLegalMemos();\r\n\t\t}\r\n\t}\r\n\r\n\tasync activate() {\r\n\t\tthis.serviceData = this.LevyRollService;\r\n\t\tthis.financialsServiceData = this.FinancialsService;\r\n\t\tthis.financialsSummaryServiceData = this.FinancialSummaryService;\r\n\t\tthis.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tvar buildingName = '';\r\n\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n\t\tif (userProfile) {\r\n\t\t\tif (!this.selectedBuildingRef) {\r\n\t\t\t\tthis.selectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n\t\t\t}\r\n\t\t\tconst selectedBuilding = userProfile.BuildingProfiles.find((building) => {\r\n\t\t\t\treturn building.SchemeReference.toUpperCase().trim() === this.selectedBuildingRef.toUpperCase().trim();\r\n\t\t\t});\r\n\r\n\t\t\tif (selectedBuilding) {\r\n\t\t\t\tbuildingName = selectedBuilding.SchemeName;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.selectedBuildingName = buildingName;\r\n\t\tif (this.financialsSummaryServiceData.buildingWorkflowAndFeatures= {}) {\r\n\t\t\tawait this.getbuildingWorkflowAndFeatures();\t\t\t\t\t\t\r\n\t\t} else {\r\n\t\t\tthis.isLegalCollectionRollEnabled = this.financialsSummaryServiceData.buildingWorkflowAndFeatures[1].Data.ViewLegalCollectionsRoll;\r\n\t\t\tthis.isConsolidatedLevyRollEnabled = this.financialsSummaryServiceData.buildingWorkflowAndFeatures[1].Data.ViewConsolidatedLevyRoll;\r\n\t\t}\r\n\t\tawait this.getFinancialYears(true);\r\n\t}\r\n\r\n\tonSelectedBuildingChanged(event, schemeRef) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.selectedBuildingRef = schemeRef;\r\n\t\tif (this.selectedBuildingRef && this.selectedBuildingRef.length > 2) {\r\n\t\t\tthis.activate();\r\n\t\t}\r\n\t}\r\n\tasync getbuildingWorkflowAndFeatures(){\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.financialsSummaryServiceData.getbuildingWorkflowAndFeatures(this.selectedBuildingRef);\r\n\t\t\tthis.buildingWorkflowAndFeatures = this.financialsSummaryServiceData.buildingWorkflowAndFeatures; \r\n\t\t\tif(this.buildingWorkflowAndFeatures){\r\n\t\t\t\tthis.isLegalCollectionRollEnabled = this.financialsSummaryServiceData.buildingWorkflowAndFeatures[1].Data.ViewLegalCollectionsRoll;\r\n\t\t\t\tthis.isConsolidatedLevyRollEnabled = this.financialsSummaryServiceData.buildingWorkflowAndFeatures[1].Data.ViewConsolidatedLevyRoll;\r\n\t\t\t}\t\t\t\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading workflow and features: ${err}`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialYears(isInit) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.FinancialsService.getFinancialYears(this.selectedBuildingRef, this.today);\r\n\t\t\tif (isInit) {\r\n\t\t\t\tawait this.getSelectedDate(true);\r\n\t\t\t} else {\r\n\t\t\t\tthis.filterYear = this.FinancialsService.financialYears[\r\n\t\t\t\t\t(await this.FinancialsService.financialYears.length) - 1\r\n\t\t\t\t].WhenTo;\r\n\t\t\t\tthis.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\t\tawait this.getFinancialMonths(this.today);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading financial years\\n${err}`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\tasync getFinancialMonths(date, isInit) {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\ttry {\r\n\t\t\tawait this.FinancialsService.getFinancialMonths(this.selectedBuildingRef, date || new Date());\r\n\t\t\tlet selectedMonthIndex = -1;\r\n\r\n\t\t\tconst selectedDateMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n\t\t\tif (selectedDateMonth) {\r\n\t\t\t\tif (this.FinancialsService.financialMonths && this.FinancialsService.financialMonths.length > 0) {\r\n\t\t\t\t\tconst foundMonth = this.FinancialsService.financialMonths.find((month, index) => {\r\n\t\t\t\t\t\tconst momentMonth = moment(month.WhenFrom);\r\n\t\t\t\t\t\tif (momentMonth.isSame(selectedDateMonth, 'month')) {\r\n\t\t\t\t\t\t\tselectedMonthIndex = index;\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif (selectedMonthIndex > -1 && foundMonth) {\r\n\t\t\t\t\t\tthis.filterMonth = this.FinancialsService.financialMonths[selectedMonthIndex].WhenFrom;\r\n\t\t\t\t\t\tthis._filterOutFutureMonths();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (date && isInit) {\r\n\t\t\t\tthis.FinancialsService.financialMonths.filter(async (month, i) => {\r\n\t\t\t\t\tconst monthDateStr = month.WhenFrom.substr(0, 10);\r\n\t\t\t\t\tconst monthDate = moment(new Date(monthDateStr), 'YYYY-DD-MM');\r\n\t\t\t\t\tconst selectedMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n\t\t\t\t\tif (monthDate.isSame(selectedMonth, 'month')) {\r\n\t\t\t\t\t\tselectedMonthIndex = i;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (selectedMonthIndex === -1) {\r\n\t\t\t\t\tthis.filterMonth = '';\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.filterMonth = this.FinancialsService.financialMonths[selectedMonthIndex].WhenFrom;\r\n\t\t\t\t}\r\n\t\t\t} else if (isInit) {\r\n\t\t\t\tthis.filterMonth = this.FinancialsService.financialMonths[\r\n\t\t\t\t\tthis.FinancialsService.financialMonths.length - 1\r\n\t\t\t\t].WhenFrom;\r\n\t\t\t}\r\n\t\t\tif (this.filterMonth) {\r\n\t\t\t\tthis.selectedDate = this.filterMonth;\r\n\t\t\t\tawait this.getLevyRoll();\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error(`Error while loading financial months\\n${err}`);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t}\r\n\t}\r\n\tasync getSelectedDate(isInit) {\r\n\t\tconst selectedDateYear = await this.FinancialsService.getSelectedYear();\r\n\t\tconst selectedDateMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n\t\tif (isInit) {\r\n\t\t\tfor (let i = 0; i < this.FinancialsService.financialYears.length; i++) {\r\n\t\t\t\tconst yearRaw = this.FinancialsService.financialYears[i];\r\n\r\n\t\t\t\tif (selectedDateYear.isBetween(yearRaw.WhenFrom, yearRaw.WhenTo)) {\r\n\t\t\t\t\tthis.filterYear = this.FinancialsService.financialYears[i].WhenTo;\r\n\t\t\t\t\tthis.selectedDateYear = await this.Utility.getFormatedDate(this.filterYear);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst date = selectedDateYear ? selectedDateYear : new Date();\r\n\t\t\tawait this.getFinancialMonths(date, true);\r\n\t\t}\r\n\t}\r\n\r\n\tasync getLevyRoll() {\r\n\t\tthis._switchIsBusyLoading(true);\r\n\t\tthis.selectedDate = await this.FinancialsService.getSelectedDate(this.selectedDate);\r\n\r\n\t\tawait this.serviceData\r\n\t\t\t.getLevyRoll(\r\n\t\t\t\tthis.selectedBuildingRef,\r\n\t\t\t\tthis.selectedDate,\r\n\t\t\t\tthis.isFilterByOrderByUnitNumber,\r\n\t\t\t\tthis.isFilterByOnlyShowDebtors,\r\n\t\t\t\tthis.isfilterByShowAllLegalMemos,\r\n\t\t\t\tthis.isfilterByShowAllLegalAccountData,\r\n\t\t\t\tthis.levyRollPaging.pageNumber\r\n\t\t\t)\r\n\t\t\t.then(\r\n\t\t\t\tasync () => {\r\n\t\t\t\t\tthis.levyRollPaging.numberOfResults = this.serviceData.numberOfResults;\r\n\t\t\t\t\tthis.levyRollPaging.numberOfResultsLegal = this.serviceData.numberOfResultsLegal;\r\n\r\n\t\t\t\t\tthis.levyRollPaging.limit = 20;\r\n\r\n\t\t\t\t\tif (this.levyRollPaging.pageNumber === 1) {\r\n\t\t\t\t\t\tthis.levyRollPaging.firstItemIndex = 1;\r\n\t\t\t\t\t\tthis.levyRollPaging.firstItemIndexLegal = 1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.levyRollPaging.firstItemIndex =\r\n\t\t\t\t\t\t\t(this.levyRollPaging.pageNumber - 1) * this.levyRollPaging.limit + 1;\r\n\t\t\t\t\t\tthis.levyRollPaging.firstItemIndexLegal =\r\n\t\t\t\t\t\t\t(this.levyRollPaging.pageNumber - 1) * this.levyRollPaging.limit + 1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.levyRollPaging.lastItemIndex =\r\n\t\t\t\t\t\tthis.levyRollPaging.firstItemIndex + this.levyRollPaging.limit - 1;\r\n\r\n\t\t\t\t\tthis.levyRollPaging.lastItemIndexLegal =\r\n\t\t\t\t\t\tthis.levyRollPaging.firstItemIndexLegal + this.levyRollPaging.limit - 1;\r\n\r\n\t\t\t\t\tif (this.levyRollPaging.numberOfResults > 0) {\r\n\t\t\t\t\t\tthis.levyRollPaging.maxPage = Math.ceil(\r\n\t\t\t\t\t\t\tthis.levyRollPaging.numberOfResults / this.levyRollPaging.limit\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (this.levyRollPaging.maxPage > 1) {\r\n\t\t\t\t\t\t\tif (this.levyRollPaging.maxPage === this.levyRollPaging.pageNumber) {\r\n\t\t\t\t\t\t\t\tthis.levyRollPaging.lastItemIndex = this.levyRollPaging.numberOfResults;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tthis.isPagingNavigationVisible = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.isPagingNavigationVisible = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.levyRollPaging.maxPage = 1;\r\n\t\t\t\t\t\tthis.isPagingNavigationVisible = false;\r\n\t\t\t\t\t\tthis.levyRollPaging.pageNumber = 1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.levyRollPaging.numberOfResultsLegal > 0) {\r\n\t\t\t\t\t\tthis.levyRollPaging.maxPageLegal = Math.ceil(\r\n\t\t\t\t\t\t\tthis.levyRollPaging.numberOfResultsLegal / this.levyRollPaging.limit\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (this.levyRollPaging.maxPageLegal > 1) {\r\n\t\t\t\t\t\t\tif (this.levyRollPaging.maxPageLegal === this.levyRollPaging.pageNumberLegal) {\r\n\t\t\t\t\t\t\t\tthis.levyRollPaging.lastItemIndexLegal = this.levyRollPaging.numberOfResultsLegal;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tthis.isPagingNavigationVisibleLegal = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.isPagingNavigationVisibleLegal = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tthis.levyRollPaging.maxPageLegal = 1;\r\n\t\t\t\t\t\tthis.isPagingNavigationVisibleLegal = false;\r\n\t\t\t\t\t\tthis.levyRollPaging.pageNumberLegal = 1;\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t},\r\n\t\t\t\t(err) => { }\r\n\t\t\t)\r\n\t\t\t.finally(async () => {\r\n\t\t\t\tawait this.getFinancialState();\r\n\t\t\t\tthis.canFilter = false;\r\n\t\t\t\tthis._switchIsBusyLoading(false);\r\n\t\t\t});\r\n\t}\r\n\r\n\tasync getUnitLegalMemo(UnitItemCode) {\r\n\t\tvar panalId = `#${UnitItemCode}`;\r\n\t\tvar islegalcollectionroll = document.getElementById(\"islegalcollectionroll\").checked;\r\n\t\tvar isconsolidatedlevyroll = document.getElementById(\"isconsolidatedlevyroll\").checked;\r\n\r\n\t\tif (islegalcollectionroll && $(`#L-${UnitItemCode}`).hasClass('in')) {\r\n\t\t\t$(`#L-${UnitItemCode}`).collapse('hide');\r\n\t\t}\r\n\t\telse if ($(`#${UnitItemCode}`).hasClass('in')) { \r\n\t\t\t$(panalId).collapse('hide');\r\n\t\t}\r\n\t\telse if (isconsolidatedlevyroll && $(`#C-${UnitItemCode}`).hasClass('in')) {\r\n\t\t\t$(`#C-${UnitItemCode}`).collapse('hide');\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.serviceData.levyRollUnitMemoData = {};\r\n\t\t\tconst schemeRef = this.selectedBuildingRef;\r\n\t\t\tvar CardCode = `B${schemeRef}${UnitItemCode}`;\r\n\t\t\tthis._switchIsBusyLoadingMemo(true);\r\n\t\t\tawait this.serviceData.getUnitLegalMemo(\r\n\t\t\t\tCardCode,\r\n\t\t\t\tthis.selectedDate,\r\n\t\t\t\tUnitItemCode\r\n\t\t\t)\r\n\t\t\t\t.then(\r\n\t\t\t\t\t() => {\r\n\t\t\t\t\t\tif (islegalcollectionroll) {\r\n\t\t\t\t\t\t\t$('.collapse.in').collapse('hide');\r\n\t\t\t\t\t\t\tpanalId = `#L-${UnitItemCode}`;\r\n\t\t\t\t\t\t\t$(panalId).collapse('show');\r\n\t\t\t\t\t\t} else if (isconsolidatedlevyroll) {\r\n\t\t\t\t\t\t\t$('.collapse.in').collapse('hide');\r\n\t\t\t\t\t\t\tpanalId = `#C-${UnitItemCode}`;\r\n\t\t\t\t\t\t\t$(panalId).collapse('show');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t$(panalId).collapse('show');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, (err) => { }\r\n\t\t\t\t)\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis._switchIsBusyLoadingMemo(false);\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tasync getFinancialState() {\r\n\t\tconst type = 3;\r\n\t\tconst schemeRef = this.selectedBuildingRef;\r\n\t\tconst momentDate = moment(this.selectedDate, 'YYYY-MM-DD');\r\n\t\tconst formattedDate = momentDate.format('YYYY-MM-DD');\r\n\t\tconst date = `${formattedDate.substr(0, 8)}01`;\r\n\r\n\t\ttry {\r\n\t\t\tconst results = await this.FinancialsService.getFinancialState(schemeRef, date, type);\r\n\r\n\t\t\tconst { status, message } = results;\r\n\t\t\tthis.statusInformation = message;\r\n\t\t} catch (error) {\r\n\t\t\tthis.NotificationService.error('Error loading levy roll statement status');\r\n\t\t} finally {\r\n\t\t}\r\n\t}\r\n\r\n\t_filterOutFutureMonths() {\r\n\t\tconst today = new Date();\r\n\t\tconst formatedDate = moment(today).format('YYYY MMMM');\r\n\t\tconst currentYear = formatedDate.split(' ')[0];\r\n\t\tconst currentMonth = formatedDate.split(' ')[1];\r\n\r\n\t\tlet foundIndex = -1;\r\n\t\tconst found = this.FinancialsService.financialMonths.find((month, index) => {\r\n\t\t\tconst fields = month.FriendlyNameMonth.split(' ');\r\n\t\t\tconst yearStr = fields[1];\r\n\t\t\tconst monthStr = fields[0];\r\n\t\t\tconst found = currentYear === yearStr && currentMonth === monthStr;\r\n\r\n\t\t\tif (found) {\r\n\t\t\t\tfoundIndex = index;\r\n\t\t\t}\r\n\t\t\treturn found;\r\n\t\t});\r\n\r\n\t\tif (found && foundIndex > -1) {\r\n\t\t\tconst filteredMonths = this.FinancialsService.financialMonths.filter(\r\n\t\t\t\t(month, index) => index < foundIndex + 1\r\n\t\t\t);\r\n\r\n\t\t\tif (filteredMonths && filteredMonths.length < this.FinancialsService.financialMonths.length) {\r\n\t\t\t\tthis.FinancialsService.financialMonths = filteredMonths;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tallowAction(actionName) {\r\n return this.AuthorizationService.isAuthorized(actionName);\r\n }\r\n\r\n\t_switchIsBusyLoading(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isLoading = flag;\r\n\t\t});\r\n\t}\r\n\r\n\t_switchIsBusyLoadingMemo(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isLoadingMemo = flag;\r\n\t\t})\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass LevyRollService {\r\n\tconstructor(\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.FinancialsService = FinancialsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.numberOfResults = 0;\r\n\t\tthis.numberOfResultsLegal = 0;\r\n\t\tthis.levyRollData = undefined;\r\n\t}\r\n\r\n\tasync getLevyRoll(schemeRef, date, sortByUnitNumber, showOnlyDebt, showLegalMemos, showAllLegalAccounts, pageNumber) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiLevyRoll');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiLevyRoll');\r\n\t\t\t}\r\n\r\n\t\t\tdate = this.FinancialsService.getMapFirstDay(date);\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\turl += `?date=${moment(date).format(\r\n\t\t\t\t'L'\r\n\t\t\t)}&sortByUnitNumber=${sortByUnitNumber}&showOnlyDebt=${showOnlyDebt}&showLegalMemos=${showLegalMemos}&showAllLegalAccounts=${showAllLegalAccounts}&pageNumber=${pageNumber}`;\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tif (!!!headers || (!!headers && (!!!headers.userName || !!!headers.sessionToken))) {\r\n\t\t\t\tconst error = `Could not load Levy as the 'Username' and/or 'Session Token' is missing`;\r\n\t\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers: headers });\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.levyRollData = data;\r\n\t\t\tthis.numberOfResults = data.NumberOfResults;\r\n\t\t\tthis.numberOfResultsLegal = data.NumberOfResultsLegal;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (error) {\r\n\t\t\tthis.levyRollData = [];\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getUnitLegalMemo(CardCode, date, UnitItemCode) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinancialApiLevyRollMemo');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/financial/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinancialApiLevyRollMemo');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdate = this.FinancialsService.getMapFirstDay(date);\r\n\t\t\turl = url.replace('{CardCode}', CardCode).trim();\r\n\t\t\turl += `?date=${moment(date).format(\r\n\t\t\t\t'L'\r\n\t\t\t)}`;\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers: headers });\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.levyRollUnitMemoData = data.Data;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (error) {\r\n\t\t\tthis.levyRollUnitMemoData = [];\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\t\treturn promise\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tFinancialsService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew LevyRollService(\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tFinancialsService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","/* @ngInject */\r\nexport default class WagesRollCtrl {\r\n constructor(\r\n $sce,\r\n $scope,\r\n $state,\r\n Utility,\r\n $timeout,\r\n $rootScope,\r\n BuildingsService,\r\n FinancialsService,\r\n LocalStorageService,\r\n WagesRollService,\r\n AuthorizationService\r\n ) {\r\n this.$sce = $sce;\r\n this.$scope = $scope;\r\n this.$state = $state;\r\n this.Utility = Utility;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.BuildingsService = BuildingsService;\r\n this.FinancialsService = FinancialsService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.WagesRollService = WagesRollService;\r\n this.AuthorizationService = AuthorizationService;\r\n this.init();\r\n this.activate();\r\n }\r\n\r\n init() {\r\n this._switchIsBusyLoading(true);\r\n this.isFilterActive = true;\r\n this.filterYear = undefined;\r\n this.reportModelHeader = '';\r\n this.filterMonth = undefined;\r\n\r\n this.selectedBuildingRef = '';\r\n this.selectedBuildingName = '';\r\n this.investmentStatment = undefined;\r\n this.financialsServiceData = undefined;\r\n this.statusInformation = null;\r\n\r\n this.today = this.Utility.getFormatedDate(new Date());\r\n\r\n const { date } = this.$state.params;\r\n\r\n if (date) {\r\n this.selectedDate = this.Utility.getFormatedDate(date);\r\n } else {\r\n this.selectedDate = this.Utility.getFormatedDate(new Date());\r\n }\r\n\r\n this.selectedDateYear = this.Utility.getFormatedDate(new Date());\r\n\r\n this.$scope.$on('selected-building-changed', async (event, newValue) => {\r\n await this.onSelectedBuildingChanged(this, newValue);\r\n });\r\n\r\n this.$scope.$watch(\r\n 'wagesRollVm.filterYear',\r\n async (newValue, oldValue) => {\r\n if (newValue && newValue !== oldValue && oldValue) {\r\n await this.getFinancialMonths(this.Utility.getFormatedDate(this.filterYear));\r\n }\r\n },\r\n true\r\n );\r\n }\r\n\r\n async activate() {\r\n this.financialsServiceData = this.FinancialsService;\r\n this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n let buildingName = '';\r\n const userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n if (userProfile) {\r\n if (!this.selectedBuildingRef) {\r\n this.selectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n }\r\n const selectedBuilding = userProfile.BuildingProfiles.find((building) => {\r\n return building.SchemeReference.toUpperCase().trim() === this.selectedBuildingRef.toUpperCase().trim();\r\n });\r\n\r\n if (selectedBuilding) {\r\n buildingName = selectedBuilding.SchemeName;\r\n }\r\n }\r\n\r\n await this.getFinancialYears(true);\r\n this.selectedBuildingName = buildingName;\r\n }\r\n\r\n openFinancials(page) {\r\n this.saveSelectedDate();\r\n this.$rootScope.$broadcast('navigate-changed', page, { date: this.filterMonth });\r\n }\r\n\r\n saveSelectedDate() {\r\n const selectedYear = moment(this.filterYear).toDate();\r\n const selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n this.LocalStorageService.save('selectedReportYear', selectedYear);\r\n this.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n }\r\n\r\n async gotoOldFinancials() {\r\n const date = moment(this.filterMonth).format('MMM YYYY');\r\n let nav = `Monthly Financial Statements>${date}`;\r\n nav = encodeURI(nav);\r\n this.$state.go('documents', { nav });\r\n }\r\n\r\n isDesktop() {\r\n this.LocalStorageService.save('mediaDevice', 'mobile');\r\n const mdvice = this.LocalStorageService.retrieve('mediaDevice');\r\n if (mdvice == 'mobile') {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n async filterByCurrentMonth() {\r\n this.isFilterActive = true;\r\n await this.getWagesRoll();\r\n }\r\n\r\n async filterByMonth() {\r\n if (this.filterMonth) {\r\n this.selectedDate = this.Utility.getFormatedDate(this.filterMonth);\r\n await this.getWagesRoll();\r\n }\r\n }\r\n\r\n async filterByYear() {\r\n await this.filterByMonth();\r\n }\r\n\r\n async getReport() {\r\n this.reportModelHeader = `${this.selectedBuildingName} - Wages Roll - ${moment(\r\n this.Utility.getFormatedDate(this.filterMonth)\r\n ).format('MMM YYYY')}`;\r\n\r\n try {\r\n await this.financialsServiceData.getReport(\r\n this.selectedBuildingRef,\r\n this.Utility.getFormatedDate(this.filterMonth),\r\n 8,\r\n this.reportModelHeader\r\n );\r\n } catch (err) {\r\n console.error(\"Error while generating Wages' Roll\");\r\n }\r\n }\r\n\r\n async onSelectedBuildingChanged(event, schemeRef) {\r\n this._switchIsBusyLoading(true);\r\n if (schemeRef && schemeRef['length'] > 2) this.selectedBuildingRef = schemeRef;\r\n else this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n if (this.selectedBuildingRef && this.selectedBuildingRef.length > 2) {\r\n await this.activate();\r\n }\r\n }\r\n\r\n async getFinancialYears(isInit) {\r\n this._switchIsBusyLoading(true);\r\n\r\n try {\r\n await this.financialsServiceData.getFinancialYears(this.selectedBuildingRef, this.today);\r\n if (isInit) {\r\n await this.getSelectedDate(true);\r\n } else {\r\n this.filterYear = this.financialsServiceData.financialYears[\r\n this.financialsServiceData.financialYears.length - 1\r\n ].WhenTo;\r\n this.selectedDateYear = this.Utility.getFormatedDate(this.filterYear);\r\n await this.getFinancialMonths(this.today);\r\n }\r\n } catch (err) {\r\n console.error('Error while loading Financial Years');\r\n }\r\n }\r\n\r\n async getFinancialMonths(date, isInit) {\r\n this._switchIsBusyLoading(true);\r\n if (!date || date > this.today) {\r\n date = this.today;\r\n }\r\n\r\n try {\r\n await this.financialsServiceData.getFinancialMonths(this.selectedBuildingRef, date);\r\n let selectedMonthIndex = -1;\r\n\r\n const selectedDateMonth = this.FinancialsService.getSelectedMonth();\r\n\r\n if (selectedDateMonth) {\r\n const foundMonth = this.FinancialsService.financialMonths.find((month, index) => {\r\n const momentMonth = moment(month.WhenFrom);\r\n if (momentMonth.isSame(selectedDateMonth, 'month')) {\r\n selectedMonthIndex = index;\r\n return true;\r\n }\r\n });\r\n\r\n if (selectedMonthIndex > -1 && foundMonth) {\r\n this.filterMonth = this.FinancialsService.financialMonths[selectedMonthIndex].WhenFrom;\r\n }\r\n } else if (date && isInit) {\r\n this.financialsServiceData.financialMonths.filter((month, i) => {\r\n const monthDateStr = month.WhenFrom.substr(0, 10);\r\n const monthDate = moment(new Date(monthDateStr), 'YYYY-DD-MM');\r\n const selectedMonth = this.FinancialsService.getSelectedMonth();\r\n\r\n if (monthDate.isSame(selectedMonth, 'month')) {\r\n selectedMonthIndex = i;\r\n return true;\r\n }\r\n });\r\n\r\n if (selectedMonthIndex === -1) {\r\n this.filterMonth = '';\r\n this._switchIsBusyLoading(false);\r\n } else {\r\n this.filterMonth = this.financialsServiceData.financialMonths[selectedMonthIndex].WhenFrom;\r\n }\r\n } else if (isInit) {\r\n this.filterMonth = this.financialsServiceData.financialMonths[\r\n this.financialsServiceData.financialMonths.length - 1\r\n ].WhenFrom;\r\n }\r\n if (this.filterMonth) {\r\n await this.getWagesRoll();\r\n }\r\n } catch (err) {\r\n console.error('Error while loading Financial Months', err);\r\n }\r\n }\r\n\r\n async getWagesRoll() {\r\n this._switchIsBusyLoading(true);\r\n this.selectedDate = this.FinancialsService.getSelectedDate(this.selectedDate);\r\n\r\n try {\r\n await this.WagesRollService.getWagesRoll(this.selectedBuildingRef, this.selectedDate);\r\n await this.getFinancialState();\r\n } catch (err) {\r\n console.error('Error while loading Wages Roll', err);\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n\r\n saveSelectedDate() {\r\n const selectedYear = moment(this.filterYear).toDate();\r\n const selectedMonth = moment(this.filterMonth).add(3, 'h').toDate();\r\n this.LocalStorageService.save('selectedReportYear', selectedYear);\r\n this.LocalStorageService.save('selectedReportMonth', selectedMonth);\r\n }\r\n\r\n async getSelectedDate(isInit) {\r\n const selectedDateYear = await this.FinancialsService.getSelectedYear();\r\n const selectedDateMonth = await this.FinancialsService.getSelectedMonth();\r\n\r\n if (isInit) {\r\n for (let i = 0; i < this.FinancialsService.financialYears.length; i++) {\r\n const yearRaw = this.FinancialsService.financialYears[i];\r\n\r\n const whenFrom = moment(yearRaw.WhenFrom).toDate();\r\n const whenTo = moment(yearRaw.WhenTo).toDate();\r\n\r\n if (selectedDateMonth >= whenFrom && selectedDateMonth <= whenTo) {\r\n this.filterYear = this.FinancialsService.financialYears[i].WhenTo;\r\n this.selectedDateYear = await this.Utility.getFormatedDate(this.filterYear);\r\n break;\r\n }\r\n }\r\n\r\n const date = this.selectedDateYear ? this.selectedDateYear : new Date();\r\n await this.getFinancialMonths(date, true);\r\n }\r\n }\r\n\r\n async getFinancialState() {\r\n const type = 7;\r\n const schemeRef = this.selectedBuildingRef;\r\n const momentDate = moment(this.selectedDate, 'YYYY-MM-DD');\r\n const formattedDate = momentDate.format('YYYY-MM-DD');\r\n const date = `${formattedDate.substr(0, 8)}01`;\r\n\r\n this._switchIsBusyLoading(true);\r\n try {\r\n const results = await this.FinancialsService.getFinancialState(schemeRef, date, type);\r\n\r\n const { status, message } = results;\r\n this.statusInformation = message;\r\n } catch (error) {\r\n this.NotificationService.error('Error wages roll statement status');\r\n } finally {\r\n this._switchIsBusyLoading(false);\r\n }\r\n }\r\n\r\n allowAction(actionName) {\r\n return this.AuthorizationService.isAuthorized(actionName);\r\n }\r\n\r\n _switchIsBusyLoading(flag) {\r\n this.$timeout(() => {\r\n this.isLoading = flag;\r\n });\r\n }\r\n}\r\n","class WagesRollService {\r\n constructor($sce, $http, Utility, $timeout, $rootScope, ContentService, LocalStorageService, InternalLinksService) {\r\n this.$sce = $sce;\r\n this.$http = $http;\r\n this.Utility = Utility;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.ContentService = ContentService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.InternalLinksService = InternalLinksService;\r\n this.init();\r\n }\r\n\r\n init() {\r\n this.wagesRollData = undefined;\r\n this.wagesRollTotal = undefined;\r\n }\r\n async getWagesRoll(schemeRef, date) {\r\n let promise, promiseHandler;\r\n\r\n try {\r\n promise = new Promise((resolve, reject) => {\r\n promiseHandler = {\r\n reject,\r\n resolve\r\n };\r\n });\r\n\r\n let url = await this.InternalLinksService.getLink('FinancialApiWagesRoll');\r\n if (!url) {\r\n await this.InternalLinksService.getLinks('/api/financial/links');\r\n url = await this.InternalLinksService.getLink('FinancialApiWagesRoll');\r\n }\r\n\r\n url = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n const headers = this.Utility.headersWithContentType;\r\n\r\n if (!!!headers || (!!headers && (!!!headers.userName || !!!headers.sessionToken))) {\r\n const error = `Could not load Wages Roll as the 'Username' and/or 'Session Token' is missing`;\r\n this.$timeout(() => promiseHandler.reject(error));\r\n }\r\n\r\n const results = await this.$http.post(url, date, { headers });\r\n const { data } = results;\r\n\r\n this.wagesRollData = data;\r\n this.wagesRollTotal = 0;\r\n this.wagesRollData.forEach((value) => {\r\n this.wagesRollTotal += value.Amount;\r\n });\r\n this.$timeout(() => promiseHandler.resolve());\r\n } catch (err) {\r\n this.wagesRollData = null;\r\n this.$timeout(() => promiseHandler.reject(err));\r\n }\r\n\r\n return promise;\r\n }\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n $sce,\r\n $http,\r\n Utility,\r\n $timeout,\r\n $rootScope,\r\n ContentService,\r\n LocalStorageService,\r\n InternalLinksService\r\n) =>\r\n new WagesRollService(\r\n $sce,\r\n $http,\r\n Utility,\r\n $timeout,\r\n $rootScope,\r\n ContentService,\r\n LocalStorageService,\r\n InternalLinksService\r\n );","/* @ngInject */\r\nexport default class PaymentAuthorisationCtrl {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$uibModal,\r\n\t\t$rootScope,\r\n\t\t$cacheFactory,\r\n\t\t$templateCache,\r\n\t\tBuildingsService,\r\n\t\tNotificationService,\r\n\t\tLocalStorageService,\r\n\t\tAuthorizationService,\r\n\t\tAuthenticationService,\r\n\t\tpaymentAuthorisationDataService\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$uibModal = $uibModal;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.$cacheFactory = $cacheFactory;\r\n\t\tthis.$templateCache = $templateCache;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.AuthorizationService = AuthorizationService;\r\n\t\tthis.AuthenticationService = AuthenticationService;\r\n\t\tthis.paymentAuthorisationDataService = paymentAuthorisationDataService;\r\n\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tget selectedContractualPayments() {\r\n\t\tconst payments = this.paymentBandData.bandsData.ContractualPayments.filter((payment) => payment.checked);\r\n\t\treturn payments;\r\n\t}\r\n\r\n\tget bulkApproveLabel() {\r\n\t\tconst hasSelectedPayments = this.selectedContractualPayments && this.selectedContractualPayments.length > 0;\r\n\t\tconst label = `BULK APPROVE ${hasSelectedPayments ? `(${this.selectedContractualPayments.length})` : ''}`;\r\n\t\treturn label;\r\n\t}\r\n\r\n\tget approvePaymentAuthorisations() {\r\n\t\tconst canApprove = this.AuthorizationService.isAuthorized('Approve Payment bands');\r\n\t\treturn canApprove;\r\n\t}\r\n\r\n\tget approveContractualPayments() {\r\n\t\tconst canApprove = this.AuthorizationService.isAuthorized('Approve Contractual Payments');\r\n\t\treturn canApprove;\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.query = '';\r\n\t\tthis._switchIsBusy(false);\r\n\t\tthis.paymentBandData;\r\n\t\tthis.webPortfolio = [];\r\n\t\tthis.isQuerying = false;\r\n\t\tthis.isApproving = false;\r\n\t\tthis.SchemeRef = undefined;\r\n\t\tthis.selectedBuildingRef = undefined;\r\n\t\tthis.webPortfolioToggle = [];\r\n\t\tthis.isBulkApproving = false;\r\n\t\tthis.portfolioArrayLength = 0;\r\n\t\tthis.webPortfolioComments = [];\r\n\t\tthis.disableQuerySubmit = false;\r\n\t\tthis.contractualDetails = undefined;\r\n\r\n\t\tthis.currentAttachment = this.testCache = undefined;\r\n\r\n\t\tthis.$scope.$on('selected-building-changed', (event, newValue) => {\r\n\t\t\tthis.onSelectedBuildingChanged(event, newValue);\r\n\t\t});\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'paymentAuthorisationVm.BuildingsService.buildingsData.selectedBuilding',\r\n\t\t\t(newValue, oldValue) => {\r\n\t\t\t\tconst isSame = this.Utility.buildingRefsAreEqual(newValue, oldValue);\r\n\t\t\t\tconst lastTriedStr = this.LocalStorageService.retrieve('lastTriedAuthorisation');\r\n\t\t\t\tconst retryAt = moment(new Date(), this.Utility.dateTimeFormat).add(\r\n\t\t\t\t\tthis.Utility.apiRetry.value.toString(),\r\n\t\t\t\t\tthis.Utility.apiRetry.units\r\n\t\t\t\t);\r\n\t\t\t\tconst lastTried = moment(lastTriedStr, this.Utility.dateTimeFormat);\r\n\t\t\t\tconst shouldTryAgain = lastTried ? retryAt.isAfter(lastTried) : false;\r\n\r\n\t\t\t\tif (isSame) {\r\n\t\t\t\t\tif (lastTried && shouldTryAgain) {\r\n\t\t\t\t\t\tthis.onSelectedBuildingChanged(this, newValue);\r\n\t\t\t\t\t\tthis.LocalStorageService.save(\r\n\t\t\t\t\t\t\t'lastTriedAuthorisation',\r\n\t\t\t\t\t\t\tmoment(new Date()).format(this.Utility.dateTimeFormat)\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t} else if (!lastTried) {\r\n\t\t\t\t\t\tthis.onSelectedBuildingChanged(this, newValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.onSelectedBuildingChanged(this, newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'paymentAuthorisationVm.query',\r\n\t\t\t(newValue, oldValue) => {\r\n\t\t\t\tthis.disableQuerySubmit = newValue && newValue.length > 10 ? true : false;\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\t}\r\n\r\n\tactivate() {\r\n\t\tthis._switchIsBusy(true);\r\n\t\tthis.paymentBandData = this.paymentAuthorisationDataService;\r\n\t\tthis.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\tif (this.selectedBuildingRef) {\r\n\t\t\tthis.onSelectedBuildingChanged({}, this.selectedBuildingRef);\r\n\t\t}\r\n\t\tthis.testCache = this.$cacheFactory;\r\n\t}\r\n\r\n\tasync onSelectedBuildingChanged(event, schemeRef) {\r\n\t\tthis.SchemeRef = schemeRef && schemeRef.length > 2 ? schemeRef : this.selectedBuildingRef;\r\n\t\tif (this.SchemeRef && this.SchemeRef.length > 2) {\r\n\t\t\tthis._switchIsBusy(true);\r\n\t\t\tawait this.paymentAuthorisationDataService.getPaymentAuthorisation(this.SchemeRef);\r\n\t\t\tif (this.paymentBandData.bandsData && this.paymentBandData.bandsData.WebPortfolio) {\r\n\t\t\t\tfor (let i = 0; i < this.paymentBandData.bandsData.WebPortfolio.length; i++) {\r\n\t\t\t\t\tconst portfolio = this.paymentBandData.bandsData.WebPortfolio[i];\r\n\t\t\t\t\tconst temp = {\r\n\t\t\t\t\t\tId: portfolio.Id,\r\n\t\t\t\t\t\tValue: false\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthis.webPortfolioToggle[i] = temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (\r\n\t\t\t\tthis.paymentBandData.bandsData.ContractualPayments &&\r\n\t\t\t\tthis.paymentBandData.bandsData.ContractualPayments.length > 0\r\n\t\t\t) {\r\n\t\t\t\tthis.paymentBandData.bandsData.ContractualPayments.Value = true;\r\n\t\t\t} else {\r\n\t\t\t\tthis.paymentBandData.bandsData.ContractualPayments = {\r\n\t\t\t\t\tValue: false\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tthis._switchIsBusy(false);\r\n\t\t}\r\n\t}\r\n\r\n\tsetPanelCollapsed(status, id) {\r\n\t\tconsole.log(id);\r\n\t\tconsole.log(status);\r\n\t\tconst $collapsing = $('#' + id).hasClass('collapsing');\r\n\t\tif (!$collapsing) {\r\n\t\t\tstatus = !status;\r\n\t\t}\r\n\t\treturn status;\r\n\t}\r\n\r\n\tshouldShowNote(approverAuthorisation, isNoBand) {\r\n\t\tlet shouldShow = false;\r\n\t\tif (isNoBand == true && approverAuthorisation.length == 0) {\r\n\t\t\tshouldShow = true;\r\n\t\t}\r\n\r\n\t\treturn shouldShow;\r\n\t}\r\n\r\n\tshouldShowDiscretionary(approverAuthorisation) {\r\n\t\tlet shouldShow = false;\r\n\t\tif (typeof approverAuthorisation != 'undefined') {\r\n\t\t\tfor (let i = 0; i < approverAuthorisation.length; i++) {\r\n\t\t\t\tconst band = approverAuthorisation[i];\r\n\t\t\t\tif (band.IsMandatory == false) {\r\n\t\t\t\t\tshouldShow = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn shouldShow;\r\n\t}\r\n\r\n\tshouldShowMandatory(approverAuthorisation) {\r\n\t\tlet shouldShow = false;\r\n\t\tif (typeof approverAuthorisation != 'undefined') {\r\n\t\t\tfor (let i = 0; i < approverAuthorisation.length; i++) {\r\n\t\t\t\tconst band = approverAuthorisation[i];\r\n\t\t\t\tif (band.IsMandatory == true) {\r\n\t\t\t\t\tshouldShow = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn shouldShow;\r\n\t}\r\n\r\n\tchangeGlyphiconPanelHeading(portfolioId) {\r\n\t\tconst $collapsing = $(`#${portfolioId || 'contractualPayments'}`).hasClass('collapse in');\r\n\t\tlet glyphiconClass = false;\r\n\r\n\t\tif (portfolioId === 'contractualPayments') {\r\n\t\t\tthis.paymentBandData.bandsData.ContractualPayments.Value = $collapsing ? false : true;\r\n\t\t} else if (!$collapsing) {\r\n\t\t\tfor (let i = 0; i < this.webPortfolio.length; i++) {\r\n\t\t\t\tconst portfolio = this.webPortfolio[i];\r\n\t\t\t\tif (portfolio.Id == portfolioId) {\r\n\t\t\t\t\tthis.webPortfolioToggle[i].Value = !this.webPortfolioToggle[i].Value;\r\n\t\t\t\t\tglyphiconClass = this.webPortfolioToggle[i].Value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.webPortfolioToggle[i].Value = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn glyphiconClass;\r\n\t}\r\n\r\n\tinnerGlyphStatus(status, id) {\r\n\t\tconsole.log(status);\r\n\t\tconsole.log(id);\r\n\t\tconst $collapsing = $('#' + id).hasClass('collapsing');\r\n\t\tif (!$collapsing) {\r\n\t\t\tstatus = !status;\r\n\t\t}\r\n\t\treturn status;\r\n\t}\r\n\r\n\tapprovePaymentBand() {\r\n\t\tconsole.log('Approve clicked');\r\n\t\tthis.SchemeRef = this.selectedBuildingRef;\r\n\t\tthis.isApproving = true;\r\n\t\tthis.paymentAuthorisationDataService\r\n\t\t\t.approvePaymentAuthorisation(this.SchemeRef)\r\n\t\t\t.then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\t\t\tconsole.log('Payment Band Approval succeeded..');\r\n\t\t\t\t\t\tthis.NotificationService.success('APPROVED');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.log('Payment Band Approval failed');\r\n\t\t\t\t\t\tthis.NotificationService.error('FAILED');\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tconsole.log('Payment Band Approval failed with the error: ', err);\r\n\t\t\t\t\tthis.NotificationService.error('FAILED', err);\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.isApproving = false;\r\n\t\t\t});\r\n\t}\r\n\r\n\tqueryPaymentBand() {\r\n\t\tthis.SchemeRef = this.selectedBuildingRef;\r\n\t\tthis.isQuerying = true;\r\n\t\tthis.paymentAuthorisationDataService\r\n\t\t\t.queryPaymentAuthorisation(this.SchemeRef, this.query)\r\n\t\t\t.then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\t\t\tthis.NotificationService.success('QUERIED');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.log('Payment Band query failed');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.query = '';\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tconsole.log('Payment Band query failed with the error: ', err);\r\n\t\t\t\t\tthis.NotificationService.error('FAILED', err);\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.isQuerying = false;\r\n\t\t\t\t$('#paymentAuthorisationModal').modal('hide');\r\n\t\t\t});\r\n\t}\r\n\r\n\tcanApprove() {\r\n\t\tthis.selectedBuildingRef = this.selectedBuildingRef ? this.selectedBuildingRef : this.BuildingsService.getSelectedBuildingRef();\r\n\t\tconst allowed = this.AuthenticationService.hasRoleForBuilding(this.selectedBuildingRef, 'chairman');\r\n\t\treturn allowed;\r\n\t}\r\n\r\n\tcheckPayment(paymentId) {\r\n\t\tthis.paymentBandData.bandsData.ContractualPayments.forEach((payment) => {\r\n\t\t\tif (payment.ContractualPaymentId === paymentId) {\r\n\t\t\t\tif (!payment.checked) {\r\n\t\t\t\t\tpayment.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tpayment.checked = !payment.checked;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tpopulateContractualDetailsViewModal(id, evt) {\r\n\t\tthis.contractualDetails = this.paymentBandData.bandsData.ContractualPayments.find((payment) => {\r\n\t\t\treturn payment.ContractualPaymentId === id;\r\n\t\t});\r\n\r\n\t\tif (this.contractualDetails) {\r\n\t\t\tthis.contractualDetails.ContractualAttachment = this.contractualDetails.ContractualAttachment.map(\r\n\t\t\t\t(file) => {\r\n\t\t\t\t\tconst attachmentUrl =\r\n\t\t\t\t\t\tpretorOnlineUrl + `${pretorOnlineUrl.endsWith('/') ? '' : '/'}documents/attachment/${file.Id}`;\r\n\t\t\t\t\tfile.documentsUrl = this.$sce.trustAsResourceUrl(`${attachmentUrl}?extension=pdf`);\r\n\r\n\t\t\t\t\treturn file;\r\n\t\t\t\t}\r\n\t\t\t);\r\n\r\n\t\t\tthis.currentAttachment =\r\n\t\t\t\tthis.contractualDetails.ContractualAttachment &&\r\n\t\t\t\t\tthis.contractualDetails.ContractualAttachment.length > 0\r\n\t\t\t\t\t? this.contractualDetails.ContractualAttachment[0]\r\n\t\t\t\t\t: undefined;\r\n\t\t}\r\n\t}\r\n\r\n\tgetAttachmentPath(id) {\r\n\t\tconst attachment = this.contractualDetails.ContractualAttachment.find((att) => {\r\n\t\t\treturn att.CorrelationId == id;\r\n\t\t});\r\n\r\n\t\tthis.currentAttachment = attachment;\r\n\t}\r\n\r\n\tqueryContractualPayment() {\r\n\t\tconst id = this.contractualDetails.ContractualPaymentId;\r\n\t\tconst message = this.contractualDetails.queryMessage;\r\n\r\n\t\tif (id && message) {\r\n\t\t\tthis.contractualDetails.isQuerying = true;\r\n\t\t\tthis.paymentAuthorisationDataService\r\n\t\t\t\t.queryContractualPayment(id, message)\r\n\t\t\t\t.then(\r\n\t\t\t\t\t(results) => {\r\n\t\t\t\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\t\t\t\tconsole.log('Payment Band query succeeded..');\r\n\t\t\t\t\t\t\tthis.NotificationService.success('QUERIED');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tconsole.log('Payment Band query failed');\r\n\t\t\t\t\t\t\tthis.NotificationService.error('FAILED');\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.contractualDetails.queryMessage = undefined;\r\n\t\t\t\t\t},\r\n\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\tthis.NotificationService.error('FAILED');\r\n\t\t\t\t\t}\r\n\t\t\t\t)\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.contractualDetails.isQuerying = false;\r\n\t\t\t\t\t$('#contractualPaymentQueryModal').modal('hide');\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tgetContractualPaymentIDs() {\r\n\t\tconst ids = [];\r\n\r\n\t\tthis.paymentBandData.bandsData.ContractualPayments.forEach((payment) => {\r\n\t\t\tif (payment.checked) {\r\n\t\t\t\tids.push(payment.ContractualPaymentId);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn ids;\r\n\t}\r\n\r\n\tbulkApprove() {\r\n\t\tconst paymentIDsForApproval = this.getContractualPaymentIDs();\r\n\t\tthis.isBulkApproving = true;\r\n\t\tthis.bulkStatusChange(paymentIDsForApproval, true);\r\n\r\n\t\tthis.paymentAuthorisationDataService\r\n\t\t\t.approveContractualPayments(paymentIDsForApproval, this.SchemeRef)\r\n\t\t\t.then(\r\n\t\t\t\t() => {\r\n\t\t\t\t\tthis.NotificationService.success('SUCCESSFULLY APPROVED');\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tconsole.error(err);\r\n\t\t\t\t\tthis.NotificationService.error('FAILED');\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.isBulkApproving = false;\r\n\t\t\t\tthis.bulkStatusChange(paymentIDsForApproval, false);\r\n\t\t\t});\r\n\t}\r\n\r\n\tbulkStatusChange(IDs, busy) {\r\n\t\tthis.paymentBandData.bandsData.ContractualPayments.map((payment) => {\r\n\t\t\tconst id = IDs.find((_id) => {\r\n\t\t\t\treturn _id === payment.ContractualPaymentId;\r\n\t\t\t});\r\n\t\t\tif (id) {\r\n\t\t\t\tpayment.isApproving = busy;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tapproveContractual(id, unApprove) {\r\n\t\tconst busyType = unApprove ? 'un-approving' : 'approving';\r\n\t\tthis.changeContractualApprovalStatus(id, busyType, true);\r\n\r\n\t\tlet promise;\r\n\r\n\t\tif (unApprove) {\r\n\t\t\tpromise = this.paymentAuthorisationDataService.unApproveContractualPayment(id);\r\n\t\t} else {\r\n\t\t\tpromise = this.paymentAuthorisationDataService.approveContractualPayment(id);\r\n\t\t}\r\n\r\n\t\tpromise\r\n\t\t\t.then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tconst msg = unApprove ? 'APPROVAL CANCELLED' : 'APPROVED';\r\n\t\t\t\t\tthis.NotificationService.success(msg);\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tthis.NotificationService.error('FAILED');\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.changeContractualApprovalStatus(id, busyType, false);\r\n\t\t\t});\r\n\t}\r\n\r\n\tchangeContractualApprovalStatus(id, type, busy) {\r\n\t\tthis.paymentBandData.bandsData.ContractualPayments.forEach((payment) => {\r\n\t\t\tif (payment.ContractualPaymentId === id) {\r\n\t\t\t\tif (type === 'approving') {\r\n\t\t\t\t\tpayment.isApproving = busy;\r\n\t\t\t\t} else if (type === 'un-approving') {\r\n\t\t\t\t\tpayment.isUnApproving = busy;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.contractualDetails = payment;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t_switchIsBusy(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isBusy = flag;\r\n\t\t});\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass PaymentAuthorisationService {\r\n\t/*@ngInject*/\r\n\tconstructor($http, Utility, $timeout, $rootScope, ContentService, BuildingsService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.bandsData = {};\r\n\t\tthis.InternalLinksService.getLinks('/api/paymentAuthorisation/links');\r\n\t}\r\n\r\n\tasync getPaymentAuthorisation(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentAuthorisationApi');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/paymentAuthorisation/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentAuthorisationApi');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tresults.data.WebPortfolio = results.data.hasOwnProperty('WebPortfolio')\r\n\t\t\t\t? results.data.WebPortfolio\r\n\t\t\t\t: results.data.Portfolios;\r\n\r\n\t\t\tthis.bandsData = {\r\n\t\t\t\tWebPortfolio: results.data.Portfolios,\r\n\t\t\t\tComments: results.data.Comments,\r\n\t\t\t\tStatus: results.data.Status,\r\n\t\t\t\tContractualPayments: results.data.ContractualPayments\r\n\t\t\t};\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (err) {\r\n\t\t\tthis.bandsData = {\r\n\t\t\t\tWebPortfolio: [],\r\n\t\t\t\tComments: [],\r\n\t\t\t\tStatus: undefined,\r\n\t\t\t\tContractualPayments: []\r\n\t\t\t};\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync approvePaymentAuthorisation(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentAuthorisationApiApprove');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/paymentAuthorisation/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentAuthorisationApiApprove');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tconst { data } = results;\r\n\t\t\tawait this.getPaymentAuthorisation(schemeRef);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync approveContractualPayments(contractualPaymentIDs, schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!(contractualPaymentIDs && contractualPaymentIDs.length > 0)) {\r\n\t\t\t\tthrow new Error('Contractual Payment IDs must be supplied.');\r\n\t\t\t}\r\n\t\t\tif (!schemeRef || schemeRef['length'] < 3) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ContractualPaymentsApiBulkApprove');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/contractualpayments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ContractualPaymentsApiBulkApprove');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst payload = {\r\n\t\t\t\tPaymentIds: contractualPaymentIDs\r\n\t\t\t};\r\n\r\n\t\t\tconst results = await this.$http.post(url, payload, { headers });\r\n\t\t\tawait this.getPaymentAuthorisation(schemeRef);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync approveContractualPayment(id) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!id) {\r\n\t\t\t\tthrow new Error('No Contractual Payment Id provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ContractualPaymentsApiApprove');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/contractualpayments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ContractualPaymentsApiApprove');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{contractualPaymentId}', id);\r\n\r\n\t\t\tconst results = this.$http.post(url);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tconst schemeRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\tawait this.getPaymentAuthorisation(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync unApproveContractualPayment(id) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!id) {\r\n\t\t\t\tthrow new Error('No Contractual Payment Id provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ContractualPaymentUnApprove');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/contractualpayments/links');\r\n\t\t\t\tif (!url) url = await this.InternalLinksService.getLink('ContractualPaymentUnApprove');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{contractualPaymentId}', id);\r\n\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tconst schemeRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\tawait this.getPaymentAuthorisation(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync queryContractualPayment(id, message) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!id) {\r\n\t\t\t\tthrow new Error('No Contractual Payment Id provided...');\r\n\t\t\t}\r\n\t\t\tif (!message) {\r\n\t\t\t\tthrow new Error('No Query message provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ContractualPaymentsApiQuery');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/contractualpayments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ContractualPaymentsApiQuery');\r\n\t\t\t}\r\n\r\n\t\t\tconst payload = {\r\n\t\t\t\tPaymentId: id,\r\n\t\t\t\tMessage: message\r\n\t\t\t};\r\n\r\n\t\t\tconst results = this.$http.post(url, payload);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tconst schemeRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\tawait this.getPaymentAuthorisation(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync queryPaymentAuthorisation(schemeRef, message) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\t\t\tif (!message) {\r\n\t\t\t\tthrow new Error('No Query message provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentAuthorisationApiQuery');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/paymentAuthorisation/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentAuthorisationApiQuery');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\tconst payload = {\r\n\t\t\t\tSchemeRef: schemeRef,\r\n\t\t\t\tMessage: message\r\n\t\t\t};\r\n\r\n\t\t\tconst results = await this.$http.post(url, payload);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tawait this.getPaymentAuthorisation(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tBuildingsService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew PaymentAuthorisationService(\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tBuildingsService,\r\n\t\tInternalLinksService\r\n\t);\r\n","//@ts-check\r\n\r\nclass PaymentApprovalService {\r\n\tconstructor($http, Utility, $timeout, $rootScope, ContentService, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.approvalsData = undefined;\r\n\t\tthis.paymentTypes = undefined;\r\n\t\tthis.serviceProviders = undefined;\r\n\t\tthis.numberOfResults = 0;\r\n\t\tthis.InternalLinksService.getLinks('/api/payments/links');\r\n\t}\r\n\r\n\t/**\r\n\t * Method for fetching payments to be approved\r\n\t * @param {string} schemeRef The building scheme reference\r\n\t * @return {Promise} The payments promise\r\n\t */\r\n\tasync getPaymentApprovals(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!schemeRef || schemeRef['length'] < 3) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentsApi');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentsApi');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tconst currentCount = results.data && results.data.length ? results.data.length : 0;\r\n\r\n\t\t\tlet approvalsData = results.data ? results.data : results;\r\n\r\n\t\t\tapprovalsData = this._mapApprovals(approvalsData);\r\n\r\n\t\t\tconst oldApprovalsData = this.approvalsData;\r\n\r\n\t\t\tif (oldApprovalsData && oldApprovalsData.hasOwnProperty('approvals') && oldApprovalsData.approvals) {\r\n\t\t\t\toldApprovalsData.approvals = approvalsData;\r\n\t\t\t} else {\r\n\t\t\t\tthis.approvalsData = $.extend({ approvals: approvalsData }, oldApprovalsData);\r\n\t\t\t}\r\n\r\n\t\t\tthis.$rootScope.$broadcast('approvals-count-changed', currentCount);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(approvalsData));\r\n\t\t} catch (err) {\r\n\t\t\tconst payments = {\r\n\t\t\t\tapprovals: [],\r\n\t\t\t\tapproved: []\r\n\t\t\t};\r\n\t\t\tthis.approvalsData = payments;\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n\t * Method for fetching approved payments\r\n\t * @param {string} schemeRef The building scheme reference\r\n\t * @return {Promise} The payments promise\r\n\t */\r\n\tasync getApprovedPayments(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!schemeRef || schemeRef['length'] < 3) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentsApiApproved');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentsApiApproved');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tconst approvedData = results.data ? results.data : results;\r\n\t\t\tconst oldApprovedData = this.approvalsData;\r\n\r\n\t\t\tif (oldApprovedData && oldApprovedData.hasOwnProperty('approved') && oldApprovedData.approved)\r\n\t\t\t\toldApprovedData.approved = approvedData;\r\n\t\t\telse {\r\n\t\t\t\tthis.approvalsData = $.extend({ approved: approvedData }, oldApprovedData);\r\n\t\t\t}\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(approvedData));\r\n\t\t} catch (err) {\r\n\t\t\tconst payments = {\r\n\t\t\t\tapprovals: [],\r\n\t\t\t\tapproved: []\r\n\t\t\t};\r\n\t\t\tthis.approvalsData = payments;\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n\t * Method for approving a payment\r\n\t * @param {string} paymentId The payment ID\r\n\t * @param {string} schemeRef The building scheme reference\r\n\t * @return {Promise} The results promise\r\n\t */\r\n\tasync approvePayment(paymentId, schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!paymentId) {\r\n\t\t\t\tthrow new Error('No payment id provided...');\r\n\t\t\t}\r\n\t\t\tif (!schemeRef || schemeRef['length'] < 3) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentsApiApprove');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentsApiApprove');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{paymentId}', paymentId);\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\t// await this.getApprovedPayments(schemeRef);\r\n\t\t\tawait this.getPaymentApprovals(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync submitPaymentForApporval(paymentDataPayload, arrayOfAttachmentBase64Blobs) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('SubmitPaymentForApproval');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('SubmitPaymentForApproval');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.postAsFormData(paymentDataPayload, arrayOfAttachmentBase64Blobs, url);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\tasync canSubmitPaymentForApproval(request) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tif (!request) {\r\n\t\t\t\tthrow new Error('No payment data provided...');\r\n\t\t\t}\r\n\t\t\tlet url = await this.InternalLinksService.getLink('CanSubmitPaymentForApproval');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('CanSubmitPaymentForApproval');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.post(url, request, { headers });\r\n\t\t\tlet cansubmit = results.data ? results.data : results;\r\n\r\n\t\t\tcansubmit = cansubmit.Data;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(cansubmit));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getCurrentVatRateForScheme(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tif (!schemeRef || schemeRef['length'] < 3) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetCurrentVatRateForScheme');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetCurrentVatRateForScheme');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tlet currentVatRate = results.data;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(currentVatRate));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync isPaymentBandEnabledBySchemeRef(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tif (!schemeRef || schemeRef['length'] < 3) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\t\t\tlet url = await this.InternalLinksService.getLink('IsPaymentBandEnabledBySchemeRef');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('IsPaymentBandEnabledBySchemeRef');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tlet isPaymentBandEnabled = results.data ? results.data : results;\r\n\r\n\t\t\tisPaymentBandEnabled = isPaymentBandEnabled.Data;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(isPaymentBandEnabled));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n\t * Method for approving a bulk of payments\r\n\t * @param {string} schemeRef The building scheme reference\r\n\t * @param {Array} IDs The selected payment IDs for approval\r\n\t * @return {Promise} The results promise\r\n\t */\r\n\tasync bulkApprovePayments(schemeRef, IDs) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tif (!IDs) {\r\n\t\t\t\tthrow new Error('No selected Payment IDs for approval provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentsApiBulkApprove');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentsApiBulkApprove');\r\n\t\t\t}\r\n\r\n\t\t\tconst payload = {\r\n\t\t\t\tPaymentIds: IDs\r\n\t\t\t};\r\n\r\n\t\t\tconst results = await this.$http.post(url, payload);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\t// await this.getApprovedPayments(schemeRef);\r\n\t\t\tawait this.getPaymentApprovals(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n\t * Method for querying a payment\r\n\t * @param {string} paymentId The payment Id of the payment to be queried\r\n\t * @param {string} message The query message\r\n\t * @return {Promise} The results promise\r\n\t */\r\n\tasync queryPayment(paymentId, message, schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!message) {\r\n\t\t\t\tthrow new Error('No Query message provided...');\r\n\t\t\t}\r\n\t\t\tif (!paymentId) {\r\n\t\t\t\tthrow new Error('No Payment ID provided...');\r\n\t\t\t}\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentsApiQuery');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentsApiQuery');\r\n\t\t\t}\r\n\r\n\t\t\tconst payload = {\r\n\t\t\t\tMessage: message,\r\n\t\t\t\tPaymentId: paymentId\r\n\t\t\t};\r\n\r\n\t\t\tconst results = await this.$http.post(url, payload);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\tawait this.getPaymentApprovals(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n\t * Method for fetching the payments content\r\n\t * @return {Promise} The html promise\r\n\t */\r\n\tasync loadContent() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst content = await this.ContentService.load('PaymentsContent', '/api/payments/links');\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(content));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n\t * Helper Method for mapping payment IDs \r\n\t * @param {string} schemeRef\r\n\t * @return {Array} The payment IDs\r\n\t */\r\n\t_getPaymentIds(schemeRef) {\r\n\t\tlet ids = [];\r\n\t\tids = _.map(this.approvalsData.approvals, 'PaymentId');\r\n\r\n\t\treturn ids;\r\n\t}\r\n\r\n\t/**\r\n\t * Method for un-approving a specific payment\r\n\t * @param {string} paymentId The payment ID\r\n\t * @return {Promise} Asynchronous process\r\n\t */\r\n\tasync unApprovePayment(paymentId, schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!paymentId) {\r\n\t\t\t\tthrow new Error('No payment id provided...');\r\n\t\t\t}\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentUnApprove');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentUnApprove');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{paymentId}', paymentId);\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tconst { data } = results;\r\n\r\n\t\t\t// await this.getApprovedPayments(schemeRef);\r\n\t\t\tawait this.getPaymentApprovals(schemeRef);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync searchPayments(webPaymentSearch) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst schemeRef = webPaymentSearch.SchemeReference;\r\n\r\n\t\t\tif (!schemeRef || schemeRef['length'] < 3) {\r\n\t\t\t\tthrow new Error('No Building reference provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentSearch');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentSearch');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.post(url, webPaymentSearch, { headers });\r\n\r\n\t\t\tconst approvedData = results.data.Data ? results.data.Data : results;\r\n\t\t\tconst oldApprovedData = this.approvalsData;\r\n\r\n\t\t\tthis.numberOfResults = results.data.NumberOfResults;\r\n\r\n\t\t\tif (oldApprovedData && oldApprovedData.hasOwnProperty('approved') && oldApprovedData.approved)\r\n\t\t\t\toldApprovedData.approved = approvedData;\r\n\t\t\telse {\r\n\t\t\t\tthis.approvalsData = $.extend({ approved: approvedData }, oldApprovedData);\r\n\t\t\t}\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(approvedData));\r\n\t\t} catch (err) {\r\n\t\t\tconst payments = {\r\n\t\t\t\tapproved: []\r\n\t\t\t};\r\n\t\t\tthis.approvalsData = payments;\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n\t * Helper Method for mapping payment IDs \r\n\t * @param {Array} approvals The payment approvals\r\n\t * @return {Array} The payment IDs\r\n\t */\r\n\t_mapApprovals(approvals) {\r\n\t\tapprovals.forEach((payment, index) => {\r\n\t\t\tpayment.Checked = payment.hasOwnProperty('Checked') ? payment.Checked : false;\r\n\r\n\t\t\tpayment.isQuerying = false;\r\n\t\t\tpayment.isApproving = false;\r\n\t\t\tpayment.isUnApproving = false;\r\n\r\n\t\t\tpayment.Attachments.forEach((attachment, innerIndex) => {\r\n\t\t\t\tattachment.Path = `${attachment.Path}${attachment.DocumentExtension}`;\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\treturn approvals;\r\n\t}\r\n\r\n\tasync getPaymentTypes() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('PaymentTypes');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('PaymentTypes');\r\n\t\t\t}\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\r\n\t\t\tlet paymentTypes = results.data ? results.data : results;\r\n\r\n\t\t\tthis.paymentTypes = paymentTypes.Data;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(this.paymentTypes));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync searchServiceProvider(searchTerm) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!searchTerm) {\r\n\t\t\t\tthrow new Error('No search service term provided...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ServiceProviderSearch');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ServiceProviderSearch');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.post(url, searchTerm, { headers });\r\n\r\n\t\t\tlet serviceProviderResult = results.data ? results.data : results;\r\n\t\t\tthis.serviceProviders = serviceProviderResult.Data;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(this.serviceProviders));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync checkInvoiceNumberHasDuplicate(serviceProviderId, invoiceNumber) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('CheckInvoiceNumberHasDuplicate');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('CheckInvoiceNumberHasDuplicate');\r\n\t\t\t}\r\n\r\n\t\t\tconst payload = {\r\n\t\t\t\tserviceProviderId,\r\n\t\t\t\tinvoiceNumber\r\n\t\t\t};\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.post(url, payload, { headers });\r\n\r\n\t\t\tlet hasDuplicateResult = results.data ? results.data : results;\r\n\r\n\t\t\tlet hasDuplicate = hasDuplicateResult.Data;\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(hasDuplicate));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync postAsFormData(objToBeHttpPosted, arrayOfBase64Blobs, link) {\r\n\r\n\t\tvar formdata = new FormData();\r\n\r\n\t\tformdata.append('JSONObject', JSON.stringify(objToBeHttpPosted));\r\n\r\n\t\tfor (let index = 0; index < arrayOfBase64Blobs.length; index++) {\r\n\t\t\tconst element = arrayOfBase64Blobs[index];\r\n\t\t\tformdata.append(`BlobBase64${index}`, new Blob([element], {\r\n\t\t\t\ttype: \"application/pdf\"\r\n\t\t\t})\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tlet headers = this.Utility.headers;\r\n\t\theaders = {\r\n\t\t\t...headers,\r\n\t\t\t'content-type': undefined\r\n\t\t};\r\n\r\n\t\treturn this.$http({\r\n\t\t\turl: link,\r\n\t\t\theaders: headers,\r\n\t\t\tdata: formdata,\r\n\t\t\tmethod: \"POST\",\r\n\t\t\ttransformRequest: angular.identity\r\n\t\t});\r\n\t}\r\n\r\n\tasync SearchGLAccounts(searchTerm, schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tif (!searchTerm) {\r\n\t\t\t\tthrow new Error('no initial request data');\r\n\t\t\t}\r\n\t\t\tlet url = await this.InternalLinksService.getLink('SearchForAccountNames');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/payments/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('SearchForAccountNames');\r\n\t\t\t}\r\n\r\n\t\t\tconst payload = {\r\n\t\t\t\tsearchTerm,\r\n\t\t\t\tschemeRef\r\n\t\t\t};\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.post(url, payload, { headers });\r\n\t\t\tconst accountsData = results.data ? results.data : results;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(accountsData));\r\n\t\t} catch (error) {\r\n\t\t\tconst msg = `Error while searching available accountnames.`;\r\n\t\t\tconsole.error(msg, error);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew PaymentApprovalService(\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","const base64js = require('base64-js');\r\nimport Validator from 'validatorjs';\r\nimport { request } from \"https\";\r\nimport utilityService from \"../../services/common/utility-service\";\r\n//@ts-check\r\n\r\n/* @ngInject */\r\nexport default class PaymentCtrl {\r\n\tconstructor(\r\n\t\t$sce,\r\n\t\t$state,\r\n\t\t$scope,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$interval,\r\n\t\t$uibModal,\r\n\t\t$rootScope,\r\n\t\tPagingService,\r\n\t\tBuildingsService,\r\n\t\tNotificationService,\r\n\t\tLocalStorageService,\r\n\t\tAuthorizationService,\r\n\t\tAuthenticationService,\r\n\t\tpaymentApprovalsDataService,\r\n\t) {\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$interval = $interval;\r\n\t\tthis.$uibModal = $uibModal;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.PagingService = PagingService;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.AuthorizationService = AuthorizationService;\r\n\t\tthis.AuthenticationService = AuthenticationService;\r\n\t\tthis.paymentApprovalsDataService = paymentApprovalsDataService;\r\n\t\tthis.hasPaymentsInitiallySucceeded = false;\r\n\t\tthis.hasInitialisedFromSession = false;\r\n\r\n\t\tthis.$rootScope.$on('user-session-set', () => {\r\n\t\t\tif (!this.hasInitialisedFromSession) {\r\n\t\t\t\tthis.activate();\r\n\t\t\t\tthis.hasInitialisedFromSession = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t\tthis.registerEventHandlers();\r\n\r\n\t\tthis.defaultAddEditPayment = {\r\n\t\t\tPaymentType: undefined,\r\n\t\t\tInvoiceNumber: undefined,\r\n\t\t\tServiceProviderId: undefined,\r\n\t\t\tTotalInvoiceAmount: undefined,\r\n\t\t\tFuturePaymentDate: undefined,\r\n\t\t\tAllocations: [],\r\n\t\t\tInvoice: undefined,\r\n\t\t\tSupportingDocuments: [],\r\n\t\t\tIsTaxable: false,\r\n\t\t\tVatRatePercentage: undefined\r\n\t\t}\r\n\r\n\t\tthis.Allocations = {\r\n\t\t\tGLAccount: undefined,\r\n\t\t\tAmount: undefined\r\n\t\t}\r\n\r\n\t\tthis.defaultAddEditPaymenOptions = {\r\n\t\t\tshowDuplicateInvoiceWarning: false,\r\n\t\t\tshowDuplicateInvoiceError: false,\r\n\t\t\tisCheckingForDuplicateInvoice: false,\r\n\t\t\ttempServiceProvider: undefined,\r\n\t\t\tfutureDatechecked: false,\r\n\t\t\tserviceProviderChecked: false,\r\n\t\t\tsearchServiceTerm: '',\r\n\t\t\tschemeConfirmed: false,\r\n\t\t\tserviceProviderConfirmed: false,\r\n\t\t\tinvoiceNumberConfirmed: false,\r\n\t\t\tamountConfirmed: false,\r\n\t\t\tinvoiceCaptureConfirmed: false\r\n\t\t}\r\n\r\n\t\tthis.addEditPayment = {};\r\n\t\tthis.addEditPaymenOptions = {};\r\n\r\n\t\t//TODO: Use this ssame logic to reset the payment object when requirued\r\n\t\tthis.resetPaymentData();\r\n\r\n\t\tthis.captureFormErrors();\r\n\t}\r\n\r\n\tresetPaymentData() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tObject.assign(this.addEditPayment, this.defaultAddEditPayment);\r\n\t\t\tObject.assign(this.addEditPaymenOptions, this.defaultAddEditPaymenOptions);\r\n\t\t\tthis.allocationRows = [];\r\n\t\t\tthis.selectedserviceProviderName = undefined;\r\n\t\t\tthis.addEditPayment.SupportingDocuments = [];\r\n\t\t});\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.query = '';\r\n\t\tthis.isBusy = false;\r\n\t\tthis.searchTerm = '';\r\n\t\tthis.awaitQueries = false;\r\n\t\tthis.selectedItemIndex = 0;\r\n\t\tthis.panelCollapsed = null;\r\n\t\tthis.currentSchemeRef = '';\r\n\t\tthis.scrollableStyling = ``;\r\n\t\tthis.showBulkApprove = true;\r\n\t\tthis.paymentsPromise = null;\r\n\t\tthis.isAmountChecked = false;\r\n\t\tthis.isBusySearching = false;\r\n\t\tthis.isBusySaving = false;\r\n\t\tthis.selectedPagingLimit = 5;\r\n\t\tthis.isBulkApproving = false;\r\n\t\tthis.webPaymentApproval = [];\r\n\t\tthis.portfolioArrayLength = 0;\r\n\t\tthis.isInvoiceChecked = false;\r\n\t\tthis.isSupplierChecked = false;\r\n\t\tthis.paymentApprovalsCount = 0;\r\n\t\tthis.selectedLineItemIndex = 0;\r\n\t\tthis.limits = [5, 10, 15, 20];\r\n\t\tthis.searchButtonActive = false;\r\n\t\tthis.paymentsForBulkApproval = [];\r\n\t\tthis.invoiceApprovedOverlay = false;\r\n\t\tthis.webPaymentApprovalApproved = [];\r\n\t\tthis.paymentsDataService = undefined;\r\n\t\tthis.webPaymentApprovalIndividual = {\r\n\t\t\tNotes: null,\r\n\t\t\tAttachments: []\r\n\t\t};\r\n\t\tthis.isPagingNavigationVisible = false;\r\n\t\tthis.approvedPaymentsPaging = this.PagingService;\r\n\t\tthis.selectedserviceProviderName = undefined;\r\n\t\tthis.canPaymentcapture = false;\r\n\t\tthis.allocationRows = [];\r\n\t\tthis.attachment = [];\r\n\t\tthis.allocationAmountMatchedInvoiceTotal = false;\r\n\t}\r\n\r\n\tregisterEventHandlers() {\r\n\t\tthis.$scope.$on('payments-bulk-is-busy', () => {\r\n\t\t\tthis.paymentsDataService.approvalsData.approvals.forEach((payment) => {\r\n\t\t\t\tthis.paymentsForBulkApproval.forEach((innerPayment) => {\r\n\t\t\t\t\tif (innerPayment.PaymentId === payment.PaymentId) {\r\n\t\t\t\t\t\tpayment.isApproving = true;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('payments-bulk-is-done', () => {\r\n\t\t\tthis.paymentsDataService.approvalsData.approvals.forEach((payment) => {\r\n\t\t\t\tthis.paymentsForBulkApproval.forEach((innerPayment) => {\r\n\t\t\t\t\tif (innerPayment.PaymentId === payment.PaymentId) {\r\n\t\t\t\t\t\tpayment.isApproving = false;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tthis.paymentsForBulkApproval = [];\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('payment-is-busy', (evt, paymentId, type) => {\r\n\t\t\tlet paymentIndex = -1;\r\n\t\t\tthis.paymentsDataService.approvalsData.approvals.forEach((payment, index) => {\r\n\t\t\t\tif (payment.PaymentId == paymentId) {\r\n\t\t\t\t\tpaymentIndex = index;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (paymentIndex > -1) {\r\n\t\t\t\tif (type.toLowerCase().indexOf('query') !== -1) {\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isQuerying = true;\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isApproving = false;\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isUnApproving = false;\r\n\t\t\t\t\tif (this.webPaymentApprovalIndividual) {\r\n\t\t\t\t\t\tthis.webPaymentApprovalIndividual.isQuerying = true;\r\n\t\t\t\t\t\tthis.webPaymentApprovalIndividual.isApproving = false;\r\n\t\t\t\t\t\tthis.webPaymentApprovalIndividual.isUnApproving = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (type.toLowerCase().indexOf('unapproval') !== -1) {\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isQuerying = false;\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isApproving = false;\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isUnApproving = true;\r\n\t\t\t\t\tif (this.webPaymentApprovalIndividual) {\r\n\t\t\t\t\t\tthis.webPaymentApprovalIndividual.isQuerying = false;\r\n\t\t\t\t\t\tthis.webPaymentApprovalIndividual.isApproving = false;\r\n\t\t\t\t\t\tthis.webPaymentApprovalIndividual.isUnApproving = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isApproving = true;\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isQuerying = false;\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isUnApproving = false;\r\n\t\t\t\t\tif (this.webPaymentApprovalIndividual) {\r\n\t\t\t\t\t\tthis.webPaymentApprovalIndividual.isApproving = true;\r\n\t\t\t\t\t\tthis.webPaymentApprovalIndividual.isQuerying = false;\r\n\t\t\t\t\t\tthis.webPaymentApprovalIndividual.isUnApproving = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('payment-is-done', (evt, paymentId, type) => {\r\n\t\t\tlet paymentIndex;\r\n\t\t\tthis.paymentsDataService.approvalsData.approvals.forEach((payment, index) => {\r\n\t\t\t\tif (payment.PaymentId == paymentId) {\r\n\t\t\t\t\tpaymentIndex = index;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (paymentIndex) {\r\n\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isQuerying = false;\r\n\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isApproving = false;\r\n\t\t\t\tthis.paymentsDataService.approvalsData.approvals[paymentIndex].isUnApproving = false;\r\n\t\t\t\tif (this.webPaymentApprovalIndividual) {\r\n\t\t\t\t\tthis.webPaymentApprovalIndividual.isQuerying = false;\r\n\t\t\t\t\tthis.webPaymentApprovalIndividual.isApproving = false;\r\n\t\t\t\t\tthis.webPaymentApprovalIndividual.isUnApproving = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('selected-building-changed', (event, newValue) => {\r\n\t\t\tthis.onSelectedBuildingChanged(this, newValue);\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('approvals-count-changed', (event, currentCount) => {\r\n\t\t\tthis.paymentApprovalsCount = currentCount;\r\n\t\t});\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'paymentApprovalVm.approvedPaymentsPaging.pageNumber',\r\n\t\t\t(newVal, oldVal) => {\r\n\t\t\t\tif (oldVal && newVal !== oldVal) {\r\n\t\t\t\t\tthis.searchPayments();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'paymentApprovalVm.approvedPaymentsPaging.maxPage',\r\n\t\t\t() => {\r\n\t\t\t\tthis.approvedPaymentsPaging.pageNumber = 1;\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'paymentApprovalVm.searchTerm',\r\n\t\t\t() => {\r\n\t\t\t\tif (this.isInvoiceChecked) {\r\n\t\t\t\t\tif (this.searchTerm && this.searchTerm.hasOwnProperty('length') && this.searchTerm.length >= 1) {\r\n\t\t\t\t\t\tthis.searchButtonActive = true;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.isSupplierChecked) {\r\n\t\t\t\t\tif (this.searchTerm && this.searchTerm.hasOwnProperty('length') && this.searchTerm.length >= 3) {\r\n\t\t\t\t\t\tthis.searchButtonActive = true;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.isAmountChecked) {\r\n\t\t\t\t\tif (this.searchTerm && this.searchTerm.hasOwnProperty('length') && this.searchTerm.length >= 1) {\r\n\t\t\t\t\t\tconst isDecimal = this._isDecimal(this.searchTerm);\r\n\t\t\t\t\t\tif (isDecimal) {\r\n\t\t\t\t\t\t\tthis.searchButtonActive = true;\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (\r\n\t\t\t\t\t!this.isInvoiceChecked &&\r\n\t\t\t\t\t!this.isSupplierChecked &&\r\n\t\t\t\t\t!this.isAmountChecked &&\r\n\t\t\t\t\t(!this.searchTerm || this.searchTerm === '')\r\n\t\t\t\t) {\r\n\t\t\t\t\tthis.searchButtonActive = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.searchButtonActive = false;\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'paymentApprovalVm.isInvoiceChecked',\r\n\t\t\t() => {\r\n\t\t\t\tif (this.isInvoiceChecked) {\r\n\t\t\t\t\tthis.isSupplierChecked = false;\r\n\t\t\t\t\tthis.isAmountChecked = false;\r\n\t\t\t\t\tif (this.searchTerm && this.searchTerm.hasOwnProperty('length') && this.searchTerm.length >= 1) {\r\n\t\t\t\t\t\tthis.searchButtonActive = true;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (\r\n\t\t\t\t\t!this.isInvoiceChecked &&\r\n\t\t\t\t\t!this.isSupplierChecked &&\r\n\t\t\t\t\t!this.isAmountChecked &&\r\n\t\t\t\t\t(!this.searchTerm || this.searchTerm === '')\r\n\t\t\t\t) {\r\n\t\t\t\t\tthis.searchButtonActive = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.searchButtonActive = false;\r\n\t\t\t\treturn;\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'paymentApprovalVm.isSupplierChecked',\r\n\t\t\t() => {\r\n\t\t\t\tif (this.isSupplierChecked) {\r\n\t\t\t\t\tthis.isInvoiceChecked = false;\r\n\t\t\t\t\tthis.isAmountChecked = false;\r\n\t\t\t\t\tif (this.searchTerm && this.searchTerm.hasOwnProperty('length') && this.searchTerm.length >= 3) {\r\n\t\t\t\t\t\tthis.searchButtonActive = true;\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (\r\n\t\t\t\t\t!this.isInvoiceChecked &&\r\n\t\t\t\t\t!this.isSupplierChecked &&\r\n\t\t\t\t\t!this.isAmountChecked &&\r\n\t\t\t\t\t(!this.searchTerm || this.searchTerm === '')\r\n\t\t\t\t) {\r\n\t\t\t\t\tthis.searchButtonActive = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.searchButtonActive = false;\r\n\t\t\t\treturn;\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tthis.$scope.$watch(\r\n\t\t\t'paymentApprovalVm.isAmountChecked',\r\n\t\t\t() => {\r\n\t\t\t\tif (this.isAmountChecked) {\r\n\t\t\t\t\tthis.isSupplierChecked = false;\r\n\t\t\t\t\tthis.isInvoiceChecked = false;\r\n\t\t\t\t\tif (this.searchTerm && this.searchTerm.hasOwnProperty('length') && this.searchTerm.length >= 1) {\r\n\t\t\t\t\t\tvar isDecimal = this._isDecimal(this.searchTerm);\r\n\t\t\t\t\t\tif (isDecimal) {\r\n\t\t\t\t\t\t\tthis.searchButtonActive = true;\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (\r\n\t\t\t\t\t!this.isInvoiceChecked &&\r\n\t\t\t\t\t!this.isSupplierChecked &&\r\n\t\t\t\t\t!this.isAmountChecked &&\r\n\t\t\t\t\t(!this.searchTerm || this.searchTerm === '')\r\n\t\t\t\t) {\r\n\t\t\t\t\tthis.searchButtonActive = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.searchButtonActive = false;\r\n\t\t\t\treturn;\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\tangular.element('#paymentViewModal').on('hidden.bs.modal', () => {\r\n\t\t\tthis.webPaymentApprovalIndividual = null;\r\n\t\t});\r\n\r\n\t\tangular.element('li.historicApprovals.active').on('click', (evt) => {\r\n\t\t\tconst $historyTab = angular.element('li.historicApprovals.active');\r\n\t\t\tconst shouldShouldBulkApprove = $historyTab.attr('aria-expanded');\r\n\t\t});\r\n\t}\r\n\r\n\tactivate() {\r\n\t\tconst userSession = this.LocalStorageService.retrieve('userSession');\r\n\r\n\t\tif (!userSession) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.paymentsDataService = this.paymentApprovalsDataService;\r\n\t\tthis.buildingsDataService = this.BuildingsService;\r\n\t\tthis.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\tif (this.selectedBuildingRef) {\r\n\t\t\tthis.onSelectedBuildingChanged({}, this.selectedBuildingRef);\r\n\t\t}\r\n\t\tthis.capturePayment();\r\n\t\tthis.getPaymentTypes();\r\n\t\tthis.initializeDatePicker();\r\n\t\tthis.addMainAttachmentWatch();\t\t\r\n\t}\r\n\r\n\tasync onSelectedBuildingChanged(event, incomingSchemeRef) {\r\n\r\n\t\tif (incomingSchemeRef == this.currentSchemeRef) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.clearSearchPayments();\r\n\r\n\t\tif (incomingSchemeRef) {\r\n\t\t\tthis.currentSchemeRef = incomingSchemeRef;\r\n\t\t} else {\r\n\t\t\tthis.currentSchemeRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\t\tif (!!!this.currentSchemeRef) {\r\n\t\t\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\t\t\t\tconst { BuildingProfiles } = userProfile;\r\n\r\n\t\t\t\tif (!!BuildingProfiles && BuildingProfiles.length > 0) {\r\n\t\t\t\t\tconst buildingProfile = BuildingProfiles[0];\r\n\t\t\t\t\tconst { SchemeReference } = buildingProfile;\r\n\t\t\t\t\tincomingSchemeRef = SchemeReference;\r\n\t\t\t\t\tthis.currentSchemeRef = SchemeReference;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.currentSchemeRef && this.currentSchemeRef.length > 2) {\r\n\t\t\tthis._switchIsLoading(true);\r\n\t\t\tthis.getPaymentTypes();\r\n\t\t\tthis.isPaymentBandEnabledBySchemeRef();\r\n\t\t\tthis.paymentApprovalsDataService.getPaymentApprovals(this.currentSchemeRef, true)\r\n\t\t\t\t.then((data) => {\r\n\t\t\t\t\tthis.hasPaymentsInitiallySucceeded = true;\r\n\t\t\t\t\tconsole.log(\"data: \" + JSON.stringify(data));\r\n\t\t\t\t\tif (this.paymentsDataService.approvalsData && (this.paymentsDataService.approvalsData.approvals && this.paymentsDataService.approvalsData.approvals.length > 0)) {\r\n\t\t\t\t\t\tthis._mapIcons();\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.catch((err) => {\r\n\t\t\t\t\tconsole.error(err);\r\n\t\t\t\t})\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis._switchIsLoading(false);\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tshowHistoryTab() {\r\n\t\tthis.searchPayments();\r\n\t\tthis.showBulkApprove = false;\r\n\t}\r\n\r\n\ttogglePayment(paymentId) {\r\n\t\tthis.paymentsDataService.approvalsData.approvals.forEach((payment) => {\r\n\t\t\tif (payment.PaymentId === paymentId) {\r\n\t\t\t\tpayment.expanded = !payment.expanded;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_mapIcons() {\r\n\t\tthis.paymentsDataService.approvalsData.approvals.forEach((payment) => {\r\n\t\t\tpayment.expanded = true;\r\n\t\t});\r\n\t}\r\n\r\n\tsetPanelCollapsed(status, id) {\r\n\t\tconst $collapsing = angular.element('#' + id).hasClass('collapsing');\r\n\t\tif (!$collapsing) {\r\n\t\t\tstatus = !status;\r\n\t\t}\r\n\t\treturn status;\r\n\t}\r\n\r\n\tbulkApprovePayments() {\r\n\t\tthis.currentSchemeRef = this.currentSchemeRef ? this.currentSchemeRef : this.BuildingsService.getSelectedBuildingRef();\r\n\t\tconst ids = this.paymentsForBulkApproval.map((payment) => payment.PaymentId);\r\n\r\n\t\tthis.isBulkApproving = true;\r\n\t\tthis._bulkStatusChange(ids, true);\r\n\t\tthis.paymentApprovalsDataService\r\n\t\t\t.bulkApprovePayments(this.currentSchemeRef, ids)\r\n\t\t\t.then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\t\t\tthis.NotificationService.success('APPROVED');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.NotificationService.error('FAILED');\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tthis.NotificationService.error('FAILED', err);\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.isBulkApproving = false;\r\n\t\t\t\tthis._bulkStatusChange(ids, false);\r\n\t\t\t});\r\n\t}\r\n\r\n\tactionPayment(paymentId) {\r\n\t\tconst payment = this.paymentsDataService.approvalsData.approvals.find((pa) => {\r\n\t\t\treturn pa.PaymentId == paymentId;\r\n\t\t});\r\n\r\n\t\tif (payment.HasApproved) this._unApprovePayment(paymentId);\r\n\t\telse this._approvePayment(paymentId);\r\n\t}\r\n\r\n\t_approvePayment(paymentId) {\r\n\t\tconsole.log(`Payment ${paymentId} is being approved.`);\r\n\r\n\t\tthis.currentSchemeRef = this.currentSchemeRef ? this.currentSchemeRef : this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tthis._changePaymentApprovalStatus(paymentId, 'approving', true);\r\n\t\tthis.paymentApprovalsDataService\r\n\t\t\t.approvePayment(paymentId, this.currentSchemeRef)\r\n\t\t\t.then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\t\t\tthis.NotificationService.success('APPROVED');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.NotificationService.success('FAILED');\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tthis.NotificationService.error('FAILED', err);\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis._changePaymentApprovalStatus(paymentId, 'approving', false);\r\n\t\t\t\tangular.element('#paymentViewModal').modal('hide');\r\n\t\t\t});\r\n\t}\r\n\r\n\t_unApprovePayment(paymentId) {\r\n\t\tconsole.log('Payment ' + paymentId + ' is being un-approved.');\r\n\r\n\t\tthis.currentSchemeRef = this.currentSchemeRef ? this.currentSchemeRef : this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tthis._changePaymentApprovalStatus(paymentId, 'un-approving', true);\r\n\t\tthis.paymentApprovalsDataService\r\n\t\t\t.unApprovePayment(paymentId, this.currentSchemeRef)\r\n\t\t\t.then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\t\t\tthis.NotificationService.success('UN-APPROVED');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.NotificationService.success('FAILED');\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tthis.NotificationService.error('FAILED', err);\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis._changePaymentApprovalStatus(paymentId, 'un-approving', false);\r\n\t\t\t\tangular.element('#paymentViewModal').modal('hide');\r\n\t\t\t});\r\n\t}\r\n\r\n\tasync searchPayments() {\r\n\t\tconst userName = this.LocalStorageService.retrieve('userProfile').UserName;\r\n\r\n\t\tlet searchOption = 0;\r\n\t\tif (this.isInvoiceChecked) {\r\n\t\t\tsearchOption = 1;\r\n\t\t}\r\n\t\tif (this.isSupplierChecked) {\r\n\t\t\tsearchOption = 2;\r\n\t\t}\r\n\t\tif (this.isAmountChecked) {\r\n\t\t\tsearchOption = 3;\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tconst webPaymentSearch = {\r\n\t\t\t\tSchemeReference: this.currentSchemeRef,\r\n\t\t\t\tUserName: userName,\r\n\t\t\t\tSearchTerm: this.searchTerm || '',\r\n\t\t\t\tOptions: searchOption,\r\n\t\t\t\tPageNumber: this.approvedPaymentsPaging.pageNumber,\r\n\t\t\t\tLimit: this.selectedPagingLimit\r\n\t\t\t};\r\n\r\n\t\t\tthis.approvedPaymentsPaging.limit = this.selectedPagingLimit;\r\n\r\n\t\t\tthis._switchIsSearching(true);\r\n\t\t\tawait this.paymentApprovalsDataService.searchPayments(webPaymentSearch);\r\n\t\t\tthis.approvedPaymentsPaging.numberOfResults = this.paymentsDataService.numberOfResults;\r\n\r\n\t\t\tif (this.approvedPaymentsPaging.pageNumber === 1) {\r\n\t\t\t\tthis.approvedPaymentsPaging.firstItemIndex = 1;\r\n\t\t\t} else {\r\n\t\t\t\tthis.approvedPaymentsPaging.firstItemIndex =\r\n\t\t\t\t\t(this.approvedPaymentsPaging.pageNumber - 1) * this.approvedPaymentsPaging.limit + 1;\r\n\t\t\t}\r\n\r\n\t\t\tthis.approvedPaymentsPaging.lastItemIndex =\r\n\t\t\t\tthis.approvedPaymentsPaging.firstItemIndex + this.approvedPaymentsPaging.limit - 1;\r\n\r\n\t\t\tif (this.approvedPaymentsPaging.numberOfResults > 0) {\r\n\t\t\t\tthis.approvedPaymentsPaging.maxPage = Math.ceil(\r\n\t\t\t\t\tthis.approvedPaymentsPaging.numberOfResults / this.approvedPaymentsPaging.limit\r\n\t\t\t\t);\r\n\t\t\t\tif (this.approvedPaymentsPaging.maxPage > 1) {\r\n\t\t\t\t\tthis.isPagingNavigationVisible = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.isPagingNavigationVisible = false;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthis.approvedPaymentsPaging.maxPage = 1;\r\n\t\t\t\tthis.isPagingNavigationVisible = false;\r\n\t\t\t\tthis.approvedPaymentsPaging.pageNumber = 1;\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Error while getting payment approval data: ', err);\r\n\t\t} finally {\r\n\t\t\tthis._switchIsSearching(false);\r\n\t\t}\r\n\t}\r\n\r\n\t_switchIsSearching(flag) {\r\n\t\tthis.$timeout(() => (this.isBusySearching = flag));\r\n\t}\r\n\r\n\tget approvePayments() {\r\n\t\tconst canApprove = this.AuthorizationService.isAuthorized('Approve Payments');\r\n\t\treturn canApprove;\r\n\t}\r\n\r\n\tcapturePayment() {\r\n\t\tthis.canPaymentcapture = this.AuthorizationService.isAuthorized('Capture Payment');\r\n\t\treturn this.canPaymentcapture;\r\n\t}\r\n\r\n\tclearSearchPayments() {\r\n\t\tthis.isInvoiceChecked = false;\r\n\t\tthis.isSupplierChecked = false;\r\n\t\tthis.isAmountChecked = false;\r\n\t\tthis.selectedPagingLimit = 5;\r\n\t\tthis.searchButtonActive = false;\r\n\t\tthis.searchTerm = undefined;\r\n\t\tthis.approvedPaymentsPaging.pageNumber = 1;\r\n\t}\r\n\r\n\t_changePaymentApprovalStatus(id, type, busy) {\r\n\t\tthis.paymentsDataService.approvalsData.approvals.forEach((payment) => {\r\n\t\t\tif (payment.PaymentId === id) {\r\n\t\t\t\tif (type === 'approving') {\r\n\t\t\t\t\tpayment.isApproving = busy;\r\n\t\t\t\t} else if (type === 'un-approving') {\r\n\t\t\t\t\tpayment.isUnApproving = busy;\r\n\t\t\t\t} else if (type === 'querying') {\r\n\t\t\t\t\tpayment.isQuerying = busy;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_isInt(value) {\r\n\t\tconst reg = new RegExp('^[-]?[0-9]?[.]?[0-9]+$');\r\n\t\tlet isNumber = false;\r\n\r\n\t\tif (reg.test(value)) {\r\n\t\t\tisNumber = true;\r\n\t\t}\r\n\r\n\t\treturn isNumber;\r\n\t}\r\n\r\n\t_isDecimal(value) {\r\n\t\tvalue += '';\r\n\t\treturn value.trim().length > 0 ? !isNaN(value) : false;\r\n\t}\r\n\r\n\tqueryPayment(paymentId) {\r\n\t\tthis.currentSchemeRef = this.currentSchemeRef ? this.currentSchemeRef : this.BuildingsService.getSelectedBuildingRef();\r\n\t\tconsole.log('Payment ' + paymentId + ' is being queried.');\r\n\r\n\t\tthis._changePaymentApprovalStatus(paymentId, 'querying', true);\r\n\t\tthis.paymentApprovalsDataService\r\n\t\t\t.queryPayment(paymentId, this.query, this.currentSchemeRef)\r\n\t\t\t.then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\t\t\tthis.NotificationService.success('QUERIED');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.NotificationService.error('FAILED');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.query = '';\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tconsole.log('Payment ' + paymentId + ' query failed with the error: ', err);\r\n\t\t\t\t\tthis.NotificationService.error('FAILED', err);\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis._changePaymentApprovalStatus(paymentId, 'querying', false);\r\n\t\t\t\tangular.element('#paymentViewModal').modal('hide');\r\n\t\t\t});\r\n\t}\r\n\r\n\tpopulateNewPaymentViewModal(paymentId) {\r\n\t\tthis.awaitQueries = true;\r\n\t\tfor (let i = 0; i < this.paymentsDataService.approvalsData.approvals.length; i++) {\r\n\t\t\tconst payment = this.paymentsDataService.approvalsData.approvals[i];\r\n\t\t\tif (payment.PaymentId == paymentId) {\r\n\t\t\t\tthis.webPaymentApprovalIndividual = payment;\r\n\t\t\t\tfor (let j = 0; j < this.webPaymentApprovalIndividual.Attachments.length; j++) {\r\n\t\t\t\t\tif (this.webPaymentApprovalIndividual.Attachments[j].IsInvoice) {\r\n\t\t\t\t\t\tthis.selectedDocumentIndex = j;\r\n\t\t\t\t\t\tthis.iframePaymentDocuments = this.$sce.trustAsResourceUrl(\r\n\t\t\t\t\t\t\tthis.webPaymentApprovalIndividual.Attachments[j].Path\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t//this._refreshEQCSS();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tpopulateHistoryPaymentViewModal(paymentId) {\r\n\t\tfor (let i = 0; i < this.paymentsDataService.approvalsData.approved.length; i++) {\r\n\t\t\tconst payment = this.paymentsDataService.approvalsData.approved[i];\r\n\t\t\tif (payment.PaymentId == paymentId) {\r\n\t\t\t\tthis.webPaymentApprovalIndividual = payment;\r\n\t\t\t\tfor (let j = 0; j < this.webPaymentApprovalIndividual.Attachments.length; j++) {\r\n\t\t\t\t\tif (this.webPaymentApprovalIndividual.Attachments[j].IsInvoice) {\r\n\t\t\t\t\t\tconst path = this.webPaymentApprovalIndividual.Attachments[j].Path.toLowerCase();\r\n\t\t\t\t\t\tif (\r\n\t\t\t\t\t\t\tpath.includes(\r\n\t\t\t\t\t\t\t\tthis.webPaymentApprovalIndividual.Attachments[j].DocumentExtension.toLowerCase()\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\tthis.iframePaymentDocuments = this.$sce.trustAsResourceUrl(path);\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthis.iframePaymentDocuments = this.$sce.trustAsResourceUrl(\r\n\t\t\t\t\t\t\t\tpath + this.webPaymentApprovalIndividual.Attachments[j].DocumentExtension\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.selectedDocumentIndex = j;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tgetInvoicePath(index = -1) {\r\n\t\tif (index === -1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst path = this.webPaymentApprovalIndividual.Attachments[index].Path.toLowerCase();\r\n\t\tif (path.includes(this.webPaymentApprovalIndividual.Attachments[index].DocumentExtension.toLowerCase()))\r\n\t\t\tthis.iframePaymentDocuments = this.$sce.trustAsResourceUrl(path);\r\n\t\telse {\r\n\t\t\tthis.iframePaymentDocuments = this.$sce.trustAsResourceUrl(\r\n\t\t\t\tpath + this.webPaymentApprovalIndividual.Attachments[index].DocumentExtension\r\n\t\t\t);\r\n\t\t}\r\n\t\tthis.selectedDocumentIndex = index;\r\n\t\t//mapping mobileview download button name.\r\n\t\tthis.selectedDocumentTypeDesc = this.webPaymentApprovalIndividual.Attachments[index].Name;\r\n\t}\r\n\r\n\tcheckPayment(paymentId) {\r\n\t\tfor (let i = 0; i < this.paymentsDataService.approvalsData.approvals.length; i++) {\r\n\t\t\tconst payment = this.paymentsDataService.approvalsData.approvals[i];\r\n\t\t\tif (payment.PaymentId == paymentId) {\r\n\t\t\t\tif (\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[i].hasOwnProperty('Checked') &&\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[i].Checked\r\n\t\t\t\t) {\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[i].Checked = false;\r\n\r\n\t\t\t\t\tconst newCopy = this.paymentsForBulkApproval.filter((pmt) => {\r\n\t\t\t\t\t\tvar shouldRemove = pmt.PaymentId !== paymentId;\r\n\t\t\t\t\t\treturn shouldRemove;\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.paymentsForBulkApproval = newCopy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.paymentsDataService.approvalsData.approvals[i].Checked = true;\r\n\t\t\t\t\tthis.paymentsForBulkApproval.push(this.paymentsDataService.approvalsData.approvals[i]);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisQuerying() {\r\n\t\tlet querying = false;\r\n\t\tconst queryingPayments = this.paymentsDataService.approvalsData.approvals.filter((payment) => {\r\n\t\t\tconst shouldInclude = payment.isQuerying;\r\n\t\t\treturn shouldInclude;\r\n\t\t});\r\n\t\tquerying = queryingPayments && queryingPayments.length > 0;\r\n\t\treturn querying;\r\n\t}\r\n\r\n\tselectDocumentPreview(index) {\r\n\t\tthis.selectedDocumentIndex = index;\r\n\t}\r\n\r\n\t_bulkStatusChange(ids, busy) {\r\n\t\tthis.paymentsDataService.approvalsData.approvals.map((payment) => {\r\n\t\t\tconst id = ids.find((_id) => {\r\n\t\t\t\treturn _id === payment.PaymentId;\r\n\t\t\t});\r\n\t\t\tif (id) {\r\n\t\t\t\tpayment.isApproving = busy;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_switchIsLoading(flag) {\r\n\t\tthis.$timeout(() => (this.isBusy = flag));\r\n\t}\r\n\t_switchIsSaving(flag) {\r\n\t\tthis.$timeout(() => (this.isBusySaving = flag));\r\n\t}\r\n\r\n\tasync updateHasDuplicateInvoice() {\r\n\t\tif (!this.addEditPayment.InvoiceNumber || !this.addEditPayment.ServiceProviderId) {\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\ttry {\r\n\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tthis.addEditPaymenOptions.isCheckingForDuplicateInvoice = true;\r\n\t\t\t\tthis.addEditPaymenOptions.showDuplicateInvoiceWarning = false;\r\n\t\t\t});\r\n\r\n\t\t\tconst hasDuplicateInvoice =\r\n\t\t\t\tawait this.paymentApprovalsDataService.checkInvoiceNumberHasDuplicate(\r\n\t\t\t\t\tthis.addEditPayment.ServiceProviderId,\r\n\t\t\t\t\tthis.addEditPayment.InvoiceNumber);\r\n\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tthis.addEditPaymenOptions.showDuplicateInvoiceWarning = hasDuplicateInvoice;\r\n\t\t\t});\r\n\r\n\t\t} catch (e) {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tthis.addEditPaymenOptions.showDuplicateInvoiceError = false;\r\n\t\t\t});\r\n\t\t\tConsole.error(e);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tthis.addEditPaymenOptions.isCheckingForDuplicateInvoice = false;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tasync getPaymentTypes() {\r\n\t\tif (!this.canPaymentcapture) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._switchIsLoading(true);\r\n\t\tawait this.paymentApprovalsDataService.getPaymentTypes()\r\n\t\t\t.then((data) => {\r\n\r\n\t\t\t\tconsole.log(\"data: \" + JSON.stringify(data));\r\n\t\t\t})\r\n\t\t\t.catch((err) => {\r\n\t\t\t\tconsole.error(err);\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis._switchIsLoading(false);\r\n\t\t\t});\r\n\r\n\t}\r\n\r\n\tasync searchServiceProvider() {\r\n\t\tthis.addEditPayment.ServiceProviderId = undefined;\r\n\t\tthis.paymentApprovalsDataService.serviceProviders = undefined;\r\n\t\tthis.addEditPaymenOptions.serviceProviderChecked = false;\r\n\t\tthis._switchIsSearching(true);\r\n\t\tawait this.paymentApprovalsDataService.searchServiceProvider(this.addEditPaymenOptions.searchServiceTerm)\r\n\t\t\t.then((data) => {\r\n\t\t\t\tconsole.log(\"data: \" + JSON.stringify(data));\r\n\t\t\t})\r\n\t\t\t.catch((err) => {\r\n\t\t\t\tconsole.error(err);\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis._switchIsSearching(false);\r\n\t\t\t});\r\n\t}\r\n\r\n\tselectServiceProvider() {\r\n\r\n\t\tif (this.paymentApprovalsDataService.serviceProviders) {\r\n\t\t\tfor (let i = 0; i < this.paymentApprovalsDataService.serviceProviders.length; i++) {\r\n\t\t\t\tconst payment = this.paymentApprovalsDataService.serviceProviders[i];\r\n\t\t\t\tif (payment.ServiceProviderId = this.addEditPayment.ServiceProviderId) {\r\n\t\t\t\t\tthis.selectedserviceProviderName = payment.ServiceProviderName;\r\n\t\t\t\t\tthis.selectedServiceProviderSector = payment.ServiceProviderSector;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (this.selectedserviceProviderName) {\r\n\t\t\t$(\"#ServiceProviderModal\").modal(\"hide\");\r\n\t\t}\r\n\t}\r\n\tcloseServiceProviderModel() {\r\n\t\tthis.addEditPaymenOptions.searchServiceTerm = undefined;\r\n\t\tthis.addEditPayment.ServiceProviderId = undefined;\r\n\t\tthis.paymentApprovalsDataService.serviceProviders = undefined;\r\n\t}\r\n\tcloseSavePaymentModel() {\r\n\t\tthis.addEditPaymenOptions.schemeConfirmed = false;\r\n\t\tthis.addEditPaymenOptions.serviceProviderConfirmed = false;\r\n\t\tthis.addEditPaymenOptions.invoiceNumberConfirmed = false;\r\n\t\tthis.addEditPaymenOptions.amountConfirmed = false;\r\n\t\tthis.addEditPaymenOptions.invoiceCaptureConfirmed = false;\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.addMainAttachmentWatch();\r\n\t\t})\r\n\t}\r\n\tpaymentByType() {\r\n\t\tif (this.addEditPayment.PaymentType && this.addEditPayment.PaymentType !== '') {\r\n\t\t\tthis.getCurrentVatRateForScheme();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.selectedserviceProviderName = undefined;\r\n\t\tthis.addEditPayment.ServiceProviderId = undefined;\r\n\t\tthis.addEditPaymenOptions.searchServiceTerm = undefined;\r\n\t\tthis.paymentApprovalsDataService.serviceProviders = undefined;\r\n\t\tthis.addEditPayment.InvoiceNumber = undefined;\r\n\t\tthis.addEditPayment.TotalInvoiceAmount = undefined;\r\n\t\tthis.addEditPaymenOptions.futureDatechecked = false;\r\n\t\tthis.addEditPayment.FuturePaymentDate = undefined;\r\n\t}\r\n\r\n\tinitializeDatePicker() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tconst selector = '#capturePaymentDate';\r\n\t\t\tconst $input = $('#capturePaymentDate');\r\n\t\t\tlet dateNow = new Date();\r\n\t\t\tlet minimumDate = moment(dateNow).add(3, 'd').toDate();\r\n\t\t\tconst startDate = moment(minimumDate).toDate();\r\n\t\t\tconst options = {\r\n\t\t\t\tstartDate,\r\n\t\t\t\tautoclose: true,\r\n\t\t\t\tforceParse: true,\r\n\t\t\t\tformat: 'yyyy/mm/dd',\r\n\t\t\t\tassumeNearbyYear: true,\r\n\t\t\t\tenableOnReadonly: true,\r\n\t\t\t\tcontainer: selector\r\n\t\t\t};\r\n\t\t\t$input.datepicker(options);\r\n\t\t}, 10000);\r\n\t}\r\n\r\n\tasync getGLAccounts(searchAccoutTerm) {\r\n\t\tif (searchAccoutTerm.length < 2) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlet glAccountResults = await this.paymentApprovalsDataService.SearchGLAccounts(searchAccoutTerm, this.currentSchemeRef);\r\n\t\tglAccountResults = [...glAccountResults].splice(0, 8);\r\n\t\treturn glAccountResults;\r\n\t}\r\n\r\n\taddNewAllocationRow() {\r\n\t\tconst addAllocationAmount = this.FixNumber(this.Allocations.Amount);\r\n\t\tconst addAllocationAccount = this.Allocations.GLAccount;\r\n\t\tconst accountName = addAllocationAccount ? addAllocationAccount.AccountName : null;\r\n\t\tconst accountCode = addAllocationAccount ? addAllocationAccount.AccountCode : null;\r\n\r\n\t\tif (isNaN(addAllocationAmount) || addAllocationAmount == 0 || typeof addAllocationAccount === undefined || accountName == null || accountCode == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.allocationAccountAlreadyAddedToPayment()) {\r\n\t\t\tthis.Allocations.Amount = undefined;\r\n\t\t\tthis.Allocations.GLAccount = undefined;\r\n\t\t\talert('You have already added an allocation for this account.');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst newRow = {\r\n\t\t\tamount: this.FixNumber(addAllocationAmount),\r\n\t\t\taccountCode: accountCode,\r\n\t\t\taccountName: accountName\r\n\t\t};\r\n\r\n\t\tthis.allocationRows.push(newRow);\r\n\t\tthis.Allocations.Amount = undefined;\r\n\t\tthis.Allocations.GLAccount = undefined;\r\n\t}\r\n\r\n\tremoveAllocationRow(allocationRow) {\r\n\t\tconst rowIndex = this.allocationRows.indexOf(allocationRow);\r\n\r\n\t\tif (rowIndex > -1) {\r\n\t\t\tthis.allocationRows.splice(rowIndex, 1)\r\n\t\t}\r\n\t}\r\n\r\n\tFixNumber(brokenNumber) {\r\n\t\tconst fixedNumber = Number(Number(brokenNumber).toFixed(2));\r\n\t\treturn fixedNumber;\r\n\t}\r\n\r\n\ttotalAllocationAmount() {\r\n\t\tlet renurnVal = this.FixNumber(0.00);\r\n\r\n\t\tif ([...this.allocationRows].length > 0) {\r\n\t\t\t[...this.allocationRows].forEach(element => {\r\n\t\t\t\trenurnVal = renurnVal + this.FixNumber(element.amount);\r\n\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn renurnVal;\r\n\t}\r\n\r\n\tAllocationAmountMatchedInvoiceTotal() {\r\n\t\tlet TotalInvoiceAmount = this.FixNumber(this.addEditPayment.TotalInvoiceAmount);\r\n\t\tif (this.totalAllocationAmount() == TotalInvoiceAmount) {\r\n\t\t\tthis.allocationAmountMatchedInvoiceTotal = true;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.allocationAmountMatchedInvoiceTotal = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tallocationAccountAlreadyAddedToPayment() {\r\n\t\tlet acccode = this.Allocations.GLAccount.AccountCode;\r\n\t\tconst existingAllocation = [...this.allocationRows].find(element => (element.accountCode == acccode));\r\n\r\n\t\treturn !!existingAllocation\r\n\t}\r\n\r\n\thasPaymentTypeBeenSelected() {\r\n\t\treturn this.addEditPayment.PaymentType ? true : false;\r\n\t}\r\n\r\n\tcanAddEditPaymentBeSubmitted() {\r\n\t\tconst hasSelectedServiceProvider = this.addEditPayment.ServiceProviderId ? true : false;\r\n\t\tconst hasInvoiceNumber = this.addEditPayment.InvoiceNumber ? true : false;\r\n\t\tconst hasValidTotalAmount = this.addEditPayment.TotalInvoiceAmount ? true : false;\r\n\t\tconst totalallocationsMatchTotalAmount = this.allocationAmountMatchedInvoiceTotal;\r\n\t\tthis.addEditPaymenOptions.futureDatechecked ? this.addEditPayment.FuturePaymentDate : this.addEditPayment.FuturePaymentDate = undefined;\r\n\t\tconst futureDatedPaymentIsValid = this.addEditPaymenOptions.futureDatechecked ? ((this.addEditPayment.FuturePaymentDate !== undefined) ? true : false) : true;\r\n\t\tconst hasNoDuplicateInvoiceNumber = \r\n\t\t\t!this.addEditPaymenOptions.showDuplicateInvoiceWarning && !this.addEditPaymenOptions.showDuplicateInvoiceError;\r\n\r\n\t\tconst hasInvoiceBeenUploaded = !!this.addEditPayment.Invoice;\r\n\t\tthis.captureFormErrors();\r\n\r\n\t\tconst canAddEditPaymentBeSubmitted = this.hasPaymentTypeBeenSelected() && hasSelectedServiceProvider && hasInvoiceNumber &&\r\n\t\t\thasValidTotalAmount && totalallocationsMatchTotalAmount && futureDatedPaymentIsValid && hasInvoiceBeenUploaded && hasNoDuplicateInvoiceNumber;\r\n\r\n\t\tif (canAddEditPaymentBeSubmitted) {\r\n\t\t\tlet paymentPayload = {\r\n\t\t\t\t\"Allocations\": [],\r\n\t\t\t\t\"Attachments\": [],\r\n\t\t\t\t\"AmountString\": this.addEditPayment.TotalInvoiceAmount.toString(),\r\n\t\t\t\t\"Amount\": this.addEditPayment.TotalInvoiceAmount,\r\n\t\t\t\t\"InvoiceNumber\": this.addEditPayment.InvoiceNumber,\r\n\t\t\t\t\"SchemeReference\": this.currentSchemeRef,\r\n\t\t\t\t\"ServiceProviderId\": this.addEditPayment.ServiceProviderId,\r\n\t\t\t\t\"IsTaxable\": this.addEditPayment.IsTaxable,\r\n\t\t\t\t\"FuturePaymentDate\": this.addEditPayment.FuturePaymentDate,\r\n\t\t\t\t\"IsFutureDatedPayment\": this.addEditPaymenOptions.futureDatechecked,\r\n\t\t\t\t\"HasDuplicateWarningBeenShown\": this.addEditPayment.showDuplicateInvoiceWarning,\r\n\t\t\t\t\"VatRatePercentage\": this.addEditPayment.VatRatePercentage,\r\n\t\t\t\t\"PaymentTypeId\": this.addEditPayment.PaymentType\r\n\t\t\t}\r\n\r\n\t\t\tthis.allocationRows.forEach(element => {\r\n\t\t\t\tconst allocationPayload = {\r\n\t\t\t\t\t\"AccountNumber\": element.accountCode,\r\n\t\t\t\t\t\"AmountString\": element.amount.toString(),\r\n\t\t\t\t\t\"Amount\": element.amount,\r\n\t\t\t\t\t\"AmountWithTax\": null\r\n\t\t\t\t}\r\n\r\n\t\t\t\tpaymentPayload.Allocations.push(allocationPayload);\r\n\t\t\t});\r\n\r\n\t\t\tconst attachmentBlobPayload = [];\r\n\r\n\t\t\t//Split out the invoice data from the blob\r\n\t\t\tpaymentPayload.Attachments.push(\r\n\t\t\t\t{\r\n\t\t\t\t\t\"FileType\": \".pdf\",\r\n\t\t\t\t\t\"OriginalFileName\": this.addEditPayment.Invoice.FileName,\r\n\t\t\t\t\t\"Blob\": undefined,\r\n\t\t\t\t\t\"IsInvoice\": true\r\n\t\t\t\t}\r\n\t\t\t);\r\n\r\n\t\t\tattachmentBlobPayload.push(this.addEditPayment.Invoice.Blob);\r\n\r\n\t\t\t//split out the supporting docs data from the blob\r\n\t\t\tif (this.addEditPayment.SupportingDocuments) {\r\n\t\t\t\t[...this.addEditPayment.SupportingDocuments].forEach(element => {\r\n\t\t\t\t\tpaymentPayload.Attachments.push(\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"FileType\": \".pdf\",\r\n\t\t\t\t\t\t\t\"OriginalFileName\": element.FileName,\r\n\t\t\t\t\t\t\t\"Blob\": undefined,\r\n\t\t\t\t\t\t\t\"IsInvoice\": false\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tattachmentBlobPayload.push(element.Blob);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.paymentPayload = paymentPayload;\r\n\t\t\tthis.attachmentBlobPayload = attachmentBlobPayload;\r\n\t\t}\r\n\t\treturn canAddEditPaymentBeSubmitted;\r\n\r\n\t}\r\n\r\n\tasync addSubmitNewPayment() {\r\n\t\tif (this.canAddEditPaymentBeSubmitted() || true && !this.captureFormErrors()) {\r\n\t\t\tthis._switchIsSaving(true);\r\n\t\t\ttry {\r\n\t\t\t\t$(\"#SavePaymentCaptureModal\").modal(\"hide\");\r\n\t\t\t\tconst submitPaymentResult = await this.paymentApprovalsDataService.submitPaymentForApporval(this.paymentPayload, this.attachmentBlobPayload);\r\n\t\t\t\tif (submitPaymentResult.statusText == \"OK\") {\r\n\t\t\t\t\tthis.NotificationService.success('PAYMENT SAVED SUCCESSFULLY');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.NotificationService.error('PAYMENT SAVING FAILED');\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error(error);\r\n\t\t\t} finally {\r\n\t\t\t\tthis.resetPaymentData();\r\n\t\t\t\tthis.$timeout(() => {\r\n\t\t\t\t\tthis.addMainAttachmentWatch();\r\n\t\t\t\t})\r\n\t\t\t\tthis._switchIsSaving(false);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\taddMainAttachmentWatch() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\t$('input[type=file].mainAttachmentBrowseFile').each((i, el) =>\r\n\t\t\t\t$(el).on('change', (evt) => {\r\n\t\t\t\t\tevt.preventDefault();\r\n\t\t\t\t\tconst $target = $(evt.target);\r\n\t\t\t\t\tconst container = $target.closest('div[files-drop]');\r\n\t\t\t\t\tconst attrs = container.attr('files-drop').toLowerCase();\r\n\r\n\t\t\t\t\tlet type = 0;\r\n\r\n\t\t\t\t\tif (attrs.includes('invoice')) {\r\n\t\t\t\t\t\ttype = 1;\r\n\t\t\t\t\t} else if (attrs.includes('supporting documents')) {\r\n\t\t\t\t\t\ttype = 2;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (type == 0) {\r\n\t\t\t\t\t\tconsole.error('Cant determine doc type.');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst file = evt.target.files[0];\r\n\r\n\t\t\t\t\tthis.readAndStore(file, type);\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t\t}, 5000);\r\n\t}\r\n\r\n\thandleDrop(files, type) {\r\n\t\tconsole.log('handleDrop');\r\n\r\n\t\tif (type == 'Invoice') {\r\n\t\t\ttype = 1;\r\n\t\t} else if (type == 'Supporting Documents') {\r\n\t\t\ttype = 2;\r\n\t\t}\r\n\t\tthis.uploadFile(files[0], type);\r\n\t}\r\n\r\n\tuploadFile(file, type) {\r\n\t\tif (file) {\r\n\t\t\tthis.readAndStore(file, type);\r\n\t\t} else {\r\n\t\t\tconsole.error('No file And/Or purchaser', this.addEditPayment);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treadAndStore(file, type) {\r\n\t\tif (file.type !== 'application/pdf') {\r\n\t\t\tconst errorMsg = 'Wrong file type, only PDFs are allowed.';\r\n\t\t\tthis.NotificationService.error(errorMsg);\r\n\r\n\t\t\tconsole.error(\r\n\t\t\t\t`${errorMsg} \"${file.name}\" is not in the correct format for ${type} - only PDFs are allowed.`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\telse if (file.size >= 2097152) {\r\n\t\t\tconst errorMsg = 'file size exceeded limit not allowed to upload.';\r\n\t\t\tthis.NotificationService.error(errorMsg);\r\n\r\n\t\t\tconsole.error(\r\n\t\t\t\t`${errorMsg} \"${file.name}\" is exceeded limit, current file size \"${file.size}\" bytes - only below 2MB file size allowed.`\r\n\t\t\t);\r\n\r\n\t\t} else {\r\n\t\t\tconst reader = new FileReader();\r\n\t\t\treader.onload = () => {\r\n\t\t\t\tthis.$timeout(() => {\r\n\t\t\t\t\tconst description = file.name;\r\n\r\n\t\t\t\t\tif (type == 1) {\r\n\t\t\t\t\t\tconst newInvoiceattachment = {\r\n\t\t\t\t\t\t\tFileName: description,\r\n\t\t\t\t\t\t\tDocumentType: type,\r\n\t\t\t\t\t\t\tBlob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tthis.addEditPayment.Invoice = newInvoiceattachment;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (type == 2) {\r\n\t\t\t\t\t\tconst newSupportattachment = {\r\n\t\t\t\t\t\t\tFileName: description,\r\n\t\t\t\t\t\t\tDocumentType: type,\r\n\t\t\t\t\t\t\tBlob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\tthis.addEditPayment.SupportingDocuments.push(newSupportattachment);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t};\r\n\r\n\t\t\treader.readAsArrayBuffer(file);\r\n\t\t}\r\n\r\n\r\n\t}\r\n\r\n\tdeleteAttachmentNag(attachment) {\r\n\t\tthis.selectedAttachment = attachment;\r\n\t}\r\n\r\n\thideModal(modal = 'deleteAttachmentNag') {\r\n\t\tconst $modal = $(`#${modal}`);\r\n\t\t$modal.on('hide.bs.modal', () => {\r\n\t\t\t$('div.modal-backdrop.fade.in').each((i, el) => {\r\n\t\t\t\tconst $el = $(el);\r\n\t\t\t\tconst id = $el.attr('id');\r\n\r\n\t\t\t\tif (!id) {\r\n\t\t\t\t\t$el.remove();\r\n\t\t\t\t\t$('body').attr('style', `overflow-y:visible !important`);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t$modal.modal('hide');\r\n\t}\r\n\r\n\tdeleteAttachment() {\r\n\t\tthis.hideModal();\r\n\t\tif (this.selectedAttachment.DocumentType == 1) {\r\n\t\t\tthis.addEditPayment.Invoice = undefined;\r\n\t\t}\r\n\r\n\t\telse if (this.selectedAttachment.DocumentType == 2) {\r\n\t\t\tconst rowIndex = this.addEditPayment.SupportingDocuments.indexOf(this.selectedAttachment);\r\n\r\n\t\t\tif (rowIndex > -1) {\r\n\t\t\t\tthis.addEditPayment.SupportingDocuments.splice(rowIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcaptureFormErrors() {\r\n\t\tlet results = [];\r\n\r\n\t\tconst PaymentType = this.addEditPayment.PaymentType,\r\n\t\t\tServiceProviderId = this.addEditPayment.ServiceProviderId,\r\n\t\t\tInvoiceNumber = this.addEditPayment.InvoiceNumber,\r\n\t\t\tTotalInvoiceAmount = this.addEditPayment.TotalInvoiceAmount,\r\n\t\t\tFuturePaymentDateChecked = this.addEditPaymenOptions.futureDatechecked,\r\n\t\t\tFuturePaymentDate = FuturePaymentDateChecked ? this.addEditPayment.FuturePaymentDate : '',\r\n\t\t\tAllocations = this.allocationRows,\r\n\t\t\tInvoice = this.addEditPayment.Invoice;\r\n\r\n\t\tconst fieldsForValidation = {\r\n\t\t\tPaymentType,\r\n\t\t\tServiceProviderId,\r\n\t\t\tInvoiceNumber,\r\n\t\t\tTotalInvoiceAmount,\r\n\t\t\tFuturePaymentDateChecked,\r\n\t\t\tFuturePaymentDate,\r\n\t\t\tAllocations,\r\n\t\t\tInvoice,\r\n\t\t};\r\n\r\n\t\tconst customErrorMessages = {\r\n\t\t\tnumeric: ':attribute must be a number.',\r\n\t\t\trequired: ':attribute is required.',\r\n\t\t};\r\n\r\n\t\tconst displayLabels = {\r\n\t\t\tPaymentType: 'Payment Type',\r\n\t\t\tServiceProviderId: 'Service ProviderId',\r\n\t\t\tInvoiceNumber: 'Invoice Number',\r\n\t\t\tTotalInvoiceAmount: 'Total Invoice Amount',\r\n\t\t\tFuturePaymentDate: 'Future PaymentDate',\r\n\t\t\tAllocations: 'Allocations',\r\n\t\t\tInvoice: 'Invoice',\r\n\t\t};\r\n\r\n\t\tconst rules = {\r\n\t\t\tPaymentType: 'required',\r\n\t\t\tServiceProviderId: 'required',\r\n\t\t\tInvoiceNumber: 'required',\r\n\t\t\tTotalInvoiceAmount: 'required',\r\n\t\t\tFuturePaymentDate: [{ required_if: ['FuturePaymentDateChecked', true] }],\r\n\t\t\tAllocations: 'required',\r\n\t\t\tInvoice: 'required',\r\n\t\t};\r\n\r\n\r\n\r\n\t\tconst validator = new Validator(fieldsForValidation, rules, customErrorMessages);\r\n\t\tvalidator.setAttributeNames(displayLabels);\r\n\r\n\t\tvalidator.passes();\r\n\t\tif (validator.errorCount > 0) {\r\n\t\t\tObject.keys(validator.errors.errors).forEach((name) => {\r\n\t\t\t\tlet error = validator.errors.first(name);\r\n\r\n\t\t\t\tswitch (error) {\r\n\t\t\t\t\tcase \"Allocations is required.\":\r\n\t\t\t\t\t\terror = \"at least one or more Allocations required\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"The Future PaymentDate field is required when FuturePaymentDateChecked is true.\":\r\n\t\t\t\t\t\terror = \"Future PaymentDate is required.\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresults = [...results, error];\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\tasync canSubmitPaymentForApproval() {\r\n\t\tthis._switchIsSaving(true);\r\n\t\tlet userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\t\tuserProfile.BuildingProfiles.find((building) => {\r\n\t\t\tconst buildingRef = building.SchemeReference;\r\n\t\t\tif (buildingRef === this.currentSchemeRef) {\r\n\t\t\t\treturn this.selectedSchemeName = building.SchemeName;\r\n\t\t\t}\r\n\t\t});\r\n\t\tconst request = {\r\n\t\t\tSchemeReference: this.paymentPayload.SchemeReference,\r\n\t\t\tAllocationCodes: [...this.paymentPayload.Allocations].map(x => x.AccountNumber),\r\n\t\t\tServiceProviderId: this.paymentPayload.ServiceProviderId,\r\n\t\t\tAmount: this.paymentPayload.Amount,\r\n\t\t\tCapturingUsername: null,\r\n\t\t\tPaymentTypeId: this.paymentPayload.PaymentTypeId,\r\n\t\t\tPaymentStatus: null\r\n\t\t};\r\n\t\tthis.cansubmitpayment = await this.paymentApprovalsDataService.canSubmitPaymentForApproval(request);\r\n\t\t$(\"#SavePaymentCaptureModal\").modal(\"show\");\r\n\t\tthis._switchIsSaving(false);\r\n\t\treturn this.cansubmitpayment;\r\n\t}\r\n\r\n\tchecksSuccessonSubmit() {\r\n\t\tthis.cansubmitpayment = this.cansubmitpayment;\r\n\t\tlet checksubmit = this.addEditPaymenOptions.schemeConfirmed && this.addEditPaymenOptions.serviceProviderConfirmed\r\n\t\t\t&& this.addEditPaymenOptions.invoiceNumberConfirmed && this.addEditPaymenOptions.amountConfirmed &&\r\n\t\t\tthis.addEditPaymenOptions.invoiceCaptureConfirmed;\r\n\t\tif (checksubmit) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tasync getCurrentVatRateForScheme() {\r\n\t\tlet currentVatRate = null;\r\n\t\tcurrentVatRate = await this.paymentApprovalsDataService.getCurrentVatRateForScheme(this.currentSchemeRef);\r\n\t\tif (currentVatRate && currentVatRate != null) {\r\n\t\t\tthis.addEditPayment.IsTaxable = true;\r\n\t\t\tthis.addEditPayment.VatRatePercentage = currentVatRate;\r\n\t\t}\r\n\t\treturn currentVatRate;\r\n\t}\r\n\r\n\tasync isPaymentBandEnabledBySchemeRef() {\r\n\t\tthis._switchIsSaving(true);\r\n\t\tlet isPaymentBandEnabled = null;\r\n\t\tisPaymentBandEnabled = await this.paymentApprovalsDataService.isPaymentBandEnabledBySchemeRef(this.currentSchemeRef);\r\n\t\tif (isPaymentBandEnabled && isPaymentBandEnabled != null) {\r\n\t\t\tthis.isPaymentBandEnabled = true;\r\n\t\t}\r\n\t\tthis._switchIsSaving(false);\r\n\t\treturn isPaymentBandEnabled;\r\n\t}\r\n}\r\n","/* @ngInject */\r\nexport default class PersonalDocumentsCtrl {\r\n\tconstructor(\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\t$window,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tTelemetryService,\r\n\t\tBuildingsService,\r\n\t\tNavigationService,\r\n\t\tNotificationService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService,\r\n\t\tpersonalDocumentsDataService\r\n\t) {\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.$window = $window;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.TelemetryService = TelemetryService;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.NavigationService = NavigationService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\t\tthis.personalDocumentsDataService = personalDocumentsDataService;\r\n\r\n\t\tthis.init();\r\n\t\tthis.activate();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.loading = true;\r\n\t\tthis.personalDocumentsFlatFile = [];\r\n\t\tthis.personalDocuments = [];\r\n\t\tthis.content = undefined;\r\n\t\tthis.selectedCardCode = null;\r\n\t\tthis.selectedFolder = null;\r\n\t\tthis.personalDocumentsBreadCrumbs = [\r\n\t\t\t{\r\n\t\t\t\tTitle: 'Home',\r\n\t\t\t\tLevel: null,\r\n\t\t\t\tId: null,\r\n\t\t\t\tParentId: null\r\n\t\t\t}\r\n\t\t];\r\n\t\tthis._switchIsBusy(false);\r\n\t\tthis.$scope.$on('selected-building-changed', (event, newValue) => {\r\n\t\t\tthis.onSelectedBuildingChanged(event, newValue);\r\n\t\t});\r\n\t}\r\n\r\n\tactivate() {\r\n\t\tthis._switchIsBusy(true);\r\n\t\tif (this.$state.params && this.$state.params.hasOwnProperty('cardCode')) {\r\n\t\t\tthis.selectedCardCode = this.$state.params.cardCode;\r\n\t\t}\r\n\t\tif (this.$state.params && this.$state.params.hasOwnProperty('folder')) {\r\n\t\t\tthis.selectedFolder = this.$state.params.folder;\r\n\t\t}\r\n\t\tthis.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\t\tif (this.selectedCardCode) { //Account History selectedbuilding Invoices \r\n\t\t\tthis.selectedBuildingRef = this.selectedCardCode.substring(1, 4);\r\n\t\t}\r\n\t\tif (!!!this.selectedBuildingRef) {\r\n\t\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\t\t\tconst { BuildingProfiles } = userProfile;\r\n\t\t\tif (BuildingProfiles && BuildingProfiles.length > 0) {\r\n\t\t\t\tthis.selectedBuildingRef = BuildingProfiles[0].SchemeReference;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.onSelectedBuildingChanged({}, this.selectedBuildingRef);\r\n\t}\r\n\r\n\tasync getPersonalDocuments(schemeRef) {\r\n\t\tthis.personalDocumentsFlatFile = [];\r\n\t\tthis.personalDocuments = [];\r\n\t\tthis._switchIsBusy(true);\r\n\t\ttry {\r\n\t\t\tconst data = await this.personalDocumentsDataService.getPersonalDocuments(schemeRef);\r\n\t\t\tdata.forEach((document) => {\r\n\t\t\t\tthis.personalDocumentsFlatFile.push(document);\r\n\t\t\t\tthis.personalDocuments.push(document);\r\n\t\t\t});\r\n\r\n\t\t\tthis.personalDocumentsBreadCrumbs = [\r\n\t\t\t\t{\r\n\t\t\t\t\tTitle: 'Home',\r\n\t\t\t\t\tLevel: null,\r\n\t\t\t\t\tId: null,\r\n\t\t\t\t\tParentId: null\r\n\t\t\t\t}\r\n\t\t\t];\r\n\t\t} catch (err) {\r\n\t\t\tthis.NotificationService.error('COULD NOT PERSONAL DOCUMENTS');\r\n\t\t\tconsole.error(err);\r\n\t\t} finally {\r\n\t\t\tif (this.selectedCardCode) {\r\n\t\t\t\tthis.openCardCodeFolder();\r\n\t\t\t} else {\r\n\t\t\t\tthis._switchIsBusy(false);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tonSelectedBuildingChanged(event, schemeRef) {\r\n\t\tthis._switchIsBusy(true);\r\n\t\tthis.SchemeRef = schemeRef ? schemeRef : this.selectedBuildingRef;\r\n\t\tif (this.SchemeRef && this.SchemeRef.length > 2) {\r\n\t\t\tthis._switchIsBusy(true);\r\n\t\t\tthis.getPersonalDocuments(schemeRef);\r\n\t\t}\r\n\t\t//this.$parent.loadTilesData();\r\n\t}\r\n\r\n\topenFiles() {\r\n\t\t$('.open-docs').trigger('click');\r\n\t}\r\n\r\n\tasync personalDocumentsFolderClick(id) {\r\n\t\tthis.NavigationService.gotoTop();\r\n\t\tlet document;\r\n\t\tfor (let i = 0; i < this.personalDocumentsFlatFile.length; i++) {\r\n\t\t\tdocument = this.personalDocumentsFlatFile[i];\r\n\t\t\tif (document.Id === id) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (document.Level === 0 || document.Level === 1 || document.Level === 2) {\r\n\t\t\tconst tempBreadCrumbs = {\r\n\t\t\t\tTitle: document.Title,\r\n\t\t\t\tLevel: document.Level,\r\n\t\t\t\tId: document.Id,\r\n\t\t\t\tParentId: document.ParentId\r\n\t\t\t};\r\n\r\n\t\t\tthis.personalDocumentsBreadCrumbs.push(tempBreadCrumbs);\r\n\t\t\tconst index = _.findIndex(this.personalDocumentsFlatFile, (doc) => doc.Id === document.Id);\r\n\r\n\t\t\tthis.personalDocumentsFlatFile = this.personalDocumentsFlatFile[index].Children;\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (document.Level === 3) {\r\n\t\t\tconst baseURL = this.InternalLinksService.getLink('GetPersonalDocumentById');\r\n\t\t\tconst url = baseURL.replace('{id}', document.Id);\r\n\r\n\t\t\tconst documentTab = this.$window.open(url, '_blank');\r\n\t\t\tdocumentTab.document.title = document.Title;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tconst description = `Document ID: ${id}`;\r\n\t\t\t\tawait this.TelemetryService.logTelemetry('View Personal Document', description);\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error(`Error while logging Telemetry for Personal Document: ${description}`);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tpersonalDocumentsBreadCrumbClick(breadCrumb) {\r\n\t\tconst length = this.personalDocumentsBreadCrumbs.length;\r\n\t\tif (this.personalDocumentsBreadCrumbs[length - 1].Id === breadCrumb.Id) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (breadCrumb.Level === null) {\r\n\t\t\tthis.personalDocumentsFlatFile = [];\r\n\t\t\tthis.personalDocumentsBreadCrumbs = [\r\n\t\t\t\t{\r\n\t\t\t\t\tTitle: 'Home',\r\n\t\t\t\t\tLevel: null,\r\n\t\t\t\t\tId: null,\r\n\t\t\t\t\tParentId: null\r\n\t\t\t\t}\r\n\t\t\t];\r\n\t\t\tthis.personalDocumentsFlatFile = this.personalDocuments;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (breadCrumb.Level === 0 || breadCrumb.Level === 1) {\r\n\t\t\tfor (let i = 0; i < this.personalDocuments.length; i++) {\r\n\t\t\t\tconst topLevelDocument = this.personalDocuments[i];\r\n\t\t\t\tif (topLevelDocument.Id === breadCrumb.Id) {\r\n\t\t\t\t\tthis.personalDocumentsFlatFile = topLevelDocument.Children;\r\n\t\t\t\t\tif (length === 4) {\r\n\t\t\t\t\t\tthis.personalDocumentsBreadCrumbs.pop();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.personalDocumentsBreadCrumbs.pop();\r\n\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tfor (let j = 0; j < topLevelDocument.Children.length; j++) {\r\n\t\t\t\t\tconst documentOrignal = topLevelDocument.Children[j];\r\n\t\t\t\t\tif (documentOrignal.Id === breadCrumb.Id) {\r\n\t\t\t\t\t\tthis.personalDocumentsFlatFile = documentOrignal.Children;\r\n\t\t\t\t\t\tthis.personalDocumentsBreadCrumbs.splice(-1, 1);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (breadCrumb.Level === 2) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\topenCardCodeFolder() {\r\n\t\tif (this.personalDocumentsFlatFile && this.personalDocumentsFlatFile.length > 0) {\r\n\t\t\tif (this.personalDocumentsFlatFile[0].Level === 0) {\r\n\t\t\t\tlet document;\r\n\t\t\t\tfor (let i = 0; i < this.personalDocumentsFlatFile.length; i++) {\r\n\t\t\t\t\tdocument = this.personalDocumentsFlatFile[i];\r\n\t\t\t\t\tif (document.Title === this.selectedCardCode) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst tempBreadCrumbs = {\r\n\t\t\t\t\tTitle: document.Title,\r\n\t\t\t\t\tLevel: document.Level,\r\n\t\t\t\t\tId: document.Id,\r\n\t\t\t\t\tParentId: document.ParentId\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.personalDocumentsBreadCrumbs.push(tempBreadCrumbs);\r\n\t\t\t\tconst index = _.findIndex(this.personalDocumentsFlatFile, (doc) => doc.Id === document.Id);\r\n\r\n\t\t\t\tthis.personalDocumentsFlatFile = this.personalDocumentsFlatFile[index].Children;\r\n\t\t\t}\r\n\t\t\tif (this.selectedFolder) {\r\n\t\t\t\tthis.openFolder();\r\n\t\t\t} else {\r\n\t\t\t\tthis._switchIsBusy(false);\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._switchIsBusy(false);\r\n\t}\r\n\r\n\topenFolder() {\r\n\t\tif (this.personalDocumentsFlatFile && this.personalDocumentsFlatFile.length > 0) {\r\n\t\t\tif (this.personalDocumentsFlatFile[0].Level === 1) {\r\n\t\t\t\tlet document;\r\n\t\t\t\tfor (let i = 0; i < this.personalDocumentsFlatFile.length; i++) {\r\n\t\t\t\t\tdocument = this.personalDocumentsFlatFile[i];\r\n\t\t\t\t\tif (document.Title === this.selectedFolder) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst tempBreadCrumbs = {\r\n\t\t\t\t\tTitle: document.Title,\r\n\t\t\t\t\tLevel: document.Level,\r\n\t\t\t\t\tId: document.Id,\r\n\t\t\t\t\tParentId: document.ParentId\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.personalDocumentsBreadCrumbs.push(tempBreadCrumbs);\r\n\t\t\t\tconst index = _.findIndex(this.personalDocumentsFlatFile, (doc) => doc.Id === document.Id);\r\n\r\n\t\t\t\tthis.personalDocumentsFlatFile = this.personalDocumentsFlatFile[index].Children;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._switchIsBusy(false);\r\n\t}\r\n\r\n\t_switchIsBusy(flag) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.isBusy = flag;\r\n\t\t});\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass PersonalDocumentsService {\r\n\tconstructor($http, Utility, $timeout, $rootScope, ContentService, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.ContentService = ContentService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.personalDocumentsData = null;\r\n\t\tthis.InternalLinksService.getLinks('/api/documents/links');\r\n\t}\r\n\r\n\tasync getPersonalDocuments(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!schemeRef) {\r\n\t\t\t\tthrow 'No Building reference provided...';\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetWebPersonalDocuments');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/documents/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetWebPersonalDocuments');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef).trim();\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tthis.personalDocumentsData = results.data;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(this.personalDocumentsData));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while searching for account history.`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(msg, err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tContentService,\r\n\tLocalStorageService,\r\n\tInternalLinksService\r\n) =>\r\n\tnew PersonalDocumentsService(\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tContentService,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService\r\n\t);\r\n","const base64js = require('base64-js');\r\nimport Validator from 'validatorjs';\r\n\r\n/* @ngInject */\r\nexport default class RentalsCaptureCtrl {\r\n constructor($scope, $rootScope, $timeout, RentalsCaptureService, NotificationService, LocalStorageService, CountriesUtilService) {\r\n this.$scope = $scope;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.LocalStorageService = LocalStorageService;\r\n this.NotificationService = NotificationService;\r\n this.RentalsCaptureService = RentalsCaptureService;\r\n this.CountriesUtilService = CountriesUtilService;\r\n\r\n this.init();\r\n this._registerEventHandler();\r\n this.activate();\r\n this.loadSignaturePads();\r\n }\r\n\r\n init() {\r\n this.isBusy = false;\r\n this.howToGuideLink;\r\n this.attachment = {};\r\n this.documentType = '0';\r\n this.selectedAttachment = {};\r\n this.showOtherMaritalStatus = false;\r\n this.hasClearanceHeaderBeenSaved = false;\r\n this.secondApplicationChosen = false;\r\n this.thirdApplicationChosen = false;\r\n this.fourthApplicationChosen = false;\r\n this.isFirstApplicantPartner = false;\r\n this.isSecondApplicantPartner = false;\r\n this.isThirdApplicantPartner = false;\r\n this.signaturedata = null;\r\n this.RentalInitialApplicationsIDFetched = null;\r\n this.formsErrors = {\r\n acknowledgmentSection: [],\r\n firstApplicant: [],\r\n secondApplicant: [],\r\n thirdApplicant: [],\r\n fourthApplicant: [],\r\n generalSection: [],\r\n declarationSection: []\r\n };\r\n\r\n const today = new Date();\r\n let year = today.getFullYear();\r\n\r\n this.documentTypeListLoaded = [{}];\r\n this.headerDocumentsAlreadyUpLoaded = [{}];\r\n\r\n var urlToken = window.location.search;\r\n const myArray = urlToken.split(\"=\");\r\n var rentalsApplicationToken = myArray[1];\r\n var rentalInitialApplicationsData = this.$timeout(async () => {\r\n try {\r\n this.RentalInitialApplicationsIDFetched = await this.RentalsCaptureService.getRentalInitialApplication(rentalsApplicationToken);\r\n }\r\n catch (e) {\r\n console.log(\"failed to get data\");\r\n }\r\n finally {\r\n this.setRentalInitialData();\r\n }\r\n });\r\n\r\n this.rentalsHeader = {\r\n Id: 'ABD6F6D3-12DD-4261-90F5-45B568A7E53A',\r\n WhoIsApplying: \"\",\r\n premisesAddress: \"\",\r\n rentalAmount: null,\r\n leasePeriod: 12,\r\n RentalInitialApplicationsID: \"\",\r\n OccupationDate: null\r\n };\r\n\r\n this.firstPerson = {\r\n fullName: \"\",\r\n ApplicantNumber: 1,\r\n ID_Passport: \"\",\r\n Nationality: \"\",\r\n DateOfBirth: \"\",\r\n email: \"\",\r\n Telephone_Home: null,\r\n Telephone_Cell: null,\r\n MaritalStatus: null,\r\n nextOfKinName: \"\",\r\n nextOfKinTelephone: null,\r\n CurrentStreet: \"\",\r\n CurrentSuburb: \"\",\r\n CurrentCity: \"\",\r\n CurrentProvince: \"\",\r\n CurrentPostalCode: \"\",\r\n ID_Attachment: null,\r\n ProofOfAddressAttachment: null,\r\n OwnCurrentResidence: null,\r\n landlordName: \"\",\r\n LandlordNumber: null,\r\n landlordEmail: \"\",\r\n RentalAmountPaid: null,\r\n TimeLivingAtResidence: null,\r\n employersName: \"\",\r\n Occupation: \"\",\r\n EmployersEmail: \"\",\r\n EmployersNumber: null,\r\n PeriodOfEmployment: null,\r\n grossMonthlySalary: null,\r\n currentMonthlyExpenses: null,\r\n employersStreet: \"\",\r\n employersSuburb: \"\",\r\n employersCity: \"\",\r\n employersProvince: \"\",\r\n employersPostalcode: \"\",\r\n payslips: null,\r\n bankStatements: null,\r\n RentalInitialApplicationsID: \"\",\r\n applicantSignataure: null\r\n };\r\n\r\n this.secondPerson = {\r\n fullName: \"\",\r\n ApplicantNumber: 2,\r\n ID_Passport: \"\",\r\n Nationality: \"\",\r\n DateOfBirth: \"\",\r\n email: \"\",\r\n Telephone_Home: null,\r\n Telephone_Cell: null,\r\n MaritalStatus: null,\r\n nextOfKinName: \"\",\r\n nextOfKinTelephone: null,\r\n CurrentStreet: \"\",\r\n CurrentSuburb: \"\",\r\n CurrentCity: \"\",\r\n CurrentProvince: \"\",\r\n CurrentPostalCode: \"\",\r\n ID_Attachment: null,\r\n ProofOfAddressAttachment: null,\r\n OwnCurrentResidence: null,\r\n landlordName: \"\",\r\n LandlordNumber: null,\r\n landlordEmail: \"\",\r\n RentalAmountPaid: null,\r\n TimeLivingAtResidence: null,\r\n employersName: \"\",\r\n Occupation: \"\",\r\n EmployersEmail: \"\",\r\n EmployersNumber: null,\r\n PeriodOfEmployment: null,\r\n grossMonthlySalary: null,\r\n currentMonthlyExpenses: null,\r\n employersStreet: \"\",\r\n employersSuburb: \"\",\r\n employersCity: \"\",\r\n employersProvince: \"\",\r\n employersPostalcode: \"\",\r\n payslips: null,\r\n bankStatements: null,\r\n RentalInitialApplicationsID: \"\"\r\n };\r\n\r\n this.thirdPerson = {\r\n fullName: \"\",\r\n ApplicantNumber: 3,\r\n ID_Passport: \"\",\r\n Nationality: \"\",\r\n DateOfBirth: \"\",\r\n email: \"\",\r\n Telephone_Home: null,\r\n Telephone_Cell: null,\r\n MaritalStatus: null,\r\n nextOfKinName: \"\",\r\n nextOfKinTelephone: null,\r\n CurrentStreet: \"\",\r\n CurrentSuburb: \"\",\r\n CurrentCity: \"\",\r\n CurrentProvince: \"\",\r\n CurrentPostalCode: \"\",\r\n ID_Attachment: null,\r\n ProofOfAddressAttachment: null,\r\n OwnCurrentResidence: null,\r\n landlordName: \"\",\r\n LandlordNumber: null,\r\n landlordEmail: \"\",\r\n RentalAmountPaid: null,\r\n TimeLivingAtResidence: null,\r\n employersName: \"\",\r\n Occupation: \"\",\r\n EmployersEmail: \"\",\r\n EmployersNumber: null,\r\n PeriodOfEmployment: null,\r\n grossMonthlySalary: null,\r\n currentMonthlyExpenses: null,\r\n employersStreet: \"\",\r\n employersSuburb: \"\",\r\n employersCity: \"\",\r\n employersProvince: \"\",\r\n employersPostalcode: \"\",\r\n payslips: null,\r\n bankStatements: null,\r\n RentalInitialApplicationsID: \"\"\r\n };\r\n\r\n this.fourthPerson = {\r\n fullName: \"\",\r\n ApplicantNumber: 4,\r\n ID_Passport: \"\",\r\n Nationality: \"\",\r\n DateOfBirth: \"\",\r\n email: \"\",\r\n Telephone_Home: null,\r\n Telephone_Cell: null,\r\n MaritalStatus: null,\r\n nextOfKinName: \"\",\r\n nextOfKinTelephone: null,\r\n CurrentStreet: \"\",\r\n CurrentSuburb: \"\",\r\n CurrentCity: \"\",\r\n CurrentProvince: \"\",\r\n CurrentPostalCode: \"\",\r\n ID_Attachment: null,\r\n ProofOfAddressAttachment: null,\r\n OwnCurrentResidence: null,\r\n landlordName: \"\",\r\n LandlordNumber: null,\r\n landlordEmail: \"\",\r\n RentalAmountPaid: null,\r\n TimeLivingAtResidence: null,\r\n employersName: \"\",\r\n Occupation: \"\",\r\n EmployersEmail: \"\",\r\n EmployersNumber: null,\r\n PeriodOfEmployment: null,\r\n grossMonthlySalary: null,\r\n currentMonthlyExpenses: null,\r\n employersStreet: \"\",\r\n employersSuburb: \"\",\r\n employersCity: \"\",\r\n employersProvince: \"\",\r\n employersPostalcode: \"\",\r\n payslips: null,\r\n bankStatements: null,\r\n RentalInitialApplicationsID: \"\"\r\n };\r\n\r\n this.generalDetails = {\r\n RentalInitialApplicationsID: \"\",\r\n ApplicantOccupyingBuilding: null,\r\n numberOfAdults: null,\r\n numberOfChildren: 0,\r\n childAge1: null,\r\n childAge2: null,\r\n childAge3: null,\r\n childAge4: null,\r\n numberOfPets: null,\r\n petType: \"\",\r\n numberOfVehicles: 0,\r\n VehicleType1: \"\",\r\n Vehicle1Registration: \"\",\r\n VehicleType2: \"\",\r\n Vehicle2Registration: \"\",\r\n VehicleType3: \"\",\r\n Vehicle3Registration: \"\",\r\n VehicleType4: \"\",\r\n Vehicle4Registration: \"\",\r\n PreviousDefaults: false,\r\n defaultDetails: \"\",\r\n SeenProperty: false,\r\n SupportingDocument1: null,\r\n SupportingDocument2: null,\r\n SupportingDocument3: null,\r\n OtherTenantFullName: null,\r\n OtherTenantCellNumber: null,\r\n OtherTenantEmail: null\r\n };\r\n\r\n this.declarations = {\r\n RentalInitialApplicationsID: \"\",\r\n WhereSigned: \"\",\r\n DaySigned: null,\r\n MonthSigned: null,\r\n YearSigned: year,\r\n FirstApplicantCorrID: \"\",\r\n SecondApplicantCorrID: \"\",\r\n ThirdApplicantCorrID: \"\",\r\n FourthApplicantCorrID: \"\"\r\n };\r\n\r\n var firstIDBlobData = {};\r\n var firstProofOfAddressBlobData = {};\r\n var firstPayslipBlobData = {};\r\n var firstBankStatementsBlobData = {};\r\n\r\n var secondIDBlobData = {};\r\n var secondProofOfAddressBlobData = {};\r\n var secondPayslipBlobData = {};\r\n var secondBankStatementsBlobData = {};\r\n\r\n var thirdIDBlobData = {};\r\n var thirdProofOfAddressBlobData = {};\r\n var thirdPayslipBlobData = {};\r\n var thirdBankStatementsBlobData = {};\r\n\r\n var fourthIDBlobData = {};\r\n var fourthProofOfAddressBlobData = {};\r\n var fourthPayslipBlobData = {};\r\n var fourthBankStatementsBlobData = {};\r\n\r\n var firstPersonSignature = {};\r\n var secondPersonSignature = {};\r\n var thirdPersonSignature = {};\r\n var fourthPersonSignature = {};\r\n\r\n var supportingDoc1 = {};\r\n var supportingDoc2 = {};\r\n var supportingDoc3 = {};\r\n\r\n this.livesWithPartner2 = false;\r\n this.spousIsWorking2 = true;\r\n\r\n this.livesWithPartner3 = false;\r\n this.spousIsWorking3 = true;\r\n\r\n this.livesWithPartner4 = false;\r\n this.spousIsWorking4 = true;\r\n\r\n var uploadedSignatureBlobData = {};\r\n var uploadedSignatureBlobData2 = {};\r\n var uploadedSignatureBlobData3 = {};\r\n var uploadedSignatureBlobData4 = {};\r\n\r\n $(\"#upload\").hide();\r\n $(\"#upload2\").hide();\r\n $(\"#upload3\").hide();\r\n $(\"#upload4\").hide();\r\n\r\n $(\"#sigpad\").hide();\r\n $(\"#sigpad2\").hide();\r\n $(\"#sigpad3\").hide();\r\n $(\"#sigpad4\").hide();\r\n\r\n $(\"#clear\").hide();\r\n $(\"#edit\").hide();\r\n $(\"#signature-pad-empty\").hide();\r\n\r\n $(\"#clear2\").hide();\r\n $(\"#edit2\").hide();\r\n $(\"#signature-pad-empty2\").hide();\r\n\r\n $(\"#clear3\").hide();\r\n $(\"#edit3\").hide();\r\n $(\"#signature-pad-empty3\").hide();\r\n\r\n $(\"#clear4\").hide();\r\n $(\"#edit4\").hide();\r\n $(\"#signature-pad-empty4\").hide();\r\n\r\n this.removeFourthApplicantClick();\r\n this.removeThirdApplicantClick()\r\n this.removeSecondApplicantClick();\r\n this.getNumberOfChildren();\r\n this.getNumberOfVehincles();\r\n\r\n this.monthsArr = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\r\n this.countries = [\r\n \"South Africa\",\r\n \"Afghanistan\",\r\n \"Aland Islands\",\r\n \"Albania\",\r\n \"Algeria\",\r\n \"American Samoa\",\r\n \"Andorra\",\r\n \"Angola\",\r\n \"Anguilla\",\r\n \"Antarctica\",\r\n \"Antigua and Barbuda\",\r\n \"Argentina\",\r\n \"Armenia\",\r\n \"Aruba\",\r\n \"Australia\",\r\n \"Austria\",\r\n \"Azerbaijan\",\r\n \"Bahamas\",\r\n \"Bahrain\",\r\n \"Bangladesh\",\r\n \"Barbados\",\r\n \"Belarus\",\r\n \"Belgium\",\r\n \"Belize\",\r\n \"Benin\",\r\n \"Bermuda\",\r\n \"Bhutan\",\r\n \"Bolivia\",\r\n \"Bosnia and Herzegovina\",\r\n \"Botswana\",\r\n \"Bouvet Island\",\r\n \"Brazil\",\r\n \"British Indian Ocean Territory\",\r\n \"Brunei Darussalam\",\r\n \"Bulgaria\",\r\n \"Burkina Faso\",\r\n \"Burundi\",\r\n \"Cambodia\",\r\n \"Cameroon\",\r\n \"Canada\",\r\n \"Cape Verde\",\r\n \"Cayman Islands\",\r\n \"Central African Republic\",\r\n \"Chad\",\r\n \"Chile\",\r\n \"China\",\r\n \"Christmas Island\",\r\n \"Cocos (Keeling) Islands\",\r\n \"Colombia\",\r\n \"Comoros\",\r\n \"Congo\",\r\n \"Congo, The Democratic Republic of The\",\r\n \"Cook Islands\",\r\n \"Costa Rica\",\r\n \"Cote D'ivoire\",\r\n \"Croatia\",\r\n \"Cuba\",\r\n \"Curacao\",\r\n \"Cyprus\",\r\n \"Czech Republic\",\r\n \"Denmark\",\r\n \"Djibouti\",\r\n \"Dominica\",\r\n \"Dominican Republic\",\r\n \"Ecuador\",\r\n \"Egypt\",\r\n \"El Salvador\",\r\n \"Equatorial Guinea\",\r\n \"Eritrea\",\r\n \"Estonia\",\r\n \"Ethiopia\",\r\n \"Falkland Islands (Malvinas)\",\r\n \"Faroe Islands\",\r\n \"Fiji\",\r\n \"Finland\",\r\n \"France\",\r\n \"French Guiana\",\r\n \"French Polynesia\",\r\n \"French Southern Territories\",\r\n \"Gabon\",\r\n \"Gambia\",\r\n \"Georgia\",\r\n \"Germany\",\r\n \"Ghana\",\r\n \"Gibraltar\",\r\n \"Greece\",\r\n \"Greenland\",\r\n \"Grenada\",\r\n \"Guadeloupe\",\r\n \"Guam\",\r\n \"Guatemala\",\r\n \"Guernsey\",\r\n \"Guinea\",\r\n \"Guinea-bissau\",\r\n \"Guyana\",\r\n \"Haiti\",\r\n \"Heard Island and Mcdonald Islands\",\r\n \"Holy See (Vatican City State)\",\r\n \"Honduras\",\r\n \"Hong Kong\",\r\n \"Hungary\",\r\n \"Iceland\",\r\n \"India\",\r\n \"Indonesia\",\r\n \"Iran, Islamic Republic of\",\r\n \"Iraq\",\r\n \"Ireland\",\r\n \"Isle of Man\",\r\n \"Israel\",\r\n \"Italy\",\r\n \"Jamaica\",\r\n \"Japan\",\r\n \"Jersey\",\r\n \"Jordan\",\r\n \"Kazakhstan\",\r\n \"Kenya\",\r\n \"Kiribati\",\r\n \"Korea, Democratic People's Republic of\",\r\n \"Korea, Republic of\",\r\n \"Kuwait\",\r\n \"Kyrgyzstan\",\r\n \"Lao People's Democratic Republic\",\r\n \"Latvia\",\r\n \"Lebanon\",\r\n \"Lesotho\",\r\n \"Liberia\",\r\n \"Libyan Arab Jamahiriya\",\r\n \"Liechtenstein\",\r\n \"Lithuania\",\r\n \"Luxembourg\",\r\n \"Macao\",\r\n \"Macedonia, The Former Yugoslav Republic of\",\r\n \"Madagascar\",\r\n \"Malawi\",\r\n \"Malaysia\",\r\n \"Maldives\",\r\n \"Mali\",\r\n \"Malta\",\r\n \"Marshall Islands\",\r\n \"Martinique\",\r\n \"Mauritania\",\r\n \"Mauritius\",\r\n \"Mayotte\",\r\n \"Mexico\",\r\n \"Micronesia, Federated States of\",\r\n \"Moldova, Republic of\",\r\n \"Monaco\",\r\n \"Mongolia\",\r\n \"Montenegro\",\r\n \"Montserrat\",\r\n \"Morocco\",\r\n \"Mozambique\",\r\n \"Myanmar\",\r\n \"Namibia\",\r\n \"Nauru\",\r\n \"Nepal\",\r\n \"Netherlands\",\r\n \"New Caledonia\",\r\n \"New Zealand\",\r\n \"Nicaragua\",\r\n \"Niger\",\r\n \"Nigeria\",\r\n \"Niue\",\r\n \"Norfolk Island\",\r\n \"Northern Mariana Islands\",\r\n \"Norway\",\r\n \"Oman\",\r\n \"Pakistan\",\r\n \"Palau\",\r\n \"Palestinian Territory, Occupied\",\r\n \"Panama\",\r\n \"Papua New Guinea\",\r\n \"Paraguay\",\r\n \"Peru\",\r\n \"Philippines\",\r\n \"Pitcairn\",\r\n \"Poland\",\r\n \"Portugal\",\r\n \"Puerto Rico\",\r\n \"Qatar\",\r\n \"Reunion\",\r\n \"Romania\",\r\n \"Russia\",\r\n \"Rwanda\",\r\n \"Saint Helena\",\r\n \"Saint Kitts and Nevis\",\r\n \"Saint Lucia\",\r\n \"Saint Pierre and Miquelon\",\r\n \"Saint Vincent and The Grenadines\",\r\n \"Samoa\",\r\n \"San Marino\",\r\n \"Sao Tome and Principe\",\r\n \"Saudi Arabia\",\r\n \"Senegal\",\r\n \"Serbia\",\r\n \"Seychelles\",\r\n \"Sierra Leone\",\r\n \"Singapore\",\r\n \"Slovakia\",\r\n \"Slovenia\",\r\n \"Solomon Islands\",\r\n \"Somalia\",\r\n \"South Georgia and The South Sandwich Islands\",\r\n \"Spain\",\r\n \"Sri Lanka\",\r\n \"Sudan\",\r\n \"Suriname\",\r\n \"Svalbard and Jan Mayen\",\r\n \"Eswatini\",\r\n \"Sweden\",\r\n \"Switzerland\",\r\n \"Syrian Arab Republic\",\r\n \"Taiwan (ROC)\",\r\n \"Tajikistan\",\r\n \"Tanzania, United Republic of\",\r\n \"Thailand\",\r\n \"Timor-leste\",\r\n \"Togo\",\r\n \"Tokelau\",\r\n \"Tonga\",\r\n \"Trinidad and Tobago\",\r\n \"Tunisia\",\r\n \"Turkey\",\r\n \"Turkmenistan\",\r\n \"Turks and Caicos Islands\",\r\n \"Tuvalu\",\r\n \"Uganda\",\r\n \"Ukraine\",\r\n \"United Arab Emirates\",\r\n \"United Kingdom\",\r\n \"United States\",\r\n \"United States Minor Outlying Islands\",\r\n \"Uruguay\",\r\n \"Uzbekistan\",\r\n \"Vanuatu\",\r\n \"Venezuela\",\r\n \"Vietnam\",\r\n \"Virgin Islands, British\",\r\n \"Virgin Islands, U.S.\",\r\n \"Wallis and Futuna\",\r\n \"Western Sahara\",\r\n \"Yemen\",\r\n \"Zambia\",\r\n \"Zimbabwe\"\r\n ]\r\n }\r\n\r\n populateDropdown() {\r\n var dropdown = document.getElementById(\"dropdown\");\r\n var selectedOptionElement = document.getElementById(\"selectedOption\");\r\n\r\n dropdown.innerHTML = \"\";\r\n\r\n console.log(this.monthsArr);\r\n this.monthsArr.forEach(function (option) {\r\n var optionElement = document.createElement(\"option\");\r\n optionElement.textContent = option;\r\n optionElement.value = option;\r\n\r\n dropdown.appendChild(optionElement);\r\n });\r\n\r\n dropdown.addEventListener(\"change\", function () {\r\n\r\n })\r\n }\r\n\r\n _registerEventHandler() {\r\n this.$scope.$watch('rentalsCaptureVm.firstPerson.MaritalStatus', (newVal, oldVal) => {\r\n if (newVal == 5) {\r\n this.addSecondApplicantClick();\r\n this.isFirstApplicantPartner = true;\r\n $(\"#secondApplicantHeading\")[0].innerText = \"DETAILS OF THE SPOUSE OF THE FIRST APPLICANT TO RENT THE PROPERTY\";\r\n $(\"#removeSecondApplicantDiv\").hide();\r\n }\r\n else if (oldVal == 5) {\r\n this.removeSecondApplicantClick();\r\n this.isFirstApplicantPartner = false;\r\n $(\"#secondApplicantHeading\")[0].innerText = \"DETAILS OF THE SECOND PERSON APPLYING TO RENT THE PROPERTY\";\r\n }\r\n });\r\n\r\n this.$scope.$watch('rentalsCaptureVm.secondPerson.MaritalStatus', (newVal, oldVal) => {\r\n if (newVal == 5) {\r\n this.addThirdApplicantClick();\r\n this.isSecondApplicantPartner = true;\r\n $(\"#thirdApplicantHeading\")[0].innerText = \"DETAILS OF THE SPOUSE OF THE SECOND APPLICANT TO RENT THE PROPERTY\";\r\n $(\"#removeThirdApplicantDiv\").hide();\r\n }\r\n else if (oldVal == 5) {\r\n this.removeThirdApplicantClick();\r\n this.isSecondApplicantPartner = false;\r\n $(\"#thirdApplicantHeading\")[0].innerText = \"DETAILS OF THE THIRD PERSON APPLYING TO RENT THE PROPERTY\";\r\n }\r\n \r\n });\r\n\r\n this.$scope.$watch('rentalsCaptureVm.fourthPerson.MaritalStatus', (newVal, oldVal) => {\r\n if (newVal == 5) {\r\n this.addFourthApplicantClick();\r\n this.isThirdApplicantPartner = true;\r\n $(\"#fourthApplicantHeading\")[0].innerText = \"DETAILS OF THE SPOUSE OF THE THIRD APPLICANT TO RENT THE PROPERTY\";\r\n $(\"#removeFourthApplicantDiv\").hide();\r\n }\r\n else if (oldVal == 5) {\r\n this.removeThirdApplicantClick();\r\n this.isThirdApplicantPartner = false;\r\n $(\"#fourthApplicantHeading\")[0].innerText = \"DETAILS OF THE FOURTH PERSON APPLYING TO RENT THE PROPERTY\";\r\n }\r\n });\r\n }\r\n\r\n\r\n activate() {\r\n //this.howToGuideLink = `${PretorCDNAddress}${PretorCDNAddress.endsWith('/')\r\n // ? ''\r\n // : '/'}docs/Clearance How-To-Guide.pdf`;\r\n this.getMaritalStatuses();\r\n //this._initializeDatePicker();\r\n }\r\n\r\n loadSignaturePads() {\r\n $(document).ready(function () {\r\n var SignaturePad = (function (document) {\r\n \"use strict\";\r\n\r\n var log = console.log.bind(console);\r\n\r\n var SignaturePad = function (canvas, options) {\r\n var self = this,\r\n opts = options || {};\r\n\r\n this.velocityFilterWeight = opts.velocityFilterWeight || 0.7;\r\n this.minWidth = opts.minWidth || 0.5;\r\n this.maxWidth = opts.maxWidth || 2.5;\r\n this.dotSize = opts.dotSize || function () {\r\n return (self.minWidth + self.maxWidth) / 2;\r\n };\r\n this.penColor = opts.penColor || \"black\";\r\n this.backgroundColor = opts.backgroundColor || \"rgba(0,0,0,0)\";\r\n this.throttle = opts.throttle || 0;\r\n this.throttleOptions = {\r\n leading: true,\r\n trailing: true\r\n };\r\n this.minPointDistance = opts.minPointDistance || 0;\r\n this.onEnd = opts.onEnd;\r\n this.onBegin = opts.onBegin;\r\n\r\n this._canvas = canvas;\r\n\r\n this._ctx = canvas.getContext(\"2d\");\r\n this._ctx.lineCap = 'round';\r\n this.clear();\r\n\r\n // we need add these inline so they are available to unbind while still having\r\n // access to 'self' we could use _.bind but it's not worth adding a dependency\r\n this._handleMouseDown = function (event) {\r\n if (event.which === 1) {\r\n self._mouseButtonDown = true;\r\n self._strokeBegin(event);\r\n }\r\n };\r\n\r\n var _handleMouseMove = function (event) {\r\n event.preventDefault();\r\n if (self._mouseButtonDown) {\r\n self._strokeUpdate(event);\r\n if (self.arePointsDisplayed) {\r\n var point = self._createPoint(event);\r\n self._drawMark(point.x, point.y, 5);\r\n }\r\n }\r\n };\r\n\r\n this._handleMouseMove = _.throttle(_handleMouseMove, self.throttle, self.throttleOptions);\r\n this._handleMouseUp = function (event) {\r\n if (event.which === 1 && self._mouseButtonDown) {\r\n self._mouseButtonDown = false;\r\n self._strokeEnd(event);\r\n }\r\n };\r\n\r\n this._handleTouchStart = function (event) {\r\n if (event.targetTouches.length == 1) {\r\n var touch = event.changedTouches[0];\r\n self._strokeBegin(touch);\r\n }\r\n };\r\n\r\n var _handleTouchMove = function (event) {\r\n // Prevent scrolling.\r\n event.preventDefault();\r\n\r\n var touch = event.targetTouches[0];\r\n self._strokeUpdate(touch);\r\n if (self.arePointsDisplayed) {\r\n var point = self._createPoint(touch);\r\n self._drawMark(point.x, point.y, 5);\r\n }\r\n };\r\n this._handleTouchMove = _.throttle(_handleTouchMove, self.throttle, self.throttleOptions);\r\n //this._handleTouchMove = _handleTouchMove;\r\n\r\n this._handleTouchEnd = function (event) {\r\n var wasCanvasTouched = event.target === self._canvas;\r\n if (wasCanvasTouched) {\r\n event.preventDefault();\r\n self._strokeEnd(event);\r\n }\r\n };\r\n\r\n this._handleMouseEvents();\r\n this._handleTouchEvents();\r\n };\r\n\r\n SignaturePad.prototype.clear = function () {\r\n var ctx = this._ctx,\r\n canvas = this._canvas;\r\n ctx.fillStyle = this.backgroundColor;\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n this._reset();\r\n RentalsCaptureCtrl.firstPersonSignature = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n };\r\n\r\n SignaturePad.prototype.showPointsToggle = function () {\r\n this.arePointsDisplayed = !this.arePointsDisplayed;\r\n };\r\n\r\n SignaturePad.prototype.toDataURL = function (imageType, quality) {\r\n var canvas = this._canvas;\r\n return canvas.toDataURL.apply(canvas, arguments);\r\n };\r\n\r\n SignaturePad.prototype.getBlobData = function (dataURL) {\r\n var arr = dataURL.split(','), mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n\r\n return new Blob([u8arr], { type: mime });\r\n };\r\n\r\n SignaturePad.prototype.getByteArrayData = function (dataURL) {\r\n var arr = dataURL.split(','), mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n\r\n const byteArray = [];\r\n Object.keys(u8arr).forEach((key) => {\r\n const byteForKey = u8arr[key];\r\n byteArray.push(byteForKey);\r\n });\r\n\r\n return byteArray;\r\n };\r\n\r\n SignaturePad.prototype.fromDataURL = function (dataUrl) {\r\n var self = this,\r\n image = new Image(),\r\n ratio = window.devicePixelRatio || 1,\r\n width = this._canvas.width / ratio,\r\n height = this._canvas.height / ratio;\r\n\r\n this._reset();\r\n image.src = dataUrl;\r\n image.onload = function () {\r\n self._ctx.drawImage(image, 0, 0, width, height);\r\n };\r\n this._isEmpty = false;\r\n };\r\n\r\n SignaturePad.prototype._strokeUpdate = function (event) {\r\n var point = this._createPoint(event);\r\n if (this._isPointToBeUsed(point)) {\r\n this._addPoint(point);\r\n }\r\n };\r\n\r\n SignaturePad.prototype._isPointToBeUsed = function (point) {\r\n if (!this.minPointDistance)\r\n return true;\r\n\r\n var points = this.points;\r\n if (points && points.length) {\r\n var lastPoint = points[points.length - 1];\r\n if (point.distanceTo(lastPoint) < this.minPointDistance) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n\r\n SignaturePad.prototype._strokeBegin = function (event) {\r\n this._reset();\r\n this._strokeUpdate(event);\r\n if (typeof this.onBegin === 'function') {\r\n this.onBegin(event);\r\n }\r\n };\r\n\r\n SignaturePad.prototype._strokeDraw = function (point) {\r\n var ctx = this._ctx,\r\n dotSize = typeof (this.dotSize) === 'function' ? this.dotSize() : this.dotSize;\r\n\r\n ctx.beginPath();\r\n this._drawPoint(point.x, point.y, dotSize);\r\n ctx.closePath();\r\n ctx.fill();\r\n };\r\n\r\n SignaturePad.prototype._strokeEnd = function (event) {\r\n var canDrawCurve = this.points.length > 2,\r\n point = this.points[0];\r\n\r\n if (!canDrawCurve && point) {\r\n this._strokeDraw(point);\r\n }\r\n if (typeof this.onEnd === 'function') {\r\n this.onEnd(event);\r\n }\r\n };\r\n\r\n SignaturePad.prototype._handleMouseEvents = function () {\r\n this._mouseButtonDown = false;\r\n\r\n this._canvas.addEventListener(\"mousedown\", this._handleMouseDown);\r\n this._canvas.addEventListener(\"mousemove\", this._handleMouseMove);\r\n document.addEventListener(\"mouseup\", this._handleMouseUp);\r\n };\r\n\r\n SignaturePad.prototype._handleTouchEvents = function () {\r\n // Pass touch events to canvas element on mobile IE11 and Edge.\r\n this._canvas.style.msTouchAction = 'none';\r\n this._canvas.style.touchAction = 'none';\r\n\r\n this._canvas.addEventListener(\"touchstart\", this._handleTouchStart);\r\n this._canvas.addEventListener(\"touchmove\", this._handleTouchMove);\r\n this._canvas.addEventListener(\"touchend\", this._handleTouchEnd);\r\n };\r\n\r\n SignaturePad.prototype.on = function () {\r\n this._handleMouseEvents();\r\n this._handleTouchEvents();\r\n };\r\n\r\n SignaturePad.prototype.off = function () {\r\n this._canvas.removeEventListener(\"mousedown\", this._handleMouseDown);\r\n this._canvas.removeEventListener(\"mousemove\", this._handleMouseMove);\r\n document.removeEventListener(\"mouseup\", this._handleMouseUp);\r\n\r\n this._canvas.removeEventListener(\"touchstart\", this._handleTouchStart);\r\n this._canvas.removeEventListener(\"touchmove\", this._handleTouchMove);\r\n this._canvas.removeEventListener(\"touchend\", this._handleTouchEnd);\r\n };\r\n\r\n SignaturePad.prototype.isEmpty = function () {\r\n return this._isEmpty;\r\n };\r\n\r\n SignaturePad.prototype._reset = function () {\r\n this.points = [];\r\n this._lastVelocity = 0;\r\n this._lastWidth = (this.minWidth + this.maxWidth) / 2;\r\n this._isEmpty = true;\r\n this._ctx.fillStyle = this.penColor;\r\n };\r\n\r\n SignaturePad.prototype._createPoint = function (event) {\r\n var rect = this._canvas.getBoundingClientRect();\r\n return new Point(\r\n event.clientX - rect.left,\r\n event.clientY - rect.top\r\n );\r\n };\r\n\r\n SignaturePad.prototype._addPoint = function (point) {\r\n var points = this.points,\r\n c2, c3,\r\n curve, tmp;\r\n\r\n points.push(point);\r\n\r\n if (points.length > 2) {\r\n // To reduce the initial lag make it work with 3 points\r\n // by copying the first point to the beginning.\r\n if (points.length === 3) points.unshift(points[0]);\r\n\r\n tmp = this._calculateCurveControlPoints(points[0], points[1], points[2]);\r\n c2 = tmp.c2;\r\n tmp = this._calculateCurveControlPoints(points[1], points[2], points[3]);\r\n c3 = tmp.c1;\r\n curve = new Bezier(points[1], c2, c3, points[2]);\r\n this._addCurve(curve);\r\n\r\n // Remove the first element from the list,\r\n // so that we always have no more than 4 points in points array.\r\n points.shift();\r\n }\r\n };\r\n\r\n SignaturePad.prototype._calculateCurveControlPoints = function (s1, s2, s3) {\r\n var dx1 = s1.x - s2.x,\r\n dy1 = s1.y - s2.y,\r\n dx2 = s2.x - s3.x,\r\n dy2 = s2.y - s3.y,\r\n\r\n m1 = {\r\n x: (s1.x + s2.x) / 2.0,\r\n y: (s1.y + s2.y) / 2.0\r\n },\r\n m2 = {\r\n x: (s2.x + s3.x) / 2.0,\r\n y: (s2.y + s3.y) / 2.0\r\n },\r\n\r\n l1 = Math.sqrt(1.0 * dx1 * dx1 + dy1 * dy1),\r\n l2 = Math.sqrt(1.0 * dx2 * dx2 + dy2 * dy2),\r\n\r\n dxm = (m1.x - m2.x),\r\n dym = (m1.y - m2.y),\r\n\r\n k = l2 / (l1 + l2),\r\n cm = {\r\n x: m2.x + dxm * k,\r\n y: m2.y + dym * k\r\n },\r\n\r\n tx = s2.x - cm.x,\r\n ty = s2.y - cm.y;\r\n\r\n return {\r\n c1: new Point(m1.x + tx, m1.y + ty),\r\n c2: new Point(m2.x + tx, m2.y + ty)\r\n };\r\n };\r\n\r\n SignaturePad.prototype._addCurve = function (curve) {\r\n var startPoint = curve.startPoint,\r\n endPoint = curve.endPoint,\r\n velocity, newWidth;\r\n\r\n velocity = endPoint.velocityFrom(startPoint);\r\n velocity = this.velocityFilterWeight * velocity +\r\n (1 - this.velocityFilterWeight) * this._lastVelocity;\r\n\r\n newWidth = this._strokeWidth(velocity);\r\n this._drawCurve(curve, this._lastWidth, newWidth);\r\n\r\n this._lastVelocity = velocity;\r\n this._lastWidth = newWidth;\r\n };\r\n\r\n SignaturePad.prototype._drawPoint = function (x, y, size) {\r\n var ctx = this._ctx;\r\n\r\n ctx.moveTo(x, y);\r\n ctx.arc(x, y, size, 0, 2 * Math.PI, false);\r\n this._isEmpty = false;\r\n };\r\n\r\n SignaturePad.prototype._drawMark = function (x, y, size) {\r\n var ctx = this._ctx;\r\n\r\n ctx.save();\r\n ctx.moveTo(x, y);\r\n ctx.arc(x, y, size, 0, 2 * Math.PI, false);\r\n ctx.fillStyle = 'rgba(255, 0, 0, 0.2)';\r\n ctx.fill();\r\n ctx.restore();\r\n };\r\n\r\n SignaturePad.prototype._drawCurve = function (curve, startWidth, endWidth) {\r\n var ctx = this._ctx,\r\n widthDelta = endWidth - startWidth,\r\n drawSteps, width, i, t, tt, ttt, u, uu, uuu, x, y;\r\n\r\n drawSteps = Math.floor(curve.length());\r\n ctx.beginPath();\r\n for (i = 0; i < drawSteps; i++) {\r\n // Calculate the Bezier (x, y) coordinate for this step.\r\n t = i / drawSteps;\r\n tt = t * t;\r\n ttt = tt * t;\r\n u = 1 - t;\r\n uu = u * u;\r\n uuu = uu * u;\r\n\r\n x = uuu * curve.startPoint.x;\r\n x += 3 * uu * t * curve.control1.x;\r\n x += 3 * u * tt * curve.control2.x;\r\n x += ttt * curve.endPoint.x;\r\n\r\n y = uuu * curve.startPoint.y;\r\n y += 3 * uu * t * curve.control1.y;\r\n y += 3 * u * tt * curve.control2.y;\r\n y += ttt * curve.endPoint.y;\r\n\r\n width = startWidth + ttt * widthDelta;\r\n this._drawPoint(x, y, width);\r\n }\r\n ctx.closePath();\r\n ctx.fill();\r\n };\r\n\r\n SignaturePad.prototype._strokeWidth = function (velocity) {\r\n return Math.max(this.maxWidth / (velocity + 1), this.minWidth);\r\n };\r\n\r\n var Point = function (x, y, time) {\r\n this.x = x;\r\n this.y = y;\r\n this.time = time || new Date().getTime();\r\n };\r\n\r\n Point.prototype.velocityFrom = function (start) {\r\n return (this.time !== start.time) ? this.distanceTo(start) / (this.time - start.time) : 1;\r\n };\r\n\r\n Point.prototype.distanceTo = function (start) {\r\n return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));\r\n };\r\n\r\n var Bezier = function (startPoint, control1, control2, endPoint) {\r\n this.startPoint = startPoint;\r\n this.control1 = control1;\r\n this.control2 = control2;\r\n this.endPoint = endPoint;\r\n };\r\n\r\n // Returns approximated length.\r\n Bezier.prototype.length = function () {\r\n var steps = 10,\r\n length = 0,\r\n i, t, cx, cy, px, py, xdiff, ydiff;\r\n\r\n for (i = 0; i <= steps; i++) {\r\n t = i / steps;\r\n cx = this._point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);\r\n cy = this._point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);\r\n if (i > 0) {\r\n xdiff = cx - px;\r\n ydiff = cy - py;\r\n length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);\r\n }\r\n px = cx;\r\n py = cy;\r\n }\r\n return length;\r\n };\r\n\r\n Bezier.prototype._point = function (t, start, c1, c2, end) {\r\n return start * (1.0 - t) * (1.0 - t) * (1.0 - t) +\r\n 3.0 * c1 * (1.0 - t) * (1.0 - t) * t +\r\n 3.0 * c2 * (1.0 - t) * t * t +\r\n end * t * t * t;\r\n };\r\n\r\n return SignaturePad;\r\n })(document);\r\n\r\n var signaturePad = new SignaturePad(document.getElementById('signature-pad'), {\r\n backgroundColor: 'rgba(255, 255, 255, 0)',\r\n penColor: 'rgb(0, 0, 0)',\r\n velocityFilterWeight: .7,\r\n minWidth: 0.5,\r\n maxWidth: 2.5,\r\n throttle: 16, // max x milli seconds on event update, OBS! this introduces lag for event update\r\n minPointDistance: 3,\r\n });\r\n\r\n var saveButton = document.getElementById('save'),\r\n clearButton = document.getElementById('clear'),\r\n editButton = document.getElementById('edit'),\r\n showPointsToggle = document.getElementById('showPointsToggle');\r\n\r\n saveButton.addEventListener('click', function (event) {\r\n var data = signaturePad.toDataURL('image/png');\r\n RentalsCaptureCtrl.firstPersonSignature = {\r\n FileName: \"Signature\",\r\n Blob: signaturePad.getByteArrayData(data)\r\n };\r\n\r\n $(\"#save\").hide();\r\n $(\"#signature-pad\").hide();\r\n $(\"#signature-pad-empty\").show();\r\n $(\"#clear\").show();\r\n $(\"#edit\").show();\r\n\r\n const ctx = document.getElementById(\"signature-pad-empty\").getContext(\"2d\");\r\n ctx.font = \"20px Italic Montserrat\";\r\n ctx.fillStyle = \"Grey\";\r\n ctx.fillText(\"Signature Saved\", 20, 55);\r\n });\r\n\r\n if (clearButton) {\r\n clearButton.addEventListener('click', function (event) {\r\n signaturePad.clear();\r\n RentalsCaptureCtrl.firstPersonSignature = {\r\n FileName: null,\r\n IntArray: null\r\n };\r\n\r\n $(\"#save\").show();\r\n $(\"#clear\").hide();\r\n $(\"#edit\").hide();\r\n $(\"#signature-pad\").show();\r\n $(\"#signature-pad-empty\").hide();\r\n });\r\n }\r\n\r\n if (editButton) {\r\n editButton.addEventListener('click', function (event) {\r\n $(\"#save\").show();\r\n $(\"#edit\").hide();\r\n $(\"#clear\").hide();\r\n $(\"#signature-pad\").show();\r\n $(\"#signature-pad-empty\").hide();\r\n });\r\n }\r\n\r\n if (showPointsToggle) {\r\n showPointsToggle.addEventListener('click', function (event) {\r\n signaturePad.showPointsToggle();\r\n showPointsToggle.classList.toggle('toggle');\r\n });\r\n }\r\n\r\n var idAttachment1 = document.getElementById('ID_Attachment'),\r\n addressDoc1 = document.getElementById('ProofOfAddressAttachment'),\r\n payslip1 = document.getElementById('payslips'),\r\n bankStatement1 = document.getElementById('bankStatements'),\r\n idAttachment2 = document.getElementById('ID_Attachment2'),\r\n addressDoc2 = document.getElementById('ProofOfAddressAttachment2'),\r\n payslip2 = document.getElementById('payslips2'),\r\n bankStatement2 = document.getElementById('bankStatements2'),\r\n idAttachment3 = document.getElementById('ID_Attachment3'),\r\n addressDoc3 = document.getElementById('ProofOfAddressAttachment3'),\r\n payslip3 = document.getElementById('payslips3'),\r\n bankStatement3 = document.getElementById('bankStatements3'),\r\n idAttachment4 = document.getElementById('ID_Attachment4'),\r\n addressDoc4 = document.getElementById('ProofOfAddressAttachment4'),\r\n payslip4 = document.getElementById('payslips4'),\r\n bankStatement4 = document.getElementById('bankStatements4'),\r\n supportingDocument1 = document.getElementById('supportingDocument1'),\r\n supportingDocument2 = document.getElementById('supportingDocument2'),\r\n supportingDocument3 = document.getElementById('supportingDocument3');\r\n\r\n if (idAttachment1 != null) {\r\n idAttachment1.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#ID_Attachment')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.firstIDBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n document.getElementById('ID_Attachment').value = null;\r\n RentalsCaptureCtrl.firstIDBlobData = {}\r\n }\r\n\r\n });\r\n\r\n addressDoc1.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#ProofOfAddressAttachment')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.firstProofOfAddressBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('ProofOfAddressAttachment').value = null;\r\n RentalsCaptureCtrl.firstProofOfAddressBlobData = {}\r\n }\r\n });\r\n\r\n payslip1.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#payslips')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.firstPayslipBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('payslips').value = null;\r\n RentalsCaptureCtrl.firstPayslipBlobData = {}\r\n }\r\n });\r\n\r\n bankStatement1.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#bankStatements')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.firstBankStatementsBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('bankStatements').value = null;\r\n RentalsCaptureCtrl.firstBankStatementsBlobData = {}\r\n }\r\n }\r\n });\r\n\r\n idAttachment2.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#ID_Attachment2')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.secondIDBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('ID_Attachment2').value = null;\r\n RentalsCaptureCtrl.secondIDBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n addressDoc2.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#ProofOfAddressAttachment2')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.secondProofOfAddressBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('ProofOfAddressAttachment2').value = null;\r\n RentalsCaptureCtrl.secondProofOfAddressBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n payslip2.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#payslips2')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.secondPayslipBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('payslips2').value = null;\r\n RentalsCaptureCtrl.secondPayslipBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n bankStatement2.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#bankStatements2')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.secondBankStatementsBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('bankStatements2').value = null;\r\n RentalsCaptureCtrl.secondBankStatementsBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n idAttachment3.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#ID_Attachment3')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.thirdIDBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('ID_Attachment3').value = null;\r\n RentalsCaptureCtrl.thirdIDBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n addressDoc3.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#ProofOfAddressAttachment3')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.thirdProofOfAddressBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('ProofOfAddressAttachment3').value = null;\r\n RentalsCaptureCtrl.thirdProofOfAddressBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n payslip3.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#payslips3')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.thirdPayslipBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('payslips3').value = null;\r\n RentalsCaptureCtrl.thirdPayslipBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n bankStatement3.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#bankStatements3')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.thirdBankStatementsBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('bankStatements3').value = null;\r\n RentalsCaptureCtrl.thirdBankStatementsBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n idAttachment4.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#ID_Attachment4')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.fourthIDBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('ID_Attachment4').value = null;\r\n RentalsCaptureCtrl.fourthIDBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n addressDoc4.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#ProofOfAddressAttachment4')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.fourthProofOfAddressBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('ProofOfAddressAttachment4').value = null;\r\n RentalsCaptureCtrl.fourthProofOfAddressBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n payslip4.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#payslips4')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.fourthPayslipBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('payslips4').value = null;\r\n RentalsCaptureCtrl.fourthPayslipBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n bankStatement4.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#bankStatements4')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.fourthBankStatementsBlobData = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('bankStatements4').value = null;\r\n RentalsCaptureCtrl.fourthBankStatementsBlobData = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n supportingDocument1.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#supportingDocument1')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.supportingDoc1 = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('supportingDocument1').value = null;\r\n RentalsCaptureCtrl.supportingDoc1 = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n supportingDocument2.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#supportingDocument2')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.supportingDoc2 = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('supportingDocument2').value = null;\r\n RentalsCaptureCtrl.supportingDoc2 = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n\r\n supportingDocument3.addEventListener('change', function (event) {\r\n const file2 = $('input[type=file]#supportingDocument3')[0].files[0];\r\n var legitFile = check_file_pdf(file2);\r\n if (legitFile == true) {\r\n let reader = new FileReader();\r\n if (file2 !== undefined) {\r\n reader.readAsArrayBuffer(file2);\r\n reader.onload = function () {\r\n RentalsCaptureCtrl.supportingDoc3 = {\r\n FileName: file2.name,\r\n Blob: base64js.fromByteArray(new Uint8Array(reader.result))\r\n }\r\n }\r\n\r\n }\r\n }\r\n else {\r\n document.getElementById('supportingDocument3').value = null;\r\n RentalsCaptureCtrl.supportingDoc3 = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n }\r\n });\r\n }\r\n var check_file_pdf = function (file) {\r\n if (file.type !== 'application/pdf') {\r\n const errorMsg = 'Wrong file type, only PDFs are allowed.';\r\n\r\n console.error(\r\n `${errorMsg} \"${file.name}\" is not in the correct format - only PDFs are allowed.`\r\n );\r\n\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format - only PDFs are allowed. Please contact RicardoP@pretor.co.za for assistance.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else if (file.name.length > 50) {\r\n const errorMsg = 'Filename too long. Please shorten your filename to less than 50 characters.';\r\n\r\n console.error(\r\n `Filename too long. Please shorten your filename to less than 50 characters.`\r\n );\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format. Please contact RicardoP@pretor.co.za for assistance.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else if (file.size > 100242880) {\r\n const errorMsg = 'File size too large. Please reduce the size of your file to smaller than 100 mega bytes.';\r\n\r\n console.error(\r\n `File size too large. Please reduce the size of your file to smaller than 100 mega bytes.`\r\n );\r\n document.getElementsByClassName(\"errorMessage\")[0].innerText = `${errorMsg} \"${file.name}\" is not in the correct format. Please contact RicardoP@pretor.co.za for assistance.`;\r\n $(\"#attachmentFailureModal\").modal('show');\r\n return false;\r\n }\r\n else {\r\n return true;\r\n\r\n }\r\n }\r\n\r\n //section 3\r\n var SignaturePad2 = (function (document) {\r\n \"use strict\";\r\n\r\n var log = console.log.bind(console);\r\n\r\n var SignaturePad2 = function (canvas, options) {\r\n var self = this,\r\n opts = options || {};\r\n\r\n this.velocityFilterWeight = opts.velocityFilterWeight || 0.7;\r\n this.minWidth = opts.minWidth || 0.5;\r\n this.maxWidth = opts.maxWidth || 2.5;\r\n this.dotSize = opts.dotSize || function () {\r\n return (self.minWidth + self.maxWidth) / 2;\r\n };\r\n this.penColor = opts.penColor || \"black\";\r\n this.backgroundColor = opts.backgroundColor || \"rgba(0,0,0,0)\";\r\n this.throttle = opts.throttle || 0;\r\n this.throttleOptions = {\r\n leading: true,\r\n trailing: true\r\n };\r\n this.minPointDistance = opts.minPointDistance || 0;\r\n this.onEnd = opts.onEnd;\r\n this.onBegin = opts.onBegin;\r\n\r\n this._canvas = canvas;\r\n\r\n this._ctx = canvas.getContext(\"2d\");\r\n this._ctx.lineCap = 'round';\r\n this.clear();\r\n\r\n // we need add these inline so they are available to unbind while still having\r\n // access to 'self' we could use _.bind but it's not worth adding a dependency\r\n this._handleMouseDown = function (event) {\r\n if (event.which === 1) {\r\n self._mouseButtonDown = true;\r\n self._strokeBegin(event);\r\n }\r\n };\r\n\r\n var _handleMouseMove = function (event) {\r\n event.preventDefault();\r\n if (self._mouseButtonDown) {\r\n self._strokeUpdate(event);\r\n if (self.arePointsDisplayed) {\r\n var point = self._createPoint(event);\r\n self._drawMark(point.x, point.y, 5);\r\n }\r\n }\r\n };\r\n\r\n this._handleMouseMove = _.throttle(_handleMouseMove, self.throttle, self.throttleOptions);\r\n //this._handleMouseMove = _handleMouseMove;\r\n\r\n this._handleMouseUp = function (event) {\r\n if (event.which === 1 && self._mouseButtonDown) {\r\n self._mouseButtonDown = false;\r\n self._strokeEnd(event);\r\n }\r\n };\r\n\r\n this._handleTouchStart = function (event) {\r\n if (event.targetTouches.length == 1) {\r\n var touch = event.changedTouches[0];\r\n self._strokeBegin(touch);\r\n }\r\n };\r\n\r\n var _handleTouchMove = function (event) {\r\n // Prevent scrolling.\r\n event.preventDefault();\r\n\r\n var touch = event.targetTouches[0];\r\n self._strokeUpdate(touch);\r\n if (self.arePointsDisplayed) {\r\n var point = self._createPoint(touch);\r\n self._drawMark(point.x, point.y, 5);\r\n }\r\n };\r\n this._handleTouchMove = _.throttle(_handleTouchMove, self.throttle, self.throttleOptions);\r\n //this._handleTouchMove = _handleTouchMove;\r\n\r\n this._handleTouchEnd = function (event) {\r\n var wasCanvasTouched = event.target === self._canvas;\r\n if (wasCanvasTouched) {\r\n event.preventDefault();\r\n self._strokeEnd(event);\r\n }\r\n };\r\n\r\n this._handleMouseEvents();\r\n this._handleTouchEvents();\r\n };\r\n\r\n SignaturePad2.prototype.clear = function () {\r\n var ctx = this._ctx,\r\n canvas = this._canvas;\r\n\r\n ctx.fillStyle = this.backgroundColor;\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n this._reset();\r\n RentalsCaptureCtrl.secondPersonSignature = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n };\r\n\r\n SignaturePad2.prototype.showPointsToggle = function () {\r\n this.arePointsDisplayed = !this.arePointsDisplayed;\r\n };\r\n\r\n SignaturePad2.prototype.toDataURL = function (imageType, quality) {\r\n var canvas = this._canvas;\r\n return canvas.toDataURL.apply(canvas, arguments);\r\n };\r\n\r\n SignaturePad2.prototype.getBlobData = function (dataURL) {\r\n var arr = dataURL.split(','), mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n\r\n return new Blob([u8arr], { type: mime });\r\n };\r\n\r\n SignaturePad2.prototype.fromDataURL = function (dataUrl) {\r\n var self = this,\r\n image = new Image(),\r\n ratio = window.devicePixelRatio || 1,\r\n width = this._canvas.width / ratio,\r\n height = this._canvas.height / ratio;\r\n\r\n this._reset();\r\n image.src = dataUrl;\r\n image.onload = function () {\r\n self._ctx.drawImage(image, 0, 0, width, height);\r\n };\r\n this._isEmpty = false;\r\n };\r\n\r\n SignaturePad2.prototype._strokeUpdate = function (event) {\r\n var point = this._createPoint(event);\r\n if (this._isPointToBeUsed(point)) {\r\n this._addPoint(point);\r\n }\r\n };\r\n\r\n var pointsSkippedFromBeingAdded = 0;\r\n SignaturePad2.prototype._isPointToBeUsed = function (point) {\r\n // Simplifying, De-noise\r\n if (!this.minPointDistance)\r\n return true;\r\n\r\n var points = this.points;\r\n if (points && points.length) {\r\n var lastPoint = points[points.length - 1];\r\n if (point.distanceTo(lastPoint) < this.minPointDistance) {\r\n // log(++pointsSkippedFromBeingAdded);\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n\r\n SignaturePad2.prototype._strokeBegin = function (event) {\r\n this._reset();\r\n this._strokeUpdate(event);\r\n if (typeof this.onBegin === 'function') {\r\n this.onBegin(event);\r\n }\r\n };\r\n\r\n SignaturePad2.prototype._strokeDraw = function (point) {\r\n var ctx = this._ctx,\r\n dotSize = typeof (this.dotSize) === 'function' ? this.dotSize() : this.dotSize;\r\n\r\n ctx.beginPath();\r\n this._drawPoint(point.x, point.y, dotSize);\r\n ctx.closePath();\r\n ctx.fill();\r\n };\r\n\r\n SignaturePad2.prototype._strokeEnd = function (event) {\r\n var canDrawCurve = this.points.length > 2,\r\n point = this.points[0];\r\n\r\n if (!canDrawCurve && point) {\r\n this._strokeDraw(point);\r\n }\r\n if (typeof this.onEnd === 'function') {\r\n this.onEnd(event);\r\n }\r\n };\r\n\r\n SignaturePad2.prototype._handleMouseEvents = function () {\r\n this._mouseButtonDown = false;\r\n\r\n this._canvas.addEventListener(\"mousedown\", this._handleMouseDown);\r\n this._canvas.addEventListener(\"mousemove\", this._handleMouseMove);\r\n document.addEventListener(\"mouseup\", this._handleMouseUp);\r\n };\r\n\r\n SignaturePad2.prototype._handleTouchEvents = function () {\r\n // Pass touch events to canvas element on mobile IE11 and Edge.\r\n this._canvas.style.msTouchAction = 'none';\r\n this._canvas.style.touchAction = 'none';\r\n\r\n this._canvas.addEventListener(\"touchstart\", this._handleTouchStart);\r\n this._canvas.addEventListener(\"touchmove\", this._handleTouchMove);\r\n this._canvas.addEventListener(\"touchend\", this._handleTouchEnd);\r\n };\r\n\r\n SignaturePad2.prototype.on = function () {\r\n this._handleMouseEvents();\r\n this._handleTouchEvents();\r\n };\r\n\r\n SignaturePad2.prototype.off = function () {\r\n this._canvas.removeEventListener(\"mousedown\", this._handleMouseDown);\r\n this._canvas.removeEventListener(\"mousemove\", this._handleMouseMove);\r\n document.removeEventListener(\"mouseup\", this._handleMouseUp);\r\n\r\n this._canvas.removeEventListener(\"touchstart\", this._handleTouchStart);\r\n this._canvas.removeEventListener(\"touchmove\", this._handleTouchMove);\r\n this._canvas.removeEventListener(\"touchend\", this._handleTouchEnd);\r\n };\r\n\r\n SignaturePad2.prototype.isEmpty = function () {\r\n return this._isEmpty;\r\n };\r\n\r\n SignaturePad2.prototype._reset = function () {\r\n this.points = [];\r\n this._lastVelocity = 0;\r\n this._lastWidth = (this.minWidth + this.maxWidth) / 2;\r\n this._isEmpty = true;\r\n this._ctx.fillStyle = this.penColor;\r\n };\r\n\r\n SignaturePad2.prototype._createPoint = function (event) {\r\n var rect = this._canvas.getBoundingClientRect();\r\n return new Point(\r\n event.clientX - rect.left,\r\n event.clientY - rect.top\r\n );\r\n };\r\n\r\n SignaturePad2.prototype._addPoint = function (point) {\r\n var points = this.points,\r\n c2, c3,\r\n curve, tmp;\r\n\r\n points.push(point);\r\n\r\n if (points.length > 2) {\r\n // To reduce the initial lag make it work with 3 points\r\n // by copying the first point to the beginning.\r\n if (points.length === 3) points.unshift(points[0]);\r\n\r\n tmp = this._calculateCurveControlPoints(points[0], points[1], points[2]);\r\n c2 = tmp.c2;\r\n tmp = this._calculateCurveControlPoints(points[1], points[2], points[3]);\r\n c3 = tmp.c1;\r\n curve = new Bezier(points[1], c2, c3, points[2]);\r\n this._addCurve(curve);\r\n\r\n // Remove the first element from the list,\r\n // so that we always have no more than 4 points in points array.\r\n points.shift();\r\n }\r\n };\r\n\r\n SignaturePad2.prototype._calculateCurveControlPoints = function (s1, s2, s3) {\r\n var dx1 = s1.x - s2.x,\r\n dy1 = s1.y - s2.y,\r\n dx2 = s2.x - s3.x,\r\n dy2 = s2.y - s3.y,\r\n\r\n m1 = {\r\n x: (s1.x + s2.x) / 2.0,\r\n y: (s1.y + s2.y) / 2.0\r\n },\r\n m2 = {\r\n x: (s2.x + s3.x) / 2.0,\r\n y: (s2.y + s3.y) / 2.0\r\n },\r\n\r\n l1 = Math.sqrt(1.0 * dx1 * dx1 + dy1 * dy1),\r\n l2 = Math.sqrt(1.0 * dx2 * dx2 + dy2 * dy2),\r\n\r\n dxm = (m1.x - m2.x),\r\n dym = (m1.y - m2.y),\r\n\r\n k = l2 / (l1 + l2),\r\n cm = {\r\n x: m2.x + dxm * k,\r\n y: m2.y + dym * k\r\n },\r\n\r\n tx = s2.x - cm.x,\r\n ty = s2.y - cm.y;\r\n\r\n return {\r\n c1: new Point(m1.x + tx, m1.y + ty),\r\n c2: new Point(m2.x + tx, m2.y + ty)\r\n };\r\n };\r\n\r\n SignaturePad2.prototype._addCurve = function (curve) {\r\n var startPoint = curve.startPoint,\r\n endPoint = curve.endPoint,\r\n velocity, newWidth;\r\n\r\n velocity = endPoint.velocityFrom(startPoint);\r\n velocity = this.velocityFilterWeight * velocity +\r\n (1 - this.velocityFilterWeight) * this._lastVelocity;\r\n\r\n newWidth = this._strokeWidth(velocity);\r\n this._drawCurve(curve, this._lastWidth, newWidth);\r\n\r\n this._lastVelocity = velocity;\r\n this._lastWidth = newWidth;\r\n };\r\n\r\n SignaturePad2.prototype._drawPoint = function (x, y, size) {\r\n var ctx = this._ctx;\r\n\r\n ctx.moveTo(x, y);\r\n ctx.arc(x, y, size, 0, 2 * Math.PI, false);\r\n this._isEmpty = false;\r\n };\r\n\r\n SignaturePad2.prototype._drawMark = function (x, y, size) {\r\n var ctx = this._ctx;\r\n\r\n ctx.save();\r\n ctx.moveTo(x, y);\r\n ctx.arc(x, y, size, 0, 2 * Math.PI, false);\r\n ctx.fillStyle = 'rgba(255, 0, 0, 0.2)';\r\n ctx.fill();\r\n ctx.restore();\r\n };\r\n\r\n SignaturePad2.prototype._drawCurve = function (curve, startWidth, endWidth) {\r\n var ctx = this._ctx,\r\n widthDelta = endWidth - startWidth,\r\n drawSteps, width, i, t, tt, ttt, u, uu, uuu, x, y;\r\n\r\n drawSteps = Math.floor(curve.length());\r\n ctx.beginPath();\r\n for (i = 0; i < drawSteps; i++) {\r\n // Calculate the Bezier (x, y) coordinate for this step.\r\n t = i / drawSteps;\r\n tt = t * t;\r\n ttt = tt * t;\r\n u = 1 - t;\r\n uu = u * u;\r\n uuu = uu * u;\r\n\r\n x = uuu * curve.startPoint.x;\r\n x += 3 * uu * t * curve.control1.x;\r\n x += 3 * u * tt * curve.control2.x;\r\n x += ttt * curve.endPoint.x;\r\n\r\n y = uuu * curve.startPoint.y;\r\n y += 3 * uu * t * curve.control1.y;\r\n y += 3 * u * tt * curve.control2.y;\r\n y += ttt * curve.endPoint.y;\r\n\r\n width = startWidth + ttt * widthDelta;\r\n this._drawPoint(x, y, width);\r\n }\r\n ctx.closePath();\r\n ctx.fill();\r\n };\r\n\r\n SignaturePad2.prototype._strokeWidth = function (velocity) {\r\n return Math.max(this.maxWidth / (velocity + 1), this.minWidth);\r\n };\r\n\r\n var Point = function (x, y, time) {\r\n this.x = x;\r\n this.y = y;\r\n this.time = time || new Date().getTime();\r\n };\r\n\r\n Point.prototype.velocityFrom = function (start) {\r\n return (this.time !== start.time) ? this.distanceTo(start) / (this.time - start.time) : 1;\r\n };\r\n\r\n Point.prototype.distanceTo = function (start) {\r\n return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));\r\n };\r\n\r\n var Bezier = function (startPoint, control1, control2, endPoint) {\r\n this.startPoint = startPoint;\r\n this.control1 = control1;\r\n this.control2 = control2;\r\n this.endPoint = endPoint;\r\n };\r\n\r\n // Returns approximated length.\r\n Bezier.prototype.length = function () {\r\n var steps = 10,\r\n length = 0,\r\n i, t, cx, cy, px, py, xdiff, ydiff;\r\n\r\n for (i = 0; i <= steps; i++) {\r\n t = i / steps;\r\n cx = this._point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);\r\n cy = this._point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);\r\n if (i > 0) {\r\n xdiff = cx - px;\r\n ydiff = cy - py;\r\n length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);\r\n }\r\n px = cx;\r\n py = cy;\r\n }\r\n return length;\r\n };\r\n\r\n Bezier.prototype._point = function (t, start, c1, c2, end) {\r\n return start * (1.0 - t) * (1.0 - t) * (1.0 - t) +\r\n 3.0 * c1 * (1.0 - t) * (1.0 - t) * t +\r\n 3.0 * c2 * (1.0 - t) * t * t +\r\n end * t * t * t;\r\n };\r\n\r\n return SignaturePad2;\r\n })(document);\r\n\r\n var signaturePad2 = new SignaturePad2(document.getElementById('signature-pad2'), {\r\n backgroundColor: 'rgba(255, 255, 255, 0)',\r\n penColor: 'rgb(0, 0, 0)',\r\n velocityFilterWeight: .7,\r\n minWidth: 0.5,\r\n maxWidth: 2.5,\r\n throttle: 16, // max x milli seconds on event update, OBS! this introduces lag for event update\r\n minPointDistance: 3,\r\n });\r\n\r\n var saveButton2 = document.getElementById('save2'),\r\n clearButton2 = document.getElementById('clear2'),\r\n editButton2 = document.getElementById('edit2'),\r\n showPointsToggle = document.getElementById('showPointsToggle');\r\n\r\n saveButton2.addEventListener('click', function (event) {\r\n var data = signaturePad2.toDataURL('image/png');\r\n RentalsCaptureCtrl.secondPersonSignature = {\r\n FileName: \"Signature\",\r\n Blob: signaturePad.getByteArrayData(data)\r\n };\r\n\r\n $(\"#save2\").hide();\r\n $(\"#signature-pad2\").hide();\r\n $(\"#signature-pad-empty2\").show();\r\n $(\"#clear2\").show();\r\n $(\"#edit2\").show();\r\n\r\n const ctx = document.getElementById(\"signature-pad-empty2\").getContext(\"2d\");\r\n ctx.font = \"20px Italic Montserrat\";\r\n ctx.fillStyle = \"Grey\";\r\n ctx.fillText(\"Signature Saved\", 20, 55);\r\n });\r\n\r\n if (clearButton2) {\r\n clearButton2.addEventListener('click', function (event) {\r\n signaturePad2.clear();\r\n RentalsCaptureCtrl.secondPersonSignature = {\r\n FileName: null,\r\n Blob: null\r\n };\r\n\r\n $(\"#save2\").show();\r\n $(\"#clear2\").hide();\r\n $(\"#edit2\").hide();\r\n $(\"#signature-pad2\").show();\r\n $(\"#signature-pad-empty2\").hide();\r\n });\r\n }\r\n\r\n if (editButton2) {\r\n editButton2.addEventListener('click', function (event) {\r\n $(\"#save2\").show();\r\n $(\"#edit2\").hide();\r\n $(\"#clear2\").hide();\r\n $(\"#signature-pad2\").show();\r\n $(\"#signature-pad-empty2\").hide();\r\n });\r\n }\r\n\r\n if (showPointsToggle) {\r\n showPointsToggle.addEventListener('click', function (event) {\r\n signaturePad.showPointsToggle();\r\n showPointsToggle.classList.toggle('toggle');\r\n });\r\n }\r\n\r\n //section 3\r\n var SignaturePad3 = (function (document) {\r\n \"use strict\";\r\n\r\n var log = console.log.bind(console);\r\n\r\n var SignaturePad3 = function (canvas, options) {\r\n var self = this,\r\n opts = options || {};\r\n\r\n this.velocityFilterWeight = opts.velocityFilterWeight || 0.7;\r\n this.minWidth = opts.minWidth || 0.5;\r\n this.maxWidth = opts.maxWidth || 2.5;\r\n this.dotSize = opts.dotSize || function () {\r\n return (self.minWidth + self.maxWidth) / 2;\r\n };\r\n this.penColor = opts.penColor || \"black\";\r\n this.backgroundColor = opts.backgroundColor || \"rgba(0,0,0,0)\";\r\n this.throttle = opts.throttle || 0;\r\n this.throttleOptions = {\r\n leading: true,\r\n trailing: true\r\n };\r\n this.minPointDistance = opts.minPointDistance || 0;\r\n this.onEnd = opts.onEnd;\r\n this.onBegin = opts.onBegin;\r\n\r\n this._canvas = canvas;\r\n\r\n this._ctx = canvas.getContext(\"2d\");\r\n this._ctx.lineCap = 'round';\r\n this.clear();\r\n\r\n // we need add these inline so they are available to unbind while still having\r\n // access to 'self' we could use _.bind but it's not worth adding a dependency\r\n this._handleMouseDown = function (event) {\r\n if (event.which === 1) {\r\n self._mouseButtonDown = true;\r\n self._strokeBegin(event);\r\n }\r\n };\r\n\r\n var _handleMouseMove = function (event) {\r\n event.preventDefault();\r\n if (self._mouseButtonDown) {\r\n self._strokeUpdate(event);\r\n if (self.arePointsDisplayed) {\r\n var point = self._createPoint(event);\r\n self._drawMark(point.x, point.y, 5);\r\n }\r\n }\r\n };\r\n\r\n this._handleMouseMove = _.throttle(_handleMouseMove, self.throttle, self.throttleOptions);\r\n //this._handleMouseMove = _handleMouseMove;\r\n\r\n this._handleMouseUp = function (event) {\r\n if (event.which === 1 && self._mouseButtonDown) {\r\n self._mouseButtonDown = false;\r\n self._strokeEnd(event);\r\n }\r\n };\r\n\r\n this._handleTouchStart = function (event) {\r\n if (event.targetTouches.length == 1) {\r\n var touch = event.changedTouches[0];\r\n self._strokeBegin(touch);\r\n }\r\n };\r\n\r\n var _handleTouchMove = function (event) {\r\n // Prevent scrolling.\r\n event.preventDefault();\r\n\r\n var touch = event.targetTouches[0];\r\n self._strokeUpdate(touch);\r\n if (self.arePointsDisplayed) {\r\n var point = self._createPoint(touch);\r\n self._drawMark(point.x, point.y, 5);\r\n }\r\n };\r\n this._handleTouchMove = _.throttle(_handleTouchMove, self.throttle, self.throttleOptions);\r\n //this._handleTouchMove = _handleTouchMove;\r\n\r\n this._handleTouchEnd = function (event) {\r\n var wasCanvasTouched = event.target === self._canvas;\r\n if (wasCanvasTouched) {\r\n event.preventDefault();\r\n self._strokeEnd(event);\r\n }\r\n };\r\n\r\n this._handleMouseEvents();\r\n this._handleTouchEvents();\r\n };\r\n\r\n SignaturePad3.prototype.clear = function () {\r\n var ctx = this._ctx,\r\n canvas = this._canvas;\r\n\r\n ctx.fillStyle = this.backgroundColor;\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n this._reset();\r\n RentalsCaptureCtrl.thirdPersonSignature = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n };\r\n\r\n SignaturePad3.prototype.showPointsToggle = function () {\r\n this.arePointsDisplayed = !this.arePointsDisplayed;\r\n };\r\n\r\n SignaturePad3.prototype.toDataURL = function (imageType, quality) {\r\n var canvas = this._canvas;\r\n return canvas.toDataURL.apply(canvas, arguments);\r\n };\r\n\r\n SignaturePad3.prototype.getBlobData = function (dataURL) {\r\n var arr = dataURL.split(','), mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\r\n\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n\r\n return new Blob([u8arr], { type: mime });\r\n };\r\n\r\n SignaturePad3.prototype.fromDataURL = function (dataUrl) {\r\n var self = this,\r\n image = new Image(),\r\n ratio = window.devicePixelRatio || 1,\r\n width = this._canvas.width / ratio,\r\n height = this._canvas.height / ratio;\r\n\r\n this._reset();\r\n image.src = dataUrl;\r\n image.onload = function () {\r\n self._ctx.drawImage(image, 0, 0, width, height);\r\n };\r\n this._isEmpty = false;\r\n };\r\n\r\n SignaturePad3.prototype._strokeUpdate = function (event) {\r\n var point = this._createPoint(event);\r\n if (this._isPointToBeUsed(point)) {\r\n this._addPoint(point);\r\n }\r\n };\r\n\r\n var pointsSkippedFromBeingAdded = 0;\r\n SignaturePad3.prototype._isPointToBeUsed = function (point) {\r\n // Simplifying, De-noise\r\n if (!this.minPointDistance)\r\n return true;\r\n\r\n var points = this.points;\r\n if (points && points.length) {\r\n var lastPoint = points[points.length - 1];\r\n if (point.distanceTo(lastPoint) < this.minPointDistance) {\r\n // log(++pointsSkippedFromBeingAdded);\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n\r\n SignaturePad3.prototype._strokeBegin = function (event) {\r\n this._reset();\r\n this._strokeUpdate(event);\r\n if (typeof this.onBegin === 'function') {\r\n this.onBegin(event);\r\n }\r\n };\r\n\r\n SignaturePad3.prototype._strokeDraw = function (point) {\r\n var ctx = this._ctx,\r\n dotSize = typeof (this.dotSize) === 'function' ? this.dotSize() : this.dotSize;\r\n\r\n ctx.beginPath();\r\n this._drawPoint(point.x, point.y, dotSize);\r\n ctx.closePath();\r\n ctx.fill();\r\n };\r\n\r\n SignaturePad3.prototype._strokeEnd = function (event) {\r\n var canDrawCurve = this.points.length > 2,\r\n point = this.points[0];\r\n\r\n if (!canDrawCurve && point) {\r\n this._strokeDraw(point);\r\n }\r\n if (typeof this.onEnd === 'function') {\r\n this.onEnd(event);\r\n }\r\n };\r\n\r\n SignaturePad3.prototype._handleMouseEvents = function () {\r\n this._mouseButtonDown = false;\r\n\r\n this._canvas.addEventListener(\"mousedown\", this._handleMouseDown);\r\n this._canvas.addEventListener(\"mousemove\", this._handleMouseMove);\r\n document.addEventListener(\"mouseup\", this._handleMouseUp);\r\n };\r\n\r\n SignaturePad3.prototype._handleTouchEvents = function () {\r\n // Pass touch events to canvas element on mobile IE11 and Edge.\r\n this._canvas.style.msTouchAction = 'none';\r\n this._canvas.style.touchAction = 'none';\r\n\r\n this._canvas.addEventListener(\"touchstart\", this._handleTouchStart);\r\n this._canvas.addEventListener(\"touchmove\", this._handleTouchMove);\r\n this._canvas.addEventListener(\"touchend\", this._handleTouchEnd);\r\n };\r\n\r\n SignaturePad3.prototype.on = function () {\r\n this._handleMouseEvents();\r\n this._handleTouchEvents();\r\n };\r\n\r\n SignaturePad3.prototype.off = function () {\r\n this._canvas.removeEventListener(\"mousedown\", this._handleMouseDown);\r\n this._canvas.removeEventListener(\"mousemove\", this._handleMouseMove);\r\n document.removeEventListener(\"mouseup\", this._handleMouseUp);\r\n\r\n this._canvas.removeEventListener(\"touchstart\", this._handleTouchStart);\r\n this._canvas.removeEventListener(\"touchmove\", this._handleTouchMove);\r\n this._canvas.removeEventListener(\"touchend\", this._handleTouchEnd);\r\n };\r\n\r\n SignaturePad3.prototype.isEmpty = function () {\r\n return this._isEmpty;\r\n };\r\n\r\n SignaturePad3.prototype._reset = function () {\r\n this.points = [];\r\n this._lastVelocity = 0;\r\n this._lastWidth = (this.minWidth + this.maxWidth) / 2;\r\n this._isEmpty = true;\r\n this._ctx.fillStyle = this.penColor;\r\n };\r\n\r\n SignaturePad3.prototype._createPoint = function (event) {\r\n var rect = this._canvas.getBoundingClientRect();\r\n return new Point(\r\n event.clientX - rect.left,\r\n event.clientY - rect.top\r\n );\r\n };\r\n\r\n SignaturePad3.prototype._addPoint = function (point) {\r\n var points = this.points,\r\n c2, c3,\r\n curve, tmp;\r\n\r\n points.push(point);\r\n\r\n if (points.length > 2) {\r\n // To reduce the initial lag make it work with 3 points\r\n // by copying the first point to the beginning.\r\n if (points.length === 3) points.unshift(points[0]);\r\n\r\n tmp = this._calculateCurveControlPoints(points[0], points[1], points[2]);\r\n c2 = tmp.c2;\r\n tmp = this._calculateCurveControlPoints(points[1], points[2], points[3]);\r\n c3 = tmp.c1;\r\n curve = new Bezier(points[1], c2, c3, points[2]);\r\n this._addCurve(curve);\r\n\r\n // Remove the first element from the list,\r\n // so that we always have no more than 4 points in points array.\r\n points.shift();\r\n }\r\n };\r\n\r\n SignaturePad3.prototype._calculateCurveControlPoints = function (s1, s2, s3) {\r\n var dx1 = s1.x - s2.x,\r\n dy1 = s1.y - s2.y,\r\n dx2 = s2.x - s3.x,\r\n dy2 = s2.y - s3.y,\r\n\r\n m1 = {\r\n x: (s1.x + s2.x) / 2.0,\r\n y: (s1.y + s2.y) / 2.0\r\n },\r\n m2 = {\r\n x: (s2.x + s3.x) / 2.0,\r\n y: (s2.y + s3.y) / 2.0\r\n },\r\n\r\n l1 = Math.sqrt(1.0 * dx1 * dx1 + dy1 * dy1),\r\n l2 = Math.sqrt(1.0 * dx2 * dx2 + dy2 * dy2),\r\n\r\n dxm = (m1.x - m2.x),\r\n dym = (m1.y - m2.y),\r\n\r\n k = l2 / (l1 + l2),\r\n cm = {\r\n x: m2.x + dxm * k,\r\n y: m2.y + dym * k\r\n },\r\n\r\n tx = s2.x - cm.x,\r\n ty = s2.y - cm.y;\r\n\r\n return {\r\n c1: new Point(m1.x + tx, m1.y + ty),\r\n c2: new Point(m2.x + tx, m2.y + ty)\r\n };\r\n };\r\n\r\n SignaturePad3.prototype._addCurve = function (curve) {\r\n var startPoint = curve.startPoint,\r\n endPoint = curve.endPoint,\r\n velocity, newWidth;\r\n\r\n velocity = endPoint.velocityFrom(startPoint);\r\n velocity = this.velocityFilterWeight * velocity +\r\n (1 - this.velocityFilterWeight) * this._lastVelocity;\r\n\r\n newWidth = this._strokeWidth(velocity);\r\n this._drawCurve(curve, this._lastWidth, newWidth);\r\n\r\n this._lastVelocity = velocity;\r\n this._lastWidth = newWidth;\r\n };\r\n\r\n SignaturePad3.prototype._drawPoint = function (x, y, size) {\r\n var ctx = this._ctx;\r\n\r\n ctx.moveTo(x, y);\r\n ctx.arc(x, y, size, 0, 2 * Math.PI, false);\r\n this._isEmpty = false;\r\n };\r\n\r\n SignaturePad3.prototype._drawMark = function (x, y, size) {\r\n var ctx = this._ctx;\r\n\r\n ctx.save();\r\n ctx.moveTo(x, y);\r\n ctx.arc(x, y, size, 0, 2 * Math.PI, false);\r\n ctx.fillStyle = 'rgba(255, 0, 0, 0.2)';\r\n ctx.fill();\r\n ctx.restore();\r\n };\r\n\r\n SignaturePad3.prototype._drawCurve = function (curve, startWidth, endWidth) {\r\n var ctx = this._ctx,\r\n widthDelta = endWidth - startWidth,\r\n drawSteps, width, i, t, tt, ttt, u, uu, uuu, x, y;\r\n\r\n drawSteps = Math.floor(curve.length());\r\n ctx.beginPath();\r\n for (i = 0; i < drawSteps; i++) {\r\n // Calculate the Bezier (x, y) coordinate for this step.\r\n t = i / drawSteps;\r\n tt = t * t;\r\n ttt = tt * t;\r\n u = 1 - t;\r\n uu = u * u;\r\n uuu = uu * u;\r\n\r\n x = uuu * curve.startPoint.x;\r\n x += 3 * uu * t * curve.control1.x;\r\n x += 3 * u * tt * curve.control2.x;\r\n x += ttt * curve.endPoint.x;\r\n\r\n y = uuu * curve.startPoint.y;\r\n y += 3 * uu * t * curve.control1.y;\r\n y += 3 * u * tt * curve.control2.y;\r\n y += ttt * curve.endPoint.y;\r\n\r\n width = startWidth + ttt * widthDelta;\r\n this._drawPoint(x, y, width);\r\n }\r\n ctx.closePath();\r\n ctx.fill();\r\n };\r\n\r\n SignaturePad3.prototype._strokeWidth = function (velocity) {\r\n return Math.max(this.maxWidth / (velocity + 1), this.minWidth);\r\n };\r\n\r\n var Point = function (x, y, time) {\r\n this.x = x;\r\n this.y = y;\r\n this.time = time || new Date().getTime();\r\n };\r\n\r\n Point.prototype.velocityFrom = function (start) {\r\n return (this.time !== start.time) ? this.distanceTo(start) / (this.time - start.time) : 1;\r\n };\r\n\r\n Point.prototype.distanceTo = function (start) {\r\n return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));\r\n };\r\n\r\n var Bezier = function (startPoint, control1, control2, endPoint) {\r\n this.startPoint = startPoint;\r\n this.control1 = control1;\r\n this.control2 = control2;\r\n this.endPoint = endPoint;\r\n };\r\n\r\n // Returns approximated length.\r\n Bezier.prototype.length = function () {\r\n var steps = 10,\r\n length = 0,\r\n i, t, cx, cy, px, py, xdiff, ydiff;\r\n\r\n for (i = 0; i <= steps; i++) {\r\n t = i / steps;\r\n cx = this._point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);\r\n cy = this._point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);\r\n if (i > 0) {\r\n xdiff = cx - px;\r\n ydiff = cy - py;\r\n length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);\r\n }\r\n px = cx;\r\n py = cy;\r\n }\r\n return length;\r\n };\r\n\r\n Bezier.prototype._point = function (t, start, c1, c2, end) {\r\n return start * (1.0 - t) * (1.0 - t) * (1.0 - t) +\r\n 3.0 * c1 * (1.0 - t) * (1.0 - t) * t +\r\n 3.0 * c2 * (1.0 - t) * t * t +\r\n end * t * t * t;\r\n };\r\n\r\n return SignaturePad3;\r\n })(document);\r\n\r\n var signaturePad3 = new SignaturePad3(document.getElementById('signature-pad3'), {\r\n backgroundColor: 'rgba(255, 255, 255, 0)',\r\n penColor: 'rgb(0, 0, 0)',\r\n velocityFilterWeight: .7,\r\n minWidth: 0.5,\r\n maxWidth: 2.5,\r\n throttle: 16, // max x milli seconds on event update, OBS! this introduces lag for event update\r\n minPointDistance: 3,\r\n });\r\n\r\n var saveButton3 = document.getElementById('save3'),\r\n clearButton3 = document.getElementById('clear3'),\r\n editButton3 = document.getElementById('edit3'),\r\n showPointsToggle = document.getElementById('showPointsToggle');\r\n\r\n saveButton3.addEventListener('click', function (event) {\r\n var data = signaturePad3.toDataURL('image/png');\r\n RentalsCaptureCtrl.thirdPersonSignature = {\r\n FileName: \"Signature\",\r\n Blob: signaturePad.getByteArrayData(data)\r\n };\r\n\r\n $(\"#save3\").hide();\r\n $(\"#signature-pad3\").hide();\r\n $(\"#signature-pad-empty3\").show();\r\n $(\"#clear3\").show();\r\n $(\"#edit3\").show();\r\n\r\n const ctx = document.getElementById(\"signature-pad-empty3\").getContext(\"2d\");\r\n ctx.font = \"20px Italic Montserrat\";\r\n ctx.fillStyle = \"Grey\";\r\n ctx.fillText(\"Signature Saved\", 20, 55);\r\n });\r\n\r\n if (clearButton3) {\r\n clearButton3.addEventListener('click', function (event) {\r\n signaturePad3.clear();\r\n RentalsCaptureCtrl.thirdPersonSignature = {\r\n FileName: null,\r\n Blob: null\r\n };\r\n\r\n $(\"#save3\").show();\r\n $(\"#clear3\").hide();\r\n $(\"#edit3\").hide();\r\n $(\"#signature-pad3\").show();\r\n $(\"#signature-pad-empty3\").hide();\r\n });\r\n }\r\n\r\n if (editButton3) {\r\n editButton.addEventListener('click', function (event) {\r\n $(\"#save3\").show();\r\n $(\"#edit3\").hide();\r\n $(\"#clear3\").hide();\r\n $(\"#signature-pad3\").show();\r\n $(\"#signature-pad-empty3\").hide();\r\n });\r\n }\r\n\r\n if (showPointsToggle) {\r\n showPointsToggle.addEventListener('click', function (event) {\r\n signaturePad.showPointsToggle();\r\n showPointsToggle.classList.toggle('toggle');\r\n });\r\n }\r\n\r\n\r\n //section 4\r\n var SignaturePad4 = (function (document) {\r\n \"use strict\";\r\n\r\n var log = console.log.bind(console);\r\n\r\n var SignaturePad4 = function (canvas, options) {\r\n var self = this,\r\n opts = options || {};\r\n\r\n this.velocityFilterWeight = opts.velocityFilterWeight || 0.7;\r\n this.minWidth = opts.minWidth || 0.5;\r\n this.maxWidth = opts.maxWidth || 2.5;\r\n this.dotSize = opts.dotSize || function () {\r\n return (self.minWidth + self.maxWidth) / 2;\r\n };\r\n this.penColor = opts.penColor || \"black\";\r\n this.backgroundColor = opts.backgroundColor || \"rgba(0,0,0,0)\";\r\n this.throttle = opts.throttle || 0;\r\n this.throttleOptions = {\r\n leading: true,\r\n trailing: true\r\n };\r\n this.minPointDistance = opts.minPointDistance || 0;\r\n this.onEnd = opts.onEnd;\r\n this.onBegin = opts.onBegin;\r\n\r\n this._canvas = canvas;\r\n\r\n this._ctx = canvas.getContext(\"2d\");\r\n this._ctx.lineCap = 'round';\r\n this.clear();\r\n\r\n // we need add these inline so they are available to unbind while still having\r\n // access to 'self' we could use _.bind but it's not worth adding a dependency\r\n this._handleMouseDown = function (event) {\r\n if (event.which === 1) {\r\n self._mouseButtonDown = true;\r\n self._strokeBegin(event);\r\n }\r\n };\r\n\r\n var _handleMouseMove = function (event) {\r\n event.preventDefault();\r\n if (self._mouseButtonDown) {\r\n self._strokeUpdate(event);\r\n if (self.arePointsDisplayed) {\r\n var point = self._createPoint(event);\r\n self._drawMark(point.x, point.y, 5);\r\n }\r\n }\r\n };\r\n\r\n this._handleMouseMove = _.throttle(_handleMouseMove, self.throttle, self.throttleOptions);\r\n //this._handleMouseMove = _handleMouseMove;\r\n\r\n this._handleMouseUp = function (event) {\r\n if (event.which === 1 && self._mouseButtonDown) {\r\n self._mouseButtonDown = false;\r\n self._strokeEnd(event);\r\n }\r\n };\r\n\r\n this._handleTouchStart = function (event) {\r\n if (event.targetTouches.length == 1) {\r\n var touch = event.changedTouches[0];\r\n self._strokeBegin(touch);\r\n }\r\n };\r\n\r\n var _handleTouchMove = function (event) {\r\n // Prevent scrolling.\r\n event.preventDefault();\r\n\r\n var touch = event.targetTouches[0];\r\n self._strokeUpdate(touch);\r\n if (self.arePointsDisplayed) {\r\n var point = self._createPoint(touch);\r\n self._drawMark(point.x, point.y, 5);\r\n }\r\n };\r\n this._handleTouchMove = _.throttle(_handleTouchMove, self.throttle, self.throttleOptions);\r\n //this._handleTouchMove = _handleTouchMove;\r\n\r\n this._handleTouchEnd = function (event) {\r\n var wasCanvasTouched = event.target === self._canvas;\r\n if (wasCanvasTouched) {\r\n event.preventDefault();\r\n self._strokeEnd(event);\r\n }\r\n };\r\n\r\n this._handleMouseEvents();\r\n this._handleTouchEvents();\r\n };\r\n\r\n SignaturePad4.prototype.clear = function () {\r\n var ctx = this._ctx,\r\n canvas = this._canvas;\r\n\r\n ctx.fillStyle = this.backgroundColor;\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n this._reset();\r\n RentalsCaptureCtrl.fourthPersonSignature = {\r\n FileName: null,\r\n Blob: null\r\n }\r\n };\r\n\r\n SignaturePad4.prototype.showPointsToggle = function () {\r\n this.arePointsDisplayed = !this.arePointsDisplayed;\r\n };\r\n\r\n SignaturePad4.prototype.toDataURL = function (imageType, quality) {\r\n var canvas = this._canvas;\r\n return canvas.toDataURL.apply(canvas, arguments);\r\n };\r\n\r\n SignaturePad4.prototype.getBlobData = function (dataURL) {\r\n var arr = dataURL.split(','), mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n\r\n return new Blob([u8arr], { type: mime });\r\n };\r\n\r\n SignaturePad4.prototype.fromDataURL = function (dataUrl) {\r\n var self = this,\r\n image = new Image(),\r\n ratio = window.devicePixelRatio || 1,\r\n width = this._canvas.width / ratio,\r\n height = this._canvas.height / ratio;\r\n\r\n this._reset();\r\n image.src = dataUrl;\r\n image.onload = function () {\r\n self._ctx.drawImage(image, 0, 0, width, height);\r\n };\r\n this._isEmpty = false;\r\n };\r\n\r\n SignaturePad4.prototype._strokeUpdate = function (event) {\r\n var point = this._createPoint(event);\r\n if (this._isPointToBeUsed(point)) {\r\n this._addPoint(point);\r\n }\r\n };\r\n\r\n var pointsSkippedFromBeingAdded = 0;\r\n SignaturePad4.prototype._isPointToBeUsed = function (point) {\r\n // Simplifying, De-noise\r\n if (!this.minPointDistance)\r\n return true;\r\n\r\n var points = this.points;\r\n if (points && points.length) {\r\n var lastPoint = points[points.length - 1];\r\n if (point.distanceTo(lastPoint) < this.minPointDistance) {\r\n // log(++pointsSkippedFromBeingAdded);\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n\r\n SignaturePad4.prototype._strokeBegin = function (event) {\r\n this._reset();\r\n this._strokeUpdate(event);\r\n if (typeof this.onBegin === 'function') {\r\n this.onBegin(event);\r\n }\r\n };\r\n\r\n SignaturePad4.prototype._strokeDraw = function (point) {\r\n var ctx = this._ctx,\r\n dotSize = typeof (this.dotSize) === 'function' ? this.dotSize() : this.dotSize;\r\n\r\n ctx.beginPath();\r\n this._drawPoint(point.x, point.y, dotSize);\r\n ctx.closePath();\r\n ctx.fill();\r\n };\r\n\r\n SignaturePad4.prototype._strokeEnd = function (event) {\r\n var canDrawCurve = this.points.length > 2,\r\n point = this.points[0];\r\n\r\n if (!canDrawCurve && point) {\r\n this._strokeDraw(point);\r\n }\r\n if (typeof this.onEnd === 'function') {\r\n this.onEnd(event);\r\n }\r\n };\r\n\r\n SignaturePad4.prototype._handleMouseEvents = function () {\r\n this._mouseButtonDown = false;\r\n\r\n this._canvas.addEventListener(\"mousedown\", this._handleMouseDown);\r\n this._canvas.addEventListener(\"mousemove\", this._handleMouseMove);\r\n document.addEventListener(\"mouseup\", this._handleMouseUp);\r\n };\r\n\r\n SignaturePad4.prototype._handleTouchEvents = function () {\r\n // Pass touch events to canvas element on mobile IE11 and Edge.\r\n this._canvas.style.msTouchAction = 'none';\r\n this._canvas.style.touchAction = 'none';\r\n\r\n this._canvas.addEventListener(\"touchstart\", this._handleTouchStart);\r\n this._canvas.addEventListener(\"touchmove\", this._handleTouchMove);\r\n this._canvas.addEventListener(\"touchend\", this._handleTouchEnd);\r\n };\r\n\r\n SignaturePad4.prototype.on = function () {\r\n this._handleMouseEvents();\r\n this._handleTouchEvents();\r\n };\r\n\r\n SignaturePad4.prototype.off = function () {\r\n this._canvas.removeEventListener(\"mousedown\", this._handleMouseDown);\r\n this._canvas.removeEventListener(\"mousemove\", this._handleMouseMove);\r\n document.removeEventListener(\"mouseup\", this._handleMouseUp);\r\n\r\n this._canvas.removeEventListener(\"touchstart\", this._handleTouchStart);\r\n this._canvas.removeEventListener(\"touchmove\", this._handleTouchMove);\r\n this._canvas.removeEventListener(\"touchend\", this._handleTouchEnd);\r\n };\r\n\r\n SignaturePad4.prototype.isEmpty = function () {\r\n return this._isEmpty;\r\n };\r\n\r\n SignaturePad4.prototype._reset = function () {\r\n this.points = [];\r\n this._lastVelocity = 0;\r\n this._lastWidth = (this.minWidth + this.maxWidth) / 2;\r\n this._isEmpty = true;\r\n this._ctx.fillStyle = this.penColor;\r\n };\r\n\r\n SignaturePad4.prototype._createPoint = function (event) {\r\n var rect = this._canvas.getBoundingClientRect();\r\n return new Point(\r\n event.clientX - rect.left,\r\n event.clientY - rect.top\r\n );\r\n };\r\n\r\n SignaturePad4.prototype._addPoint = function (point) {\r\n var points = this.points,\r\n c2, c3,\r\n curve, tmp;\r\n\r\n points.push(point);\r\n\r\n if (points.length > 2) {\r\n // To reduce the initial lag make it work with 3 points\r\n // by copying the first point to the beginning.\r\n if (points.length === 3) points.unshift(points[0]);\r\n\r\n tmp = this._calculateCurveControlPoints(points[0], points[1], points[2]);\r\n c2 = tmp.c2;\r\n tmp = this._calculateCurveControlPoints(points[1], points[2], points[3]);\r\n c3 = tmp.c1;\r\n curve = new Bezier(points[1], c2, c3, points[2]);\r\n this._addCurve(curve);\r\n\r\n // Remove the first element from the list,\r\n // so that we always have no more than 4 points in points array.\r\n points.shift();\r\n }\r\n };\r\n\r\n SignaturePad4.prototype._calculateCurveControlPoints = function (s1, s2, s3) {\r\n var dx1 = s1.x - s2.x,\r\n dy1 = s1.y - s2.y,\r\n dx2 = s2.x - s3.x,\r\n dy2 = s2.y - s3.y,\r\n\r\n m1 = {\r\n x: (s1.x + s2.x) / 2.0,\r\n y: (s1.y + s2.y) / 2.0\r\n },\r\n m2 = {\r\n x: (s2.x + s3.x) / 2.0,\r\n y: (s2.y + s3.y) / 2.0\r\n },\r\n\r\n l1 = Math.sqrt(1.0 * dx1 * dx1 + dy1 * dy1),\r\n l2 = Math.sqrt(1.0 * dx2 * dx2 + dy2 * dy2),\r\n\r\n dxm = (m1.x - m2.x),\r\n dym = (m1.y - m2.y),\r\n\r\n k = l2 / (l1 + l2),\r\n cm = {\r\n x: m2.x + dxm * k,\r\n y: m2.y + dym * k\r\n },\r\n\r\n tx = s2.x - cm.x,\r\n ty = s2.y - cm.y;\r\n\r\n return {\r\n c1: new Point(m1.x + tx, m1.y + ty),\r\n c2: new Point(m2.x + tx, m2.y + ty)\r\n };\r\n };\r\n\r\n SignaturePad4.prototype._addCurve = function (curve) {\r\n var startPoint = curve.startPoint,\r\n endPoint = curve.endPoint,\r\n velocity, newWidth;\r\n\r\n velocity = endPoint.velocityFrom(startPoint);\r\n velocity = this.velocityFilterWeight * velocity +\r\n (1 - this.velocityFilterWeight) * this._lastVelocity;\r\n\r\n newWidth = this._strokeWidth(velocity);\r\n this._drawCurve(curve, this._lastWidth, newWidth);\r\n\r\n this._lastVelocity = velocity;\r\n this._lastWidth = newWidth;\r\n };\r\n\r\n SignaturePad4.prototype._drawPoint = function (x, y, size) {\r\n var ctx = this._ctx;\r\n\r\n ctx.moveTo(x, y);\r\n ctx.arc(x, y, size, 0, 2 * Math.PI, false);\r\n this._isEmpty = false;\r\n };\r\n\r\n SignaturePad4.prototype._drawMark = function (x, y, size) {\r\n var ctx = this._ctx;\r\n\r\n ctx.save();\r\n ctx.moveTo(x, y);\r\n ctx.arc(x, y, size, 0, 2 * Math.PI, false);\r\n ctx.fillStyle = 'rgba(255, 0, 0, 0.2)';\r\n ctx.fill();\r\n ctx.restore();\r\n };\r\n\r\n SignaturePad4.prototype._drawCurve = function (curve, startWidth, endWidth) {\r\n var ctx = this._ctx,\r\n widthDelta = endWidth - startWidth,\r\n drawSteps, width, i, t, tt, ttt, u, uu, uuu, x, y;\r\n\r\n drawSteps = Math.floor(curve.length());\r\n ctx.beginPath();\r\n for (i = 0; i < drawSteps; i++) {\r\n // Calculate the Bezier (x, y) coordinate for this step.\r\n t = i / drawSteps;\r\n tt = t * t;\r\n ttt = tt * t;\r\n u = 1 - t;\r\n uu = u * u;\r\n uuu = uu * u;\r\n\r\n x = uuu * curve.startPoint.x;\r\n x += 3 * uu * t * curve.control1.x;\r\n x += 3 * u * tt * curve.control2.x;\r\n x += ttt * curve.endPoint.x;\r\n\r\n y = uuu * curve.startPoint.y;\r\n y += 3 * uu * t * curve.control1.y;\r\n y += 3 * u * tt * curve.control2.y;\r\n y += ttt * curve.endPoint.y;\r\n\r\n width = startWidth + ttt * widthDelta;\r\n this._drawPoint(x, y, width);\r\n }\r\n ctx.closePath();\r\n ctx.fill();\r\n };\r\n\r\n SignaturePad4.prototype._strokeWidth = function (velocity) {\r\n return Math.max(this.maxWidth / (velocity + 1), this.minWidth);\r\n };\r\n\r\n var Point = function (x, y, time) {\r\n this.x = x;\r\n this.y = y;\r\n this.time = time || new Date().getTime();\r\n };\r\n\r\n Point.prototype.velocityFrom = function (start) {\r\n return (this.time !== start.time) ? this.distanceTo(start) / (this.time - start.time) : 1;\r\n };\r\n\r\n Point.prototype.distanceTo = function (start) {\r\n return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));\r\n };\r\n\r\n var Bezier = function (startPoint, control1, control2, endPoint) {\r\n this.startPoint = startPoint;\r\n this.control1 = control1;\r\n this.control2 = control2;\r\n this.endPoint = endPoint;\r\n };\r\n\r\n // Returns approximated length.\r\n Bezier.prototype.length = function () {\r\n var steps = 10,\r\n length = 0,\r\n i, t, cx, cy, px, py, xdiff, ydiff;\r\n\r\n for (i = 0; i <= steps; i++) {\r\n t = i / steps;\r\n cx = this._point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);\r\n cy = this._point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);\r\n if (i > 0) {\r\n xdiff = cx - px;\r\n ydiff = cy - py;\r\n length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);\r\n }\r\n px = cx;\r\n py = cy;\r\n }\r\n return length;\r\n };\r\n\r\n Bezier.prototype._point = function (t, start, c1, c2, end) {\r\n return start * (1.0 - t) * (1.0 - t) * (1.0 - t) +\r\n 3.0 * c1 * (1.0 - t) * (1.0 - t) * t +\r\n 3.0 * c2 * (1.0 - t) * t * t +\r\n end * t * t * t;\r\n };\r\n\r\n return SignaturePad4;\r\n })(document);\r\n\r\n var signaturePad4 = new SignaturePad4(document.getElementById('signature-pad4'), {\r\n backgroundColor: 'rgba(255, 255, 255, 0)',\r\n penColor: 'rgb(0, 0, 0)',\r\n velocityFilterWeight: .7,\r\n minWidth: 0.5,\r\n maxWidth: 2.5,\r\n throttle: 16, // max x milli seconds on event update, OBS! this introduces lag for event update\r\n minPointDistance: 3,\r\n });\r\n\r\n var saveButton4 = document.getElementById('save4'),\r\n clearButton4 = document.getElementById('clear4'),\r\n editButton4 = document.getElementById('edit4'),\r\n showPointsToggle = document.getElementById('showPointsToggle');\r\n\r\n saveButton4.addEventListener('click', function (event) {\r\n var data = signaturePad4.toDataURL('image/png');\r\n RentalsCaptureCtrl.fourthPersonSignature = {\r\n FileName: \"Signature\",\r\n Blob: signaturePad.getByteArrayData(data)\r\n };\r\n\r\n $(\"#save4\").hide();\r\n $(\"#signature-pad4\").hide();\r\n $(\"#signature-pad-empty4\").show();\r\n $(\"#clear4\").show();\r\n $(\"#edit4\").show();\r\n\r\n const ctx = document.getElementById(\"signature-pad-empty4\").getContext(\"2d\");\r\n ctx.font = \"20px Italic Montserrat\";\r\n ctx.fillStyle = \"Grey\";\r\n ctx.fillText(\"Signature Saved\", 20, 55);\r\n\r\n });\r\n\r\n if (clearButton4) {\r\n clearButton4.addEventListener('click', function (event) {\r\n signaturePad4.clear();\r\n RentalsCaptureCtrl.fourthPersonSignature = {\r\n FileName: null,\r\n Blob: null\r\n };\r\n\r\n $(\"#save4\").show();\r\n $(\"#clear4\").hide();\r\n $(\"#edit4\").hide();\r\n $(\"#signature-pad4\").show();\r\n $(\"#signature-pad-empty4\").hide();\r\n });\r\n }\r\n\r\n if (editButton4) {\r\n editButton4.addEventListener('click', function (event) {\r\n $(\"#save4\").show();\r\n $(\"#edit4\").hide();\r\n $(\"#clear4\").hide();\r\n $(\"#signature-pad4\").show();\r\n $(\"#signature-pad-empty4\").hide();\r\n });\r\n }\r\n\r\n if (showPointsToggle) {\r\n showPointsToggle.addEventListener('click', function (event) {\r\n signaturePad.showPointsToggle();\r\n showPointsToggle.classList.toggle('toggle');\r\n });\r\n }\r\n });\r\n }\r\n\r\n reload() {\r\n if (window.localStorage) {\r\n if (!localStorage.getItem('firstLoad')) {\r\n localStorage['firstLoad'] = true;\r\n window.location.reload();\r\n }\r\n else\r\n localStorage.removeItem('firstLoad');\r\n }\r\n }\r\n\r\n setRentalInitialData() {\r\n this.rentalsHeader.RentalInitialApplicationsID = this.RentalInitialApplicationsIDFetched.Id;\r\n this.rentalsHeader.rentalAmount = this.RentalInitialApplicationsIDFetched.RentalAmount;\r\n this.rentalsHeader.premisesAddress = this.RentalInitialApplicationsIDFetched.UnitName;\r\n this.firstPerson.RentalInitialApplicationsID = this.RentalInitialApplicationsIDFetched.Id;\r\n this.secondPerson.RentalInitialApplicationsID = this.RentalInitialApplicationsIDFetched.Id;\r\n this.thirdPerson.RentalInitialApplicationsID = this.RentalInitialApplicationsIDFetched.Id;\r\n this.fourthPerson.RentalInitialApplicationsID = this.RentalInitialApplicationsIDFetched.Id;\r\n this.generalDetails.RentalInitialApplicationsID = this.RentalInitialApplicationsIDFetched.Id;\r\n this.declarations.RentalInitialApplicationsID = this.RentalInitialApplicationsIDFetched.Id;\r\n }\r\n\r\n async getMaritalStatuses() {\r\n this.$timeout(async () => {\r\n if (!this.isBusy) {\r\n this._switchIsBusy(true);\r\n }\r\n\r\n await this.RentalsCaptureService.getMaritalStatuses();\r\n if (this.isBusy) {\r\n this._switchIsBusy(false);\r\n }\r\n });\r\n }\r\n\r\n handleDrop(files, type) {\r\n console.log('handleDrop');\r\n if (!this.disableFileUpload()) {\r\n this.uploadFile(files[0]);\r\n }\r\n }\r\n\r\n selectFile(id) {\r\n const file = $('input[type=file]#' + id)[0].files[0];\r\n this.uploadFile(file);\r\n }\r\n\r\n uploadFile(file) {\r\n if (file) {\r\n this.readAndStore(file);\r\n } else {\r\n console.error('No file And/Or purchaser', this.purchaser);\r\n }\r\n\r\n $('input[type=file]').each((i, el) => $(el).val(''));\r\n }\r\n\r\n readAndStore(file, type) {\r\n if (file.type !== 'application/pdf') {\r\n const errorMsg = 'Wrong file type, only PDFs are allowed.';\r\n this.NotificationService.error(errorMsg);\r\n\r\n console.error(\r\n `${errorMsg} \"${file.name}\" is not in the correct format for ${type} - only PDFs are allowed.`\r\n );\r\n\r\n return false;\r\n }\r\n else if (file.name.length > 50) {\r\n const errorMsg = 'Filename too long. Please shorten your filename to less than 50 characters.';\r\n this.NotificationService.error(errorMsg);\r\n\r\n console.error(\r\n `Filename too long. Please shorten your filename to less than 50 characters.`\r\n );\r\n return false;\r\n }\r\n else if (file.size > 5242880) {\r\n const errorMsg = 'File size too large. Please reduce the size of your file to smaller than 5 mega bytes.';\r\n this.NotificationService.error(errorMsg);\r\n\r\n console.error(\r\n `File size too large. Please reduce the size of your file to smaller than 5 mega bytes.`\r\n );\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }\r\n\r\n _updateDatePicker() {\r\n this.$rootScope.$eval(() => {\r\n this.$timeout(() => {\r\n const selector = '.date-picker';\r\n const $input = $(selector);\r\n\r\n $input.datepicker('update');\r\n });\r\n });\r\n }\r\n\r\n _initializeDatePicker() {\r\n this.$timeout(() => {\r\n const selector = '.date-picker';\r\n const $purchasorInput = $(selector, $('#purchaseInformationForm'));\r\n\r\n let dateNow = new Date();\r\n let minimumDate = moment(dateNow).startOf('month').add(2, 'M').toDate();\r\n if (dateNow.getDay() > 15) {\r\n minimumDate = moment(minimumDate).add(1, 'M').toDate();\r\n }\r\n\r\n const startDate = moment(minimumDate).toDate();\r\n const endDate = '+20y';\r\n\r\n const purchasorInputOptions = {\r\n startDate,\r\n endDate,\r\n autoclose: true,\r\n forceParse: true,\r\n container: selector,\r\n format: \"yyyy-mm\",\r\n startView: \"months\",\r\n minViewMode: \"months\",\r\n assumeNearbyYear: true,\r\n enableOnReadonly: true,\r\n };\r\n\r\n $purchasorInput.datepicker(purchasorInputOptions);\r\n\r\n const selector1 = '#date-picker-reg';\r\n const $regInput = $(selector1, $('#uploadRegistrationForm'));\r\n\r\n const regInputOptions = {\r\n autoclose: true,\r\n forceParse: true,\r\n container: selector1,\r\n format: 'yyyy-mm-dd',\r\n assumeNearbyYear: true,\r\n enableOnReadonly: true\r\n };\r\n\r\n $regInput.datepicker(regInputOptions);\r\n });\r\n }\r\n\r\n _switchIsBusy(flag) {\r\n this.$timeout(() => {\r\n this.isBusy = flag;\r\n });\r\n }\r\n\r\n checkIfOwnProperty() {\r\n var notOwnProperty = document.getElementById('dontOwnProperty1');\r\n if (notOwnProperty.checked == true) {\r\n $(\"#ifNoDiv1\").show();\r\n this.firstPerson.OwnCurrentResidence = false;\r\n }\r\n else {\r\n $(\"#ifNoDiv1\").hide();\r\n this.firstPerson.OwnCurrentResidence = true;\r\n }\r\n };\r\n\r\n checkIfOwnProperty2() {\r\n var notOwnProperty = document.getElementById('dontOwnProperty2');\r\n if (notOwnProperty.checked == true) {\r\n $(\"#ifNoDiv2\").show();\r\n this.secondPerson.OwnCurrentResidence = false;\r\n }\r\n else {\r\n $(\"#ifNoDiv2\").hide();\r\n this.secondPerson.OwnCurrentResidence = true;\r\n }\r\n };\r\n\r\n checkIfOwnProperty3() {\r\n var notOwnProperty = document.getElementById('dontOwnProperty3');\r\n if (notOwnProperty.checked == true) {\r\n $(\"#ifNoDiv3\").show();\r\n this.thirdPerson.OwnCurrentResidence = false;\r\n }\r\n else {\r\n $(\"#ifNoDiv3\").hide();\r\n this.thirdPerson.OwnCurrentResidence = true;\r\n }\r\n };\r\n\r\n checkIfOwnProperty4() {\r\n var notOwnProperty = document.getElementById('dontOwnProperty4');\r\n if (notOwnProperty.checked == true) {\r\n $(\"#ifNoDiv4\").show();\r\n this.fourthPerson.OwnCurrentResidence = false;\r\n }\r\n else {\r\n $(\"#ifNoDiv4\").hide();\r\n this.fourthPerson.OwnCurrentResidence = true;\r\n }\r\n };\r\n\r\n checkIfLivesWithPartner2() {\r\n var livesWithPartner = document.getElementById('livesWithPartner2');\r\n if (livesWithPartner.checked == true) {\r\n $(\".secondAddress\").hide();\r\n this.livesWithPartner2 = true;\r\n }\r\n else {\r\n $(\".secondAddress\").show();\r\n this.livesWithPartner2 = false;\r\n }\r\n };\r\n\r\n currentlyEmployedCheck2() {\r\n var currentlyEmployed = document.getElementById('currentlyEmployed2');\r\n if (currentlyEmployed.checked == false) {\r\n $(\".employmentData2\").hide();\r\n $(\"#affordability\").hide();\r\n this.spousIsWorking2 = false;\r\n }\r\n else {\r\n $(\".employmentData2\").show();\r\n $(\"#affordability\").show();\r\n this.spousIsWorking2 = true;\r\n }\r\n };\r\n\r\n checkIfLivesWithPartner3() {\r\n var livesWithPartner = document.getElementById('livesWithPartner3');\r\n if (livesWithPartner.checked == true) {\r\n $(\".thirdAddress\").hide();\r\n this.livesWithPartner3 = true;\r\n }\r\n else {\r\n $(\".thirdAddress\").show();\r\n this.livesWithPartner3 = false;\r\n }\r\n };\r\n\r\n currentlyEmployedCheck3() {\r\n var currentlyEmployed = document.getElementById('currentlyEmployed3');\r\n if (currentlyEmployed.checked == false) {\r\n $(\".employmentData3\").hide();\r\n $(\"#affordability2\").hide();\r\n this.spousIsWorking3 = false;\r\n }\r\n else {\r\n $(\".employmentData3\").show();\r\n $(\"#affordability2\").show();\r\n this.spousIsWorking3 = true;\r\n }\r\n };\r\n\r\n\r\n checkIfJudgementOrDefault() {\r\n var isDefaultOrJudgement = document.getElementById('isDefaulted');\r\n if (isDefaultOrJudgement.checked == true) {\r\n $(\"#isDefaultOrJudgementDiv\").show();\r\n }\r\n else {\r\n $(\"#isDefaultOrJudgementDiv\").hide();\r\n }\r\n }\r\n\r\n viewSupportingDocs() {\r\n var isViewingSuppDocs = document.getElementById('viewSupportingDocs');\r\n if (isViewingSuppDocs.checked == false) {\r\n $(\"#supportingDocs\").hide();\r\n }\r\n else {\r\n $(\"#supportingDocs\").show();\r\n }\r\n };\r\n\r\n viewOtherTenantInfo() {\r\n var isOccupying = document.getElementById('isOccupying');\r\n if (isOccupying.checked == true) {\r\n $(\"#otherTenantInformation\").hide();\r\n }\r\n else {\r\n $(\"#otherTenantInformation\").show();\r\n }\r\n };\r\n\r\n getNumberOfChildren() {\r\n var numOfChildren = document.getElementById('numOfChildrenInput').value;\r\n switch (numOfChildren) {\r\n case \"1\":\r\n $(\"#childrenAgesDiv\").show();\r\n $(\"#childDiv1\").show();\r\n $(\"#childDiv2\").hide();\r\n $(\"#childDiv3\").hide();\r\n $(\"#childDiv4\").hide();\r\n break;\r\n case \"2\":\r\n $(\"#childrenAgesDiv\").show();\r\n $(\"#childDiv1\").show();\r\n $(\"#childDiv2\").show();\r\n $(\"#childDiv3\").hide();\r\n $(\"#childDiv4\").hide();\r\n break;\r\n case \"3\":\r\n $(\"#childrenAgesDiv\").show();\r\n $(\"#childDiv1\").show();\r\n $(\"#childDiv2\").show();\r\n $(\"#childDiv3\").show();\r\n $(\"#childDiv4\").hide();\r\n break;\r\n case \"4\":\r\n $(\"#childrenAgesDiv\").show();\r\n $(\"#childDiv1\").show();\r\n $(\"#childDiv2\").show();\r\n $(\"#childDiv3\").show();\r\n $(\"#childDiv4\").show();\r\n break;\r\n default:\r\n $(\"#childrenAgesDiv\").hide();\r\n $(\"#childDiv1\").hide();\r\n $(\"#childDiv2\").hide();\r\n $(\"#childDiv3\").hide();\r\n $(\"#childDiv4\").hide();\r\n break;\r\n }\r\n\r\n };\r\n\r\n getNumberOfVehincles() {\r\n var numOfVehicles = document.getElementById('numOfVehiclesInput').value;\r\n\r\n switch (numOfVehicles) {\r\n case \"1\":\r\n $(\"#vehicleTypeDiv1\").show();\r\n $(\"#vehicleTypeDiv2\").hide();\r\n $(\"#vehicleTypeDiv3\").hide();\r\n $(\"#vehicleTypeDiv4\").hide();\r\n break;\r\n case \"2\":\r\n $(\"#vehicleTypeDiv1\").show();\r\n $(\"#vehicleTypeDiv2\").show();\r\n $(\"#vehicleTypeDiv3\").hide();\r\n $(\"#vehicleTypeDiv4\").hide();\r\n break;\r\n case \"3\":\r\n $(\"#vehicleTypeDiv1\").show();\r\n $(\"#vehicleTypeDiv2\").show();\r\n $(\"#vehicleTypeDiv3\").show();\r\n $(\"#vehicleTypeDiv4\").hide();\r\n break;\r\n case \"4\":\r\n $(\"#vehicleTypeDiv1\").show();\r\n $(\"#vehicleTypeDiv2\").show();\r\n $(\"#vehicleTypeDiv3\").show();\r\n $(\"#vehicleTypeDiv4\").show();\r\n break;\r\n default:\r\n $(\"#vehicleTypeDiv1\").hide();\r\n $(\"#vehicleTypeDiv2\").hide();\r\n $(\"#vehicleTypeDiv3\").hide();\r\n $(\"#vehicleTypeDiv4\").hide();\r\n break;\r\n }\r\n };\r\n\r\n addSecondApplicantClick() {\r\n $(\"#secondApplicantInfo\").show();\r\n $(\".secondApplicantSignature\").show();\r\n $(\"#secondApplicantSectionModal\").show();\r\n $('#SecondPersonDetails').collapse('show');\r\n $(\"#addThirdApplicantDiv\").show();\r\n $(\"#removeSecondApplicantDiv\").show();\r\n $(\"#secondSection\").show();\r\n this.secondApplicationChosen = true;\r\n $(\".secondApplicantButtonDiv\").hide();\r\n }\r\n\r\n uploadFirstSignature() {\r\n $(\"#save\").hide();\r\n $(\"#clear\").hide();\r\n $(\"#signature-pad\").hide();\r\n $(\"#upload\").show();\r\n }\r\n\r\n uploadSecondSignature() {\r\n $(\"#save2\").hide();\r\n $(\"#clear2\").hide();\r\n $(\"#signature-pad2\").hide();\r\n $(\"#upload2\").show();\r\n $(\"#upButton2\").hide();\r\n $(\"#sigpad2\").show();\r\n }\r\n\r\n uploadThirdSignature() {\r\n $(\"#save3\").hide();\r\n $(\"#clear3\").hide();\r\n $(\"#signature-pad3\").hide();\r\n $(\"#upload3\").show();\r\n $(\"#upButton3\").hide();\r\n $(\"#sigpad3\").show();\r\n }\r\n\r\n uploadFourthSignature() {\r\n $(\"#save4\").hide();\r\n $(\"#clear4\").hide();\r\n $(\"#signature-pad4\").hide();\r\n $(\"#upload4\").show();\r\n $(\"#upButton4\").hide();\r\n $(\"#sigpad4\").show();\r\n }\r\n\r\n useFirstSigPad() {\r\n $(\"#save\").show();\r\n $(\"#clear\").show();\r\n $(\"#signature-pad\").show();\r\n $(\"#upload\").hide();\r\n $(\"#upButton\").show();\r\n $(\"#sigpad\").hide();\r\n\r\n }\r\n\r\n useSecondSigPad() {\r\n\r\n $(\"#save2\").show();\r\n $(\"#clear2\").show();\r\n $(\"#signature-pad2\").show();\r\n $(\"#upload2\").hide();\r\n $(\"#upButton2\").show();\r\n $(\"#sigpad2\").hide();\r\n }\r\n\r\n useThirdSigPad() {\r\n $(\"#save3\").show();\r\n $(\"#clear3\").show();\r\n $(\"#signature-pad3\").show();\r\n $(\"#upload3\").hide();\r\n $(\"#upButton3\").show();\r\n $(\"#sigpad3\").hide();\r\n }\r\n\r\n useFourthSigPad() {\r\n $(\"#save4\").show();\r\n $(\"#clear4\").show();\r\n $(\"#signature-pad4\").show();\r\n $(\"#upload4\").hide();\r\n $(\"#upButton4\").show();\r\n $(\"#sigpad4\").hide();\r\n }\r\n\r\n removeSecondApplicantClick() {\r\n $(\"#secondApplicantInfo\").hide();\r\n $(\".secondApplicantSignature\").hide();\r\n $(\"#secondApplicantSectionModal\").hide();\r\n $(\"#SecondPersonDetails\").collapse('hide');\r\n $(\"#addThirdApplicantDiv\").hide();\r\n $(\"#removeSecondApplicantDiv\").hide();\r\n $(\"#secondSection\").hide();\r\n $(\".secondApplicantButtonDiv\").show();\r\n this.secondApplicationChosen = false;\r\n\r\n this.secondPerson.CurrentStreet = \"\";\r\n this.secondPerson.CurrentSuburb = \"\";\r\n this.secondPerson.CurrentCity = \"\";\r\n this.secondPerson.CurrentProvince = \"\";\r\n this.secondPerson.CurrentPostalCode = \"\";\r\n\r\n this.secondPerson.landlordName = \"\";\r\n this.secondPerson.LandlordNumber = null;\r\n this.secondPerson.landlordEmail = \"\";\r\n this.secondPerson.RentalAmountPaid = null;\r\n this.secondPerson.TimeLivingAtResidence = null;\r\n\r\n RentalsCaptureCtrl.secondProofOfAddressBlobData = null;\r\n\r\n this.secondPerson.Occupation = \"\";\r\n this.secondPerson.employersName = \"\";\r\n this.secondPerson.EmployersNumber = null;\r\n this.secondPerson.EmployersEmail = \"\";\r\n this.secondPerson.PeriodOfEmployment = null;\r\n this.secondPerson.grossMonthlySalary = null;\r\n this.secondPerson.currentMonthlyExpenses = null;\r\n\r\n }\r\n\r\n addThirdApplicantClick() {\r\n $(\"#removeSecondApplicantDiv\").hide();\r\n\r\n $(\"#thirdApplicantInfo\").show();\r\n $(\".thirdApplicantSignature\").show();\r\n $(\"#thirdApplicantSectionModal\").show();\r\n $('#ThirdPersonDetails').collapse('show');\r\n $(\"#addFourthApplicantDiv\").show();\r\n $(\"#removeThirdApplicantDiv\").show();\r\n $(\"#thirdSection\").show();\r\n this.thirdApplicationChosen = true;\r\n $(\".thirdApplicantButtons\").hide();\r\n }\r\n\r\n removeThirdApplicantClick() {\r\n if (!this.isFirstApplicantPartner)\r\n $(\"#removeSecondApplicantDiv\").show();\r\n\r\n\r\n $(\"#thirdApplicantInfo\").hide();\r\n $(\".thirdApplicantSignature\").hide();\r\n $(\"#thirdApplicantSectionModal\").hide();\r\n $(\"#thirdPersonDetails\").collapse('hide');\r\n $(\"#addThirdApplicantDiv\").show();\r\n $(\"#removeThirdApplicantDiv\").hide();\r\n $(\"#addFourthApplicantDiv\").hide();\r\n $(\"#thirdSection\").hide();\r\n this.thirdApplicationChosen = false;\r\n\r\n }\r\n\r\n addFourthApplicantClick() {\r\n\r\n $(\"#removeThirdApplicantDiv\").hide();\r\n\r\n $(\"#fourthApplicantInfo\").show();\r\n $(\".fourthApplicantSignature\").show();\r\n $(\"#fourthApplicantSectionModal\").show();\r\n $('#FourthPersonDetails').collapse('show');\r\n $(\"#removeFourthApplicantDiv\").show();\r\n $(\"#fourthSection\").show();\r\n this.fourthApplicationChosen = true;\r\n $(\".fourthApplicantButtons\").hide();\r\n }\r\n\r\n removeFourthApplicantClick() {\r\n $(\"#removeThirdApplicantDiv\").show();\r\n $(\"#addThirdApplicantDiv\").show();\r\n\r\n $(\"#fourthApplicantInfo\").hide();\r\n $(\".fourthApplicantSignature\").hide();\r\n $(\"#fourthApplicantSectionModal\").hide();\r\n $(\"#fourthPersonDetails\").collapse('hide');\r\n\r\n $(\"#removeFourthApplicantDiv\").hide();\r\n $(\"#fourthSection\").hide();\r\n this.fourthApplicationChosen = false;\r\n $(\".fourthApplicantButtons\").show();\r\n }\r\n\r\n checkSecondSpouse() {\r\n if (this.isFirstApplicantPartner == true) {\r\n this.secondPerson.MaritalStatus = \"Married In Community Of Property\";\r\n\r\n if (this.livesWithPartner2 == true) {\r\n this.secondPerson.CurrentStreet = this.firstPerson.CurrentStreet;\r\n this.secondPerson.CurrentSuburb = this.firstPerson.CurrentSuburb;\r\n this.secondPerson.CurrentCity = this.firstPerson.CurrentCity;\r\n this.secondPerson.CurrentProvince = this.firstPerson.CurrentProvince;\r\n this.secondPerson.CurrentPostalCode = this.firstPerson.CurrentPostalCode;\r\n\r\n this.secondPerson.landlordName = this.firstPerson.landlordName;\r\n this.secondPerson.LandlordNumber = this.firstPerson.LandlordNumber;\r\n this.secondPerson.landlordEmail = this.firstPerson.landlordEmail;\r\n this.secondPerson.RentalAmountPaid = this.firstPerson.RentalAmountPaid;\r\n this.secondPerson.TimeLivingAtResidence = this.firstPerson.TimeLivingAtResidence;\r\n\r\n RentalsCaptureCtrl.secondProofOfAddressBlobData = RentalsCaptureCtrl.firstProofOfAddressBlobData;\r\n RentalsCaptureCtrl.secondBankStatementsBlobData = RentalsCaptureCtrl.firstProofOfAddressBlobData;\r\n }\r\n\r\n if (this.spousIsWorking2 == false) {\r\n this.secondPerson.Occupation = \"Not Working\";\r\n this.secondPerson.employersName = \"Not Working\";\r\n this.secondPerson.EmployersNumber = \"Not Working\";\r\n this.secondPerson.EmployersEmail = \"Not Working\";\r\n this.secondPerson.employersStreet = \"Not Working\";\r\n this.secondPerson.employersSuburb = \"Not Working\";\r\n this.secondPerson.employersCity = \"Not Working\";\r\n this.secondPerson.employersProvince = \"Not Working\";\r\n this.secondPerson.employersPostalcode = \"0000\";\r\n this.secondPerson.PeriodOfEmployment = 0;\r\n this.secondPerson.grossMonthlySalary = 0;\r\n this.secondPerson.currentMonthlyExpenses = 0;\r\n }\r\n }\r\n\r\n }\r\n\r\n checkThirdSpouse() {\r\n if (this.isSecondApplicantPartner == true) {\r\n this.thirdPerson.MaritalStatus = \"Married In Community Of Property\";\r\n\r\n if (this.livesWithPartner3 == true) {\r\n this.thirdPerson.CurrentStreet = this.secondPerson.CurrentStreet;\r\n this.thirdPerson.CurrentSuburb = this.secondPerson.CurrentSuburb;\r\n this.thirdPerson.CurrentCity = this.secondPerson.CurrentCity;\r\n this.thirdPerson.CurrentProvince = this.secondPerson.CurrentProvince;\r\n this.thirdPerson.CurrentPostalCode = this.secondPerson.CurrentPostalCode;\r\n\r\n this.thirdPerson.landlordName = this.secondPerson.landlordName;\r\n this.thirdPerson.LandlordNumber = this.secondPerson.LandlordNumber;\r\n this.thirdPerson.landlordEmail = this.secondPerson.landlordEmail;\r\n this.thirdPerson.RentalAmountPaid = this.secondPerson.RentalAmountPaid;\r\n this.thirdPerson.TimeLivingAtResidence = this.secondPerson.TimeLivingAtResidence;\r\n\r\n RentalsCaptureCtrl.thirdProofOfAddressBlobData = RentalsCaptureCtrl.secondProofOfAddressBlobData;\r\n }\r\n\r\n if (this.spousIsWorking3 == false) {\r\n this.thirdPerson.Occupation = \"Not Working\";\r\n this.thirdPerson.employersName = \"Not Working\";\r\n this.thirdPerson.EmployersNumber = \"Not Working\";\r\n this.thirdPerson.EmployersEmail = \"Not Working\";\r\n this.thirdPerson.employersStreet = \"Not Working\";\r\n this.thirdPerson.employersSuburb = \"Not Working\";\r\n this.thirdPerson.employersCity = \"Not Working\";\r\n this.thirdPerson.employersProvince = \"Not Working\";\r\n this.thirdPerson.employersPostalcode = \"0000\";\r\n this.thirdPerson.PeriodOfEmployment = 0;\r\n this.thirdPerson.grossMonthlySalary = 0;\r\n this.thirdPerson.currentMonthlyExpenses = 0;\r\n }\r\n }\r\n\r\n }\r\n\r\n checkFourthSpouse() {\r\n if (this.isThirdApplicantPartner == true) {\r\n this.fourthPerson.MaritalStatus = \"Married In Community Of Property\";\r\n\r\n if (this.livesWithPartner4 == true) {\r\n this.fourthPerson.CurrentStreet = this.thirdPerson.CurrentStreet;\r\n this.fourthPerson.CurrentSuburb = this.thirdPerson.CurrentSuburb;\r\n this.fourthPerson.CurrentCity = this.thirdPerson.CurrentCity;\r\n this.fourthPerson.CurrentProvince = this.thirdPerson.CurrentProvince;\r\n this.fourthPerson.CurrentPostalCode = this.thirdPerson.CurrentPostalCode;\r\n\r\n this.fourthPerson.landlordName = this.thirdPerson.landlordName;\r\n this.fourthPerson.LandlordNumber = this.thirdPerson.LandlordNumber;\r\n this.fourthPerson.landlordEmail = this.thirdPerson.landlordEmail;\r\n this.fourthPerson.RentalAmountPaid = this.thirdPerson.RentalAmountPaid;\r\n this.fourthPerson.TimeLivingAtResidence = this.thirdPerson.TimeLivingAtResidence;\r\n\r\n RentalsCaptureCtrl.fourthProofOfAddressBlobData = RentalsCaptureCtrl.thirdProofOfAddressBlobData;\r\n }\r\n\r\n if (this.spousIsWorking4 == false) {\r\n this.fourthPerson.Occupation = \"Not Working\";\r\n this.fourthPerson.employersName = \"Not Working\";\r\n this.fourthPerson.EmployersNumber = \"Not Working\";\r\n this.fourthPerson.EmployersEmail = \"Not Working\";\r\n this.fourthPerson.employersStreet = \"Not Working\";\r\n this.fourthPerson.employersSuburb = \"Not Working\";\r\n this.fourthPerson.employersCity = \"Not Working\";\r\n this.fourthPerson.employersProvince = \"Not Working\";\r\n this.fourthPerson.employersPostalcode = \"0000\";\r\n this.fourthPerson.PeriodOfEmployment = 0;\r\n this.fourthPerson.grossMonthlySalary = 0;\r\n this.fourthPerson.currentMonthlyExpenses = 0;\r\n }\r\n }\r\n }\r\n\r\n validateAndSubmit() {\r\n this.checkSecondSpouse();\r\n this.checkThirdSpouse();\r\n this.checkFourthSpouse();\r\n this.validateForm();\r\n\r\n document.getElementById(\"acknowledgementList\").innerHTML = \"\";\r\n document.getElementById(\"firstApplicantList\").innerHTML = \"\";\r\n document.getElementById(\"secondApplicantList\").innerHTML = \"\";\r\n document.getElementById(\"thirdApplicantList\").innerHTML = \"\";\r\n document.getElementById(\"fourthApplicantList\").innerHTML = \"\";\r\n document.getElementById(\"generalDetailsList\").innerHTML = \"\";\r\n document.getElementById(\"declarationsList\").innerHTML = \"\";\r\n if (this.formsErrors.acknowledgmentSection.length > 0) {\r\n var ul = document.getElementById(\"acknowledgementList\");\r\n for (var x = 0; x < this.formsErrors.acknowledgmentSection.length; x++) {\r\n var li = document.createElement(\"li\");\r\n li.appendChild(document.createTextNode(this.formsErrors.acknowledgmentSection[x]));\r\n ul.appendChild(li);\r\n }\r\n $(\"#acknowledgementSectionModal\").show();\r\n }\r\n else {\r\n $(\"#acknowledgementSectionModal\").hide();\r\n }\r\n\r\n if (this.formsErrors.firstApplicant.length > 0) {\r\n var ul = document.getElementById(\"firstApplicantList\");\r\n for (var x = 0; x < this.formsErrors.firstApplicant.length; x++) {\r\n var li = document.createElement(\"li\");\r\n li.appendChild(document.createTextNode(this.formsErrors.firstApplicant[x]));\r\n ul.appendChild(li);\r\n }\r\n $(\"#firstApplicantSectionModal\").show();\r\n }\r\n else {\r\n $(\"#firstApplicantSectionModal\").hide();\r\n }\r\n\r\n if (this.formsErrors.secondApplicant.length > 0) {\r\n var ul = document.getElementById(\"secondApplicantList\");\r\n for (var x = 0; x < this.formsErrors.secondApplicant.length; x++) {\r\n var li = document.createElement(\"li\");\r\n li.appendChild(document.createTextNode(this.formsErrors.secondApplicant[x]));\r\n ul.appendChild(li);\r\n }\r\n $(\"#secondApplicantSectionModal\").show();\r\n }\r\n else {\r\n $(\"#secondApplicantSectionModal\").hide();\r\n }\r\n\r\n if (this.formsErrors.thirdApplicant.length > 0) {\r\n var ul = document.getElementById(\"thirdApplicantList\");\r\n for (var x = 0; x < this.formsErrors.thirdApplicant.length; x++) {\r\n var li = document.createElement(\"li\");\r\n li.appendChild(document.createTextNode(this.formsErrors.thirdApplicant[x]));\r\n ul.appendChild(li);\r\n }\r\n $(\"#thirdApplicantSectionModal\").show();\r\n }\r\n else {\r\n $(\"#thirdApplicantSectionModal\").hide();\r\n }\r\n\r\n if (this.formsErrors.fourthApplicant.length > 0) {\r\n var ul = document.getElementById(\"fourthApplicantList\");\r\n for (var x = 0; x < this.formsErrors.fourthApplicant.length; x++) {\r\n var li = document.createElement(\"li\");\r\n li.appendChild(document.createTextNode(this.formsErrors.fourthApplicant[x]));\r\n ul.appendChild(li);\r\n }\r\n $(\"#fourthApplicantSectionModal\").show();\r\n }\r\n else {\r\n $(\"#fourthApplicantSectionModal\").hide();\r\n }\r\n\r\n if (this.formsErrors.generalSection.length > 0) {\r\n var ul = document.getElementById(\"generalDetailsList\");\r\n for (var x = 0; x < this.formsErrors.generalSection.length; x++) {\r\n var li = document.createElement(\"li\");\r\n li.appendChild(document.createTextNode(this.formsErrors.generalSection[x]));\r\n ul.appendChild(li);\r\n }\r\n $(\"#generalDetailsSectionModal\").show();\r\n }\r\n else {\r\n $(\"#generalDetailsSectionModal\").hide();\r\n }\r\n\r\n if (this.formsErrors.declarationSection.length > 0) {\r\n var ul = document.getElementById(\"declarationsList\");\r\n for (var x = 0; x < this.formsErrors.declarationSection.length; x++) {\r\n var li = document.createElement(\"li\");\r\n li.appendChild(document.createTextNode(this.formsErrors.declarationSection[x]));\r\n ul.appendChild(li);\r\n }\r\n $(\"#declarationsSectionModal\").show();\r\n }\r\n else {\r\n $(\"#declarationsSectionModal\").hide();\r\n }\r\n\r\n if (this.formsErrors.acknowledgmentSection.length > 0 ||\r\n this.formsErrors.firstApplicant.length > 0 ||\r\n this.formsErrors.secondApplicant.length > 0 ||\r\n this.formsErrors.thirdApplicant.length > 0 ||\r\n this.formsErrors.fourthApplicant.length > 0 ||\r\n this.formsErrors.generalSection.length > 0 ||\r\n this.formsErrors.declarationSection.length > 0) {\r\n $(\"#FormErrors\").modal('show');\r\n\r\n return;\r\n }\r\n\r\n this.$timeout(async () => {\r\n var success = true;\r\n this.firstPerson.DateOfBirth = this.firstPerson.DateOfBirth.toLocaleString();\r\n this.rentalsHeader.OccupationDate = this.rentalsHeader.OccupationDate.toLocaleString();\r\n if (this.secondPerson.DateOfBirth != \"\")\r\n this.secondPerson.DateOfBirth = this.secondPerson.DateOfBirth.toLocaleString();\r\n if (this.thirdPerson.DateOfBirth != \"\")\r\n this.thirdPerson.DateOfBirth = this.thirdPerson.DateOfBirth.toLocaleString();\r\n if (this.fourthPerson.DateOfBirth != \"\")\r\n this.fourthPerson.DateOfBirth = this.fourthPerson.DateOfBirth.toLocaleString();\r\n\r\n try {\r\n $(\"#uploadingModal\").modal('show');\r\n await this.RentalsCaptureService.uploadApplicationAcknowledgementInfo(this.rentalsHeader);\r\n await this.RentalsCaptureService.uploadApplicantInfo(this.firstPerson,\r\n RentalsCaptureCtrl.firstIDBlobData,\r\n RentalsCaptureCtrl.firstProofOfAddressBlobData,\r\n RentalsCaptureCtrl.firstPayslipBlobData,\r\n RentalsCaptureCtrl.firstBankStatementsBlobData);\r\n\r\n if (this.secondApplicationChosen == true) {\r\n await this.RentalsCaptureService.uploadApplicantInfo(this.secondPerson,\r\n RentalsCaptureCtrl.secondIDBlobData,\r\n RentalsCaptureCtrl.secondProofOfAddressBlobData,\r\n RentalsCaptureCtrl.secondPayslipBlobData,\r\n RentalsCaptureCtrl.secondBankStatementsBlobData);\r\n }\r\n\r\n if (this.thirdApplicationChosen == true) {\r\n await this.RentalsCaptureService.uploadApplicantInfo(this.thirdPerson,\r\n RentalsCaptureCtrl.thirdIDBlobData,\r\n RentalsCaptureCtrl.thirdProofOfAddressBlobData,\r\n RentalsCaptureCtrl.thirdPayslipBlobData,\r\n RentalsCaptureCtrl.thirdBankStatementsBlobData);\r\n }\r\n\r\n if (this.fourthApplicationChosen == true) {\r\n await this.RentalsCaptureService.uploadApplicantInfo(this.fourthPerson,\r\n RentalsCaptureCtrl.fourthIDBlobData,\r\n RentalsCaptureCtrl.fourthProofOfAddressBlobData,\r\n RentalsCaptureCtrl.fourthPayslipBlobData,\r\n RentalsCaptureCtrl.fourthBankStatementsBlobData);\r\n }\r\n\r\n await this.RentalsCaptureService.uploadGeneralDetailsInfo(this.generalDetails,\r\n RentalsCaptureCtrl.supportingDoc1,\r\n RentalsCaptureCtrl.supportingDoc2,\r\n RentalsCaptureCtrl.supportingDoc3);\r\n\r\n await this.RentalsCaptureService.uploadDeclarationsInfo(this.declarations,\r\n RentalsCaptureCtrl.firstPersonSignature,\r\n RentalsCaptureCtrl.secondPersonSignature,\r\n RentalsCaptureCtrl.thirdPersonSignature,\r\n RentalsCaptureCtrl.fourthPersonSignature);\r\n }\r\n catch (e) {\r\n console.log(\"failed to get data\");\r\n console.log(e);\r\n success = false;\r\n $(\"#uploadingFailureModal\").modal('show');\r\n }\r\n finally {\r\n $(\"#uploadingModal\").modal('hide');\r\n if (success == true) {\r\n $(\"#uploadingSuccessModal\").modal('show');\r\n $('#finalSubmitAndValiBtn').attr('disabled', true);\r\n }\r\n }\r\n });\r\n }\r\n\r\n validateForm() {\r\n this.formsErrors.acknowledgmentSection.length = 0;\r\n this.formsErrors.firstApplicant.length = 0;\r\n this.formsErrors.secondApplicant.length = 0;\r\n this.formsErrors.thirdApplicant.length = 0;\r\n this.formsErrors.fourthApplicant.length = 0;\r\n this.formsErrors.generalSection.length = 0;\r\n this.formsErrors.declarationSection.length = 0;\r\n\r\n //check initial declaration\r\n if (this.rentalsHeader.WhoIsApplying == \"\") {\r\n this.formsErrors.acknowledgmentSection.push(\"Enter Full Name in the Acknowledgment of Application section\");\r\n }\r\n //if (this.rentalsHeader.rentalAmount == null) {\r\n //\tthis.formsErrors.acknowledgmentSection.push(\"Enter the Rentals Amount in Acknowledgment of Application section\");\r\n //}\r\n if (this.rentalsHeader.leasePeriod == null) {\r\n this.formsErrors.acknowledgmentSection.push(\"Enter the Lease Period Amount in Acknowledgment of Application section\");\r\n }\r\n if (this.rentalsHeader.OccupationDate == null) {\r\n this.formsErrors.acknowledgmentSection.push(\"Enter the Occupation Date in Acknowledgment of Application section\");\r\n }\r\n\r\n //check first person details\r\n if (this.firstPerson.fullName == \"\" || this.firstPerson.fullName === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Full Name of the first applicant\");\r\n }\r\n if (this.firstPerson.ID_Passport == \"\" || this.firstPerson.ID_Passport === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the ID Number of the first applicant\");\r\n }\r\n if (this.firstPerson.Nationality == \"\" || this.firstPerson.Nationality === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Nationality of the first applicant\");\r\n }\r\n if (this.firstPerson.DateOfBirth == \"\" || this.firstPerson.DateOfBirth === null) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Date of Birth of the first applicant\");\r\n }\r\n if (this.firstPerson.email == \"\" || this.firstPerson.email === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter a Valid Email for the first applicant\");\r\n }\r\n if (this.firstPerson.Telephone_Home == null || this.firstPerson.Telephone_Home === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Telephone (Work) Number of the first applicant\");\r\n }\r\n else {\r\n if (this.firstPerson.Telephone_Home.length < 10) {\r\n this.formsErrors.firstApplicant.push(\"The Telephone (Work) Number of the first applicant is too short\");\r\n }\r\n }\r\n if (this.firstPerson.Telephone_Cell == null || this.firstPerson.Telephone_Cell === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Cellphone Number of the first applicant\");\r\n }\r\n else {\r\n if (this.firstPerson.Telephone_Cell.length < 10) {\r\n this.formsErrors.firstApplicant.push(\"The Cellphone Number of the first applicant is too short\");\r\n }\r\n }\r\n if (this.firstPerson.MaritalStatus == null || this.firstPerson.MaritalStatus === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Marital Status of the first applicant\");\r\n }\r\n if (this.firstPerson.nextOfKinName == \"\" || this.firstPerson.nextOfKinName === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Next of Kin of the first applicant\");\r\n }\r\n if (this.firstPerson.nextOfKinTelephone == null || this.firstPerson.nextOfKinTelephone === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Next of Kin Telephone Number of the first applicant\");\r\n }\r\n else {\r\n if (this.firstPerson.nextOfKinTelephone.length < 10) {\r\n this.formsErrors.firstApplicant.push(\"The Next of Kin Telephone Number of the first applicant is too short\");\r\n }\r\n }\r\n if (this.firstPerson.CurrentStreet == \"\" || this.firstPerson.CurrentStreet === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Street Address of the first applicant\");\r\n }\r\n if (this.firstPerson.CurrentSuburb == \"\" || this.firstPerson.CurrentSuburb === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Suburb Address of the first applicant\");\r\n }\r\n if (this.firstPerson.CurrentCity == \"\" || this.firstPerson.CurrentCity === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the City Address of the first applicant\");\r\n }\r\n if (this.firstPerson.CurrentProvince == \"\" || this.firstPerson.CurrentProvince === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Province Address of the first applicant\");\r\n }\r\n if ($(\"#ID_Attachment\").get(0).files.length == 0) {\r\n this.formsErrors.firstApplicant.push(\"Select the ID/Passport Attachment of the first applicant\");\r\n }\r\n if ($(\"#ProofOfAddressAttachment\").get(0).files.length == 0) {\r\n this.formsErrors.firstApplicant.push(\"Select the Proof of Address Attachment of the first applicant\");\r\n }\r\n if (document.getElementById('dontOwnProperty1').checked == true) {\r\n if (this.firstPerson.landlordName == \"\" || this.firstPerson.landlordName === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Land Owners Name of the first applicant\");\r\n }\r\n if (this.firstPerson.LandlordNumber == null || this.firstPerson.LandlordNumber === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Land Owners Telephone Number of the first applicant\");\r\n }\r\n else {\r\n if (this.firstPerson.LandlordNumber.length < 10) {\r\n this.formsErrors.firstApplicant.push(\"The Land Owners Number of the first applicant is too short\");\r\n }\r\n }\r\n if (this.firstPerson.landlordEmail == \"\" || this.firstPerson.landlordEmail === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter a Valid Email Address of the Land Owner for the first applicant\");\r\n }\r\n if (this.firstPerson.RentalAmountPaid == null || this.firstPerson.RentalAmountPaid === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Rental Amount to Landlord of the first applicant\");\r\n }\r\n if (this.firstPerson.TimeLivingAtResidence == null || this.firstPerson.TimeLivingAtResidence === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Amount of time living in the current residence of the first applicant\");\r\n }\r\n }\r\n\r\n if (this.firstPerson.employersName == \"\" || this.firstPerson.employersName === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Employers Name of the first applicant\");\r\n }\r\n if (this.firstPerson.Occupation == \"\" || this.firstPerson.Occupation === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Occupation of the first applicant\");\r\n }\r\n if (this.firstPerson.EmployersEmail == \"\" || this.firstPerson.EmployersEmail === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter a Valid Email Address for the Employer of the first applicant\");\r\n }\r\n if (this.firstPerson.EmployersNumber == null || this.firstPerson.EmployersNumber === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Employer Contact Number of the first applicant\");\r\n }\r\n else {\r\n if (this.firstPerson.EmployersNumber.length < 10) {\r\n this.formsErrors.firstApplicant.push(\"The Employer Contact Number of the first applicant is too short\");\r\n }\r\n }\r\n if (this.firstPerson.PeriodOfEmployment == null || this.firstPerson.PeriodOfEmployment === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Period of Employment of the first applicant\");\r\n }\r\n if (this.firstPerson.grossMonthlySalary == null || this.firstPerson.grossMonthlySalary === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Gross Monthly Salary of the first applicant\");\r\n }\r\n if (this.firstPerson.currentMonthlyExpenses == null || this.firstPerson.currentMonthlyExpenses === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Current Monthly Expenses of the first applicant\");\r\n }\r\n if (this.firstPerson.employersStreet == \"\" || this.firstPerson.employersStreet === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Employers Street Address of the first applicant\");\r\n }\r\n if (this.firstPerson.employersSuburb == \"\" || this.firstPerson.employersSuburb === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Employers Suburb Address of the first applicant\");\r\n }\r\n if (this.firstPerson.employersCity == \"\" || this.firstPerson.employersCity === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Employers City Address of the first applicant\");\r\n }\r\n if (this.firstPerson.employersProvince == \"\" || this.firstPerson.employersProvince === undefined) {\r\n this.formsErrors.firstApplicant.push(\"Enter the Employers Province Address of the first applicant\");\r\n }\r\n if ($(\"#payslips\").get(0).files.length == 0) {\r\n this.formsErrors.firstApplicant.push(\"Select the Payslip Attachment of the first applicant\");\r\n }\r\n if ($(\"#bankStatements\").get(0).files.length == 0) {\r\n this.formsErrors.firstApplicant.push(\"Select the 3 Month Bank Statements Attachment of the first applicant\");\r\n }\r\n if (RentalsCaptureCtrl.firstPersonSignature.FileName == \"\" || RentalsCaptureCtrl.firstPersonSignature.FileName == null) {\r\n this.formsErrors.firstApplicant.push(\"The first applicant needs to sign (Remember to click 'Save')\");\r\n };\r\n\r\n //second applicant\r\n if (this.secondApplicationChosen == true) {\r\n if (this.secondPerson.fullName == \"\" || this.secondPerson.fullName === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Full Name of the second applicant\");\r\n }\r\n if (this.secondPerson.ID_Passport == \"\" || this.secondPerson.ID_Passport === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the ID Number of the second applicant\");\r\n }\r\n if (this.secondPerson.Nationality == \"\" || this.secondPerson.Nationality === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Nationality of the second applicant\");\r\n }\r\n if (this.secondPerson.DateOfBirth == \"\" || this.secondPerson.DateOfBirth === null) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Date of Birth of the second applicant\");\r\n }\r\n if (this.secondPerson.email == \"\" || this.secondPerson.email === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter a Valid Email of the second applicant\");\r\n }\r\n if (this.secondPerson.Telephone_Home == null || this.secondPerson.Telephone_Home === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Telephone (Home) Number of the second applicant\");\r\n }\r\n else {\r\n if (this.secondPerson.Telephone_Home.length < 10) {\r\n this.formsErrors.secondApplicant.push(\"The Telephone (Home) Number of the second applicant is too short\");\r\n }\r\n }\r\n if (this.secondPerson.Telephone_Cell == null || this.secondPerson.Telephone_Cell === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Cellphone Number of the second applicant\");\r\n }\r\n else {\r\n if (this.secondPerson.Telephone_Cell.length < 10) {\r\n this.formsErrors.secondApplicant.push(\"The the Cellphone Number of the second applicant is too short\");\r\n }\r\n }\r\n if (this.secondPerson.MaritalStatus == null || this.secondPerson.MaritalStatus === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Marital Status of the second applicant\");\r\n }\r\n if (this.secondPerson.nextOfKinName == \"\" || this.secondPerson.nextOfKinName === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Next of Kin of the second applicant\");\r\n }\r\n if (this.secondPerson.nextOfKinTelephone == null || this.secondPerson.nextOfKinTelephone === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Next of Kin Telephone Number of the second applicant\");\r\n }\r\n else {\r\n if (this.secondPerson.nextOfKinTelephone.length < 10) {\r\n this.formsErrors.secondApplicant.push(\"The the Next of Kin Telephone Number of the second applicant is too short\");\r\n }\r\n }\r\n if (this.secondPerson.CurrentStreet == \"\" || this.secondPerson.CurrentStreet === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Street Address of the second applicant\");\r\n }\r\n if (this.secondPerson.CurrentSuburb == \"\" || this.secondPerson.CurrentSuburb === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Suburb Address of the second applicant\");\r\n }\r\n if (this.secondPerson.CurrentCity == \"\" || this.secondPerson.CurrentCity === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the City Address of the second applicant\");\r\n }\r\n if (this.secondPerson.CurrentProvince == \"\" || this.secondPerson.CurrentProvince === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Province Address of the second applicant\");\r\n }\r\n if ($(\"#ID_Attachment2\").get(0).files.length == 0) {\r\n this.formsErrors.secondApplicant.push(\"Select the ID/Passport Attachment of the second applicant\");\r\n }\r\n if (this.livesWithPartner2 == false && $(\"#ProofOfAddressAttachment2\").get(0).files.length == 0) {\r\n this.formsErrors.secondApplicant.push(\"Select the Proof of Address Attachment of the second applicant\");\r\n }\r\n if (document.getElementById('dontOwnProperty2').checked == true) {\r\n if (this.secondPerson.landlordName == \"\" || this.secondPerson.landlordName === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Landlord Name of the second applicant\");\r\n }\r\n if (this.secondPerson.LandlordNumber == null || this.secondPerson.LandlordNumber === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Landlord Telephone Number of the second applicant\");\r\n }\r\n else {\r\n if (this.secondPerson.LandlordNumber.length < 10) {\r\n this.formsErrors.secondApplicant.push(\"The the Landlord Number of the second applicant is too short\");\r\n }\r\n }\r\n if (this.secondPerson.landlordEmail == \"\" || this.secondPerson.landlordEmail === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter a Valid Email Address for the Land Owner of the second applicant\");\r\n }\r\n if (this.secondPerson.RentalAmountPaid == null || this.secondPerson.RentalAmountPaid === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Rental Amount to Landlord of the second applicant\");\r\n }\r\n if (this.secondPerson.TimeLivingAtResidence == null || this.secondPerson.TimeLivingAtResidence === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Amount of time living in the current residence of the second applicant\");\r\n }\r\n }\r\n\r\n if (this.secondPerson.employersName == \"\" || this.secondPerson.employersName === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Employers Name of the second applicant\");\r\n }\r\n if (this.secondPerson.Occupation == \"\" || this.secondPerson.Occupation === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Occupation of the second applicant\");\r\n }\r\n if (this.secondPerson.EmployersEmail == \"\" || this.secondPerson.EmployersEmail === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter a Valid Email Address for the Employer of the second applicant\");\r\n }\r\n if (this.secondPerson.EmployersNumber == null || this.secondPerson.EmployersNumber === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Employer Contact Number of the second applicant\");\r\n }\r\n else {\r\n if (this.secondPerson.EmployersNumber.length < 10) {\r\n this.formsErrors.secondApplicant.push(\"The Employer Contact Number of the second applicant is too short\");\r\n }\r\n }\r\n if (this.secondPerson.PeriodOfEmployment == null || this.secondPerson.PeriodOfEmployment === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Period of Employment of the second applicant\");\r\n }\r\n if (this.secondPerson.grossMonthlySalary == null || this.secondPerson.grossMonthlySalary === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Gross Monthly Salary of the second applicant\");\r\n }\r\n if (this.secondPerson.currentMonthlyExpenses == null || this.secondPerson.currentMonthlyExpenses === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Current Monthly Expenses of the second applicant\");\r\n }\r\n if (this.secondPerson.employersStreet == \"\" || this.secondPerson.employersStreet === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Employers Street Address of the second applicant\");\r\n }\r\n if (this.secondPerson.employersSuburb == \"\" || this.secondPerson.employersSuburb === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Employers Suburb Address of the second applicant\");\r\n }\r\n if (this.secondPerson.employersCity == \"\" || this.secondPerson.employersCity === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Employers City Address of the second applicant\");\r\n }\r\n if (this.secondPerson.employersProvince == \"\" || this.secondPerson.employersProvince === undefined) {\r\n this.formsErrors.secondApplicant.push(\"Enter the Employers Province Address of the second applicant\");\r\n }\r\n if (this.spousIsWorking2 == true && $(\"#payslips2\").get(0).files.length == 0) {\r\n this.formsErrors.secondApplicant.push(\"Select the Payslip Attachment of the second applicant\");\r\n }\r\n if (this.spousIsWorking2 == true && $(\"#bankStatements2\").get(0).files.length == 0) {\r\n this.formsErrors.secondApplicant.push(\"Select the 3 Month Bank Statements Attachment of the second applicant\");\r\n }\r\n if (RentalsCaptureCtrl.secondPersonSignature.FileName == \"\" || RentalsCaptureCtrl.secondPersonSignature.FileName == null) {\r\n this.formsErrors.secondApplicant.push(\"The second applicant needs to sign (Remember to click 'Save')\");\r\n };\r\n }\r\n\r\n //third applicant\r\n if (this.thirdApplicationChosen == true) {\r\n if (this.thirdPerson.fullName == \"\" || this.thirdPerson.fullName === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Full Name of the third applicant\");\r\n }\r\n if (this.thirdPerson.ID_Passport == \"\" || this.thirdPerson.ID_Passport === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the ID Number of the third applicant\");\r\n }\r\n if (this.thirdPerson.Nationality == \"\" || this.thirdPerson.Nationality === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Nationality of the third applicant\");\r\n }\r\n if (this.thirdPerson.DateOfBirth == \"\" || this.thirdPerson.DateOfBirth === null) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Date of Birth of the third applicant\");\r\n }\r\n if (this.thirdPerson.email == \"\" || this.thirdPerson.email === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter a Valid Email of the third applicant\");\r\n }\r\n if (this.thirdPerson.Telephone_Home == null || this.thirdPerson.Telephone_Home === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Telephone (Home) Number of the third applicant\");\r\n }\r\n else {\r\n if (this.thirdPerson.Telephone_Home.length < 10) {\r\n this.formsErrors.thirdApplicant.push(\"The Telephone (Home) Number of the third applicant is too short\");\r\n }\r\n }\r\n if (this.thirdPerson.Telephone_Cell == null || this.thirdPerson.Telephone_Cell === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Cellphone Number of the third applicant\");\r\n }\r\n else {\r\n if (this.thirdPerson.Telephone_Cell.length < 10) {\r\n this.formsErrors.thirdApplicant.push(\"The the Cellphone Number of the third applicant is too short\");\r\n }\r\n }\r\n if (this.thirdPerson.MaritalStatus == null || this.thirdPerson.MaritalStatus === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Marital Status of the third applicant\");\r\n }\r\n if (this.thirdPerson.nextOfKinName == \"\" || this.thirdPerson.nextOfKinName === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Next of Kin of the third applicant\");\r\n }\r\n if (this.thirdPerson.nextOfKinTelephone == null || this.thirdPerson.nextOfKinTelephone === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Next of Kin Telephone Number of the third applicant\");\r\n }\r\n else {\r\n if (this.thirdPerson.nextOfKinTelephone.length < 10) {\r\n this.formsErrors.thirdApplicant.push(\"The the Next of Kin Telephone Number of the third applicant is too short\");\r\n }\r\n }\r\n if (this.thirdPerson.CurrentStreet == \"\" || this.thirdPerson.CurrentStreet === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Street Address of the third applicant\");\r\n }\r\n if (this.thirdPerson.CurrentSuburb == \"\" || this.thirdPerson.CurrentSuburb === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Suburb Address of the third applicant\");\r\n }\r\n if (this.thirdPerson.CurrentCity == \"\" || this.thirdPerson.CurrentCity === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the City Address of the third applicant\");\r\n }\r\n if (this.thirdPerson.CurrentProvince == \"\" || this.thirdPerson.CurrentProvince === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Province Address of the third applicant\");\r\n }\r\n if ($(\"#ID_Attachment3\").get(0).files.length == 0) {\r\n this.formsErrors.thirdApplicant.push(\"Select the ID/Passport Attachment of the third applicant\");\r\n }\r\n if (this.livesWithPartner3 == false && $(\"#ProofOfAddressAttachment3\").get(0).files.length == 0) {\r\n this.formsErrors.thirdApplicant.push(\"Select the Proof of Address Attachment of the third applicant\");\r\n }\r\n if (document.getElementById('dontOwnProperty3').checked == true) {\r\n if (this.thirdPerson.landlordName == \"\" || this.thirdPerson.landlordName === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Landlord Name of the third applicant\");\r\n }\r\n if (this.thirdPerson.LandlordNumber == null || this.thirdPerson.LandlordNumber === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Landlord Telephone Number of the third applicant\");\r\n }\r\n else {\r\n if (this.thirdPerson.LandlordNumber.length < 10) {\r\n this.formsErrors.thirdApplicant.push(\"The the Landlord Number of the third applicant is too short\");\r\n }\r\n }\r\n if (this.thirdPerson.landlordEmail == \"\" || this.thirdPerson.landlordEmail === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter a Valid Email Address for the Land Owner of the third applicant\");\r\n }\r\n if (this.thirdPerson.RentalAmountPaid == null || this.thirdPerson.RentalAmountPaid === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Rental Amount to Landlord of the third applicant\");\r\n }\r\n if (this.thirdPerson.TimeLivingAtResidence == null || this.thirdPerson.TimeLivingAtResidence === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Amount of time living in the current residence of the third applicant\");\r\n }\r\n }\r\n\r\n if (this.thirdPerson.employersName == \"\" || this.thirdPerson.employersName === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Employers Name of the third applicant\");\r\n }\r\n if (this.thirdPerson.Occupation == \"\" || this.thirdPerson.Occupation === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Occupation of the third applicant\");\r\n }\r\n if (this.thirdPerson.EmployersEmail == \"\" || this.thirdPerson.EmployersEmail === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter a Valid Email Address for the Employer of the third applicant\");\r\n }\r\n if (this.thirdPerson.EmployersNumber == null || this.thirdPerson.EmployersNumber === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Employer Contact Number of the third applicant\");\r\n }\r\n else {\r\n if (this.thirdPerson.EmployersNumber.length < 10) {\r\n this.formsErrors.thirdApplicant.push(\"The Employer Contact Number of the third applicant is too short\");\r\n }\r\n }\r\n if (this.thirdPerson.PeriodOfEmployment == null || this.thirdPerson.PeriodOfEmployment === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Period of Employment of the third applicant\");\r\n }\r\n if (this.thirdPerson.grossMonthlySalary == null || this.thirdPerson.grossMonthlySalary === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Gross Monthly Salary of the third applicant\");\r\n }\r\n if (this.thirdPerson.currentMonthlyExpenses == null || this.thirdPerson.currentMonthlyExpenses === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Current Monthly Expenses of the third applicant\");\r\n }\r\n if (this.thirdPerson.employersStreet == \"\" || this.thirdPerson.employersStreet === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Employers Street Address of the third applicant\");\r\n }\r\n if (this.thirdPerson.employersSuburb == \"\" || this.thirdPerson.employersSuburb === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Employers Suburb Address of the third applicant\");\r\n }\r\n if (this.thirdPerson.employersCity == \"\" || this.thirdPerson.employersCity === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Employers City Address of the third applicant\");\r\n }\r\n if (this.thirdPerson.employersProvince == \"\" || this.thirdPerson.employersProvince === undefined) {\r\n this.formsErrors.thirdApplicant.push(\"Enter the Employers Province Address of the third applicant\");\r\n }\r\n if (this.spousIsWorking3 == true && $(\"#payslips3\").get(0).files.length == 0) {\r\n this.formsErrors.thirdApplicant.push(\"Select the Payslip Attachment of the third applicant\");\r\n }\r\n if (this.spousIsWorking3 == true && $(\"#bankStatements3\").get(0).files.length == 0) {\r\n this.formsErrors.thirdApplicant.push(\"Select the 3 Month Bank Statements Attachment of the third applicant\");\r\n }\r\n if (RentalsCaptureCtrl.thirdPersonSignature.FileName == \"\" || RentalsCaptureCtrl.thirdPersonSignature.FileName == null) {\r\n this.formsErrors.thirdApplicant.push(\"The third applicant needs to sign (Remember to click 'Save')\");\r\n };\r\n }\r\n\r\n //fourth applicant \r\n if (this.fourthApplicationChosen == true) {\r\n if (this.fourthPerson.fullName == \"\" || this.fourthPerson.fullName === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Full Name of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.ID_Passport == \"\" || this.fourthPerson.ID_Passport === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the ID Number of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.Nationality == \"\" || this.fourthPerson.Nationality === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Nationality of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.DateOfBirth == \"\" || this.fourthPerson.DateOfBirth === null) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Date of Birth of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.email == \"\" || this.fourthPerson.email === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter a Valid Email of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.Telephone_Home == null || this.fourthPerson.Telephone_Home === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Telephone (Home) Number of the fourth applicant\");\r\n }\r\n else {\r\n if (this.fourthPerson.Telephone_Home.length < 10) {\r\n this.formsErrors.fourthApplicant.push(\"The Telephone (Home) Number of the fourth applicant is too short\");\r\n }\r\n }\r\n if (this.fourthPerson.Telephone_Cell == null || this.fourthPerson.Telephone_Cell === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Cellphone Number of the fourth applicant\");\r\n }\r\n else {\r\n if (this.fourthPerson.Telephone_Cell.length < 10) {\r\n this.formsErrors.fourthApplicant.push(\"The the Cellphone Number of the fourth applicant is too short\");\r\n }\r\n }\r\n if (this.fourthPerson.MaritalStatus == null || this.fourthPerson.MaritalStatus === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Marital Status of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.nextOfKinName == \"\" || this.fourthPerson.nextOfKinName === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Next of Kin of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.nextOfKinTelephone == null || this.fourthPerson.nextOfKinTelephone === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Next of Kin Telephone Number of the fourth applicant\");\r\n }\r\n else {\r\n if (this.fourthPerson.nextOfKinTelephone.length < 10) {\r\n this.formsErrors.fourthApplicant.push(\"The the Next of Kin Telephone Number of the fourth applicant is too short\");\r\n }\r\n }\r\n if (this.fourthPerson.CurrentStreet == \"\" || this.fourthPerson.CurrentStreet === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Street Address of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.CurrentSuburb == \"\" || this.fourthPerson.CurrentSuburb === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Suburb Address of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.CurrentCity == \"\" || this.fourthPerson.CurrentCity === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the City Address of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.CurrentProvince == \"\" || this.fourthPerson.CurrentProvince === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Province Address of the fourth applicant\");\r\n }\r\n if ($(\"#ID_Attachment4\").get(0).files.length == 0) {\r\n this.formsErrors.fourthApplicant.push(\"Select the ID/Passport Attachment of the fourth applicant\");\r\n }\r\n if (this.livesWithPartner4 == false && $(\"#ProofOfAddressAttachment4\").get(0).files.length == 0) {\r\n this.formsErrors.fourthApplicant.push(\"Select the Proof of Address Attachment of the fourth applicant\");\r\n }\r\n if (document.getElementById('dontOwnProperty3').checked == true) {\r\n if (this.fourthPerson.landlordName == \"\" || this.fourthPerson.landlordName === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Landlord Name of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.LandlordNumber == null || this.fourthPerson.LandlordNumber === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Landlord Telephone Number of the fourth applicant\");\r\n }\r\n else {\r\n if (this.fourthPerson.LandlordNumber.length < 10) {\r\n this.formsErrors.fourthApplicant.push(\"The the Landlord Number of the fourth applicant is too short\");\r\n }\r\n }\r\n if (this.fourthPerson.landlordEmail == \"\" || this.fourthPerson.landlordEmail === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter a Valid Email Address for the Land Owner of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.RentalAmountPaid == null || this.fourthPerson.RentalAmountPaid === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Rental Amount to Landlord of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.TimeLivingAtResidence == null || this.fourthPerson.TimeLivingAtResidence === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Amount of time living in the current residence of the fourth applicant\");\r\n }\r\n }\r\n\r\n if (this.fourthPerson.employersName == \"\" || this.fourthPerson.employersName === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Employers Name of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.Occupation == \"\" || this.fourthPerson.Occupation === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Occupation of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.EmployersEmail == \"\" || this.fourthPerson.EmployersEmail === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter a Valid Email Address for the Employer of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.EmployersNumber == null || this.fourthPerson.EmployersNumber === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Employer Contact Number of the fourth applicant\");\r\n }\r\n else {\r\n if (this.fourthPerson.EmployersNumber.length < 10) {\r\n this.formsErrors.fourthApplicant.push(\"The Employer Contact Number of the fourth applicant is too short\");\r\n }\r\n }\r\n if (this.fourthPerson.PeriodOfEmployment == null || this.fourthPerson.PeriodOfEmployment === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Period of Employment of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.grossMonthlySalary == null || this.fourthPerson.grossMonthlySalary === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Gross Monthly Salary of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.currentMonthlyExpenses == null || this.fourthPerson.currentMonthlyExpenses === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Current Monthly Expenses of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.employersStreet == \"\" || this.fourthPerson.employersStreet === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Employers Street Address of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.employersSuburb == \"\" || this.fourthPerson.employersSuburb === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Employers Suburb Address of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.employersCity == \"\" || this.fourthPerson.employersCity === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Employers City Address of the fourth applicant\");\r\n }\r\n if (this.fourthPerson.employersProvince == \"\" || this.fourthPerson.employersProvince === undefined) {\r\n this.formsErrors.fourthApplicant.push(\"Enter the Employers Province Address of the fourth applicant\");\r\n }\r\n if (this.spousIsWorking4 == true && $(\"#payslips4\").get(0).files.length == 0) {\r\n this.formsErrors.fourthApplicant.push(\"Select the Payslip Attachment of the fourth applicant\");\r\n }\r\n if (this.spousIsWorking4 == true && $(\"#bankStatements4\").get(0).files.length == 0) {\r\n this.formsErrors.fourthApplicant.push(\"Select the 3 Month Bank Statements Attachment of the fourth applicant\");\r\n }\r\n if (RentalsCaptureCtrl.fourthPersonSignature.FileName == \"\" || RentalsCaptureCtrl.fourthPersonSignature.FileName == null) {\r\n this.formsErrors.fourthApplicant.push(\"The fourth applicant needs to sign (Remember to click 'Save')\");\r\n };\r\n }\r\n\r\n //general section\r\n if (document.getElementById('isOccupying').checked == false && document.getElementById('isNotOccupying').checked == false) {\r\n this.formsErrors.generalSection.push(\"Please Pick if you will be occupying the property\");\r\n }\r\n if (document.getElementById('isNotOccupying').checked == true) {\r\n if (this.generalDetails.OtherTenantFullName == null || this.generalDetails.OtherTenantFullName == \"\") {\r\n this.formsErrors.generalSection.push(\"Please Enter the Other Tenants Full Name\");\r\n }\r\n if (this.generalDetails.OtherTenantCellNumber == null || this.generalDetails.OtherTenantCellNumber == \"\") {\r\n this.formsErrors.generalSection.push(\"Please Enter the Other Tenants Cellphone Number\");\r\n }\r\n if (this.generalDetails.OtherTenantEmail == null || this.generalDetails.OtherTenantEmail == \"\") {\r\n this.formsErrors.generalSection.push(\"Please Enter the Other Tenants Email address\");\r\n }\r\n }\r\n if (this.generalDetails.numberOfAdults == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Number of Adults in the General Details\");\r\n }\r\n if (this.generalDetails.numberOfChildren == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Number of Children in the General Details\");\r\n }\r\n if (this.generalDetails.numberOfChildren != null && this.generalDetails.numberOfChildren != 0) {\r\n switch (this.generalDetails.numberOfChildren) {\r\n case 1: if (this.generalDetails.childAge1 == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Age of the First child\");\r\n }\r\n break;\r\n case 2: if (this.generalDetails.childAge1 == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Age of the First child\");\r\n }\r\n if (this.generalDetails.childAge2 == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Age of the Second child\");\r\n }\r\n break;\r\n case 3: if (this.generalDetails.childAge1 == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Age of the First child\");\r\n }\r\n if (this.generalDetails.childAge2 == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Age of the Second child\");\r\n }\r\n if (this.generalDetails.childAge3 == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Age of the Third child\");\r\n }\r\n break;\r\n case 4: if (this.generalDetails.childAge1 == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Age of the First child\");\r\n }\r\n if (this.generalDetails.childAge2 == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Age of the Second child\");\r\n }\r\n if (this.generalDetails.childAge3 == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Age of the Third child\");\r\n }\r\n if (this.generalDetails.childAge4 == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Age of the Fourth child\");\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n if (this.generalDetails.numberOfPets == null) {\r\n this.formsErrors.generalSection.push(\"Enter the Number of Pets in the General Details\");\r\n }\r\n if (this.generalDetails.numberOfPets != null && this.generalDetails.numberOfPets > 0) {\r\n if (this.generalDetails.petType == \"\") {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Pets you have\");\r\n }\r\n }\r\n\r\n if (this.generalDetails.numberOfVehicles == null) {\r\n this.formsErrors.generalSection.push(\"Enter the number of vehicles\");\r\n }\r\n\r\n if (this.generalDetails.numberOfVehicles != null && this.generalDetails.numberOfVehicles != 0) {\r\n switch (this.generalDetails.numberOfVehicles) {\r\n case 1: if (this.generalDetails.VehicleType1 == \"\" || this.generalDetails.VehicleType1 == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Vehicle 1\");\r\n }\r\n if (this.generalDetails.Vehicle1Registration == \"\") {\r\n this.formsErrors.generalSection.push(\"Enter the Registration number of Vehicle 1\");\r\n }\r\n break;\r\n\r\n case 2: if (this.generalDetails.VehicleType1 == \"\" || this.generalDetails.VehicleType1 == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Vehicle 1\");\r\n }\r\n if (this.generalDetails.Vehicle1Registration == \"\" || this.generalDetails.Vehicle1Registration == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Registration number of Vehicle 1\");\r\n }\r\n\r\n if (this.generalDetails.VehicleType2 == \"\" || this.generalDetails.VehicleType2 == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Vehicle 2\");\r\n }\r\n if (this.generalDetails.Vehicle2Registration == \"\" || this.generalDetails.Vehicle2Registration == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Registration number of Vehicle 2\");\r\n }\r\n break;\r\n\r\n case 3: if (this.generalDetails.VehicleType1 == \"\" || this.generalDetails.VehicleType1 == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Vehicle 1\");\r\n }\r\n if (this.generalDetails.Vehicle1Registration == \"\" || this.generalDetails.Vehicle1Registration == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Registration number of Vehicle 1\");\r\n }\r\n\r\n if (this.generalDetails.VehicleType2 == \"\" || this.generalDetails.VehicleType2 == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Vehicle 2\");\r\n }\r\n if (this.generalDetails.Vehicle2Registration == \"\" || this.generalDetails.Vehicle2Registration == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Registration number of Vehicle 2\");\r\n }\r\n if (this.generalDetails.VehicleType3 == \"\" || this.generalDetails.VehicleType3 == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Vehicle 3\");\r\n }\r\n if (this.generalDetails.Vehicle3Registration == \"\" || this.generalDetails.Vehicle3Registration == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Registration number of Vehicle 3\");\r\n }\r\n break;\r\n\r\n case 4:\r\n if (this.generalDetails.VehicleType1 == \"\" || this.generalDetails.VehicleType1 == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Vehicle 1\");\r\n }\r\n if (this.generalDetails.Vehicle1Registration == \"\" || this.generalDetails.Vehicle1Registration == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Registration number of Vehicle 1\");\r\n }\r\n if (this.generalDetails.VehicleType2 == \"\" || this.generalDetails.VehicleType2 == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Vehicle 2\");\r\n }\r\n if (this.generalDetails.Vehicle2Registration == \"\" || this.generalDetails.Vehicle2Registration == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Registration number of Vehicle 2\");\r\n }\r\n if (this.generalDetails.VehicleType3 == \"\" || this.generalDetails.VehicleType3 == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Vehicle 3\");\r\n }\r\n if (this.generalDetails.Vehicle3Registration == \"\" || this.generalDetails.Vehicle3Registration == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Registration number of Vehicle 3\");\r\n }\r\n if (this.generalDetails.VehicleType4 == \"\" || this.generalDetails.VehicleType4 == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Type of Vehicle 4\");\r\n }\r\n if (this.generalDetails.Vehicle4Registration == \"\" || this.generalDetails.Vehicle4Registration == undefined) {\r\n this.formsErrors.generalSection.push(\"Enter the Registration number of Vehicle 4\");\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n if (document.getElementById('isDefaulted').checked == false && document.getElementById('isNotDefaulted').checked == false) {\r\n this.formsErrors.generalSection.push(\"Please Enter if defaults have been given to any of the applicants\");\r\n }\r\n if (document.getElementById('isDefaulted').checked == true) {\r\n if (this.generalDetails.defaultDetails == \"\" || this.generalDetails.defaultDetails == undefined) {\r\n this.formsErrors.generalSection.push(\"Please Enter the details of the defaults given\");\r\n }\r\n }\r\n if (document.getElementById('SeenProperty').checked == false && document.getElementById('NotSeenProperty').checked == false) {\r\n this.formsErrors.generalSection.push(\"Please Enter if you have seen the property\");\r\n }\r\n\r\n //declarations\r\n if (this.declarations.WhereSigned == \"\" || this.generalDetails.defaultDetails == undefined) {\r\n this.formsErrors.declarationSection.push(\"Please enter the area the document was signed\");\r\n }\r\n if (this.declarations.DaySigned == null || this.generalDetails.defaultDetails == undefined) {\r\n this.formsErrors.declarationSection.push(\"Please enter the day the application was signed\");\r\n }\r\n if (this.declarations.MonthSigned == null || this.generalDetails.defaultDetails == undefined) {\r\n this.formsErrors.declarationSection.push(\"Please enter the month the application was signed\");\r\n }\r\n if (this.declarations.YearSigned == null || this.generalDetails.defaultDetails == undefined) {\r\n this.formsErrors.declarationSection.push(\"Please enter the year the application was signed\");\r\n }\r\n if (this.declarations.firstApplicant == \"\" || this.generalDetails.defaultDetails == undefined) {\r\n this.formsErrors.declarationSection.push(\"The First Applicants Signature is required\");\r\n }\r\n if (this.secondApplicationChosen == true && this.declarations.secondApplicant == \"\") {\r\n this.formsErrors.declarationSection.push(\"The Second Applicants Signature is required\");\r\n }\r\n if (this.thirdApplicationChosen == true && this.declarations.thirdApplicant == \"\") {\r\n this.formsErrors.declarationSection.push(\"The Third Applicants Signature is required\");\r\n }\r\n if (this.fourthApplicationChosen == true && this.declarations.fourthApplicant == \"\") {\r\n this.formsErrors.declarationSection.push(\"The Fourth Applicants Signature is required\");\r\n }\r\n }\r\n\r\n onChangeOfSubjects() {\r\n alert(\"change\");\r\n }\r\n}\r\n\r\n","//@ts-check\r\n\r\nclass RentalsCaptureService {\r\n\tconstructor($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.utilities = [];\r\n\t\tthis.schemeInformation = null;\r\n\t\tthis.purchaserData = {};\r\n\t\tthis.isSubmitted = false;\r\n\t\tthis.maritalStatuses = [];\r\n\t\tthis.rentalsCapture = {};\r\n\t\tthis.contactPersonData = {};\r\n\t\tthis.bankNames = '';\r\n\t}\r\n\r\n\tasync submitClearanceCapture(clearanceHeaderId) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!clearanceHeaderId) {\r\n\t\t\t\tthrow new Error('No clearance Header Id.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('FinalizeClearances');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/clearance/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('FinalizeClearances');\r\n\t\t\t}\r\n\r\n\t\t\turl = `${url}?clearanceHeaderId=${clearanceHeaderId}`;\r\n\r\n\t\t\tconst results = await this.$http.post(url);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while submitting clearance header`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\r\n\tasync getMaritalStatuses() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetMaritalStatuses');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/clearance/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetMaritalStatuses');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tthis.maritalStatuses = results.data.filter(\r\n\t\t\t\t(maritalStatus) => maritalStatus.status.toLowerCase() !== 'unknown'\r\n\t\t\t);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while fetching Marital Statuses`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync uploadApplicantInfo(personalDetail, idDoc, proofOfAddressDoc, payslipDoc, bankStatementDoc) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('uploadApplicantInfo');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/rentals/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('uploadApplicantInfo');\r\n\t\t\t}\r\n\r\n\t\t\tlet payload = {\r\n\t\t\t\tpersonalDetail: personalDetail,\r\n\t\t\t\tidDoc: idDoc,\r\n\t\t\t\tproofOfAddressDoc: proofOfAddressDoc,\r\n\t\t\t\tpayslipDoc: payslipDoc,\r\n\t\t\t\tbankStatementDoc: bankStatementDoc\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tconst results = await this.$http.post(url, payload);\r\n\t\t\t\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while uploading applicant information.`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync uploadApplicationAcknowledgementInfo(acknowledgementDetails) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('uploadAcknowledgementDetails');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/rentals/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('uploadAcknowledgementDetails');\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.post(url, acknowledgementDetails);\r\n\t\t\tconst { data } = results;\r\n\t\t\t\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while uploading applicant acknowledgement information.`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync uploadGeneralDetailsInfo(generalDetails, supportingDoc1, supportingDoc2, supportingDoc3) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('uploadGeneralDetails');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/rentals/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('uploadGeneralDetails');\r\n\t\t\t}\r\n\r\n\t\t\tlet generalDetailsPayload = {\r\n\t\t\t\tgeneralDetails: generalDetails,\r\n\t\t\t\tsupportDocument1: supportingDoc1,\r\n\t\t\t\tsupportDocument2: supportingDoc2,\r\n\t\t\t\tsupportDocument3: supportingDoc3\r\n\t\t\t};\r\n\r\n\t\t\tconst results = await this.$http.post(url, generalDetailsPayload);\r\n\t\t\tconst { data } = results;\r\n\t\t\t\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while uploading applicant acknowledgement information.`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync uploadDeclarationsInfo(declarationDetails, firstPersonSignature, secondPersonSignature, thirdPersonSignature, fourthPersonSignature) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('uploadApplicationDeclarations');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/rentals/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('uploadApplicationDeclarations');\r\n\t\t\t}\r\n\t\t\tlet declarationPayload = {\r\n\t\t\t\tdeclarationDetails: declarationDetails,\r\n\t\t\t\tfirstPersonSignature: firstPersonSignature,\r\n\t\t\t\tsecondPersonSignature: secondPersonSignature,\r\n\t\t\t\tthirdPersonSignature: thirdPersonSignature,\r\n\t\t\t\tfourthPersonSignature: fourthPersonSignature\r\n\t\t\t};\r\n\t\t\tconst results = await this.$http.post(url, declarationPayload);\r\n\t\t\tconst { data } = results;\r\n\t\t\t\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while uploading applicant declarations information.`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getRentalInitialApplication(tokenId) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('getInitialApplicationsInfo');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/rentals/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('getInitialApplicationsInfo');\r\n\t\t\t}\r\n\t\t\turl = `${url}?tokenId=${tokenId}`;\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tthis.rentalsApplicationData = results.data;\r\n\t\t\tconst { rentalsInitialApplicationData } = results;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconst msg = `Error while fetching Initial Applications Information`;\r\n\t\t\tconsole.error(msg, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n}\r\n\r\nexport default /* @ngInject */ ($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) =>\r\n\tnew RentalsCaptureService($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService);\r\n"," /* @ngInject */\r\nexport default class TrusteeDashboardCtrl {\r\n constructor(\r\n $sce,\r\n $scope,\r\n $timeout,\r\n $rootScope,\r\n BuildingsService,\r\n NavigationService,\r\n LocalStorageService,\r\n DashboardService,\r\n ) {\r\n this.$sce = $sce;\r\n this.$scope = $scope;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.BuildingsService = BuildingsService;\r\n this.NavigationService = NavigationService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.DashboardService = DashboardService;\r\n\r\n this.init();\r\n this.activate();\r\n }\r\n\r\n async init() {\r\n this.isBusy = true;\r\n }\r\n}","class TrusteeDashboardService {\r\n\tconstructor($http, $window, $timeout, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\r\n\tinit() {\r\n\r\n }\r\n}\r\n\r\n\r\nexport default /* @ngInject */ ($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService) =>\r\n\tnew TrusteeDashboardService($http, $window, $timeout, $rootScope, InternalLinksService, LocalStorageService);"," /* @ngInject */\r\nexport default class UtilityinfoCtrl {\r\n constructor(\r\n $sce,\r\n $scope,\r\n $timeout,\r\n $rootScope,\r\n BuildingsService,\r\n NavigationService,\r\n LocalStorageService,\r\n DashboardService,\r\n ) {\r\n this.$sce = $sce;\r\n this.$scope = $scope;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.BuildingsService = BuildingsService;\r\n this.NavigationService = NavigationService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.DashboardService = DashboardService;\r\n\r\n this.init();\r\n this.activate();\r\n }\r\n\r\n async init() {\r\n this.isBusy = true;\r\n }\r\n\r\n async activate() {\r\n this.selectedBuildingRef = this.BuildingsService.getSelectedBuildingRef();\r\n\r\n\t\tlet buildingName = '';\r\n\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n\t\tif (userProfile) {\r\n\t\t\tif (!this.selectedBuildingRef) {\r\n this.selectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n }\r\n\t\t\tconst selectedBuilding = userProfile.BuildingProfiles.find((building) => {\r\n\t\t\t\treturn building.SchemeReference.toUpperCase().trim() === this.selectedBuildingRef.toUpperCase().trim();\r\n\t\t\t});\r\n\r\n\t\t\tif (selectedBuilding) {\r\n\t\t\t\tbuildingName = selectedBuilding.SchemeName;\r\n\t\t\t}\r\n\t\t}\r\n await this.getUtilityinfo();\r\n }\r\n\r\n async _onSelectedBuildingChanged(event, schemeRef) {\r\n try {\r\n if (schemeRef) {\r\n this.activate();\r\n }\r\n } catch (err) {\r\n console.error('Error while loading utility information:', err);\r\n } finally {\r\n this.isBusy = false;\r\n }\r\n }\r\n\r\n async getUtilityinfo() {\r\n this.isBusy = true;\r\n this.$timeout(async () => {\r\n try {\r\n if (this.selectedBuildingRef && this.selectedBuildingRef != null) {\r\n let utilityinfo = await this.DashboardService.getBuildingUtilityInformation(this.selectedBuildingRef);\r\n this.utilityinfo = utilityinfo;\r\n } \r\n\r\n } catch (err) {\r\n console.error('Error while loading utility information:', err);\r\n } finally {\r\n this.isBusy = false;\r\n }\r\n });\r\n }\r\n}\r\n","//@ts-check\r\n\r\nclass UtilityinfoService {\r\n\tconstructor($http, Utility, $timeout, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.userDetails = null;\r\n\t\tthis.myProfileInformation = null;\r\n\t}\r\n\t\r\n\tasync getBuildingUtilityInformation(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\tpromiseHandler = {\r\n\t\t\t\treject,\r\n\t\t\t\tresolve\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tif (!!!schemeRef) {\r\n\t\t\t\tthrow new Error('scheme Reference must be specified.');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('LoadUtilitiesLink');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/dashboard/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('LoadUtilitiesLink');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{schemeRef}', schemeRef);\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\t\t\t\r\n\r\n\t\t\tvar results = await this.$http.get(url, { headers });\r\n\r\n\t\t\tlet Data;\r\n\t\t\tif ('data' in results) {\r\n\t\t\t\tconst { data: rawData } = results;\r\n\t\t\t\tData = rawData;\r\n\t\t\t} else {\r\n\t\t\t\tData = results;\r\n\t\t\t}\r\n\t\t\tconst { Data: data, WasSuccessful: wasSuccessful } = Data;\r\n\r\n\t\t\tif (!wasSuccessful) {\r\n\t\t\t\tthrow new Error('Error while loading utilities.');\r\n\t\t\t}\r\n\r\n\t\t\tpromiseHandler.resolve(data);\r\n\t\t} catch (error) {\r\n\t\t\tpromiseHandler.reject(error);\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n}\r\n\r\nexport default /* @ngInject */ ($http, Utility, $timeout, LocalStorageService, InternalLinksService) =>\r\n\tnew UtilityinfoService($http, Utility, $timeout, LocalStorageService, InternalLinksService);\r\n","/* @ngInject */\r\nexport default class AuthCtrl {\r\n\tconstructor(\r\n\t\t$scope,\r\n\t\t$state,\r\n\t\tUtility,\r\n\t\t$window,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tNavigationService,\r\n\t\tLocalStorageService,\r\n\t\tNotificationService,\r\n\t\tAuthenticationService\r\n\t) {\r\n\t\t'ngInject';\r\n\t\tthis.$scope = $scope;\r\n\t\tthis.$state = $state;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.NavigationService = NavigationService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.NotificationService = NotificationService;\r\n\t\tthis.AuthenticationService = AuthenticationService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.Password = undefined;\r\n\t\tthis.UserName = undefined;\r\n\t\tthis.resetToken = undefined;\r\n\t\tthis.wantToRegister = undefined;\r\n\t\tthis.dontAskMeAgain = undefined;\r\n\t\tthis.isRegisterFormValid = false;\r\n\t\tthis.ConfirmPassword = undefined;\r\n\r\n\t\tthis.Utility.loadLoader();\r\n\r\n\t\tthis.isBusy = false;\r\n\t\tthis.timeBetweenModals = 680;\r\n\r\n\t\tthis._handleEvents();\r\n\r\n\t\tthis.NavigationService.activate();\r\n\t}\r\n\r\n\tchange(evt) {\r\n\t\tthis.isRegisterFormValid =\r\n\t\t\tthis.FirstName &&\r\n\t\t\tthis.LastName &&\r\n\t\t\tthis.Password &&\r\n\t\t\tthis.ConfirmPassword &&\r\n\t\t\tthis.Password === this.ConfirmPassword;\r\n\t}\r\n\r\n\tcontinue(evt) {\r\n\t\tthis.closeRegisterPromptModal();\r\n\r\n\t\tif (this.wantToRegister) {\r\n\t\t\tconst user = this.AuthenticationService.currentUser();\r\n\t\t\tthis.UserName = user.UserName;\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tthis.showRegisterModal();\r\n\t\t\t}, timeBetweenModals);\r\n\t\t} else if (this.dontAskMeAgain) {\r\n\t\t\tthis.AuthenticationService\r\n\t\t\t\t.dontShowRegisterPrompt()\r\n\t\t\t\t.then(\r\n\t\t\t\t\t(results) => {},\r\n\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\tconsole.error('Error while opting out of the register reminder: ' + this.UserName, err);\r\n\t\t\t\t\t}\r\n\t\t\t\t)\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.init();\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tregister() {\r\n\t\tconst payLoad = {\r\n\t\t\tUserName: this.UserName,\r\n\t\t\tPassword: this.Password,\r\n\t\t\tFirstName: this.FirstName,\r\n\t\t\tLastName: this.LastName\r\n\t\t};\r\n\r\n\t\tthis.isBusy = true;\r\n\t\tthis.AuthenticationService\r\n\t\t\t.registerUser(payLoad)\r\n\t\t\t.then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\t\t\tthis.NotificationService.success('REGISTERED SUCCESSFULLY');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.NotificationService.error('REGISTRATION UNSUCCESSFUL');\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tconsole.error('Error while registering user: ' + this.UserName, err);\r\n\t\t\t\t\tthis.NotificationService.error('REGISTRATION UNSUCCESSFUL');\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t\t.finally(() => {\r\n\t\t\t\tthis.init();\r\n\t\t\t\tthis.isBusy = true;\r\n\t\t\t\tthis.closeRegisterModal();\r\n\t\t\t});\r\n\t}\r\n\r\n\tasync login(evt, shouldRedirect) {\r\n\t\tthis.isBusy = true;\r\n\r\n\t\ttry {\r\n\t\t\tconst results = await this.AuthenticationService.loginUser(this.UserName, this.Password);\r\n\r\n\t\t\tif (typeof results === 'object' && results.length === 2) {\r\n\t\t\t\tif (shouldRedirect) {\r\n\t\t\t\t\tthis.$window.location = '/dashboard#!/';\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthis.NotificationService.success('LOGIN UNSUCCESSFUL');\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.NotificationService.error('LOGIN UNSUCCESSFUL');\r\n\t\t\tconst payLoad = {\r\n\t\t\t\tisBusy: false,\r\n\t\t\t\terr: null\r\n\t\t\t};\r\n\r\n\t\t\tthis.$rootScope.$broadcast('user-login-busy', payLoad);\r\n\t\t\tconsole.error(`Error while logging in user: ${this.UserName}\\nError: ${err}`);\r\n\t\t} finally {\r\n\t\t\tthis.closeLoginModal();\r\n\t\t\tthis.init();\r\n\t\t\tthis.isBusy = false;\r\n\t\t}\r\n\t}\r\n\r\n\tpreShowForgotPasswordModal() {\r\n\t\tthis.closeLoginModal();\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.UserName = '';\r\n\t\t\tthis.showForgotPasswordModal();\r\n\t\t}, this.timeBetweenModals - 300);\r\n\t}\r\n\r\n\tforgotPassword(userName = null) {\r\n\t\tthis.isBusy = true;\r\n\t\tconst promise = this.AuthenticationService.userForgotPassword(userName || this.UserName);\r\n\t\tpromise.finally(() => {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromise\r\n\t\t\t\t\t.then(\r\n\t\t\t\t\t\t(results) => {\r\n\t\t\t\t\t\t\tthis.NotificationService.success('FOLLOW THE EMAIL LINK TO SET A NEW PASSWORD');\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\t\tconsole.error(`Error while resetting a password: ${err}`);\r\n\r\n\t\t\t\t\t\t\tthis.NotificationService.error('PASSWORD RESET FAILED');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\tthis.init();\r\n\t\t\t\t\t\tthis.isBusy = false;\r\n\t\t\t\t\t\tthis.closeForgotPasswordModal();\r\n\t\t\t\t\t});\r\n\t\t\t}, 1200);\r\n\t\t});\r\n\t}\r\n\r\n\tresetPassword() {\r\n\t\tthis.isBusy = true;\r\n\r\n\t\tconst promise = this.AuthenticationService.userResetPassword(this.Password, this.resetToken);\r\n\t\tpromise.finally(() => {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromise\r\n\t\t\t\t\t.then(\r\n\t\t\t\t\t\t(results) => {\r\n\t\t\t\t\t\t\tthis.NotificationService.success('PASSWORD RESET SUCCESSFULLY');\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\t\tthis.NotificationService.error('FAILED. PLEASE CONTACT PRETOR GROUP.');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t)\r\n\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\tthis.init();\r\n\t\t\t\t\t\tthis.isBusy = false;\r\n\t\t\t\t\t\tthis.closeRestPasswordModal();\r\n\t\t\t\t\t});\r\n\t\t\t}, 1200);\r\n\t\t});\r\n\t}\r\n\r\n\tcloseUnsubscribe() {\r\n\t\tthis.AuthenticationService.unsubscribeMonthlyFinancialDocs().then(\r\n\t\t\t(results) => {\r\n\t\t\t\tthis.NotificationService.success('UNSUBSCRIBED SUCCESSFULLY');\r\n\t\t\t},\r\n\t\t\t(err) => {\r\n\t\t\t\tthis.NotificationService.error('UNSUBSCRIBE FAILED');\r\n\t\t\t\tconsole.error(err);\r\n\t\t\t}\r\n\t\t);\r\n\t\tthis.closeUnsubscribeMonthlyFinancialDocs();\r\n\t}\r\n\r\n\t_handleEvents() {\r\n\r\n\t\tthis.$rootScope.$on('auth-modal-set-username', (event, username) => {\r\n\t\t\tthis.UserName = username;\r\n\t\t})\r\n\r\n\t\tthis.$scope.$on('reset-user-password', ($evt, userName) => {\r\n\t\t\tthis.forgotPassword(userName);\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('unsubscribe-monthly-financial-docs', ($event) => {\r\n\t\t\tthis.showUnsubscribeMonthlyFinancialDocs();\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('show-login-auth-modal', (event) => {\r\n\t\t\tthis.showLoginModal();\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('show-reset-password-auth-modal', ($event, token) => {\r\n\t\t\tthis.resetToken = token;\r\n\t\t\tthis.LocalStorageService.save('resetPasswordToken', token);\r\n\t\t\tthis.showRestPasswordModal();\r\n\t\t});\r\n\r\n\t\tthis.$scope.$on('user-logged-in', ($event, results) => {\r\n\t\t\tconst profile = results && results.length > 0 ? results[1] : results;\r\n\t\t\tif (profile && profile.ProfileReminder) {\r\n\t\t\t\tif (profile.ProfileReminder.ShowUserAuthenticationNotSecure) {\r\n\t\t\t\t\t//this.showRegisterPromptModal();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.$rootScope.$on('user-reset-password', (event, data) => {\r\n\t\t\tthis.preShowForgotPasswordModal();\r\n\t\t});\r\n\t}\r\n}\r\n","/* @ngInject */\r\n\r\nimport { FEATURES, shouldBeEnabled, getTrustedBuildingImageUrl } from '../common';\r\n\r\nexport default class MainCtrl {\r\n constructor(\r\n $q,\r\n $sce,\r\n $http,\r\n $scope,\r\n $state,\r\n Utility,\r\n $window,\r\n $timeout,\r\n $location,\r\n $injector,\r\n $rootScope,\r\n $filter,\r\n LayoutService,\r\n CommonService,\r\n BuildingsService,\r\n NavigationService,\r\n LocalStorageService,\r\n AuthorizationService,\r\n AuthenticationService\r\n ) {\r\n this.$q = $q;\r\n this.$sce = $sce;\r\n this.$http = $http;\r\n this.$scope = $scope;\r\n this.$state = $state;\r\n this.$window = $window;\r\n this.Utility = Utility;\r\n this.$timeout = $timeout;\r\n this.$location = $location;\r\n this.$injector = $injector;\r\n this.$rootScope = $rootScope;\r\n this.$filter = $filter;\r\n this.LayoutService = LayoutService;\r\n this.CommonService = CommonService;\r\n this.BuildingsService = BuildingsService;\r\n this.NavigationService = NavigationService;\r\n this.LocalStorageService = LocalStorageService;\r\n this.AuthorizationService = AuthorizationService;\r\n this.AuthenticationService = AuthenticationService;\r\n\r\n this.init();\r\n this.activate();\r\n }\r\n\r\n init() {\r\n this.isHome = false;\r\n this.user = undefined;\r\n this.isMobile = false;\r\n this.authorized = false;\r\n this.isNewDesign = true;\r\n this.currentPage = null;\r\n this.topMarginClass = '';\r\n this.showFullMenu = false;\r\n this.selectedBuildingRef = undefined;\r\n this.buildingsDataService = undefined;\r\n this.shouldBeEnabled = shouldBeEnabled;\r\n this.GetTrustedBuildingImageUrl = this.BuildingsService.getTrustedBuildingImageUrl;\r\n this.title = 'Welcome to your dashboard!';\r\n this.isLoadingBuildingFeaturesPromise = null;\r\n this.loadingIndicator = this.Utility.loadingImage;\r\n this.largePretorLogo = this.Utility.largePretorLogo;\r\n this.smallPretorLogo = this.Utility.smallPretorLogo;\r\n this.isBusy = this.LocalStorageService.retrieve('userProfile')\r\n ? false\r\n : true;\r\n this._registerEventHandling();\r\n\r\n this.LocalStorageService.delete('selectedBuildingRef');\r\n\r\n angular\r\n .element(window)\r\n .resize(() => this.$timeout(() => this.checkIsMobile()));\r\n }\r\n setTitle(value) {\r\n if (!value) {\r\n const selector = '#userBuildings .panel-body a, #userBuildings .panel-body a img, #userBuildings .panel-body a span';\r\n const $links = angular.element(selector, this.$rootScope.$element);\r\n\r\n $links.each((i, l) => {\r\n const $l = angular.element(l);\r\n let selectedBuildingTab = $l.hasClass('active');\r\n if (selectedBuildingTab) {\r\n this.title = $l.context.innerText;\r\n return;\r\n }\r\n });\r\n } else {\r\n this.title = value;\r\n }\r\n\r\n // array.forEach(element => {\r\n // if(element.SchemeReference === value){\r\n // if (titleRef) {\r\n // let buildingTitle = angular.element('selectedBuildingTitle');\r\n // console.warn(\"buildingTitle: \" + buildingTitle);\r\n // this.title = element.SchemeName; \r\n // }\r\n // return element;\r\n // }\r\n // });\r\n }\r\n\r\n isOnPage(page) {\r\n const currentPage = this.$state.current.name;\r\n return !!page && page === currentPage;\r\n }\r\n\r\n checkIsMobile() {\r\n this.$timeout(() => {\r\n const mobileWidth = 991;\r\n let isMobileScreen = false;\r\n const screenWidth = $('body').width();\r\n\r\n if (screenWidth <= mobileWidth) {\r\n isMobileScreen = true;\r\n }\r\n\r\n console.log(\r\n `The current form factor: ${isMobileScreen ? 'Mobile' : 'Bigger than Mobile'\r\n }.`\r\n );\r\n this.$timeout(() => {\r\n this.isMobile = isMobileScreen;\r\n });\r\n });\r\n }\r\n\r\n showBackgroundPic() {\r\n const shouldShow = this.$state.current.name === FEATURES.DASHBOARD;\r\n this.topMarginClass = shouldShow ? '' : 'margin-top-3';\r\n return shouldShow;\r\n }\r\n\r\n isActive(path, otherPath) {\r\n const isActive = otherPath\r\n ? this.$state.current.name === path ||\r\n this.$state.current.name === otherPath\r\n : this.$state.current.name === path;\r\n return isActive;\r\n }\r\n\r\n toggleSideBar() {\r\n this.showFullMenu = !this.showFullMenu;\r\n }\r\n\r\n linkClicked(evt) {\r\n debugger;\r\n const linkText = evt.target.innerText.toLowerCase();\r\n let url = `${this.$location.protocol()}://${this.$location.host()}:${this.$location.port()}/`;\r\n \r\n if (linkText === 'logout') {\r\n this.LocalStorageService.clear();\r\n } \r\n \r\n this.$window.location.href = url;\r\n }\r\n\r\n gotUser(results) {\r\n const profile = results && results.length > 0 ? results[1] : results;\r\n /*start Auth Token selected building ref */\r\n let url = window.location.search;\r\n for (let i = 0; i < profile.BuildingProfiles.length; i++) {\r\n const scheme = profile.BuildingProfiles[i];\r\n if (url.includes(scheme.SchemeReference)) {\r\n const {\r\n SchemeName: buildingName,\r\n SchemeReference: buildingRef\r\n } = profile.BuildingProfiles[i];\r\n this.setTitle(buildingName);\r\n this.selectedBuildingRef = buildingRef;\r\n }\r\n }\r\n /*end Auth Token selected building ref */\r\n this.user = profile;\r\n if (profile.UserName) {\r\n this.isBusy = false;\r\n this.authorized = true;\r\n let selectedBuildingRef;\r\n this.friendlyName = profile.FullName;\r\n\r\n let hasBuidlingProfiles = !angular.isUndefined(this.user.BuildingProfiles) && [...this.user.BuildingProfiles].length > 0;\r\n\r\n if (!this.selectedBuildingRef) {\r\n if (hasBuidlingProfiles) {\r\n //if (this.user.BuildingProfiles && c > 0) {\r\n const {\r\n SchemeName: buildingName,\r\n SchemeReference: buildingRef\r\n } = this.user.BuildingProfiles[0];\r\n this.setTitle(buildingName);\r\n this.selectedBuildingRef = buildingRef;\r\n //}\r\n }\r\n } else {\r\n selectedBuildingRef = this.LayoutService.getSelectedBuildingReference(\r\n this.LocalStorageService.retrieve('selectedBuildingRef')\r\n );\r\n }\r\n\r\n if (!hasBuidlingProfiles) {\r\n let selectedBuildingRefQueryString = this.Utility.QueryString('DBRef');\r\n if (selectedBuildingRefQueryString) {\r\n this.selectedBuildingRef = selectedBuildingRefQueryString.toUpperCase();\r\n }\r\n let tempBuildRef = this.selectedBuildingRef;\r\n this.selectedBuildingRef = tempBuildRef.toUpperCase();\r\n\r\n this.$rootScope.$broadcast('set-selected-scheme-active', this.selectedBuildingRef);\r\n this.$rootScope.$broadcast('selected-building-changed', this.selectedBuildingRef);\r\n //this.title = buildingName;\r\n this.setTitle(buildingName);\r\n }\r\n this.loadBuildingFeatures();\r\n this.$timeout(() => {\r\n\r\n const selector = '#userBuildings .panel-body a, #userBuildings .panel-body a img, #userBuildings .panel-body a span';\r\n const $links = angular.element(selector, this.$rootScope.$element);\r\n\r\n $links.each((i, l) => {\r\n const $l = angular.element(l);\r\n let selectedBuildingTab = $l.hasClass('active');\r\n if (selectedBuildingTab) {\r\n this.setTitle($l.context.innerText);\r\n //this.title = $l.context.innerText;\r\n return;\r\n }\r\n });\r\n }, 3000);\r\n }\r\n\r\n if (this.isHome) {\r\n this.LayoutService.setSelectedBuildingRef();\r\n }\r\n }\r\n\r\n get mappedBuildings() {\r\n const buildings = this.user.BuildingProfiles;\r\n const mapped = buildings.map(building => {\r\n const { SchemeReference: schemeReference } = building;\r\n const imgUrl = this.GetTrustedBuildingImageUrl(schemeReference);\r\n return {\r\n imgUrl,\r\n ...building,\r\n isSelected: false\r\n };\r\n });\r\n\r\n return mapped;\r\n }\r\n\r\n async activate() {\r\n this.$timeout(() => this.checkIsMobile());\r\n\r\n await this.NavigationService.setLocalUserObjects();\r\n\r\n this.buildingsDataService = this.BuildingsService;\r\n this.user = this.AuthenticationService.currentUser();\r\n\r\n if (this.user) {\r\n this.refreshUserProfile();\r\n\r\n this.buildingsDataService.init();\r\n\r\n\r\n this.loadBuildingFeatures();\r\n if (\r\n this.user.BuildingProfiles &&\r\n this.user.BuildingProfiles.length === 1\r\n ) {\r\n const {\r\n SchemeName: buildingName,\r\n SchemeReference: buildingRef\r\n } = this.user.BuildingProfiles[0];\r\n //debugger\r\n this.setTitle(buildingName);\r\n //this.title = buildingName;\r\n\r\n this.selectedBuildingRef = buildingRef;\r\n\r\n this.user.BuildingProfiles = this.mappedBuildings;\r\n }\r\n } else {\r\n this.$rootScope.$on('user-logged-in', ($event, results) => {\r\n this.gotUser(results);\r\n });\r\n }\r\n\r\n this.currentPage = this.$state.$current.name;\r\n this.NavigationService.activate();\r\n }\r\n\r\n refreshUserProfile() {\r\n const dateTimeFormat = 'DD MMM YYYY HH:mm A',\r\n lastLoggedInStr = this.LocalStorageService.retrieve('lastLoggedIn'),\r\n currentDateTime = moment();\r\n\r\n let lastLoggedIn;\r\n\r\n if (lastLoggedInStr) lastLoggedIn = moment(lastLoggedInStr, dateTimeFormat);\r\n else {\r\n if (this.user) lastLoggedIn = moment();\r\n else lastLoggedIn = moment().add(30, 'minutes');\r\n }\r\n if (currentDateTime.isSameOrAfter(lastLoggedIn.add(30, 'minutes'))) {\r\n this.AuthenticationService.authorize(true).then(\r\n results => {\r\n console.log(\r\n 'Refreshed the user profile at :' +\r\n currentDateTime.format(dateTimeFormat)\r\n );\r\n this.gotUser(results);\r\n },\r\n err => {\r\n console.error(\r\n 'Error refreshing the user profile at :' +\r\n currentDateTime.format(dateTimeFormat),\r\n err\r\n );\r\n }\r\n );\r\n }\r\n\r\n if (this.isHome) {\r\n this.LayoutService.setSelectedBuildingRef();\r\n }\r\n }\r\n\r\n selectBuilding(event, buildingReference) {\r\n this.LocalStorageService.save(\r\n 'selectedBuildingRef',\r\n buildingReference.toUpperCase()\r\n );\r\n this.$timeout(async () => {\r\n this.selectedBuildingRef = buildingReference.toUpperCase();\r\n });\r\n }\r\n\r\n loadBuildingFeatures() {\r\n if(!this.BuildingsService.hasInitted){\r\n this.BuildingsService.init()\r\n }\r\n\r\n [...this.BuildingsService.buildingsData.allBuildings].forEach(building => {\r\n const { SchemeReference } = building;\r\n this.BuildingsService.getBuildingFeatureSettings(SchemeReference);\r\n });\r\n\r\n }\r\n\r\n get isOnDesktop() {\r\n const isDesktop = this.isActive('dashboard');\r\n return isDesktop;\r\n }\r\n\r\n _registerEventHandling() {\r\n\r\n this.$rootScope.$on('menu-changed', (evt, { shouldShow }) => {\r\n this.isHome = shouldShow\r\n ? shouldShow\r\n : !!!this.$location.$$url || this.$location.$$url === '/';\r\n this.LocalStorageService.save('isHome', this.isHome);\r\n });\r\n\r\n this.$rootScope.$on('change-is-busy', (evt, value) => {\r\n this.$timeout(() => {\r\n this.isBusy = value;\r\n });\r\n });\r\n\r\n this.$rootScope.$on('busy-processes-changed', ($event, busyProcess) => {\r\n const { type, body, id } = busyProcess;\r\n\r\n switch (type) {\r\n case 'mainProcess':\r\n const isLoading = body ? true : false;\r\n if (!isLoading) {\r\n this.isBusy = false;\r\n } else {\r\n this.isBusy = true;\r\n }\r\n\r\n break;\r\n }\r\n });\r\n\r\n this.$scope.$on('side-bar-changed-financial', (evt, shouldShow) => {\r\n this._triggerMenuClick(shouldShow);\r\n });\r\n\r\n this.$scope.$on('side-bar-changed', (evt, shouldOpen) => {\r\n this._handleSideBarChange.call(this, evt, shouldOpen);\r\n });\r\n\r\n this.$scope.$on('navigate-changed', (evt, path, params) => {\r\n this.currentPage = path;\r\n this.$state.go(path, params);\r\n this.NavigationService.gotoTop();\r\n });\r\n\r\n this.$scope.$on('hamburger-changed', evt => {\r\n this.showFullMenu = !this.showFullMenu;\r\n });\r\n\r\n this.$scope.$on('navigation-onload-changed',\r\n this._handleInitChangeForPage.bind(this)\r\n );\r\n\r\n this.$rootScope.$on('navigation-onload-changed',\r\n this._handleInitChangeForPage.bind(this)\r\n );\r\n\r\n this.$rootScope.$on('building-reference-changed', ($event, buildingRef) => {\r\n let savedBuildingRef = this.LocalStorageService.retrieve(\r\n 'selectedBuildingRef'\r\n );\r\n\r\n savedBuildingRef =\r\n savedBuildingRef &&\r\n typeof savedBuildingRef === 'object' &&\r\n 'SchemeReference' in savedBuildingRef\r\n ? savedBuildingRef.SchemeReference\r\n : savedBuildingRef;\r\n\r\n this._handleInitChangeForBuilding.call(\r\n this,\r\n buildingRef.toUpperCase(),\r\n savedBuildingRef.toUpperCase()\r\n );\r\n\r\n });\r\n\r\n //this.$rootScope.$on('set-selected-building-name', ($event, buildingName) => {\r\n // debugger;\r\n // this.title = buildingName;\r\n // });\r\n this.$rootScope.$on('accounts-confirm-email', ($evt, data) => {\r\n const { confirmEmail, confirmToken } = data;\r\n\r\n if (data) {\r\n this.$state.go(FEATURES.REGISTER, {\r\n token: confirmToken,\r\n email: confirmEmail\r\n });\r\n }\r\n });\r\n\r\n this.$rootScope.$on('user-logged-out', () => {\r\n this.$window.location = '/';\r\n });\r\n\r\n this.$rootScope.$on('user-logged-in', ($event, results) => {\r\n this.gotUser(results);\r\n });\r\n\r\n this.$rootScope.$on('user-profile-updated', ($event, updatedUser) => {\r\n this.user.FullName = updatedUser.FullName;\r\n this.friendlyName = updatedUser.FullName;\r\n });\r\n\r\n this.$rootScope.$on('clearance-user-logged-in', () => {\r\n this.$state.go(FEATURES.CLEARANCE_CAPTURE);\r\n });\r\n\r\n this.$rootScope.$on('rentals-user-logged-in', () => {\r\n this.$state.go(FEATURES.RENTALS_CAPTURE);\r\n });\r\n\r\n this.$rootScope.$on('audits-user-logged-in', () => {\r\n this.$state.go(FEATURES.AUDITS_CAPTURE);\r\n });\r\n\r\n this.$rootScope.$on('auditors-user-logged-in', () => {\r\n this.$state.go(FEATURES.AUDITORS_DASHBOARD);\r\n });\r\n\r\n this.$scope.$watch('MainVM.selectedBuildingRef',\r\n (newVal, oldVal) => {\r\n this._handleInitChangeForBuilding.call(this, newVal, oldVal);\r\n },\r\n true\r\n );\r\n\r\n this.$rootScope.$on('client-navigation-changed', ($event, data) => {\r\n let shouldShow;\r\n let { path } = data;\r\n\r\n this.NavigationService.gotoTop();\r\n\r\n this.$timeout(() => {\r\n if (path && path.length < 4) {\r\n shouldShow = true;\r\n } else {\r\n shouldShow = false;\r\n }\r\n this.$scope.$broadcast('side-bar-changed', shouldShow, path === 'yes');\r\n });\r\n });\r\n\r\n this.$rootScope.$on('set-selected-scheme-active',\r\n ($event, schemeReference) => {\r\n const elements = angular\r\n .element('#homeMenu .list-group .list-group-item')\r\n .toArray();\r\n\r\n elements.map(element => angular.element(element).removeClass('active'));\r\n\r\n const selectedElement = elements.find(element => {\r\n const $element = angular.element(element);\r\n const schemeRef = $element.data('ref');\r\n return schemeRef === schemeReference;\r\n });\r\n\r\n if (!!selectedElement) {\r\n angular.element(selectedElement).addClass('active');\r\n }\r\n }\r\n );\r\n this.$scope.$on('reload-user-units', (event, data) => {\r\n this.title = data;\r\n //this._handleUserUnitsLoad(event, data);\r\n });\r\n this.$scope.$on('selected-building-changed', ($event, schemeRef, second) => {\r\n let isInvalidLogin = angular.isUndefined(this.user) || this.user === null;\r\n let hasBuidlingProfiles = angular.isUndefined(this.user.BuildingProfiles) || this.user.BuildingProfiles === null;\r\n\r\n if (!isInvalidLogin) {\r\n if (!second) {\r\n const oldSelectedBuildingRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n if (schemeRef) {\r\n schemeRef = schemeRef.toUpperCase();\r\n if (oldSelectedBuildingRef !== schemeRef) {\r\n this.LocalStorageService.save('selectedBuildingRef', schemeRef);\r\n this.selectedBuildingRef = schemeRef;\r\n if (!hasBuidlingProfiles) {\r\n const selectedBuilding = this.user.BuildingProfiles.find(building => {\r\n const { SchemeReference: buildingReference } = building;\r\n if (buildingReference === schemeRef) {\r\n this.setTitle(building.SchemeName);\r\n //this.title = building.SchemeName;\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n if (selectedBuilding) {\r\n const { SchemeName: schemeName } = selectedBuilding;\r\n this.setTitle(selectedBuilding.SchemeName);\r\n //this.title = schemeName;\r\n }\r\n this.$rootScope.$emit('selected-building-changed', schemeRef, second);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n });\r\n\r\n this.$scope.$watch('MainVM.selectedBuildingRef',\r\n (newVal, oldVal) => {\r\n this._handleInitChangeForBuilding.call(this, newVal, oldVal);\r\n },\r\n true\r\n );\r\n\r\n this.$scope.$watch('MainVM.isBusy',\r\n (newVal, oldVal) => {\r\n if (!newVal) {\r\n this.$timeout(() => {\r\n this.checkIsMobile();\r\n }, 100);\r\n }\r\n },\r\n true\r\n );\r\n }\r\n\r\n _handleSideBarChange(evt, shouldOpen, isHome) {\r\n this.$timeout(() => {\r\n this.showFullMenu = isHome | shouldOpen || false;\r\n\r\n this._triggerMenuClick(shouldOpen);\r\n });\r\n }\r\n\r\n _handleInitChangeForBuilding(newValue, oldValue) {\r\n const isSame = this.Utility.buildingRefsAreEqual(newValue, oldValue);\r\n\r\n if (!isSame) {\r\n const selectedBuildingRef = this.LayoutService.getSelectedBuildingReference(\r\n newValue\r\n );\r\n this.selectedBuildingRef = !!selectedBuildingRef\r\n ? selectedBuildingRef.toUpperCase()\r\n : newValue.toUpperCase();\r\n\r\n\r\n\r\n this.LocalStorageService.save('selectedBuildingRef', newValue);\r\n this.$rootScope.$broadcast('selected-building-changed',\r\n this.selectedBuildingRef.toUpperCase(),\r\n null,\r\n oldValue\r\n );\r\n }\r\n\r\n const mappedPath = this.AuthorizationService.mapPath(\r\n this.$state.current.name\r\n );\r\n\r\n if (mappedPath) {\r\n const isAuthorized = this.AuthorizationService.isAuthorized(mappedPath);\r\n if (!isAuthorized) {\r\n this.$state.go(this.AuthorizationService.unProtectedRoute);\r\n }\r\n }\r\n }\r\n\r\n _handleInitChangeForPage(event, queryObj) {\r\n const { selectedTab, date } = queryObj;\r\n if (selectedTab) {\r\n const tab = selectedTab.toLowerCase();\r\n let page;\r\n switch (tab) {\r\n case '1':\r\n page = FEATURES.PAYMENTS;\r\n break;\r\n case '2':\r\n page = FEATURES.PAYMENT_AUTHORISATION;\r\n break;\r\n case '3':\r\n page = FEATURES.DOCUMENTS;\r\n break;\r\n case '4':\r\n page = FEATURES.FINANCIAL_SUMMARY;\r\n break;\r\n case '6':\r\n page = FEATURES.MY_PROFILE;\r\n break;\r\n case '7':\r\n let section = this.Utility.QueryString('section');\r\n if (!!section) {\r\n section = section.toLowerCase();\r\n } else {\r\n section = 'fire';\r\n }\r\n page = `${FEATURES.COMPLIANCE}.${section}`;\r\n break;\r\n case '8':\r\n page = FEATURES.REGISTER;\r\n break;\r\n case '9':\r\n page = FEATURES.CLEARANCE_REQUEST;\r\n break;\r\n case '10':\r\n page = FEATURES.UTILITY;\r\n break;\r\n case '11':\r\n page = FEATURES.DOCUMENTS_APPROVAL;\r\n break;\r\n default:\r\n page = FEATURES.DASHBOARD;\r\n }\r\n\r\n if (page) {\r\n this.NavigationService.gotoTop();\r\n if (!this.user) {\r\n this.$scope.$watch('MainVM.user', newValue => {\r\n if (newValue) {\r\n if (date) {\r\n this.$state.go(page, { date: date });\r\n } else {\r\n this.$state.go(page);\r\n }\r\n }\r\n });\r\n } else {\r\n this.$state.go(page, { date });\r\n }\r\n }\r\n //this.loadTilesData();\r\n this.currentPage = page;\r\n }\r\n }\r\n \r\n _triggerMenuClick(shouldShow) {\r\n const isShowing = this.$state.current.name === FEATURES.DASHBOARD;\r\n if (isShowing) {\r\n this.$timeout(() => {\r\n this.toggleSideBar();\r\n angular.element(angular.element('burger-menu').get(0)).trigger('click');\r\n });\r\n }\r\n }\r\n}\r\n","/* @ngInject */\r\n\r\nimport { default as FEATURES } from '../common/feature-enum';\r\nimport { default as USER_CLAIMS } from '../common/claim-enum';\r\nimport { shouldBeEnabled } from '../common/common'\r\n\r\nexport default class MegaNavCtrl {\r\n constructor(\r\n $q,\r\n $scope,\r\n $state,\r\n $window,\r\n $timeout,\r\n $location,\r\n $rootScope,\r\n $anchorScroll,\r\n LocalStorageService,\r\n NotificationService,\r\n AuthorizationService,\r\n AuthenticationService,\r\n CommonService\r\n ) {\r\n this.$q = $q;\r\n this.$scope = $scope;\r\n this.$state = $state;\r\n this.$window = $window;\r\n this.$timeout = $timeout;\r\n this.$location = $location;\r\n this.$rootScope = $rootScope;\r\n this.$anchorScroll = $anchorScroll;\r\n this.LocalStorageService = LocalStorageService;\r\n this.NotificationService = NotificationService;\r\n this.AuthorizationService = AuthorizationService;\r\n this.AuthenticationService = AuthenticationService;\r\n this.CommonService = CommonService;\r\n this.shouldBeEnabled = shouldBeEnabled;\r\n\r\n this.isBusy = false;\r\n this.init();\r\n this.activate();\r\n }\r\n\r\n _addMyProfile() {\r\n this.$rootScope.$eval(() => {\r\n const myProfileIsAllowed = this.shouldBeEnabled(USER_CLAIMS.MY_PROFILE)\r\n\r\n if (myProfileIsAllowed) {\r\n const oldMenuLink = this.menuLinks.find(\r\n menu => menu === USER_CLAIMS.MY_PROFILE\r\n );\r\n\r\n if (!!!oldMenuLink) {\r\n this.menuLinks.push(USER_CLAIMS.MY_PROFILE);\r\n }\r\n } else {\r\n const newMenuLinks = this.menuLinks.filter(\r\n menu => menu !== FEATURES.MY_PROFILE\r\n );\r\n this.menuLinks = newMenuLinks;\r\n }\r\n });\r\n }\r\n\r\n init() {\r\n this.friendlyName = '';\r\n this.authorize = false;\r\n this.authorized = false;\r\n this.menuLinks = ['Dashboard'];\r\n\r\n this._addMyProfile();\r\n\r\n this.$rootScope.$on('user-logged-in', ($event, results) => {\r\n this.gotUser(results);\r\n });\r\n\r\n this.$rootScope.$on('user-login-busy', ($event, { err, isBusy }) => {\r\n this.isBusy = isBusy;\r\n if (err) {\r\n this.NotificationService.error('ERROR WHILE LOGIN IN', err, 3000);\r\n }\r\n });\r\n\r\n this.$rootScope.$on('selected-building-changed', () => {\r\n this._addMyProfile();\r\n });\r\n }\r\n\r\n activate() {\r\n const currentUser = this.AuthenticationService.currentUser();\r\n if (currentUser) {\r\n this.gotUser(currentUser);\r\n }\r\n else {\r\n this.redirectedFrom();\r\n }\r\n }\r\n\r\n async redirectedFrom() {\r\n const redirectedFrom = this.CommonService.QueryString('redirectedFrom');\r\n \r\n if (redirectedFrom == 'confirm-email') {\r\n\r\n this.$timeout(() => {\r\n this.showLogin();\r\n });\r\n\r\n this.CommonService.DeleteQueryStringParameter('redirectedFrom');\r\n }\r\n else if(redirectedFrom == 'levy-invoice'){\r\n this.$timeout(() => {\r\n this.showLogin();\r\n });\r\n\r\n this.CommonService.DeleteQueryStringParameter('redirectedFrom');\r\n }\r\n }\r\n\r\n linkClicked(evt) {\r\n const myProfileLink = 'my-profile';\r\n const linkText = evt.target.innerText.toLowerCase();\r\n let url = `${this.$location.protocol()}://${this.$location.host()}:${this.$location.port()}/`;\r\n\r\n if (linkText === 'logout') {\r\n this.LocalStorageService.clear();\r\n } else if (linkText === myProfileLink.replace('-', ' ')) {\r\n const landingPage = 'dashboard';\r\n const currentPath = this.$location.absUrl();\r\n\r\n if (currentPath.includes(myProfileLink)) {\r\n return;\r\n }\r\n\r\n if (currentPath.indexOf(landingPage) !== -1) {\r\n this.$timeout(() => {\r\n this.$state.go(myProfileLink);\r\n return;\r\n });\r\n return;\r\n } else {\r\n url += `dashboard/?tab=6`;\r\n }\r\n } else {\r\n url += linkText;\r\n }\r\n\r\n this.$window.location.href = url;\r\n }\r\n\r\n gotoContactUs() {\r\n const $contactUsSection = $('#contact-us-section');\r\n\r\n if ($contactUsSection && $contactUsSection.length > 0) {\r\n $('#FullName').focus();\r\n $('html, body').animate(\r\n {\r\n scrollTop: $contactUsSection.offset().top\r\n },\r\n 1000\r\n );\r\n }\r\n return false;\r\n }\r\n\r\n showLogin() {\r\n this.$rootScope.$broadcast('show-login-auth-modal');\r\n }\r\n\r\n gotUser(results) {\r\n if (results && results.length > 0) {\r\n const profile = results[1];\r\n if (profile.UserName) {\r\n this.friendlyName = profile.FullName;\r\n this.authorized = true;\r\n }\r\n } else if (typeof results == 'object') {\r\n this.authorized = true;\r\n this.friendlyName = results['FullName'];\r\n }\r\n }\r\n}\r\n","\r\n\r\n/* @ngInject */ \r\nexport default function($templateCache) {\r\n\tvar templateString = $templateCache.get('templates/auth-nav-tmpl.html');\r\n\treturn {\r\n\t\tbindToController: true,\r\n\t\ttemplate: templateString,\r\n\t\treplace: true,\r\n\t\trestrict: 'E'\r\n\t};\r\n}\r\n","/* jshint ignore:start */\nexport default angular.module('pretor.online.directives').run(['$templateCache', function($templateCache) {$templateCache.put('light-footer.html','
\\r\\n\\t
\\r\\n\\t\\t\"Pretor\"\\r\\n\\t\\t
\\r\\n\\t\\t\\t
\\r\\n\\t\\t\\t

Copyright 2016, Pretor Group. All rights reserved

\\r\\n\\t\\t
\\r\\n\\t
\\r\\n
\\r\\n');\n$templateCache.put('scrollable/scrollable-menu-tmpl.html','\\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n');\n$templateCache.put('scrollable/scrollable-tmpl.html','\\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n');\n$templateCache.put('pages/loading-document.html','\\r\\n\\r\\n\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n \"Loading...\"\\r\\n \\r\\n
\\r\\n\\r\\n\\r\\n');\n$templateCache.put('templates/auth-nav-tmpl.html','
\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
');\n$templateCache.put('templates/documents-selector-tmpl.html','\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n');\n$templateCache.put('templates/mega-nav-tmpl.html','
\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n
');\n$templateCache.put('templates/notification-modal-tmpl.html','
\\r\\n \\r\\n {{message}}\\r\\n
');\n$templateCache.put('templates/user-menu-tmpl.html','\\r\\n\\r\\n');\n$templateCache.put('flip-card/flip-card.html','
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n');\n$templateCache.put('templates/auth-modal/auth-modal-body-tmpl.html','
\\r\\n

If you are seeing this, there is something that went wrong!!!

\\r\\n
');\n$templateCache.put('templates/auth-modal/auth-modal-header-tmpl.html','
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
');\n$templateCache.put('templates/auth-modal/auth-modal-tmpl.html','
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
');\n$templateCache.put('templates/flyout-menu/burger-menu.html','\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
');\n$templateCache.put('templates/flyout-menu/mini-side-bar.html','
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n');\n$templateCache.put('templates/flyout-menu/side-bar.html','
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n');\n$templateCache.put('flip-card/front/front.html','
\\r\\n {{object.title}}\\r\\n {{object.value}}\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n {{object.title[0]}}\\r\\n {{object.title[1]}}\\r\\n {{object.value}}\\r\\n
\\r\\n
\\r\\n');\n$templateCache.put('templates/validation/error-tmpl.html','');\n$templateCache.put('templates/validation/validation-tmpl.html','
\\r\\n
');\n$templateCache.put('scrollable/documents/documents-scroller-tmpl.html','
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
');\n$templateCache.put('nav-bar/main-site/navigation.html','\\r\\n
\\r\\n
    \\r\\n
  • {{route.value}}
  • \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

\\r\\n \\r\\n Property Menu\\r\\n \\r\\n \\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n
    \\r\\n
  • {{route.value}}
  • \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
');\n$templateCache.put('nav-bar/top/buildings-top-nav-tmpl.html','\\r\\n
\\r\\n
\\r\\n
\\r\\n

\\r\\n \\r\\n Your properties\\r\\n \\r\\n \\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
');\n$templateCache.put('nav-bar/side/buildings-side-nav-tmpl.html','
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n');}]);/* jshint ignore:end */\n","class FixHeaderPanel {\r\n\tconstructor($window, $templateCache) {\r\n\t\tthis.scope = {\r\n\t\t\tmainTarget: '@'\r\n\t\t};\r\n\t\tthis.restrict = 'A';\r\n\r\n\t\tthis.$window = $window;\r\n\t\tthis.link = this.fixHeaderPanelLink;\r\n\t\tthis.$templateCache = $templateCache;\r\n\t}\r\n\r\n\tfixHeaderPanelLink(scope, element, attrs) {\r\n\t\tconst $win = angular.element(window);\r\n\t\tconst $element = angular.element(element);\r\n\t\tconst initialWidth = $element.css('width');\r\n\t\tconst $stopFixing = angular.element('#stopFixing');\r\n\t\tconst selectionString = '.' + attrs.fixHeaderPanel;\r\n\r\n\t\tconst remHideClass = () => {\r\n\t\t\tif ($element.hasClass('hide-scroller-nav')) {\r\n\t\t\t\t$element.removeClass('hide-scroller-nav');\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst unFix = () => {\r\n\t\t\tattrs.fixHeaderToggle = 'false';\r\n\t\t\t$element.css('width', initialWidth);\r\n\t\t\t$element.removeClass('make-me-fixed');\r\n\t\t};\r\n\r\n\t\tconst makeFixed = () => {\r\n\t\t\tattrs.fixHeaderToggle = 'true';\r\n\t\t\t$element.addClass('make-me-fixed');\r\n\t\t\t$element.css('width', angular.element(selectionString).width() + 1);\r\n\t\t};\r\n\r\n\t\t$win.on('scroll', () => {\r\n\t\t\t//if past scroll trigger point\r\n\t\t\tif ($win.scrollTop() > 450 && attrs.fixHeaderToggle === 'false') {\r\n\t\t\t\tmakeFixed();\r\n\t\t\t}\r\n\t\t\t//if less than scroll trigger point remain absolute\r\n\t\t\tif ($win.scrollTop() <= 450 && attrs.fixHeaderToggle === 'true') {\r\n\t\t\t\tunFix();\r\n\t\t\t}\r\n\t\t\t//if near end of container hide the scroller-nav\r\n\t\t\tif ($win.scrollTop() > $stopFixing.offset().top + $stopFixing.height() - 200) {\r\n\t\t\t\t$element.addClass('hide-scroller-nav');\r\n\t\t\t} else {\r\n\t\t\t\tremHideClass();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($window, $templateCache) => new FixHeaderPanel($window, $templateCache);","class Back {\r\n\tconstructor($templateCache) {\r\n\t\tthis.scope = {\r\n\t\t\tstyles: '=?',\r\n\t\t\tmode: '=?'\r\n\t\t};\r\n\r\n\t\tthis.restrict = 'E';\r\n\t\tthis.link = this.BackLink;\r\n\t}\r\n\r\n\tBackLink(scope, element, attrs) {}\r\n}\r\n\r\nexport default /* @ngInject */ ($templateCache) => new Back($templateCache);\r\n","class FlipCard {\r\n\tconstructor($timeout, $rootScope, $templateCache) {\r\n\t\tthis.scope = {\r\n\t\t\tstatic: '=?'\r\n\t\t};\r\n\r\n\t\tthis.restrict = 'E';\r\n\t\tthis.link = this.flipCardLink;\r\n\t\tthis.transclude = {\r\n\t\t\tfront: 'front',\r\n\t\t\tback: '?back'\r\n\t\t};\r\n\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.$templateCache = $templateCache;\r\n\t\tconst template = this.$templateCache.get('flip-card/flip-card.html');\r\n\t\tthis.template = template;\r\n\t}\r\n\r\n\tflipCardLink(scope, element, attrs) {\r\n\t\tconst { href } = attrs;\r\n\t\tconst $element = angular.element(element);\r\n\t\tconst isStatic = Object.keys(attrs).includes('static');\r\n\t\tif (isStatic) {\r\n\t\t\tangular.element('.flip-card-inner', $element).addClass('static');\r\n\t\t}\r\n\r\n\t\tif (href && href.length > 3) {\r\n\t\t\t$element.on('click', (evt) => {\r\n\t\t\t\tthis.handleNavigation(href, evt);\r\n\t\t\t});\r\n\r\n\t\t\tangular.element('*', $element).each((ele) => {\r\n\t\t\t\tconst $ele = angular.element(ele);\r\n\r\n\t\t\t\t$ele.on('click', (evt) => {\r\n\t\t\t\t\tthis.handleNavigation(href, evt);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\thandleNavigation(page, event) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.$rootScope.$broadcast('side-bar-changed-financial', false);\r\n\r\n\t\t\tif (page.includes('?')) {\r\n\t\t\t\tconst fields = page.split('?');\r\n\t\t\t\tpage = fields[0];\r\n\t\t\t\tconst tempParams = fields[1].split('=');\r\n\t\t\t\tconst stringParams = `{ \r\n\t\t\t\t\t\"${tempParams[0]}\": \"${tempParams[1]}\"\r\n\t\t\t\t}`;\r\n\r\n\t\t\t\tconst params = JSON.parse(stringParams);\r\n\t\t\t\tthis.$rootScope.$broadcast('navigate-changed', page, params);\r\n\t\t\t} else {\r\n\t\t\t\tthis.$rootScope.$broadcast('navigate-changed', page);\r\n\t\t\t}\r\n\r\n\t\t\tthis.$rootScope.$broadcast('client-navigation-changed', { path: page });\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($timeout, $rootScope, $templateCache) =>\r\n\tnew FlipCard($timeout, $rootScope, $templateCache);\r\n","class Front {\r\n\tconstructor($templateCache) {\r\n\t\tthis.restrict = 'E';\r\n\t\tthis.scope = {\r\n\t\t\tmode: '@',\r\n\t\t\tobject: '=',\r\n\t\t\tstyles: '=?'\r\n\t\t};\r\n\t\tthis.transclude = true;\r\n\t\tthis.link = this.FrontLink;\r\n\r\n\t\tthis.$templateCache = $templateCache;\r\n\t\tconst template = this.$templateCache.get('flip-card/front/front.html');\r\n\t\tthis.template = template;\r\n\t}\r\n\r\n\tFrontLink(scope, element, attrs) {\r\n\t\tconst $element = angular.element(element);\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($templateCache) => new Front($templateCache);\r\n","export { default as Back } from './back';\r\nexport { default as Front } from './front/front';\r\nexport { default as FlipCard } from './flip-card';\r\n","function BurgerMenuLink(scope, element, attrs) {\r\n\tvar $el = $(element);\r\n\t$el.on('click', function() {\r\n\t\tvar $this = $(this);\r\n\t\tvar $wrapper = $('.hamburger', $this);\r\n\r\n\t\tif (!$wrapper.hasClass('is-active')) {\r\n\t\t\t$this.addClass('expanded');\r\n\t\t} else {\r\n\t\t\t$this.removeClass('expanded');\r\n\t\t}\r\n\r\n\t\tsetTimeout(function() {\r\n\t\t\t$wrapper.toggleClass('is-active');\r\n\t\t}, 200);\r\n\t});\r\n}\r\n\r\n \r\n\r\n\r\n/* @ngInject */ \r\nexport default function BurgerMenu($templateCache) {\r\n\tvar templateString = $templateCache.get('templates/flyout-menu/burger-menu.html');\r\n\r\n\treturn {\r\n\t\trestrict: 'E',\r\n\t\tlink: BurgerMenuLink,\r\n\t\ttemplate: templateString\r\n\t};\r\n}\r\n","class MiniSideBar {\r\n\tconstructor($timeout, $templateCache, NavigationService, LocalStorageService) {\r\n\t\tthis.restrict = 'E';\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.link = this.MiniSideBarLink;\r\n\t\tthis.$win = angular.element(window);\r\n\t\tthis.$templateCache = $templateCache;\r\n\t\tthis.template = this.htmlStringTemplate;\r\n\t\tthis.NavigationService = NavigationService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t}\r\n\r\n\tget htmlStringTemplate() {\r\n\t\tconst templateString = this.$templateCache.get('templates/flyout-menu/mini-side-bar.html');\r\n\t\treturn templateString;\r\n\t}\r\n\r\n\t_changeSideBarHeight() {\r\n\t\tconst winHeight = this.$win.width() > 521 ? `${this.$win.height()}px` : '3em';\r\n\t\tconst menuMinHeight = `min-height:${winHeight} !important`;\r\n\t\tangular.element('.side-menu-container').attr('style', menuMinHeight);\r\n\t}\r\n\r\n\tMiniSideBarLink(scope, element, attrs) {\r\n\t\tthis._changeSideBarHeight();\r\n\r\n\t\tthis.$win.on('resize', () => {\r\n\t\t\tthis._changeSideBarHeight();\r\n\t\t});\r\n\r\n\t\tconst $element = angular.element(element);\r\n\t\tangular.element('li,a', $element).each((i, link) => {\r\n\t\t\tconst $link = angular.element(link);\r\n\t\t\t$link.click((evt) => {\r\n\t\t\t\tevt.preventDefault();\r\n\t\t\t\tif ($link.attr('title') === 'Financials') {\r\n\t\t\t\t\tangular.element('#sideBarContainer burger-menu').trigger('click');\r\n\t\t\t\t\tthis.$timeout(() => {\r\n\t\t\t\t\t\tconst display = angular.element('side-bar ul li.sub-menus ul')[0].style.display;\r\n\t\t\t\t\t\tconst isNotShowing = !display || display === 'none';\r\n\t\t\t\t\t\tif (isNotShowing) {\r\n\t\t\t\t\t\t\tangular.element('side-bar ul li.sub-menus').trigger('click');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, 220);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlet path = $link.attr('ui-sref');\r\n\t\t\t\t\tif (!path) {\r\n\t\t\t\t\t\tlet $urlElement = $link.closest('[ui-sref]');\r\n\t\t\t\t\t\tif ($urlElement && $urlElement.length > 0) {\r\n\t\t\t\t\t\t\tpath = $urlElement.attr('ui-sref');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$urlElement = angular.element('[ui-sref]', $link);\r\n\t\t\t\t\t\t\tpath = $urlElement.attr('ui-sref');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (path) {\r\n\t\t\t\t\t\tpath = path.toLowerCase();\r\n\t\t\t\t\t\tthis.LocalStorageService.save('selectedReportMonth', '');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscope.$parent.$broadcast('navigate-changed', path);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.NavigationService.gotoTop();\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($timeout, $templateCache, NavigationService, LocalStorageService) =>\r\n\tnew MiniSideBar($timeout, $templateCache, NavigationService, LocalStorageService);\r\n"," \r\n\r\n\r\n/* @ngInject */ \r\nexport default function SideBar($rootScope, $templateCache, NavigationService, LocalStorageService) {\r\n\tvar templateString = $templateCache.get('templates/flyout-menu/side-bar.html');\r\n\treturn {\r\n\t\trestrict: 'E',\r\n\t\tlink: SideBarLink,\r\n\t\ttemplate: templateString\r\n\t};\r\n\tfunction SideBarLink(scope, element, attrs) {\r\n\t\tvar $menus = $(element);\r\n\t\tvar lin;\r\n\t\tvar $subMenu;\r\n\r\n\t\t$('ul>li', $menus).click(function(evt) {\r\n\t\t\tvar $item = $(this);\r\n\t\t\tvar shouldCollapseOthers = !$item.hasClass('.sub-menus');\r\n\t\t\tevt.preventDefault();\r\n\t\t\t$('ul.sub-menu-list', $menus).each(function(i, sm) {\r\n\t\t\t\tvar $sm = $(sm);\r\n\t\t\t\tif ($sm.css('display') === 'block') {\r\n\t\t\t\t\t$(sm).animate({ height: 'hide' }, 180, 'swing');\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar $anchor = $('a', $item);\r\n\t\t\tif ($anchor && $anchor.length > 0) {\r\n\t\t\t\tvar route = $anchor.attr('ui-sref');\r\n\r\n\t\t\t\tif (route && route.length > 0) {\r\n\t\t\t\t\tLocalStorageService.clearSavedDates();\r\n\t\t\t\t\t$rootScope.$broadcast('navigate-changed', route);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!$item.hasClass('sub-menus')) {\r\n\t\t\t\tscope.$parent.$eval(function() {\r\n\t\t\t\t\t$('#sideBarContainer burger-menu').trigger('click');\r\n\t\t\t\t});\r\n\t\t\t\tNavigationService.gotoTop();\r\n\t\t\t}\r\n\r\n\t\t\t// add logic to check if item has children, if it does don't run the above function\r\n\t\t\t// only apply to last child.\r\n\t\t});\r\n\t\t//});\r\n\r\n\t\t$('.sub-menus', $menus).each(function(i, el) {\r\n\t\t\tvar $el = $(el);\r\n\t\t\t$el.click(function(e) {\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\tvar $target = $(e.target);\r\n\t\t\t\tvar $subMenu = $target.closest('li.sub-menus');\r\n\t\t\t\tvar $menuItems = $('ul.sub-menu-list', $subMenu);\r\n\r\n\t\t\t\tvar isShowing = $menuItems.css('display') === 'block';\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif (!isShowing) {\r\n\t\t\t\t\t$menuItems.animate({ height: 'show' }, 250, 'swing');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$menuItems.animate({ height: 'hide' }, 180, 'swing');\r\n\t\t\t\t}\r\n\r\n\t\t\t\tNavigationService.gotoTop();\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n}\r\n","\r\n\r\n/* @ngInject */ \r\nexport default function AuthModalBody($templateCache) {\r\n\tvar templateString = $templateCache.get('templates/auth-modal/auth-modal-body-tmpl.html');\r\n\r\n\treturn {\r\n\t\trestrict: 'E',\r\n\t\tscope: {\r\n\t\t\ttest: '='\r\n\t\t},\r\n\t\ttransclude: true,\r\n\t\tlink: AuthModalBodyLink,\r\n\t\ttemplate: templateString\r\n\t};\r\n}\r\n\r\nfunction AuthModalBodyLink() {}\r\n","/* @ngInject */\r\n\r\nexport default function AuthModalHeader($templateCache) {\r\n\tvar templateString = $templateCache.get('templates/auth-modal/auth-modal-header-tmpl.html');\r\n\treturn {\r\n\t\trestrict: 'E',\r\n\t\tscope: {\r\n\t\t\ticon: '@',\r\n\t\t\ttitle: '@'\r\n\t\t},\r\n\t\tlink: AuthModalHeaderLink,\r\n\t\ttemplate: templateString\r\n\t\t//templateUrl: \"templates/auth-modal/auth-modal-header-tmpl.html\"\r\n\t};\r\n\r\n\tfunction AuthModalHeaderLink(scope, element, attrs) {\r\n\t\tvar $element = $($(element).get(0));\r\n\t\tvar $iconElement = $($('i.fas', $element).get(0));\r\n\t\tvar $titleLabel = $($('label', $element).get(0));\r\n\r\n\t\t$iconElement.attr('class', 'fas ' + attrs.icon || 'fa-user');\r\n\t\t$titleLabel.text(attrs.title || 'Welcome');\r\n\t}\r\n}\r\n","\r\n\r\n/* @ngInject */ \r\nexport default function AuthModal($rootScope, $templateCache) {\r\n\tvar templateString = $templateCache.get('templates/auth-modal/auth-modal-tmpl.html');\r\n\treturn {\r\n\t\trestrict: 'E',\r\n\t\tscope: {\r\n\t\t\tshowModal: '=',\r\n\t\t\tcloseModal: '=',\r\n\t\t\tcanClose: '@'\r\n\t\t},\r\n\t\ttemplate: templateString,\r\n\t\ttransclude: {\r\n\t\t\tmodalHeader: 'authModalHeader',\r\n\t\t\tmodalBody: 'authModalBody'\r\n\t\t},\r\n\t\tlink: AuthModalLink\r\n\t};\r\n\r\n\tfunction AuthModalLink(scope, element) {\r\n\t\tvar $element = $($(element).get(0));\r\n\t\tvar $modalBackground = $element.parent();\r\n\r\n\t\tscope.closeModal = function() {\r\n\t\t\t$modalBackground.slideUp('280');\r\n\t\t\t$rootScope.$broadcast('auth-modal-closed', $modalBackground);\r\n\t\t};\r\n\r\n\t\tscope.showModal = function() {\r\n\t\t\t$rootScope.$broadcast('auth-modal-shown', $modalBackground);\r\n\t\t\tif ($modalBackground.css('display') === 'none') {\r\n\t\t\t\t$modalBackground.animate(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\theight: 'toggle'\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tduration: 600,\r\n\t\t\t\t\t\tspecialEasing: {\r\n\t\t\t\t\t\t\twidth: 'linear',\r\n\t\t\t\t\t\t\theight: 'easeInOutExpo' //\"easeOutBack\"//\"easeOutQuart\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*,\r\n complete: function() {\r\n setTimeout(function() {\r\n $modalBackground.slideUp(\"280\");\r\n }, timeoutPeriod || 2000000);\r\n }*/\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass DocumentsSelector {\r\n\tconstructor($timeout, $interval, $rootScope, $templateCache) {\r\n\t\tthis.scope = {\r\n\t\t\ttwoColumns: '=?',\r\n\t\t\tselectEvent: '&',\r\n\t\t\ttargetSelector: '@',\r\n\t\t\tcolumnClassName: '@',\r\n\t\t\tselectedPayment: '=',\r\n\t\t\tcontainerClassName: '@',\r\n\t\t\tselectedChangedEvent: '@?'\r\n\t\t};\r\n\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$interval = $interval;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.$templateCache = $templateCache;\r\n\t\tthis.template = this.htmlViewTemplate;\r\n\t\tthis.link = this.documentsSelectorLink;\r\n\t}\r\n\r\n\tinit(scope, element) {\r\n\t\tthis.scopeReference = scope;\r\n\t\tthis.$scopeReference = scope;\r\n\t\tthis.$element = angular.element(element);\r\n\r\n\t\tthis._registerEventHandlers();\r\n\t}\r\n\r\n\tpreviewDocument(index) {\r\n\t\tlet __this;\r\n\r\n\t\tlet scope = this.$scopeReference.$parent;\r\n\t\twhile (!__this) {\r\n\t\t\tif ('previewDocument' in scope) {\r\n\t\t\t\t__this = scope;\r\n\t\t\t}\r\n\r\n\t\t\tscope = scope.$parent;\r\n\t\t}\r\n\r\n\t\t__this.$scopeReference.selectedPayment.Attachments.forEach((attachment) => {\r\n\t\t\tattachment.isSelected = false;\r\n\t\t});\r\n\r\n\t\tif (index > -1) {\r\n\t\t\t__this.$scopeReference.selectEvent({ index });\r\n\t\t\t__this.$scopeReference.selectedPayment.Attachments[index].isSelected = true;\r\n\t\t}\r\n\t}\r\n\r\n\tdocumentsSelectorLink(scope, element, attrs) {\r\n\t\tscope.previewDocument = this.previewDocument;\r\n\r\n\t\tthis.init(scope, element);\r\n\t}\r\n\r\n\tget htmlViewTemplate() {\r\n\t\tconst template = this.$templateCache.get('templates/documents-selector-tmpl.html');\r\n\t\treturn template;\r\n\t}\r\n\r\n\t_refreshEQCSS() {\r\n\t\tthis.$rootScope.$eval(() => {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tEQCSS.apply();\r\n\t\t\t}, 120);\r\n\t\t});\r\n\t}\r\n\r\n\t_registerEventHandlers() {\r\n\t\tconst $modal = angular.element(this.$element.closest('.modal')[0]);\r\n\t\t$modal.on('shown.bs.modal', () => {\r\n\t\t\tthis._refreshEQCSS();\r\n\r\n\t\t\tif (\r\n\t\t\t\t!!this.scopeReference.selectedPayment.Attachments &&\r\n\t\t\t\tthis.scopeReference.selectedPayment.Attachments.length > 0\r\n\t\t\t) {\r\n\t\t\t\tthis.scopeReference.selectedPayment.Attachments[0].isSelected = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$modal.on('hidden.bs.modal', () => {\r\n\t\t\tthis.scopeReference.selectedPayment.Attachments.forEach((attachment) => {\r\n\t\t\t\tattachment.isSelected = false;\r\n\t\t\t});\r\n\r\n\t\t\tthis.scopeReference.selectedPayment.Attachments.forEach(() => {\r\n\t\t\t\tthis.$timeout(() => this.$rootScope.$broadcast('documents-scroller-adjust', { dir: 'left' }), 250);\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tthis.scopeReference.$watch(\r\n\t\t\t'selectedPayment',\r\n\t\t\t(newValue, oldValue) => {\r\n\t\t\t\tif (this.scopeReference.selectedPayment && newValue) {\r\n\t\t\t\t\tconst { Attachments: attachments } = this.scopeReference.selectedPayment || newValue;\r\n\r\n\t\t\t\t\tif (!!!oldValue || this.scopeReference.selectedPayment.PaymentId !== oldValue.PaymentId) {\r\n\t\t\t\t\t\tattachments[0].isSelected = true;\r\n\t\t\t\t\t\tthis.$rootScope.$broadcast('noOfDocumentsChanged', { noOfDocuments: attachments.length });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($timeout, $interval, $rootScope, $templateCache) =>\r\n\tnew DocumentsSelector($timeout, $interval, $rootScope, $templateCache);\r\n","class PDFViewer {\r\n\tconstructor($sce, $http, $timeout, $window, $rootScope) {\r\n\t\tthis.restrict = 'E';\r\n\t\tthis.scope = {\r\n\t\t\turl: '=',\r\n\t\t\tisLoading: '='\r\n\t\t};\r\n\t\tthis.template = this.template();\r\n\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$http = $http;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\r\n\t\tthis.$iFrame = null;\r\n\t\tthis.$element = null;\r\n\t}\r\n\r\n\tinit(element) {\r\n\t\tthis.$element = $(element);\r\n\t}\r\n\r\n\ttemplate() {\r\n\t\treturn `\r\n\t\t\t${this.pageStyles}\r\n\t\t\t${this.busyIndicator}\r\n\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n `;\r\n\t}\r\n\r\n\tlink(scope, element, attrs) {\r\n\t\tthis.init(element);\r\n\t\tthis.ngScope = scope;\r\n\r\n\t\tscope.$watch('url', (newVal) => {\r\n\t\t\tif (newVal) {\r\n\t\t\t\tconst styles = [{ name: 'display', value: 'none' }];\r\n\t\t\t\tconst $content = $('*', this.$element);\r\n\t\t\t\tthis._applyStyling($content, styles);\r\n\r\n\t\t\t\tthis.switchIsBusy(true);\r\n\t\t\t\tthis.clearOutIFrame();\r\n\r\n\t\t\t\tnewVal = this.$sce.valueOf(newVal);\r\n\r\n\t\t\t\tconst dots = newVal.split('.');\r\n\t\t\t\tlet fileExtension = dots[dots.length - 1];\r\n\t\t\t\tlet isPdf = newVal.indexOf('?extension=pdf') !== -1;\r\n\r\n\t\t\t\tif (isPdf || newVal.toLowerCase().indexOf('/byid/') > -1) {\r\n\t\t\t\t\tfileExtension = 'pdf';\r\n\t\t\t\t\tnewVal = newVal.replace('?extension=pdf', '');\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch (fileExtension.toLowerCase()) {\r\n\t\t\t\t\tcase 'pdf':\r\n\t\t\t\t\tcase 'html':\r\n\t\t\t\t\tcase 'htm':\r\n\t\t\t\t\tcase 'jpg':\r\n\t\t\t\t\tcase 'jpeg':\r\n\t\t\t\t\tcase 'png':\r\n\t\t\t\t\tcase 'bmp':\r\n\t\t\t\t\tcase 'tif':\r\n\t\t\t\t\tcase 'tiff':\r\n\t\t\t\t\t\tthis.renderIFrame(newVal);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tconst downloadIndicator = `${pretorOnlineUrl\r\n\t\t\t\t\t\t\t? pretorOnlineUrl + 'home/downloading'\r\n\t\t\t\t\t\t\t: 'http://localhost:58626/home/downloading'}`;\r\n\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tconst data = $.ajax({\r\n\t\t\t\t\t\t\t\turl: newVal,\r\n\t\t\t\t\t\t\t\tmethod: 'GET',\r\n\t\t\t\t\t\t\t\txhrFields: {\r\n\t\t\t\t\t\t\t\t\tresponseType: 'blob'\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\tsuccess: (data, textStatus, xhr) => {\r\n\t\t\t\t\t\t\t\t\tconst a = document.createElement('a');\r\n\t\t\t\t\t\t\t\t\tconst urlData = window.URL.createObjectURL(data);\r\n\t\t\t\t\t\t\t\t\ta.href = urlData;\r\n\t\t\t\t\t\t\t\t\ta.download = `Download.${fileExtension.toLowerCase()}`;\r\n\t\t\t\t\t\t\t\t\ta.click();\r\n\t\t\t\t\t\t\t\t\twindow.URL.revokeObjectURL(urlData);\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\terror: (err) => {\r\n\t\t\t\t\t\t\t\t\tthis.renderIFrame(downloadIndicator);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} catch (err) {\r\n\t\t\t\t\t\t\tthis.renderIFrame(downloadIndicator);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.renderIFrame(downloadIndicator);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the Loading indicator content\r\n\t * @readonly\r\n\t * @returns {String} Loading indicator content\r\n\t * @memberOf PDFViewer\r\n\t */\r\n\tget busyIndicator() {\r\n\t\tconst src =\r\n\t\t\t(_.endsWith(PretorCDNAddress, '/') ? PretorCDNAddress : PretorCDNAddress + '/') + 'images/loading doc.gif';\r\n\t\treturn `\r\n\t\t
\r\n\t\t\t\"Pretor\r\n\t \t
\r\n\t\t`;\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the PDF Viewer's styles\r\n\t * @readonly\r\n\t * @returns {String} The PDF Viewer's styles\r\n\t * @memberOf PDFViewer\r\n\t */\r\n\tget pageStyles() {\r\n\t\treturn `\r\n\t\t\t\r\n\t\t`;\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the document's URL for displaying\r\n\t * @param {String} url the document URL\r\n\t * @memberOf PDFViewer\r\n\t */\r\n\tasync renderIFrame(url) {\r\n\t\tconst errorUrl = `${pretorOnlineUrl\r\n\t\t\t? pretorOnlineUrl + 'home/notFound'\r\n\t\t\t: 'http://localhost:58626/home/NotFound'}`;\r\n\r\n\t\ttry {\r\n\t\t\tif (url.toLowerCase() !== errorUrl.toLowerCase()) {\r\n\t\t\t\tawait this.$http.get(url);\r\n\t\t\t\tthis.setIFrameSrc(url);\r\n\t\t\t} else {\r\n\t\t\t\tthis.setIFrameSrc(errorUrl);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tconst msg = `Error while rendering document`;\r\n\t\t\tconsole.error(`${msg}: \\n${JSON.stringify(error)}`);\r\n\t\t\tthis.setIFrameSrc(errorUrl);\r\n\t\t}\r\n\t}\r\n\r\n\tclearOutIFrame() {\r\n\t\t/*\r\n\t\tconst $iFrame = $('iframe#pdfViewer', this.$element);\r\n\t\t$iFrame.empty();\r\n\t\t*/\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the document's src and displays the iframe\r\n\t * @param {String} url The URL of the document\r\n\t * @memberOf PDFViewer\r\n\t */\r\n\tsetIFrameSrc(url) {\r\n\t\tconst $context = this.$element.closest('.modal.fade.in')[0];\r\n\t\tconst $iFrame = $('iframe#pdfViewer', $context);\r\n\r\n\t\t$iFrame.on('load', () => {\r\n\t\t\tthis.switchIsBusy(false);\r\n\t\t\tthis._applyStyling($iFrame, [{ name: 'display', value: 'block' }]);\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tif (this.ngScope.url) {\r\n\t\t\t\t\tthis.$timeout(() => {\r\n\t\t\t\t\t\tthis.ngScope.url = this.$sce.trustAsResourceUrl('');\r\n\t\t\t\t\t}, 1500);\r\n\t\t\t\t}\r\n\t\t\t}, 400);\r\n\t\t});\r\n\r\n\t\t$iFrame.attr('src', url);\r\n\t\tthis._applyStyling($iFrame, [{ name: 'display', value: 'none' }]);\r\n\t}\r\n\r\n\t/**\r\n\t * Shows and hides the loading indicator\r\n\t * @param {Boolean} shouldShow Should show flag\r\n\t * @memberOf PDFViewer\r\n\t */\r\n\tswitchIsBusy(shouldShow) {\r\n\t\tconst $isLoadingDiv = $('.loading, .loading *', this.$element);\r\n\r\n\t\tconst styles = [\r\n\t\t\t{\r\n\t\t\t\tname: 'display',\r\n\t\t\t\tvalue: shouldShow ? 'flex' : 'none'\r\n\t\t\t}\r\n\t\t];\r\n\r\n\t\tthis._applyStyling($isLoadingDiv, styles);\r\n\t}\r\n\r\n\t/**\r\n\t * Method for safely applying styles\r\n\t * \r\n\t * @param {JQuery} elements Elements to apply styling to\r\n\t * @param {Object[]} styles Styles to be applied\r\n\t * @memberOf PDFViewer\r\n\t */\r\n\t_applyStyling(elements, styles) {\r\n\t\telements.each((i, element) => {\r\n\t\t\tstyles.forEach((style) => {\r\n\t\t\t\telement.style.removeProperty(style.name);\r\n\t\t\t\telement.style.setProperty(style.name, style.value, 'important');\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($sce, $http, $timeout, $window, $rootScope) =>\r\n\tnew PDFViewer($sce, $http, $timeout, $window, $rootScope);\r\n","export const getRootScope = (_this_, keyProperty) => {\r\n\tlet rootScopeRef,\r\n\t\ttempScope = null,\r\n\t\tfound = keyProperty in _this_;\r\n\r\n\tif (!found) {\r\n\t\ttempScope = _this_.$parent;\r\n\t} else {\r\n\t\ttempScope = _this_;\r\n\t}\r\n\r\n\twhile (!found) {\r\n\t\tif (keyProperty in tempScope) {\r\n\t\t\tfound = true;\r\n\t\t\trootScopeRef = tempScope;\r\n\t\t} else {\r\n\t\t\trootScopeRef = tempScope.$parent;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!!!rootScopeRef && !!tempScope) {\r\n\t\trootScopeRef = tempScope;\r\n\t}\r\n\r\n\treturn rootScopeRef;\r\n};\r\n","export { default as BuildingsTopNav } from './top/buildings-top-nav';\r\nexport { default as BuildingsSideNav } from './side/buildings-side-nav';\r\n","import { default as FEATURES } from '../../../common/feature-enum';\r\nimport {\r\n NAVIGATION,\r\n routeToClaim,\r\n NAVIGATION_SORTED\r\n} from '../../../common/navigation-enums';\r\n\r\nclass Navigation {\r\n constructor(\r\n $sce,\r\n $state,\r\n $window,\r\n $timeout,\r\n $rootScope,\r\n $templateCache,\r\n AuthorizationService\r\n ) {\r\n this.$sce = $sce;\r\n this.$state = $state;\r\n this.$window = $window;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.$templateCache = $templateCache;\r\n this.AuthorizationService = AuthorizationService;\r\n\r\n this.link = this.NavigationLink;\r\n this.template = this.getTemplate;\r\n //this.links = null;\r\n }\r\n\r\n get getTemplate() {\r\n const template = this.$templateCache.get(\r\n 'nav-bar/main-site/navigation.html'\r\n );\r\n return template;\r\n }\r\n\r\n generateNavLinks() {\r\n const navigationRoutes = Object.keys(NAVIGATION).map(\r\n option => NAVIGATION[option]\r\n );\r\n this.allowedRoutes = navigationRoutes.map(route => {\r\n const claim = routeToClaim(route);\r\n const { order, description } = claim;\r\n\r\n const mappedRoute = {\r\n order,\r\n description,\r\n value: route\r\n };\r\n\r\n return mappedRoute;\r\n });\r\n const sortedNavigation = NAVIGATION_SORTED(this.allowedRoutes);\r\n\r\n return sortedNavigation;\r\n }\r\n\r\n init(scope, element, attrs) {\r\n scope.activeLink = null;\r\n this.$element = element;\r\n this.scopeReference = scope;\r\n const routes = this.generateNavLinks();\r\n scope.routes = routes;\r\n this.scopeReference.$element = angular.element(element);\r\n this.scopeReference.toggleDashboardList = this.toggleDashboardList;\r\n this.$timeout(() => {\r\n this._registerEventHandling();\r\n });\r\n }\r\n \r\n toggleDashboardList() {\r\n const $arrow = angular.element('i.fas', this.$element);\r\n const $dashboardList = angular.element('#propertyMenu', this.$element);\r\n\r\n if ($dashboardList && $dashboardList.length > 0) {\r\n const isShowing = $dashboardList.hasClass('in');\r\n\r\n if (isShowing) {\r\n $arrow.addClass('fa-chevron-down');\r\n $arrow.removeClass('fa-chevron-up');\r\n } else {\r\n $arrow.addClass('fa-chevron-up');\r\n $arrow.removeClass('fa-chevron-down');\r\n }\r\n }\r\n }\r\n // setBuildingTitle(links)\r\n //{\r\n // links.each((i, l) => {\r\n // const $l = angular.element(l);\r\n // let selectedBuildingTab = $l.hasClass('active');``\r\n // console.warn(\"Found selected tab: \" + $l.hasClass('active'));\r\n // if (selectedBuildingTab)\r\n // {\r\n // angular.element('dashboard-title ng-binding').text = $l.text;\r\n\r\n // return \r\n // }\r\n // });\t\t\r\n // }\r\n\r\n _setSelectPage($links, incomingPage = undefined) {\r\n let navigationPage;\r\n const currentPage = incomingPage || this.scopeReference.MainVM.currentPage;\r\n if (!!currentPage) {\r\n switch (currentPage) {\r\n case '':\r\n case '/':\r\n case FEATURES.DASHBOARD:\r\n navigationPage = NAVIGATION.PropertyList;\r\n break;\r\n case FEATURES.TENANT:\r\n navigationPage = NAVIGATION.ManageTents;\r\n break;\r\n case FEATURES.DOCUMENTS:\r\n navigationPage = NAVIGATION.BuildingDocuments;\r\n break;\r\n case FEATURES.COMPLIANCE:\r\n navigationPage = NAVIGATION.Compliance;\r\n break;\r\n case FEATURES.ACCOUNT_HISTORY:\r\n navigationPage = NAVIGATION.AccountHistory;\r\n break;\r\n case FEATURES.FINANCIAL_SUMMARY:\r\n navigationPage = NAVIGATION.FinancialPack;\r\n break;\r\n case FEATURES.PAYMENTS:\r\n navigationPage = NAVIGATION.PaymentApprovals;\r\n break;\r\n case FEATURES.PAYMENT_AUTHORISATION:\r\n navigationPage = NAVIGATION.PaymentAuthorisation;\r\n break;\r\n case FEATURES.PERSONAL_DOCUMENTS:\r\n navigationPage = NAVIGATION.PersonalDocuments;\r\n break;\r\n case FEATURES.DOCUMENTS_APPROVAL:\r\n navigationPage = NAVIGATION.DocumentsApproval;\r\n break;\r\n case FEATURES.SHOW_FIND_A_CONTRACTOR:\r\n navigationPage = NAVIGATION.ShowFindAContractor;\r\n break;\r\n }\r\n\r\n const link = $links.toArray().find(l => {\r\n const $l = angular.element(l);\r\n const found = $l.text() === navigationPage;\r\n return found;\r\n });\r\n\r\n if (link) {\r\n $links.each((i, l) => {\r\n const $l = angular.element(l);\r\n $l.removeClass('active');\r\n });\r\n angular.element(link).addClass('active');\r\n }\r\n }\r\n }\r\n\r\n _registerEventHandling() {\r\n const $links = angular.element('li.nav-list-item', this.$element);\r\n\r\n this._setSelectPage($links);\r\n\r\n $links.each((i, link) => {\r\n const $link = angular.element(link);\r\n $link.on('click', evt => {\r\n const { currentTarget } = evt;\r\n const $target = angular.element(currentTarget);\r\n const value = $target.text();\r\n\r\n $links.each((i, l) => {\r\n const $l = angular.element(l);\r\n $l.removeClass('active');\r\n });\r\n\r\n switch (value) {\r\n case NAVIGATION.ManageTents:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.TENANT);\r\n break;\r\n case NAVIGATION.PaymentApprovals:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.PAYMENTS);\r\n break;\r\n case NAVIGATION.BuildingDocuments:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.DOCUMENTS);\r\n break;\r\n case NAVIGATION.PropertyList:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.DASHBOARD);\r\n break;\r\n case NAVIGATION.MyProfile:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.MY_PROFILE);\r\n break;\r\n case NAVIGATION.Utility:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.UTILITY);\r\n break; \r\n case NAVIGATION.Compliance:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.COMPLIANCE);\r\n break;\r\n case NAVIGATION.FinancialPack:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.FINANCIAL_SUMMARY);\r\n break;\r\n case NAVIGATION.AccountHistory:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.ACCOUNT_HISTORY);\r\n break;\r\n case NAVIGATION.PersonalDocuments:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.PERSONAL_DOCUMENTS);\r\n break;\r\n case NAVIGATION.PaymentAuthorisation:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.PAYMENT_AUTHORISATION);\r\n break;\r\n case NAVIGATION.DocumentsApproval:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.DOCUMENTS_APPROVAL);\r\n break;\r\n case NAVIGATION.ShowFindAContractor:\r\n this.$rootScope.$broadcast('navigate-changed', FEATURES.SHOW_FIND_A_CONTRACTOR);\r\n break;\r\n }\r\n\r\n $target.addClass('active');\r\n });\r\n });\r\n\r\n this.scopeReference.$on('selected-building-changed', ({ path: page }, schemeRef) => {\r\n this._setSelectPage($links, page);\r\n });\r\n\r\n this.scopeReference.$on(\r\n 'client-navigation-changed',\r\n ($event, { path: page }) => {\r\n this._setSelectPage($links, page);\r\n this.generateNavLinks();\r\n }\r\n );\r\n }\r\n\r\n NavigationLink(scope, elements, attrs) {\r\n this.init(scope, elements, attrs);\r\n }\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n $sce,\r\n $state,\r\n $window,\r\n $timeout,\r\n $rootScope,\r\n $templateCache,\r\n AuthorizationService\r\n) =>\r\n new Navigation(\r\n $sce,\r\n $state,\r\n $window,\r\n $timeout,\r\n $rootScope,\r\n $templateCache,\r\n AuthorizationService\r\n );\r\n","import { FEATURES } from '../../../common';\r\nclass BuildingsSideNav {\r\n constructor($sce, $window, $timeout, $rootScope, $templateCache, $scope) {\r\n this.restrict = 'E';\r\n this.$sce = $sce;\r\n this.$window = $window;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.selectedBuilding = null;\r\n this.buildingsForPaging = [];\r\n this.$templateCache = $templateCache;\r\n this.link = this.BuildingsSideNavLink;\r\n this.template = this.loadDirectiveTemplate;\r\n this.$scope = $scope;\r\n\r\n this.scope = {\r\n buildings: '=',\r\n selectedBuilding: '='\r\n };\r\n }\r\n\r\n get loadDirectiveTemplate() {\r\n const template = this.$templateCache.get(\r\n 'nav-bar/side/buildings-side-nav-tmpl.html'\r\n );\r\n return template;\r\n }\r\n\r\n _registerEventHandling(element) {\r\n this.$timeout(() => {\r\n const selector = '.building a, .building a img, .building a span';\r\n const $links = angular.element(selector, this.scopeReference.$element);\r\n\r\n $links.each((i, ele) => {\r\n const $ele = angular.element(ele);\r\n $ele.on('click', evt => {\r\n let link;\r\n const { currentTarget } = evt;\r\n\r\n if (currentTarget.tagName !== 'a') {\r\n link = angular.element(currentTarget).closest('a')[0];\r\n } else {\r\n link = currentTarget;\r\n }\r\n\r\n const $link = angular.element(link);\r\n const buildingName = $link.text().trim();\r\n $(\"MainVM\").context.all.selectedBuildingTitle.innerText = buildingName;\r\n\r\n this.scopeReference.$parent.$parent.$broadcast(\r\n 'reload-user-units',\r\n buildingName\r\n );\r\n });\r\n });\r\n }, 1500);\r\n\r\n this.$rootScope.$watch('selectedBuilding', (newValue, oldValue) => {\r\n if (newValue && newValue !== oldValue) {\r\n this.scopeReference.selectedBuildingReference = newValue;\r\n }\r\n });\r\n }\r\n\r\n changeBuilding(buildingReference) {\r\n\r\n this.$parent.$emit('navigate-changed', FEATURES.DOCUMENTS);\r\n this.$timeout(() => {\r\n this.buildings = this._mapBuildings(this.buildings);\r\n\r\n for (let index = 0; index < this.buildings.length; index++) {\r\n const building = this.buildings[index];\r\n if (building.SchemeReference === buildingReference) {\r\n building.isSelected = true;\r\n this.title = building.SchemeName;\r\n } else {\r\n building.isSelected = false;\r\n }\r\n }\r\n this.$parent.$emit('selected-building-changed', buildingReference);\r\n\r\n });\r\n }\r\n\r\n init(scope, element) {\r\n const { buildings, selectedBuilding } = scope;\r\n\r\n scope.$timeout = this.$timeout;\r\n scope._mapBuildings = this._mapBuildings;\r\n scope.changeBuilding = this.changeBuilding;\r\n scope.buildings = this._mapBuildings(buildings);\r\n\r\n this.scopeReference = scope;\r\n this.scopeReference.selectedBuildingReference = selectedBuilding;\r\n this.scopeReference.buildingsForPaging = this._mapBuildings(buildings);\r\n\r\n const $element = angular.element(element);\r\n this._registerEventHandling($element);\r\n }\r\n\r\n _mapBuildings(original) {\r\n if (!!!original || original.length === 0) {\r\n return null;\r\n }\r\n\r\n let mapped = original.map(building => {\r\n const { SchemeReference: schemeReference } = building;\r\n return {\r\n ...building,\r\n isSelected: false\r\n };\r\n });\r\n\r\n return mapped;\r\n }\r\n\r\n getTrustedBuildingImageUrl(schemeReference) {\r\n const imgUrl = this.$sce.trustAsResourceUrl(\r\n `${PretorCDNAddress}/images/buildings/${schemeReference}/${schemeReference}.png`\r\n );\r\n const trustedUrl = this.$sce.valueOf(imgUrl);\r\n return trustedUrl;\r\n };\r\n\r\n BuildingsSideNavLink(scope, element, attrs) {\r\n this.init(scope, element);\r\n }\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n $sce,\r\n $window,\r\n $timeout,\r\n $rootScope,\r\n $templateCache\r\n) => new BuildingsSideNav($sce, $window, $timeout, $rootScope, $templateCache);\r\n","import { getRootScope } from '../helper-utils';\r\n\r\nclass BuildingsTopNav {\r\n constructor($window, $timeout, $rootScope, $templateCache) {\r\n this.$window = $window;\r\n this.$timeout = $timeout;\r\n this.$rootScope = $rootScope;\r\n this.$templateCache = $templateCache;\r\n\r\n this.scope = {\r\n buildings: '=',\r\n selectedBuilding: '='\r\n };\r\n\r\n this.$element = null;\r\n this.template = this.getTemplate();\r\n this.link = this.BuildingsTopNavLink;\r\n }\r\n\r\n getTemplate() {\r\n const template = this.$templateCache.get('nav-bar/top/buildings-top-nav-tmpl.html');\r\n return template;\r\n }\r\n\r\n init(scope, element) {\r\n scope.changeBuilding = this.changeBuilding;\r\n this.isMobile = false;\r\n this.scopeReference = scope;\r\n this.scopeReference.$element = angular.element(element);\r\n this.scopeReference.toggleBuildingList = this.toggleBuildingList;\r\n\r\n this._registerEventHandling();\r\n }\r\n\r\n toggleBuildingList() {\r\n const $arrow = angular.element('#buildingsNav i.fas', this.$element);\r\n const $buildingList = angular.element('#userBuildings', this.$element);\r\n\r\n if ($buildingList && $buildingList.length > 0) {\r\n const isShowing = $buildingList.hasClass('in');\r\n\r\n if (isShowing) {\r\n $arrow.addClass('fa-chevron-down');\r\n $arrow.removeClass('fa-chevron-up');\r\n } else {\r\n $arrow.addClass('fa-chevron-up');\r\n $arrow.removeClass('fa-chevron-down');\r\n }\r\n }\r\n }\r\n\r\n BuildingsTopNavLink(scope, element, attrs) {\r\n const { buildings } = scope;\r\n\r\n scope.buildings = this._mapBuildings(buildings);\r\n this.init(scope, element);\r\n }\r\n\r\n\r\n changeBuilding(buildingReference) {\r\n const mapped = this.buildings.map((building) => {\r\n const { SchemeReference: schemeReference } = building;\r\n let isSelected = false;\r\n const mobileWidth = 991;\r\n let isMobileScreen = false;\r\n const screenWidth = $('body').width();\r\n\r\n if (schemeReference === buildingReference) {\r\n isSelected = true;\r\n }\r\n\r\n if (screenWidth <= mobileWidth) {\r\n isMobileScreen = true;\r\n }\r\n let tempImgUrl = \"\";\r\n if (!isMobileScreen) {\r\n tempImgUrl = this.getTrustedBuildingImageUrl(schemeReference);\r\n }\r\n const imgUrl = tempImgUrl;\r\n const $buildingList = angular.element('#userBuildings', this.$element);\r\n\r\n if ($buildingList.hasClass('in')) {\r\n $buildingList.removeClass('in');\r\n }\r\n return {\r\n imgUrl,\r\n ...building,\r\n isSelected\r\n };\r\n });\r\n\r\n\r\n this.buildings = mapped;\r\n this.$parent.$emit('selected-building-changed', buildingReference);\r\n }\r\n\r\n getTrustedBuildingImageUrl(schemeReference) {\r\n\r\n const imgUrl = this.$sce.trustAsResourceUrl(\r\n `${PretorCDNAddress}/images/buildings/${schemeReference}/${schemeReference}.png`\r\n );\r\n const trustedUrl = this.$sce.valueOf(imgUrl);\r\n return trustedUrl;\r\n\r\n };\r\n\r\n _mapBuildings(original) {\r\n if (!!!original || original.length === 0) {\r\n return null;\r\n }\r\n\r\n let mapped = original.map((building) => {\r\n return {\r\n ...building,\r\n isSelected: false\r\n };\r\n });\r\n return mapped;\r\n }\r\n\r\n _registerEventHandling() {\r\n this.$timeout(() => {\r\n const selector =\r\n '#userBuildings .panel-body a, #userBuildings .panel-body a img, #userBuildings .panel-body a span';\r\n const $links = angular.element(selector, this.scopeReference.$element);\r\n\r\n $links.each((i, ele) => {\r\n const $ele = angular.element(ele);\r\n $ele.on('click', (evt) => {\r\n let link;\r\n const { currentTarget } = evt;\r\n\r\n if (currentTarget.tagName !== 'a') {\r\n link = angular.element(currentTarget).closest('a')[0];\r\n } else {\r\n link = currentTarget;\r\n }\r\n\r\n const $link = angular.element(link);\r\n const buildingName = $link.text();\r\n this.scopeReference.$parent.$parent.$broadcast('reload-user-units', buildingName);\r\n\r\n });\r\n });\r\n }, 3500);\r\n\r\n this.scopeReference.$watch('MainVM.selectedBuildingRef', (newValue, oldValue) => { }, true);\r\n }\r\n}\r\n\r\nexport default /* @ngInject */ ($window, $timeout, $rootScope, $templateCache) =>\r\n new BuildingsTopNav($window, $timeout, $rootScope, $templateCache);\r\n","class HtmlCompile {\r\n constructor($compile, $timeout, $rootScope, $templateCache) {\r\n this.restrict = 'A';\r\n this.$compile = $compile;\r\n this.$timeout = $timeout;\r\n this.link = this.htmlCompileLink;\r\n\r\n this.$rootScope = $rootScope;\r\n this.$templateCache = $templateCache;\r\n }\r\n\r\n htmlCompileLink(scope, element, attrs) {\r\n scope.$watch(attrs.ngHtmlCompile, newValue => {\r\n element.html(newValue);\r\n const { main, outerItem, items } = attrs;\r\n if (main) {\r\n scope.main = JSON.parse(main);\r\n }\r\n if (items) {\r\n scope.items = JSON.parse(items);\r\n }\r\n if (outerItem) {\r\n scope.outerItem = JSON.parse(outerItem);\r\n }\r\n\r\n this.$compile(element.contents())(scope);\r\n });\r\n }\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n $compile,\r\n $timeout,\r\n $rootScope,\r\n $templateCache\r\n) => new HtmlCompile($compile, $timeout, $rootScope, $templateCache);\r\n","class NotificationModal {\r\n\tconstructor($timeout, $rootScope, $templateCache) {\r\n\t\tconst templateString = $templateCache.get('templates/notification-modal-tmpl.html');\r\n\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\r\n\t\tthis.restrict = 'EA';\r\n\t\tthis.scope = {\r\n\t\t\tmessage: '=',\r\n\t\t\tshowNotificationModal: '=',\r\n\t\t\tshouldCloseOnClick: '@?shouldCloseOnClick'\r\n\t\t};\r\n\t\tthis.link = this.NotificationModalLink;\r\n\t\tthis.template = templateString;\r\n\r\n\t\tthis.animationPromise = undefined;\r\n\t}\r\n\r\n\tNotificationModalLink(scope, element, attrs) {\r\n\t\tconst $element = $($(element).get(0));\r\n\t\tconst $modalBackground = $element.parent();\r\n\t\tconst $iconElement = $($('.fa', $element).get(0));\r\n\r\n\t\tlet shouldCloseOnClick = false;\r\n\r\n\t\tif (attrs.shouldCloseOnClick) {\r\n\t\t\tshouldCloseOnClick = JSON.parse(attrs.shouldCloseOnClick);\r\n\t\t}\r\n\t\tif (shouldCloseOnClick) {\r\n\t\t\t$modalBackground.on('click', () => {\r\n\t\t\t\t$modalBackground.slideUp('280');\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.$rootScope.$on('notifications-modal-show', ($event, data) => {\r\n\t\t\tconst { message, error, timeout } = data;\r\n\t\t\tif (!$event.defaultPrevented) {\r\n\t\t\t\t$event.defaultPrevented = true;\r\n\t\t\t}\r\n\t\t\tif (message) {\r\n\t\t\t\tscope.showNotificationModal(message, error, timeout);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tscope.showNotificationModal = (msg, err, timeoutPeriod) => {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tif (msg) {\r\n\t\t\t\t\tscope.message = msg;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (err) {\r\n\t\t\t\t\tif ($iconElement.hasClass('fa-check-circle')) {\r\n\t\t\t\t\t\t$iconElement.removeClass('fa-check-circle');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$iconElement.addClass('fa-times-circle');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif ($iconElement.hasClass('fa-times-circle')) {\r\n\t\t\t\t\t\t$iconElement.removeClass('fa-times-circle');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$iconElement.addClass('fa-check-circle');\r\n\t\t\t\t}\r\n\t\t\t\t$modalBackground.animate(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\theight: 'toggle'\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tduration: 600,\r\n\t\t\t\t\t\tspecialEasing: {\r\n\t\t\t\t\t\t\twidth: 'linear',\r\n\t\t\t\t\t\t\theight: 'easeInOutExpo' //\"easeOutBack\"//\"easeOutQuart\"\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tcomplete: () => {},\r\n\t\t\t\t\t\tdone: () => {\r\n\t\t\t\t\t\t\tif (!this.animationPromise) {\r\n\t\t\t\t\t\t\t\tthis.animationPromise = this.$timeout(() => {\r\n\t\t\t\t\t\t\t\t\t$modalBackground.slideUp('280');\r\n\t\t\t\t\t\t\t\t}, timeoutPeriod);\r\n\r\n\t\t\t\t\t\t\t\tthis.animationPromise.then(() => {\r\n\t\t\t\t\t\t\t\t\t//this.$timeout.cancel(this.animationPromise);\r\n\t\t\t\t\t\t\t\t\tthis.animationPromise = undefined;\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t\t};\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($timeout, $rootScope, $templateCache) =>\r\n\tnew NotificationModal($timeout, $rootScope, $templateCache);\r\n","class DocumentsScroller {\r\n\tconstructor($window, $rootScope, $templateCache) {\r\n\t\tthis.restrict = 'EA';\r\n\t\tthis.scope = {\r\n\t\t\ttwoColumns: '=',\r\n\t\t\tselectEvent: '&',\r\n\t\t\tattachments: '=',\r\n\t\t\tselectedPayment: '='\r\n\t\t};\r\n\r\n\t\tthis.$window = $window;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.$templateCache = $templateCache;\r\n\t\tthis.template = this.loadHtmlTemplate;\r\n\t\tthis.link = this.DocumentsScrollerLink;\r\n\t}\r\n\r\n\tget loadHtmlTemplate() {\r\n\t\tconst template = this.$templateCache.get('scrollable/documents/documents-scroller-tmpl.html');\r\n\t\treturn template;\r\n\t}\r\n\r\n\tinit(scope, element, attachments) {\r\n\t\tthis.Attachments = attachments;\r\n\r\n\t\tscope.offSet = 5;\r\n\t\tscope.animationDuration = 350;\r\n\t\tscope.$element = angular.element(element);\r\n\t\tscope.$scroller = angular.element('[role=\"group\"]', this.$element);\r\n\r\n\t\tthis.$scope = scope;\r\n\t\tthis._registerEventHandling();\r\n\t}\r\n\r\n\tDocumentsScrollerLink(scope, element, attrs) {\r\n\t\tconst { attachments: Attachments } = attrs;\r\n\r\n\t\tscope.Attachments = Attachments;\r\n\t\tscope.scrollLeft = this.scrollLeft;\r\n\t\tscope.scrollRight = this.scrollRight;\r\n\t\tscope.selectDocument = this.selectDocument;\r\n\t\tscope._performScroll = this._performScroll;\r\n\t\tscope._resetScroller = this._resetScroller;\r\n\t\tscope._getScrollItemWidth = this._getScrollItemWidth;\r\n\r\n\t\tthis.init(scope, element, Attachments);\r\n\t}\r\n\r\n\tselectDocument(index = -1) {\r\n\t\tlet $thisReference;\r\n\t\twhile (!$thisReference) {\r\n\t\t\tlet thisReference = this.$parent;\r\n\t\t\tif ('selectDocument' in thisReference && typeof thisReference.selectDocument === 'function') {\r\n\t\t\t\t$thisReference = thisReference;\r\n\t\t\t} else {\r\n\t\t\t\tthisReference = thisReference.$parent;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$thisReference.attachments.forEach((attachment) => {\r\n\t\t\tattachment.isSelected = false;\r\n\t\t});\r\n\r\n\t\tif ($thisReference.attachments && $thisReference.attachments.length > 0 && index !== -1) {\r\n\t\t\t$thisReference.attachments[index].isSelected = true;\r\n\r\n\t\t\t$thisReference.selectEvent({ index });\r\n\t\t}\r\n\t}\r\n\r\n\tscrollLeft() {\r\n\t\tthis._performScroll('left');\r\n\t}\r\n\r\n\tscrollRight() {\r\n\t\tthis._performScroll('right');\r\n\t}\r\n\r\n\t_performScroll(direction) {\r\n\t\tconst currentScrollPosition = this.$scroller.scrollLeft();\r\n\r\n\t\tlet newScrollPosition;\r\n\t\tif (direction === 'left') {\r\n\t\t\tnewScrollPosition = currentScrollPosition - this._getScrollItemWidth();\r\n\t\t} else {\r\n\t\t\tnewScrollPosition = currentScrollPosition + this._getScrollItemWidth();\r\n\t\t}\r\n\r\n\t\tthis.$scroller.animate({ scrollLeft: newScrollPosition }, this.animationDuration);\r\n\t}\r\n\r\n\t_registerEventHandling() {\r\n\t\tconst _scope = this.$scope;\r\n\t\tangular.element('.next-arrow, .next-arrow span', _scope.$element).each((i, ele) => {\r\n\t\t\tconst $ele = angular.element(ele);\r\n\t\t\t$ele.on('click', (evt) => {\r\n\t\t\t\t_scope.scrollRight();\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tangular.element('.previous-arrow, .previous-arrow span', _scope.$element).each((i, ele) => {\r\n\t\t\tconst $ele = angular.element(ele);\r\n\t\t\t$ele.on('click', (evt) => {\r\n\t\t\t\t_scope.scrollLeft();\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t_scope.$element.closest('.modal').on('show.bs.modal', () => {\r\n\t\t\t_scope._resetScroller();\r\n\t\t});\r\n\t}\r\n\r\n\t_getScrollItemWidth() {\r\n\t\tconst $scrollItem = angular.element(angular.element('button', this.$scroller).get(0));\r\n\t\tconst scrollItemWidth = $scrollItem.width();\r\n\r\n\t\treturn scrollItemWidth + this.offSet;\r\n\t}\r\n\r\n\t_resetScroller() {\r\n\t\tthis.attachments.forEach((attachment) => {\r\n\t\t\tattachment.isSelected = false;\r\n\t\t});\r\n\r\n\t\tif (this.attachments && this.attachments.length > 0) {\r\n\t\t\tthis.attachments[0].isSelected = true;\r\n\t\t\tthis.selectEvent({ index: 0 });\r\n\t\t}\r\n\r\n\t\tthis.$scroller.animate({ scrollLeft: 0 }, this.animationDuration);\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($window, $rootScope, $templateCache) =>\r\n\tnew DocumentsScroller($window, $rootScope, $templateCache);\r\n","export default /* @ngInject */ ($window, $templateCache, $interval) => {\r\n\tlet $win,\r\n\t\t$next,\r\n\t\t$prev,\r\n\t\t$items,\r\n\t\t$element,\r\n\t\twinWidth,\r\n\t\tscrollWidth,\r\n\t\tselectorRaw,\r\n\t\tanimDuration,\r\n\t\tstickableWidth,\r\n\t\tnCurrentPosition,\r\n\t\t$nScrollableItem,\r\n\t\tnCurrentScrollPos;\r\n\r\n\tconst template = `
\r\n
`;\r\n\r\n\tconst adjustController = (attrs) => {\r\n\t\tgetWidth();\r\n\t\tconst stickableScrollable = $(`${attrs.stickable}`);\r\n\t\tconst scrollPos = $win.scrollTop();\r\n\t\tconst stickAt = 450;\r\n\r\n\t\tlet styles;\r\n\r\n\t\tif (attrs.stickableStyles) {\r\n\t\t\tstyles = attrs.stickableStyles;\r\n\t\t} else {\r\n\t\t\tstyles = `\r\n\t\t\t\tleft: 5em;\r\n\t\t\t\ttop: 6.9em;\r\n\t\t\t\tz-index: 10;\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\tbackground-color: white;\r\n\t\t\t\twidth: ${stickableWidth ? stickableWidth + '.5px' : '82.5%'};\r\n\t\t\t`;\r\n\t\t}\r\n\r\n\t\tif (stickableWidth) {\r\n\t\t\tstyles += `\r\n width: ${stickableWidth}.5px;\r\n `;\r\n\t\t}\r\n\r\n\t\tconst $otherScrollable = angular.element(angular.element('#reserve-')[0]);\r\n\t\tif ($otherScrollable && $otherScrollable.length > 0) {\r\n\t\t\tif ($otherScrollable.css('display') !== 'none') {\r\n\t\t\t\tconst shouldHideMainScrollable = isElementNotBeingShown($otherScrollable[0]);\r\n\t\t\t\tstyles += `display: ${shouldHideMainScrollable ? 'none' : 'flex'};`;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (scrollPos >= stickAt) {\r\n\t\t\tstickableScrollable.attr('style', styles);\r\n\t\t\tstickableScrollable.addClass('is-showing');\r\n\t\t} else {\r\n\t\t\tstickableScrollable.attr('style', '');\r\n\t\t\tstickableScrollable.removeClass('is-showing');\r\n\t\t}\r\n\t};\r\n\r\n\tconst scrollDir = (dir) => {\r\n\t\tconst ntotalScrollableCols = 12;\r\n\t\tconst monthlyActualContainerWidth = $('.monthly-actual-container').width();\r\n\t\tconst nScrollAmount = $('.months-column').width();\r\n\t\tconst limitScrolls = Math.trunc(monthlyActualContainerWidth / nScrollAmount);\r\n\t\tconst $nScrollableItem = $('.scroll-me');\r\n\r\n\t\tif (dir === 'left') {\r\n\t\t\tif (nCurrentPosition > 0) {\r\n\t\t\t\tnCurrentScrollPos += nScrollAmount;\r\n\r\n\t\t\t\t$nScrollableItem.css({\r\n\t\t\t\t\ttransition: 'transform .5s',\r\n\t\t\t\t\ttransform: `translateX(${nCurrentScrollPos}px)`\r\n\t\t\t\t});\r\n\t\t\t\tnCurrentPosition -= 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (dir === 'right') {\r\n\t\t\tif (nCurrentPosition < ntotalScrollableCols - limitScrolls) {\r\n\t\t\t\tnCurrentScrollPos -= nScrollAmount;\r\n\r\n\t\t\t\t$nScrollableItem.css({\r\n\t\t\t\t\ttransition: 'transform .5s',\r\n\t\t\t\t\ttransform: `translateX(${nCurrentScrollPos}px)`\r\n\t\t\t\t});\r\n\t\t\t\tnCurrentPosition += 1;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tconst getWidth = () => {\r\n\t\tstickableWidth = $('.panel-group .months-container').width();\r\n\t};\r\n\r\n\tconst init = () => {\r\n\t\t$win = $($window);\r\n\t\tnCurrentPosition = 0;\r\n\t\tnCurrentScrollPos = 0;\r\n\t\t$next = $('[data-ctrl=next]');\r\n\t\t$prev = $('[data-ctrl=prev]');\r\n\t};\r\n\r\n\t/**\r\n\t * Checks if an element is currently being shown in view\r\n\t * @param {HtmlElement} el The element to check\r\n\t */\r\n\tconst isElementNotBeingShown = (el) => {\r\n\t\tif (!el) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tlet top = el.offsetTop;\r\n\t\tlet left = el.offsetLeft;\r\n\t\tconst width = el.offsetWidth;\r\n\t\tconst height = el.offsetHeight;\r\n\r\n\t\twhile (el.offsetParent) {\r\n\t\t\tel = el.offsetParent;\r\n\t\t\ttop += el.offsetTop;\r\n\t\t\tleft += el.offsetLeft;\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\ttop < window.pageYOffset + window.innerHeight &&\r\n\t\t\tleft < window.pageXOffset + window.innerWidth &&\r\n\t\t\ttop + height > window.pageYOffset &&\r\n\t\t\tleft + width > window.pageXOffset\r\n\t\t);\r\n\t};\r\n\r\n\treturn {\r\n\t\ttemplate,\r\n\t\tscope: {\r\n\t\t\tfixed: '=?',\r\n\t\t\tstickAt: '@',\r\n\t\t\tstickable: '@',\r\n\t\t\ttargetSelector: '@',\r\n\t\t\tstickableStyles: '@'\r\n\t\t},\r\n\t\ttransclude: true,\r\n\t\tlink: (scope, element, attrs) => {\r\n\t\t\t$element = $(element);\r\n\t\t\tinit();\r\n\r\n\t\t\tif (attrs.hasOwnProperty('stickable') && attrs.stickable) {\r\n\t\t\t\tadjustController(attrs);\r\n\r\n\t\t\t\tconst scrollEventHandler = _.throttle((evt) => {\r\n\t\t\t\t\tevt.preventDefault();\r\n\t\t\t\t\tadjustController(attrs);\r\n\t\t\t\t}, 100);\r\n\r\n\t\t\t\t$win.on('scroll', scrollEventHandler);\r\n\t\t\t}\r\n\r\n\t\t\t[ $prev, $next ].forEach(($el) => {\r\n\t\t\t\t$el.on('mousedown mouseup click', (evt) => evt.preventDefault());\r\n\r\n\t\t\t\t$el.on('click', (evt) => {\r\n\t\t\t\t\tconst dir = $(evt.currentTarget).hasClass('next') ? 'right' : 'left';\r\n\t\t\t\t\tscrollDir(dir);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\t$win.on('resize', () => {\r\n\t\t\t\twinWidth = $win.width();\r\n\t\t\t\tgetWidth();\r\n\t\t\t\tadjustController(attrs);\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n};\r\n","export default /* @ngInject */ ($window, $rootScope) => {\r\n\tlet $win,\r\n\t\t$next,\r\n\t\t$prev,\r\n\t\t$items,\r\n\t\t$element,\r\n\t\twinWidth,\r\n\t\tscrollWidth,\r\n\t\tselectorRaw,\r\n\t\tanimDuration,\r\n\t\tstickableWidth,\r\n\t\tcolumnClassName,\r\n\t\tnCurrentPosition,\r\n\t\t$nScrollableItem,\r\n\t\tnCurrentScrollPos,\r\n\t\tcontainerClassName,\r\n\t\tntotalScrollableCols;\r\n\r\n\tconst template = `\r\n\t
\r\n\t\t
\r\n\t`;\r\n\r\n\tconst adjustController = (attrs) => {\r\n\t\tgetWidth();\r\n\t\tconst stickableScrollable = $(`${attrs.stickable}`);\r\n\t\tconst scrollPos = $win.scrollTop();\r\n\t\tconst stickAt = attrs.stickAt || 103;\r\n\r\n\t\tlet styles;\r\n\r\n\t\tif (attrs.stickableStyles) {\r\n\t\t\tstyles = attrs.stickableStyles;\r\n\t\t} else {\r\n\t\t\tstyles = `\r\n top: 6.9em;\r\n left: 5em;\r\n width: ${stickableWidth ? stickableWidth + '.5px' : '92.94%'};\r\n z-index: 10;\r\n position: fixed;\r\n background-color: white;\r\n `;\r\n\t\t}\r\n\r\n\t\tif (stickableWidth) {\r\n\t\t\tstyles += `\r\n width: ${stickableWidth}.5px;\r\n `;\r\n\t\t}\r\n\r\n\t\tif (scrollPos >= stickAt) {\r\n\t\t\tstickableScrollable.attr('style', styles);\r\n\t\t} else {\r\n\t\t\tstickableScrollable.attr('style', '');\r\n\t\t}\r\n\t};\r\n\r\n\tconst scrollDir = (dir) => {\r\n\t\tconst monthlyActualContainerWidth = $(`.${containerClassName}`).width();\r\n\t\tconst nScrollAmount = $(`.${columnClassName}`).width();\r\n\t\tconst limitScrolls = Math.trunc(monthlyActualContainerWidth / nScrollAmount);\r\n\t\tconst $nScrollableItem = $('.scroll-me');\r\n\r\n\t\tif (dir === 'left') {\r\n\t\t\tif (nCurrentPosition > 0) {\r\n\t\t\t\tnCurrentScrollPos += nScrollAmount;\r\n\r\n\t\t\t\t$nScrollableItem.css({\r\n\t\t\t\t\ttransition: 'transform .5s',\r\n\t\t\t\t\ttransform: `translateX(${nCurrentScrollPos}px)`\r\n\t\t\t\t});\r\n\t\t\t\tnCurrentPosition -= 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (dir === 'right') {\r\n\t\t\tif (nCurrentPosition < ntotalScrollableCols - limitScrolls) {\r\n\t\t\t\tnCurrentScrollPos -= nScrollAmount;\r\n\r\n\t\t\t\t$nScrollableItem.css({\r\n\t\t\t\t\ttransition: 'transform .5s',\r\n\t\t\t\t\ttransform: `translateX(${nCurrentScrollPos}px)`\r\n\t\t\t\t});\r\n\t\t\t\tnCurrentPosition += 1;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tconst getWidth = () => {\r\n\t\tstickableWidth = $(`.panel-group .${columnClassName}`).width();\r\n\t};\r\n\r\n\tconst init = (numOfCells, column = 'months-container', container = 'monthly-actual-container') => {\r\n\t\t$win = $($window);\r\n\t\tnCurrentPosition = 0;\r\n\t\tnCurrentScrollPos = 0;\r\n\t\tcolumnClassName = column;\r\n\t\t$next = $('[data-ctrl=next]');\r\n\t\t$prev = $('[data-ctrl=prev]');\r\n\t\tcontainerClassName = container;\r\n\r\n\t\tif (!!numOfCells && typeof numOfCells === 'string') {\r\n\t\t\tnumOfCells = parseInt(numOfCells);\r\n\t\t} else if (!!!numOfCells || numOfCells.length === 0) {\r\n\t\t\tnumOfCells = 12;\r\n\t\t}\r\n\r\n\t\tntotalScrollableCols = numOfCells;\r\n\t};\r\n\r\n\treturn {\r\n\t\ttemplate,\r\n\t\tscope: {\r\n\t\t\tfixed: '=?',\r\n\t\t\tstickAt: '@',\r\n\t\t\tstickable: '@',\r\n\t\t\tnumOfCells: '@?',\r\n\t\t\ttargetSelector: '@',\r\n\t\t\tstickableStyles: '@',\r\n\t\t\tcolumnClassName: '@?',\r\n\t\t\tcontainerClassName: '@?'\r\n\t\t},\r\n\t\ttransclude: true,\r\n\t\tlink: (scope, element, attrs) => {\r\n\t\t\t$element = $(element);\r\n\t\t\tconst numOfCells = scope.numOfCells || null;\r\n\t\t\tconst { columnClassName, containerClassName } = scope;\r\n\r\n\t\t\tinit(numOfCells, columnClassName, containerClassName);\r\n\r\n\t\t\tif (attrs.hasOwnProperty('stickable') && attrs.stickable) {\r\n\t\t\t\tadjustController(attrs);\r\n\r\n\t\t\t\t$win.on('scroll', function(evt) {\r\n\t\t\t\t\tadjustController(attrs);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t[ $prev, $next ].forEach(($el) => {\r\n\t\t\t\t$el.on('mousedown mouseup click', (evt) => evt.preventDefault());\r\n\r\n\t\t\t\t$el.on('click', (evt) => {\r\n\t\t\t\t\tconst dir = $(evt.currentTarget).hasClass('next') ? 'right' : 'left';\r\n\t\t\t\t\tscrollDir(dir);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\t$win.on('resize', () => {\r\n\t\t\t\twinWidth = $win.width();\r\n\t\t\t\tgetWidth();\r\n\t\t\t\tadjustController(attrs);\r\n\t\t\t});\r\n\r\n\t\t\t$rootScope.$on('noOfDocumentsChanged', (evt, data) => {\r\n\t\t\t\tconst { noOfDocuments } = data;\r\n\t\t\t\tif (noOfDocuments) {\r\n\t\t\t\t\tntotalScrollableCols = noOfDocuments;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t$rootScope.$on('documents-scroller-adjust', (evt, data) => {\r\n\t\t\t\tconst { dir } = data;\r\n\t\t\t\tscrollDir(dir || 'left');\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n};\r\n","/* @ngInject */\r\n\r\nexport default function($window, $templateCache) {\r\n\tlet $next, $prev, $element, $li, $win, $menu, scrollWidth, animDuration, winWidth;\r\n\r\n\tlet template = $templateCache.get('scrollable/scrollable-menu-tmpl.html');\r\n\r\n\treturn {\r\n\t\ttemplate,\r\n\t\trestrict: 'A',\r\n\t\ttransclude: true,\r\n\t\tlink: ScrollableMenuLink\r\n\t};\r\n\r\n\tfunction init() {\r\n\t\t$win = $($window);\r\n\t\t$next = $('.next', $element);\r\n\t\t$prev = $('.prev', $element);\r\n\t\t$li = $('li:first-child', $element);\r\n\t\t$menu = $('ul:first-child', $element);\r\n\r\n\t\tanimDuration = 600;\r\n\t\twinWidth = $win.width();\r\n\t\tscrollWidth = $li.outerWidth(true) * 1.15;\r\n\r\n\t\tif (winWidth > 521) {\r\n\t\t\tshowStretched(60);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tsetHandlersPosition();\r\n\t}\r\n\r\n\tfunction ScrollableMenuLink(scope, element, attrs) {\r\n\t\t$element = $(element);\r\n\r\n\t\tinit();\r\n\r\n\t\t$win.on('resize', () => {\r\n\t\t\twinWidth = $win.width();\r\n\t\t\tif (winWidth > 521) {\r\n\t\t\t\tshowStretched();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tsetHandlersPosition();\r\n\t\t});\r\n\r\n\t\t$prev.on('click', (evt) => {\r\n\t\t\tevt.preventDefault();\r\n\t\t\tscroll(-1);\r\n\t\t});\r\n\r\n\t\t$next.on('click', (evt) => {\r\n\t\t\tevt.preventDefault();\r\n\t\t\tscroll(1);\r\n\t\t});\r\n\t}\r\n\r\n\tfunction scroll(direction, length) {\r\n\t\tlet steps,\r\n\t\t\tcurrentSteps = $menu.scrollLeft();\r\n\t\tif (length) {\r\n\t\t\tsteps = length;\r\n\t\t} else if (direction === -1) {\r\n\t\t\tif (currentSteps === 0) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tsteps = currentSteps - scrollWidth;\r\n\t\t} else {\r\n\t\t\tsteps = currentSteps + scrollWidth;\r\n\t\t}\r\n\r\n\t\t$menu.animate({ scrollLeft: steps }, animDuration);\r\n\t}\r\n\r\n\tfunction showStretched() {\r\n\t\tsetScrollableSize(60);\r\n\t\thideArrows();\r\n\t}\r\n\r\n\tfunction setHandlersPosition() {\r\n\t\tlet top = 0;\r\n\t\tshowArrow();\r\n\r\n\t\t$next.css('left', `${winWidth - 77.5}px`);\r\n\t\t$next.css('height', `${$li.outerHeight(true)}px`);\r\n\r\n\t\t$prev.css('top', `${top}em`);\r\n\t\t$prev.css('height', `${$li.outerHeight(true)}px`);\r\n\r\n\t\tsetScrollableSize();\r\n\t}\r\n\r\n\tfunction setScrollableSize(size) {\r\n\t\tlet offsetTag = $('burger-menu .hamburger');\r\n\t\tlet offset = offsetTag.length > 0 ? offsetTag.outerWidth() : 0;\r\n\t\tlet scrollableWidth = size || winWidth - offset;\r\n\r\n\t\t$menu.width(scrollableWidth);\r\n\t}\r\n\r\n\tfunction showArrow() {\r\n\t\t$next.css('display', 'inline');\r\n\t\t$prev.css('display', 'inline');\r\n\t}\r\n\tfunction hideArrows() {\r\n\t\t$next.css('display', 'none');\r\n\t\t$prev.css('display', 'none');\r\n\t}\r\n}\r\n","//@ts-check\r\n\r\nclass Scrollable {\r\n\tconstructor($window, $templateCache) {\r\n\t\tthis.scope = {\r\n\t\t\tmainTarget: '@'\r\n\t\t};\r\n\t\tthis.restrict = 'A';\r\n\t\tthis.$window = $window;\r\n\t\tthis.link = this.ScrollableLink;\r\n\t\tthis.template = this.templateString;\r\n\t\tthis.$templateCache = $templateCache;\r\n\t}\r\n\r\n\tinit() {\r\n\t\t/*\r\n\t\tthis.$items = null;\r\n\t\tthis.$element = null;\r\n\t\tthis.selectorRaw = null;\r\n\t\t*/\r\n\r\n\t\tthis.animDuration = 600;\r\n\t\tthis.winWidth = this.$win.width();\r\n\t\tthis.$win = angular.element(this.$window);\r\n\t\tthis.scrollWidth = this.$li.outerWidth(true) * 2;\r\n\t\tthis.$next = angular.element('.next', this.$element);\r\n\t\tthis.$prev = angular.element('.prev', this.$element);\r\n\t\tthis.$li = angular.element('li:first-child', this.$element);\r\n\t\tthis.$menu = angular.element('ul:first-child', this.$element);\r\n\r\n\t\tif (this.winWidth > 521) {\r\n\t\t\tthis.showStretched();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!(this.$items && this.$items.length > 0)) {\r\n\t\t\tconst $container = this.$element.closest(this.selectorRaw);\r\n\t\t\tthis.$items = angular.element('.scrollable', $container);\r\n\t\t}\r\n\t}\r\n\r\n\tget templateString() {\r\n\t\treturn `\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t`;\r\n\t}\r\n\r\n\tshowStretched() {\r\n\t\tthis.hideArrows();\r\n\t}\r\n\r\n\thideArrows() {\r\n\t\tthis.$next.css('display', 'none');\r\n\t\tthis.$prev.css('display', 'none');\r\n\t}\r\n\r\n\tshowArrow() {\r\n\t\tthis.$next.css('display', 'inline');\r\n\t\tthis.$prev.css('display', 'inline');\r\n\t}\r\n\r\n\tsetHandlersPosition() {\r\n\t\tlet top = 0;\r\n\t\tthis.showArrow();\r\n\t\tthis.$prev.css('top', `${top}em`);\r\n\t\tthis.$next.css('top', `${top}em`);\r\n\t\tthis.$next.css('left', `${this.winWidth - 77.5}px`);\r\n\t\tthis.$next.css('height', `${this.$li.outerHeight(true)} px`);\r\n\t\tthis.$prev.css('height', `${this.$li.outerHeight(true)} px`);\r\n\t}\r\n\r\n\tsetScrollableSize(size) {\r\n\t\tconst offsetTag = angular.element('burger-menu .hamburger');\r\n\t\tconst offset = offsetTag.length > 0 ? offsetTag.outerWidth() : 0;\r\n\t\tconst scrollableWidth = size || this.winWidth - offset;\r\n\r\n\t\tthis.$menu.width(scrollableWidth);\r\n\t}\r\n\r\n\tScrollableLink(scope, element, attrs) {\r\n\t\tthis.$element = angular.element(element);\r\n\t\tconst $container = this.$element.closest(this.selectorRaw);\r\n\t\tthis.$items = angular.element('.scrollable', $container);\r\n\t\tthis.selectorRaw = (attrs.mainTarget || '').toString().toLowerCase();\r\n\r\n\t\tthis.init();\r\n\r\n\t\tthis.$prev.on('click', (evt) => {\r\n\t\t\tevt.preventDefault();\r\n\t\t\tthis.scroll(-1);\r\n\t\t});\r\n\r\n\t\tthis.$next.on('click', (evt) => {\r\n\t\t\tevt.preventDefault();\r\n\t\t\tthis.scroll(1);\r\n\t\t});\r\n\r\n\t\tthis.$win.on('resize', () => {\r\n\t\t\tthis.winWidth = this.$win.width();\r\n\t\t\tif (this.winWidth > 521) {\r\n\t\t\t\tthis.showStretched();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t//setHandlersPosition();\r\n\t\t});\r\n\t}\r\n\r\n\tscroll(direction, length) {\r\n\t\tconst leftWidth = this.scrollWidth * direction;\r\n\t\tconst scrollValue = this.$element.scrollLeft() + leftWidth + (length || 0);\r\n\r\n\t\tthis.$items.animate({ scrollLeft: scrollValue }, this.animDuration);\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($window, $templateCache) => new Scrollable($window, $templateCache);\r\n","/* @ngInject */\r\n\r\nexport default function UserMenu($templateCache) {\r\n\tvar templateString = $templateCache.get('templates/user-menu-tmpl.html');\r\n\r\n\treturn {\r\n\t\tscope: {\r\n\t\t\tmenus: '@',\r\n\t\t\tfullname: '=',\r\n\t\t\tonLinkClick: '&onClick'\r\n\t\t},\r\n\t\ttemplate: templateString,\r\n\t\t//templateUrl: \"templates/user-menu-tmpl.html\",\r\n\t\tlink: userMenuLink\r\n\t};\r\n}\r\n\r\nfunction userMenuLink(scope, element, attrs) {\r\n\tvar $element = $(element);\r\n\tvar $ul = $('ul#userMenuItems', $element);\r\n\tvar menus = JSON.parse(attrs.menus);\r\n\tvar $li;\r\n\tvar $linkTag;\r\n\tvar $dropDownIcon = $($('a#title i', $element)[1]);\r\n\r\n\tangular.forEach(menus, function(menu) {\r\n\t\tvar menuItem;\r\n\t\tif (menu) {\r\n\t\t\tif (menu.trim() === '-' || menu.toLowerCase().trim() === 'divider') {\r\n\t\t\t\tmenuItem = \"

  • \";\r\n\t\t\t} else {\r\n\t\t\t\tmenuItem = \"
  • \" + menu + '
  • ';\r\n\t\t\t}\r\n\t\t\t$ul.append(menuItem);\r\n\t\t}\r\n\t});\r\n\t$ul.append('
  • Logout
  • ');\r\n\r\n\t$li = $('li', $ul);\r\n\t$linkTag = $('a', $li);\r\n\r\n\t$('a', $element).on('click', function(evt) {\r\n\t\tvar clickedTag = evt.target.tagName.toLowerCase();\r\n\t\tif (evt.target.id === 'title' || clickedTag === 'i' || clickedTag === 'label') {\r\n\t\t\tif ($ul.css('opacity').toString() === '1') {\r\n\t\t\t\thideMenu();\r\n\t\t\t} else {\r\n\t\t\t\tshowMenu();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tscope.onLinkClick({ $event: evt });\r\n\t\t\thideMenu();\r\n\t\t}\r\n\r\n\t\tscope.$broadcast('client-navigation-changed', { path: 'my-profile' });\r\n\t});\r\n\r\n\tfunction showMenu() {\r\n\t\t$ul.css('opacity', 1);\r\n\t\t$li.css('height', '36px').css('overflow', 'visible').css('padding', 0);\r\n\t\t$linkTag.css('display', 'inline-block');\r\n\r\n\t\t$dropDownIcon.removeClass('fa-chevron-down').addClass('fa-chevron-up');\r\n\t}\r\n\r\n\tfunction hideMenu() {\r\n\t\t$ul.css('opacity', 0);\r\n\t\t$li.removeAttr('style');\r\n\t\t$linkTag.css('display', 'none');\r\n\r\n\t\t$dropDownIcon.removeClass('fa-chevron-up').addClass('fa-chevron-down');\r\n\t}\r\n\r\n\tscope.$on('user-profile-updated', function($event, updatedUser) {\r\n\t\tscope.title = updatedUser.FullName;\r\n\t});\r\n}\r\n","\r\n\r\n/* @ngInject */ \r\nexport default function() {\r\n\treturn {\r\n\t\trestrict: 'A',\r\n\t\trequire: 'ngModel',\r\n\t\tlink: CompareWithLink\r\n\t};\r\n\r\n\tfunction CompareWithLink(scope, element, attrs, ctrl) {\r\n\t\tvar $element = $(element);\r\n\t\tvar otherInputName = $element.attr('compare-with');\r\n\t\tif (!otherInputName) {\r\n\t\t\tthrow 'compare-with must set the name of the field to be compared with.';\r\n\t\t}\r\n\r\n\t\tvar form = $element.closest('form');\r\n\t\tvar $form = $(form);\r\n\t\tvar otherInput = $(\"input[name='\" + otherInputName + \"']\", $form);\r\n\t\tvar $otherInput = $(otherInput);\r\n\r\n\t\tfunction customValidator(ngModelValue) {\r\n\t\t\tvar isValid = ngModelValue === $otherInput.val();\r\n\t\t\tctrl.$setValidity('compare', isValid);\r\n\t\t\treturn isValid;\r\n\t\t}\r\n\r\n\t\tctrl.$parsers.push(customValidator);\r\n\t}\r\n}\r\n","\r\n\r\n/* @ngInject */ \r\nexport default function($templateCache) {\r\n\tvar templateString = $templateCache.get('templates/validation/error-tmpl.html');\r\n\r\n\treturn {\r\n\t\trestrict: 'E',\r\n\t\tscope: {\r\n\t\t\ttype: '='\r\n\t\t},\r\n\t\ttransclude: true,\r\n\t\ttemplate: templateString,\r\n\t\tlink: ErrorLink\r\n\t};\r\n}\r\n\r\nfunction ErrorLink() {}\r\n","class MultiMaxLength {\r\n\tconstructor($timeout) {\r\n\t\tthis.$timeout = $timeout;\r\n\r\n\t\tthis.restrict = 'A';\r\n\r\n\t\tthis.scope = {\r\n\t\t\tmaxFieldLength: '='\r\n\t\t};\r\n\r\n\t\tthis.require = 'ngModel';\r\n\t\tthis.link = this.MultiMaxLengthLink;\r\n\t}\r\n\r\n\tMultiMaxLengthLink(scope, element, attrs, ctrl) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tconst { maxFieldLength } = attrs;\r\n\t\t\tconst $element = angular.element(element);\r\n\t\t\tconst otherInputsSelector = $element.attr('multi-max-length');\r\n\t\t\tif (!otherInputsSelector) {\r\n\t\t\t\tthrow 'multi-max-length must set the name of the field to be compared with.';\r\n\t\t\t}\r\n\r\n\t\t\tconst form = $element.closest('form');\r\n\t\t\tconst $form = angular.element(form);\r\n\t\t\tconst otherInputs = angular.element(`${otherInputsSelector}`, $form);\r\n\t\t\tconst $otherInputs = angular.element(otherInputs);\r\n\r\n\t\t\tconst multiMaxLengthValidator = (ngModelValue) => {\r\n\t\t\t\tlet calculatedLength = $element.val().length;\r\n\t\t\t\t$otherInputs.each((i, input) => {\r\n\t\t\t\t\tconst $input = angular.element(input);\r\n\t\t\t\t\tconst value = $input.val();\r\n\r\n\t\t\t\t\tif (value) {\r\n\t\t\t\t\t\tcalculatedLength += value.length;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tconst isValid = calculatedLength <= maxFieldLength;\r\n\t\t\t\tctrl.$setValidity('multimaxlength', isValid);\r\n\r\n\t\t\t\treturn isValid;\r\n\t\t\t};\r\n\r\n\t\t\tctrl.$parsers.push(multiMaxLengthValidator);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($timeout) => new MultiMaxLength($timeout);\r\n","class ValidationSummary {\r\n\tconstructor($timeout, $rootScope, CommonService, $templateCache) {\r\n\t\tthis.scope = {\r\n\t\t\tfor: '='\r\n\t\t};\r\n\t\tthis.restrict = 'E';\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.link = this.ValidationLink;\r\n\t\tthis.CommonService = CommonService;\r\n\t}\r\n\r\n\tValidationLink(scope, element, attrs) {\r\n\t\tconst formName = attrs.for;\r\n\t\tconst $element = angular.element(element);\r\n\t\tconst $form = angular.element(`form[name=${formName}]`);\r\n\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis._toggleValidationDisplay(scope, $element, formName);\r\n\r\n\t\t\tthis._registerEventsHandler($form, scope, $element, formName);\r\n\t\t\tthis.$rootScope.$on('clearance-selected-entity-type-changed', () => {\r\n\t\t\t\tthis._registerEventsHandler($form, scope, $element, formName);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\t_registerEventsHandler($form, scope, $element, formName) {\r\n\t\tangular.element(`input, select`, $form).each((i, input) => {\r\n\t\t\tangular.element(input).on('change input', (event) => {\r\n\t\t\t\tconst fieldName = angular.element(event.target).attr('name');\r\n\t\t\t\tconsole.log(`Checking for: ${fieldName}`);\r\n\t\t\t\tthis._toggleValidationDisplay(scope, $element, formName);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\t_toggleValidationDisplay(scope, $element, formName) {\r\n\t\tif (!scope.$parent[formName]) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet isDirty = scope.$parent[formName].$dirty;\r\n\t\tlet hasErrors = !!scope.$parent[formName].$error && Object.keys(scope.$parent[formName].$error).length > 0;\r\n\r\n\t\tthis.$timeout(() => {\r\n\t\t\tif (isDirty && hasErrors) {\r\n\t\t\t\tthis.showErrors(scope, $element, formName);\r\n\t\t\t} else {\r\n\t\t\t\t$element.empty();\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tshowErrors(scope, $element, formName) {\r\n\t\tconst form = scope.$parent[formName];\r\n\t\tconst errors = form.$error;\r\n\r\n\t\tlet html = `\r\n\t\t\t\t\r\n\t\t\t`;\r\n\r\n\t\tObject.keys(errors).forEach((key) => {\r\n\t\t\terrors[key].forEach((error) => {\r\n\t\t\t\tlet fieldLabelText;\r\n\t\t\t\tconst fieldName = error.$name;\r\n\t\t\t\tconst $form = angular.element(`form[name=${formName}]`);\r\n\t\t\t\tconst $field = angular.element(`[name=${fieldName}]`, $form);\r\n\t\t\t\tconst $parent = $field.parent().parent();\r\n\r\n\t\t\t\tlet label;\r\n\t\t\t\tconst isDatePicker = angular.element('.date-picker', $parent).length > 0;\r\n\t\t\t\tif (isDatePicker) {\r\n\t\t\t\t\tconst $label = angular.element(`label[for=${fieldName}]`, $parent.parent());\r\n\t\t\t\t\tif ($label) {\r\n\t\t\t\t\t\tlabel = $label;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlabel = angular.element(`label[for=${fieldName}]`, $parent);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst span = angular.element('span.clearance-label', $field.parent().parent());\r\n\r\n\t\t\t\tif (label && label.length > 0) {\r\n\t\t\t\t\tif (label.text() && label.text().length > 0) {\r\n\t\t\t\t\t\tfieldLabelText = this.CommonService.cleanUpStrings(label.text());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (span && span.length > 0) {\r\n\t\t\t\t\tif (span.text() && span.text().length > 0) {\r\n\t\t\t\t\t\tfieldLabelText = this.CommonService.cleanUpStrings(span.text());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!fieldLabelText) {\r\n\t\t\t\t\tconst text = $field.attr('placeholder');\r\n\t\t\t\t\tfieldLabelText = text;\r\n\t\t\t\t}\r\n\r\n\t\t\t\thtml = this._generateHtml(fieldName, form, key, html, fieldLabelText);\r\n\t\t\t});\r\n\r\n\t\t\thtml += '';\r\n\t\t});\r\n\r\n\t\t$element.html(html);\r\n\t}\r\n\r\n\t_generateHtml(fieldName, form, key, html, fieldLabelText) {\r\n\t\tif (!fieldLabelText) {\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tconst formName = form.$name;\r\n\t\tconst $form = angular.element(`form[name=${formName}]`);\r\n\t\tconst $container = angular.element(`[name=\"${fieldName}\"]`, $form).closest('[ng-if]');\r\n\t\tconst isShown = $container.css('display') !== 'none';\r\n\t\tif (form[fieldName].$error[key] && isShown) {\r\n\t\t\thtml += `\r\n\t\t\t\t`;\r\n\t\t\t} else {\r\n\t\t\t\tthrow `Validation Summary - There is no related error for field: ${fieldName} type: ${key}`;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn html;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($timeout, $rootScope, CommonService, $templateCache) =>\r\n\tnew ValidationSummary($timeout, $rootScope, CommonService, $templateCache);\r\n","import ValidateDate from './validators/date-validator';\r\n\r\nclass Validation {\r\n\tconstructor($timeout, $rootScope, $templateCache) {\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.$templateCache = $templateCache;\r\n\r\n\t\tthis.scope = {\r\n\t\t\tfor: '='\r\n\t\t};\r\n\t\tthis.restrict = 'E';\r\n\t\tthis.transclude = true;\r\n\t\tthis.link = this.ValidationLink;\r\n\t\tthis.template = this.$templateCache.get('templates/validation/validation-tmpl.html');\r\n\t}\r\n\r\n\t/**\r\n\t * The directive's Link function\r\n\t * \r\n\t * @param {ng.IScope} scope \r\n\t * @param {HTMLElement} element \r\n\t * @param {object} attrs \r\n\t * \r\n\t * @memberOf Validation\r\n\t */\r\n\tValidationLink(scope, element, attrs) {\r\n\t\tconst $element = angular.element(element);\r\n\r\n\t\tconst inputName = attrs.for;\r\n\r\n\t\tlet input = angular.element(`[name='${inputName}']`, $element.parent()).get(0);\r\n\t\tif (!input) {\r\n\t\t\tinput = angular.element(`#${inputName}`, $element.parent()).get(0);\r\n\t\t}\r\n\t\tconst $input = angular.element(input);\r\n\r\n\t\tconst form = $element.closest('form');\r\n\t\tconst $form = angular.element(form);\r\n\t\tconst formName = $form.attr('name');\r\n\r\n\t\tlet isDirty = scope.$parent[formName][inputName].$dirty;\r\n\r\n\t\tthis.$timeout(() => {\r\n\t\t\tif (isDirty && scope.$parent[formName][inputName].$invalid) {\r\n\t\t\t\tthis.showValidationErrors($element, $input, scope.$parent[formName][inputName].$error);\r\n\t\t\t} else {\r\n\t\t\t\tthis.hideValidationErrors($element, $input);\r\n\t\t\t}\r\n\r\n\t\t\t$input.on('input', () => this.processErrorHandling(scope, $element, $input, isDirty, formName, inputName));\r\n\t\t\tif ($input.attr('data-is-date-picker')) {\r\n\t\t\t\t$input.on('changeDate', () =>\r\n\t\t\t\t\tthis.processErrorHandling(scope, $element, $input, isDirty, formName, inputName)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tprocessErrorHandling(scope, $element, $input, isDirty, formName, inputName) {\r\n\t\tif (!$input.attr('multi-max-length')) {\r\n\t\t\tthis._handleNormalErrors(scope, $element, $input, isDirty, formName, inputName);\r\n\t\t} else {\r\n\t\t\tangular.element(`form[name='${formName}'] [multi-max-length]`).each((i, el) => {\r\n\t\t\t\tinputName = angular.element(el).attr('name');\r\n\t\t\t\tlet hasErrors = false;\r\n\t\t\t\tisDirty = scope.$parent[formName][inputName].$dirty;\r\n\t\t\t\tif (isDirty) {\r\n\t\t\t\t\tif (scope.$parent[formName][inputName].$invalid) {\r\n\t\t\t\t\t\thasErrors = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$input = angular.element(el);\r\n\t\t\t\t$element = angular.element(`validation[for='${inputName}']`);\r\n\t\t\t\tif (hasErrors) {\r\n\t\t\t\t\tthis.showValidationErrors($element, $input, scope.$parent[formName][inputName].$error);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.hideValidationErrors($element, $input);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_handleNormalErrors(scope, $element, $input, isDirty, formName, inputName) {\r\n\t\tlet hasErrors = false;\r\n\t\tisDirty = scope.$parent[formName][inputName].$dirty;\r\n\t\tif (isDirty) {\r\n\t\t\tif (scope.$parent[formName][inputName].$invalid) {\r\n\t\t\t\thasErrors = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($input.attr('data-is-date-picker')) {\r\n\t\t\tconst isValidDate = ValidateDate($input.val());\r\n\r\n\t\t\tif (!isValidDate) {\r\n\t\t\t\tscope.$parent[formName][inputName].$error.datepicker = true;\r\n\t\t\t} else {\r\n\t\t\t\tdelete scope.$parent[formName][inputName].$error.datepicker;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (hasErrors) {\r\n\t\t\tthis.showValidationErrors($element, $input, scope.$parent[formName][inputName].$error);\r\n\t\t} else {\r\n\t\t\tthis.hideValidationErrors($element, $input);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Method for removing input's validation errors from the screen\r\n\t * \r\n\t * @param {JQuery} $element \r\n\t * @param {JQuery} $input\r\n\t * \r\n\t * @memberOf Validation\r\n\t */\r\n\thideValidationErrors($element, $input) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\t$input.removeClass('error');\r\n\r\n\t\t\t$element.css('display', 'none');\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Method for showing input's validation errors\r\n\t * \r\n\t * @param {JQuery} $element \r\n\t * @param {JQuery} $input \r\n\t * @param {object} errors 0\r\n\t * \r\n\t * @memberOf Validation\r\n\t */\r\n\tshowValidationErrors($element, $input, errors) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\t$input.removeClass('error').addClass('error');\r\n\r\n\t\t\tObject.keys(errors).forEach((key) => {\r\n\t\t\t\tconst value = errors[key];\r\n\t\t\t\tif (value === true) {\r\n\t\t\t\t\tthis.$timeout(() => {\r\n\t\t\t\t\t\tangular.element('error', $element).each((index, error) => {\r\n\t\t\t\t\t\t\tconst $error = angular.element(error);\r\n\t\t\t\t\t\t\tif ($error.attr('type') === key) {\r\n\t\t\t\t\t\t\t\t$error.css('display', 'block');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$error.css('display', 'none');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t$element.css('display', 'block');\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($timeout, $rootScope, $templateCache) =>\r\n\tnew Validation($timeout, $rootScope, $templateCache);\r\n","const ValidateDate = (input) => {\r\n\tconst expression = /([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]))/;\r\n\tconst isMatch = expression.test(input);\r\n\treturn isMatch;\r\n};\r\n\r\nexport default ValidateDate;\r\n","export default /* @ngInject */ () => {\r\n\treturn (val) => {\r\n\t\treturn Math.abs(val);\r\n\t};\r\n};\r\n","export default /* @ngInject */ ($filter, $sce) => (input) => {\r\n\tlet formatted;\r\n\r\n\tif (input === 0) {\r\n\t\tformatted = $sce.trustAsHtml('—');\r\n\t} else {\r\n\t\tconst abs = Math.abs(input);\r\n\t\tconst float = parseFloat(abs);\r\n\t\tconst noDecimal = float.toFixed(0);\r\n\t\tconst number = $.number(noDecimal, 0, '.', ' ');\r\n\r\n\t\tif (input > 0) {\r\n\t\t\tformatted = $sce.trustAsHtml(number);\r\n\t\t} else {\r\n\t\t\tformatted = $sce.trustAsHtml(`(${number})`);\r\n\t\t}\r\n\t}\r\n\r\n\treturn formatted;\r\n};\r\n","export default /* @ngInject */ ($filter, $sce) => (input) => {\r\n\tlet formatted;\r\n\r\n\tif (input === 0) {\r\n\t\tformatted = $sce.trustAsHtml('—');\r\n\t} else {\r\n\t\tconst abs = Math.abs(input);\r\n\t\tconst float = parseFloat(abs);\r\n\t\tconst noDecimal = float.toFixed(0);\r\n\t\tconst number = $.number(noDecimal, 0, '.', ' ');\r\n\r\n\t\tif (input > 0) {\r\n\t\t\tformatted = $sce.trustAsHtml(`${number}`);\r\n\t\t} else {\r\n\t\t\tformatted = $sce.trustAsHtml(`(${number})`);\r\n\t\t}\r\n\t}\r\n\r\n\treturn formatted;\r\n};\r\n","export default /* @ngInject */ ($filter, $sce) => (input) => {\r\n\tlet formatted;\r\n\r\n\tif (input === 0) {\r\n\t\tformatted = $sce.trustAsHtml('—');\r\n\t} else {\r\n\t\tconst abs = Math.abs(input);\r\n\t\tconst float = parseFloat(abs);\r\n\t\tconst noDecimal = float.toFixed(0);\r\n\t\tconst number = $.number(noDecimal, 0, '.', ',');\r\n\r\n\t\tif (input > 0) {\r\n\t\t\tformatted = $sce.trustAsHtml(number);\r\n\t\t} else {\r\n\t\t\tformatted = $sce.trustAsHtml(`(${number})`);\r\n\t\t}\r\n\t}\r\n\r\n\treturn formatted;\r\n};\r\n","import { default as Abs } from './abs-filter';\r\nimport { default as Money } from './money-filter';\r\nimport { default as MoneyNoDecimals } from './money-no-decimals-filter';\r\nimport { default as FinancialsAmount } from './financials-amount-filter';\r\nimport { default as FinancialsAmountOpposite } from './financials-amount-opposite-filter';\r\nimport { default as FinancialsSeperatorAmount } from './financials-seperator-amount-filter';\r\n\r\nexport { Abs, Money, MoneyNoDecimals, FinancialsAmount, FinancialsAmountOpposite,FinancialsSeperatorAmount};\r\n","export default /* @ngInject */ () => {\r\n\treturn (val) => {\r\n\t\tconst abs = Math.abs(val);\r\n\t\tconst float = parseFloat(abs);\r\n\t\tconst decimal = float.toFixed(2);\r\n\t\tconst format = $.number(decimal, 2, '.', ' ');\r\n\r\n\t\treturn format;\r\n\t};\r\n};\r\n","export default /* @ngInject */ ($filter, $sce) => (val) => {\r\n\tconst abs = Math.abs(val);\r\n\tconst float = parseFloat(abs);\r\n\tconst noDecimal = float.toFixed(0);\r\n\tlet format = $.number(noDecimal, 0, '.', ' ');\r\n\r\n\tif (val < 0) {\r\n\t\tformat = $sce.trustAsHtml(`(${format})`);\r\n\t}\r\n\r\n\treturn format;\r\n};\r\n","import { default as MainCtrl } from '../controllers/main-ctrl';\r\nimport { default as AuthCtrl } from '../controllers/auth-ctrl';\r\nimport { default as ProfileCtrl\t} from '../components/accounts/profile/profile-ctrl';\r\nimport { default as MegaNavCtrl } from '../controllers/mega-nav-ctrl';\r\nimport { default as PaymentCtrl } from '../components/payments/payment-ctrl';\r\nimport { default as DashboardCtrl } from '../components/dashboard/dashboard-ctrl';\r\nimport { default as RegisterCtrl } from '../components/accounts/register/register-ctrl';\r\nimport { default as LevyRollCtrl } from '../components/financials/levy-roll/levy-roll-ctrl';\r\nimport { default as ClearanceCaptureCtrl } from '../components/clearances/clearance-capture-ctrl';\r\nimport { default as ClearanceRequestCtrl } from '../components/clearances/clearance-request/clearance-request-ctrl';\r\nimport { default as BalanceSheetCtrl } from '../components/financials/balance-sheet/balance-sheet-ctrl';\r\nimport { default as PersonalDocumentsCtrl } from '../components/personal-documents/personal-documents-ctrl';\r\nimport { default as BuildingDocumentsCtrl } from '../components/building-documents/building-documents-ctrl';\r\nimport { default as AccountsHistoryCtrl } from '../components/accounts/accounts-history/accounts-history-ctrl';\r\nimport { default as ContractorsRollCtrl } from '../components/financials/contractors-roll/contractors-roll-ctrl';\r\nimport { default as IncomeStatementCtrl } from '../components/financials/income-statement/income-statement-ctrl';\r\nimport { default as FinancialSummaryCtrl } from '../components/financials/financial-summary/financial-summary-ctrl';\r\nimport { default as PaymentAuthorisationCtrl } from '../components/payment-authorisation/payment-authorisation-ctrl';\r\nimport { default as CashflowStatementCtrl } from '../components/financials/cashflow-statement/cashflow-statement-ctrl';\r\nimport { default as CashflowStatementNewCtrl } from '../components/financials/cashflow-statement-new/cashflow-statement-new-ctrl';\r\nimport { default as IncomeVSBudgetCtrl } from '../components/financials/income-vs-budget/income-vs-budget-ctrl';\r\nimport { default as DebtorAgeAnalysisCtrl } from '../components/financials/debtor-age-analysis/debtor-age-analysis-ctrl';\r\nimport { default as TenantCtrl } from '../components/accounts/tenant/tenant-ctrl';\r\nimport { default as ComplianceCtrl } from '../components/compliance/compliance-ctrl';\r\nimport { default as UtilityinfoCtrl } from '../components/utility-info/utility-info-ctrl';\r\nimport { default as DocumentsApprovalCtrl } from '../components/approval-documents/documents-approval-ctrl';\r\nimport { default as LoginCtrl\t} from '../components/accounts/login/login-ctrl';\r\nimport { default as HistoricalLinkCtrl\t} from '../components/accounts/historical-link/historical-link-ctrl';\r\nimport { default as AuditsCaptureCtrl } from '../components/audits/audits-capture-ctrl';\r\nimport { default as AuditorsDashboardCtrl } from '../components/auditors-dashboard/auditors-dashboard-ctrl';\r\nimport { default as RentalsCaptureCtrl } from '../components/rentals/rentals-capture-ctrl';\r\nimport { default as WagesRollCtrl } from '../components/financials/wages-roll/wages-roll-ctrl';\r\nimport { default as TrusteeDashboardCtrl } from '../components/trustee-dashboard/trustee-dashboard-ctrl';\r\nimport { default as FindAContractorCtrl } from '../components/contractors/find-a-contractor-ctrl';\r\n\r\n\r\nexport default angular\r\n .module('pretor.online.controllers', [])\r\n .controller('MainCtrl', MainCtrl)\r\n .controller('AuthCtrl', AuthCtrl)\r\n .controller('TenantCtrl', TenantCtrl)\r\n .controller('ProfileCtrl', ProfileCtrl)\r\n .controller('MegaNavCtrl', MegaNavCtrl)\r\n .controller('PaymentCtrl', PaymentCtrl)\r\n .controller('LevyRollCtrl', LevyRollCtrl)\r\n .controller('RegisterCtrl', RegisterCtrl)\r\n .controller('DashboardCtrl', DashboardCtrl)\r\n .controller('ComplianceCtrl', ComplianceCtrl)\r\n .controller('BalanceSheetCtrl', BalanceSheetCtrl)\r\n .controller('IncomeStatementCtrl', IncomeStatementCtrl)\r\n .controller('IncomeVSBudgetCtrl', IncomeVSBudgetCtrl)\r\n .controller('DebtorAgeAnalysisCtrl', DebtorAgeAnalysisCtrl)\r\n .controller('AccountsHistoryCtrl', AccountsHistoryCtrl)\r\n .controller('ContractorsRollCtrl', ContractorsRollCtrl)\r\n .controller('ClearanceCaptureCtrl', ClearanceCaptureCtrl)\r\n .controller('ClearanceRequestCtrl', ClearanceRequestCtrl)\r\n .controller('FinancialSummaryCtrl', FinancialSummaryCtrl)\r\n .controller('BuildingDocumentsCtrl', BuildingDocumentsCtrl)\r\n .controller('CashflowStatementCtrl', CashflowStatementCtrl)\r\n .controller('CashflowStatementNewCtrl', CashflowStatementNewCtrl)\r\n .controller('PersonalDocumentsCtrl', PersonalDocumentsCtrl)\r\n .controller('BuildingDocumentsCtrl', BuildingDocumentsCtrl)\r\n .controller('PaymentAuthorisationCtrl', PaymentAuthorisationCtrl)\r\n .controller('UtilityinfoCtrl',UtilityinfoCtrl)\r\n .controller('DocumentsApprovalCtrl',DocumentsApprovalCtrl)\r\n .controller('LoginCtrl',LoginCtrl)\r\n .controller('HistoricalLinkCtrl',HistoricalLinkCtrl)\r\n .controller('AuditsCaptureCtrl',AuditsCaptureCtrl)\r\n .controller('AuditorsDashboardCtrl',AuditorsDashboardCtrl)\r\n .controller('RentalsCaptureCtrl',RentalsCaptureCtrl)\r\n .controller('WagesRollCtrl', WagesRollCtrl)\r\n .controller('TrusteeDashboardCtrl', TrusteeDashboardCtrl)\r\n .controller('FindAContractorCtrl', FindAContractorCtrl);","//import { default as TemplatesFunc } from '../directives/cached-templates/templates';\r\n\r\nimport { default as FixHeaderPanel } from '../directives/fix-header-panel/fix-header-panel';\r\nimport { default as BurgerMenu } from '../directives/flyout-menu/burger-menu';\r\nimport { default as MiniSideBar } from '../directives/flyout-menu/mini-side-bar';\r\nimport { default as SideBar } from '../directives/flyout-menu/side-bar';\r\n\r\nimport { default as AuthModal } from '../directives/modals/auth-modal';\r\nimport { default as AuthModalBody } from '../directives/modals/auth-modal-body';\r\nimport { default as AuthModalHeader } from '../directives/modals/auth-modal-header';\r\n\r\n//import { default as LoadingDocument } from '../directives/modals/loading-document';\r\nimport { default as PDFViewer } from '../directives/modals/pdf-viewer';\r\n\r\nimport { default as Scrollable } from '../directives/scrollable/scrollable';\r\nimport { default as ScrollableCtrl } from '../directives/scrollable/scrollable-ctrl';\r\nimport { default as ScrollableMenu } from '../directives/scrollable/scrollable-menu';\r\nimport { default as ScrollableDocuments } from '../directives/scrollable/scrollable-documents';\r\n\r\nimport { default as CompareWith } from '../directives/validation/compare-with';\r\nimport { default as Error } from '../directives/validation/error';\r\nimport { default as Validation } from '../directives/validation/validation';\r\nimport { default as MultiMaxLength } from '../directives/validation/multi-max-length';\r\nimport { default as ValidationSummary } from '../directives/validation/validation-summary';\r\n\r\nimport { default as AuthNav } from '../directives/auth-nav';\r\nimport { default as NgHtmlCompile } from '../directives/ng-html-compile';\r\nimport { default as NotificationModal } from '../directives/notification-modal';\r\nimport { default as UserMenu } from '../directives/user-menu';\r\n\r\nimport { default as DocumentsSelector } from '../directives/modals/documents-selector';\r\nimport { default as DocumentsScroller } from '../directives/scrollable/documents/documents-scroller';\r\n\r\nimport { Back, Front, FlipCard } from '../directives/flip-card';\r\n\r\nimport { BuildingsTopNav, BuildingsSideNav } from '../directives/nav-bar';\r\nimport { default as Navigation } from '../directives/nav-bar/main-site/navigation';\r\n\r\nexport default angular\r\n\t.module('pretor.online.directives', [])\r\n\t.directive('back', Back)\r\n\t.directive('error', Error)\r\n\t.directive('front', Front)\r\n\t.directive('authNav', AuthNav)\r\n\t.directive('sideBar', SideBar)\r\n\t.directive('userMenu', UserMenu)\r\n\t.directive('flipCard', FlipCard)\r\n\t.directive('pdfViewer', PDFViewer)\r\n\t.directive('authModal', AuthModal)\r\n\t.directive('scrollable', Scrollable)\r\n\t.directive('validation', Validation)\r\n\t.directive('burgerMenu', BurgerMenu)\r\n\t.directive('navigation', Navigation)\r\n\t.directive('compareWith', CompareWith)\r\n\t.directive('miniSideBar', MiniSideBar)\r\n\t.directive('authModalBody', AuthModalBody)\r\n\t.directive('ngHtmlCompile', NgHtmlCompile)\r\n\t.directive('scrollableCtrl', ScrollableCtrl)\r\n\t.directive('multiMaxLength', MultiMaxLength)\r\n\t.directive('scrollableMenu', ScrollableMenu)\r\n\t.directive('fixHeaderPanel', FixHeaderPanel)\r\n\t.directive('authModalHeader', AuthModalHeader)\r\n\t.directive('buildingsTopNav', BuildingsTopNav)\r\n\t.directive('buildingsSideNav', BuildingsSideNav)\r\n\t.directive('validationSummary', ValidationSummary)\r\n\t.directive('documentsSelector', DocumentsSelector)\r\n\t.directive('notificationModal', NotificationModal)\r\n\t.directive('documentsScroller', DocumentsScroller)\r\n\t.directive('scrollableDocuments', ScrollableDocuments);\r\n\r\nrequire('../directives/cached-templates/templates');\r\n","import { Abs, FinancialsAmountOpposite, FinancialsAmount, Money, MoneyNoDecimals, FinancialsSeperatorAmount} from '../filters';\r\n\r\nexport default angular\r\n\t.module('pretor.online.filters', [])\r\n\t.filter('Abs', Abs)\r\n\t.filter('financialsAmountOpposite', FinancialsAmountOpposite)\r\n\t.filter('financialsAmount', FinancialsAmount)\r\n\t.filter('money', Money)\r\n\t.filter('moneyNoDecimals', MoneyNoDecimals)\r\n\t.filter('financialsSeperatorAmount', FinancialsSeperatorAmount);\r\n","//#region Imports\r\n\r\nimport { default as ContentService } from '../services/common/content-service';\r\n\r\nimport ProfileService from '../components/accounts/profile/profile-service';\r\nimport { default as BuildingsService } from '../services/buildings-service';\r\nimport { default as RegisterService } from '../components/accounts/register/register-service';\r\n\r\nimport { default as BuildingDocumentsDataService } from '../components/building-documents/building-documents-service';\r\n\r\nimport { default as FinancialsService } from '../components/financials/financials-service';\r\nimport { default as LevyRollService } from '../components/financials/levy-roll/levy-roll-service';\r\nimport { default as BalanceSheetService } from '../components/financials/balance-sheet/balance-sheet-service';\r\nimport { default as ContractorsDataService } from '../components/financials/contractors-roll/contractors-roll-service';\r\nimport { default as IncomeStatementService } from '../components/financials/income-statement/income-statement-service';\r\nimport { default as IncomeVSBudgetService } from '../components/financials/income-vs-budget/income-vs-budget-service';\r\nimport { default as DebtorAgeAnalysisService } from '../components/financials/debtor-age-analysis/debtor-age-analysis-service';\r\nimport { default as ContractorsRollService } from '../components/financials/contractors-roll/contractors-roll-service';\r\nimport { default as CashflowStatementDataService } from '../components/financials/cashflow-statement/cashflow-statement-service';\r\nimport { default as CashflowStatementDataNewService } from '../components/financials/cashflow-statement-new/cashflow-statement-new-service';\r\n\r\nimport { default as ClearanceCaptureService } from '../components/clearances/clearance-capture-service';\r\nimport { default as ClearanceRequestService } from '../components/clearances/clearance-request/clearance-request-service';\r\nimport { default as PaymentApprovalsDataService } from '../components/payments/payment-approvals-service';\r\nimport { default as PersonalDocumentsDataService } from '../components/personal-documents/personal-documents-service';\r\nimport { default as AccountsHistoryDataService } from '../components/accounts/accounts-history/accounts-history-service';\r\nimport { default as FinancialSummaryService } from '../components/financials/financial-summary/financial-summary-service';\r\nimport { default as PaymentAuthorisationDataService } from '../components/payment-authorisation/payment-authorisation-service';\r\nimport { default as TenantDataService } from '../components/accounts/tenant/tenant-service';\r\n\r\nimport { default as AuthInterceptorService } from '../services/common/auth-interceptor-service';\r\nimport { default as CountriesUtilService } from '../services/common/countries/countries-util-service';\r\n\r\nimport { default as Utility } from '../services/common/utility-service';\r\nimport { default as PretorCache } from '../services/common/cache-service';\r\nimport { default as CommonService } from '../services/common/common-service';\r\nimport { default as PagingService } from '../services/common/paging-service';\r\nimport { default as NavigationService } from '../services/common/navigation-service';\r\nimport { default as NotificationService } from '../services/common/notification-service';\r\nimport { default as LocalStorageService } from '../services/common/local-storage-service';\r\nimport { default as AuthorizationService } from '../services/common/authorization-service';\r\nimport { default as InternalLinksService } from '../services/common/internal-links-service';\r\nimport { default as AuthenticationService } from '../services/common/authentication-service';\r\n\r\nimport { default as LayoutService } from '../services/common/layout-service';\r\n\r\nimport { default as UserUnitsService } from '../services/common/user-units-service';\r\n\r\nimport { default as DashboardService } from '../components/dashboard/dashboard-service';\r\nimport { default as ComplianceService } from '../components/compliance/compliance-service';\r\nimport { default as TelemetryService } from '../services/common/telemetry-service';\r\nimport { default as UtilityinfoService } from '../components/utility-info/utility-info-service';\r\nimport { default as ApprovalDocumentsDataService } from '../components/approval-documents/documents-approval-service';\r\nimport { default as AuditsCaptureService } from '../components/audits/audits-capture-service';\r\nimport { default as AuditorsDashboardService } from '../components/auditors-dashboard/auditors-dashboard-service';\r\nimport { default as RentalsCaptureService } from '../components/rentals/rentals-capture-service';\r\nimport { default as WagesRollService } from '../components/financials/wages-roll/wages-roll-service';\r\nimport { default as TrusteeDashboardService } from '../components/trustee-dashboard/trustee-dashboard-service';\r\nimport { default as FindAContractorService } from '../components/contractors/find-a-contractor-service';\r\n\r\n\r\n//#endregion\r\n\r\nexport default angular\r\n\t.module('pretor.online.factories', [])\r\n\t.factory('Utility', Utility)\r\n\t.factory('PretorCache', PretorCache)\r\n\t.factory('CommonService', CommonService)\r\n\t.factory('LayoutService', LayoutService)\r\n\t.factory('PagingService', PagingService)\r\n\t.factory('ContentService', ContentService)\r\n\t.factory('ProfileService', ProfileService)\r\n\t.factory('RegisterService', RegisterService)\r\n\t.factory('BuildingsService', BuildingsService)\r\n\t.factory('UserUnitsService', UserUnitsService)\r\n\t.factory('DashboardService', DashboardService)\r\n\t.factory('TelemetryService', TelemetryService)\r\n\t.factory('TenantDataService', TenantDataService)\r\n\t.factory('FinancialsService', FinancialsService)\r\n\t.factory('NavigationService', NavigationService)\r\n\t.factory('ComplianceService', ComplianceService)\r\n\t.factory('LevyRollService', LevyRollService)\r\n\t.factory('LocalStorageService', LocalStorageService)\r\n\t.factory('NotificationService', NotificationService)\r\n\t.factory('BalanceSheetService', BalanceSheetService)\r\n\t.factory('InternalLinksService', InternalLinksService)\r\n\t.factory('CountriesUtilService', CountriesUtilService)\r\n\t.factory('AuthorizationService', AuthorizationService)\r\n\t.factory('AuthenticationService', AuthenticationService)\r\n\t.factory('ContractorsRollService', ContractorsRollService)\r\n\t.factory('ContractorsDataService', ContractorsDataService)\r\n\t.factory('AuthInterceptorService', AuthInterceptorService)\r\n\t.factory('IncomeStatementService', IncomeStatementService)\r\n\t.factory('IncomeVSBudgetService', IncomeVSBudgetService)\r\n\t.factory('DebtorAgeAnalysisService', DebtorAgeAnalysisService)\r\n\t.factory('ClearanceCaptureService', ClearanceCaptureService)\r\n\t.factory('ClearanceRequestService', ClearanceRequestService)\r\n\t.factory('FinancialSummaryService', FinancialSummaryService)\r\n\t.factory('AccountsHistoryDataService', AccountsHistoryDataService)\r\n\t.factory('paymentApprovalsDataService', PaymentApprovalsDataService)\r\n\t.factory('CashflowStatementDataService', CashflowStatementDataService)\r\n\t.factory('CashflowStatementDataNewService', CashflowStatementDataNewService)\r\n\t.factory('personalDocumentsDataService', PersonalDocumentsDataService)\r\n\t.factory('buildingDocumentsDataService', BuildingDocumentsDataService)\r\n\t.factory('paymentAuthorisationDataService', PaymentAuthorisationDataService)\r\n\t.factory('UtilityinfoService',UtilityinfoService)\r\n\t.factory('ApprovalDocumentsDataService',ApprovalDocumentsDataService)\r\n\t.factory('AuditsCaptureService', AuditsCaptureService)\r\n\t.factory('AuditorsDashboardService', AuditorsDashboardService)\r\n .factory('RentalsCaptureService', RentalsCaptureService)\r\n\t.factory('WagesRollService', WagesRollService)\r\n\t.factory('TrusteeDashboardService', TrusteeDashboardService)\r\n\t.factory('FindAContractorService', FindAContractorService);\r\n","require('../../../node_modules/angular-ui-router');\r\nimport uiRouterModule, * as uiRouter from '../../../node_modules/angular-ui-router';\r\n\r\nimport { default as RoutesRouterConfig } from '../routes';\r\n\r\nexport default angular\r\n\t.module('pretor.online.views', [ uiRouterModule ])\r\n\t.config([ '$stateProvider', '$urlRouterProvider', RoutesRouterConfig ]);\r\n\r\nrequire('../pages/cached-pages/pages');\r\n","/* jshint ignore:start */\nexport default angular.module('pretor.online.views').run(['$templateCache', function($templateCache) {$templateCache.put('approval-documents/documents-approval.html','
    \\r\\n \\r\\n \\r\\n \\r\\n View Documents Approval\\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n
    \\r\\n
    0\">\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Approved\\r\\n
    \\r\\n \\r\\n Queried\\r\\n
    \\r\\n \\r\\n Rejected \\r\\n
    \\r\\n \\r\\n Not Actioned / Waiting\\r\\n
    \\r\\n
    \\r\\n Approvals :\\r\\n
    \\r\\n {{approver.ApproverName}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n
    \\r\\n

    \\r\\n By approving this document online, I confirm that I have given my signed acceptance of this \\r\\n resolution or document\\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n This document preview is currently unavailable for your\\r\\n device, please Download and view the Document.\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n QUERY\\r\\n THIS DOCUMENT\\r\\n 0\">QUERIES\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Comment is required\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    0\">\\r\\n
    \\r\\n {{documentApprovalComments.FriendlyName}} queried on\\r\\n {{documentApprovalComments.DateSubmitted | date : \"dd MMM yyyy HH:mm a\"}}\\r\\n {{documentApprovalComments.Message}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n No Documents To Approve\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n');\n$templateCache.put('audits/audits-capture.html','
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Audits Details\\r\\n \\r\\n\\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n GENERAL DETAILS\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Scheme Reference:\\r\\n
    \\r\\n
    \\r\\n {{auditsCaptureVm.AuditsCaptureService.auditsHeaderDetails.DB_Ref}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Scheme Name:\\r\\n
    \\r\\n
    \\r\\n {{auditsCaptureVm.AuditsCaptureService.auditsHeaderDetails.SchemeName}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Manager Name:\\r\\n
    \\r\\n
    \\r\\n {{auditsCaptureVm.AuditsCaptureService.auditsHeaderDetails.Manager}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Bookkeeper Name:\\r\\n
    \\r\\n
    \\r\\n {{auditsCaptureVm.AuditsCaptureService.auditsHeaderDetails.Bookkeeper}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Financial Period:\\r\\n
    \\r\\n
    \\r\\n {{auditsCaptureVm.AuditsCaptureService.auditsHeaderDetails.FinancialYearDisplay}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Upload Draft Audit\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Draft Audits\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n AUDITOR DETAILS\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Auditor Name:\\r\\n
    \\r\\n
    \\r\\n {{ auditsCaptureVm.AuditsCaptureService.auditorHeaderDetails.Auditor}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Contact Number:\\r\\n
    \\r\\n
    \\r\\n {{ auditsCaptureVm.AuditsCaptureService.auditorContactDetails.PrimaryContactNumber}}\\r\\n
    \\r\\n {{ auditsCaptureVm.AuditsCaptureService.auditorContactDetails.SecondaryContactNumber}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Email Address:\\r\\n\\r\\n
    \\r\\n
    \\r\\n {{ auditsCaptureVm.AuditsCaptureService.auditorContactDetails.PrimaryEmail}}\\r\\n
    \\r\\n {{ auditsCaptureVm.AuditsCaptureService.auditorContactDetails.SecondaryEmail}}\\r\\n
    \\r\\n {{ auditsCaptureVm.AuditsCaptureService.auditorContactDetails.AdditionalEmail}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n QUERIES\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Query NumberWho QueriedDate QueriedQuery SubjectQuery Assigned ToStatusDays - OutstandingView/Edit QueryRe-Assign/Close QueryUpload DocAttachments
    {{query.QueryNumber}}{{query.WhoLogged}}{{query.DateLoged}}{{query.MessageText}}{{query.Assignee}}{{query.Status}}{{query.outstandingDays}}
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n QUERY {{ auditsCaptureVm.queryNumberForQueryMessage}} MESSAGES\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{messages.WhoSent}} wrote on\\r\\n {{messages.theDate}} at\\r\\n {{messages.theTime}}:\\r\\n
    \\r\\n {{messages.MessageText}}\\r\\n\\r\\n
    \\r\\n \\r\\n The last upload was made by\\r\\n {{messages.WhoSent}} named\\r\\n {{messages.OriginalFileName}} on\\r\\n {{messages.QueryDate}} at\\r\\n {{messages.QueryTime}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ×\\r\\n

    Add Query

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Query Subject:\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Query Message:\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Assign Query to:\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Please choose an assignee:\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Upload Attachment?\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Add\\r\\n \\r\\n Cancel\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ×\\r\\n

    Edit Query

    \\r\\n
    \\r\\n
    \\r\\n

    Choose an action:

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Please choose an assignee:\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ×\\r\\n

    Upload confirmation

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Document Has been successfully uploaded\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Ok\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ×\\r\\n

    Upload confirmation

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n An Error Occured, Document Has been not been uploaded.\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Ok\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ×\\r\\n

    Closed Query

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Sorry, This query is closed.\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Ok\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ×\\r\\n

    Upload Query {{ auditsCaptureVm.queryNum}} Documents

    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Upload Supporting documents\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n or\\r\\n
    \\r\\n Drag + Drop\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ×\\r\\n

    View Uploaded Documents

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    File nameFile typeQuery NumberWho UploadedDate UploadedView Doc
    {{doc.OriginalFileName}}{{doc.FileType}}{{doc.QueryNumber}}{{doc.WhoUploaded}}{{doc.WhenUploaded}}
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Ok\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Close\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ×\\r\\n

    \\r\\n View Uploaded Query\\r\\n {{auditsCaptureVm.queryNumberForPerQueryDoc}} Documents\\r\\n

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    File nameFile typeQuery NumberWho UploadedDate UploadedView Doc
    {{doc.OriginalFileName}}{{doc.FileType}}{{doc.QueryNumber}}{{doc.WhoUploaded}}{{doc.WhenUploaded}}
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Ok\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n$templateCache.put('auditors-dashboard/auditors-dashboard.html','
    \\r\\n
    \\r\\n
    \\r\\n

    \\r\\n Auditor Dashboard\\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Auditor: {{auditorsDashboardVm.auditorName}} \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    ');\n$templateCache.put('building-documents/building-documents.html','
    \\r\\n
    \\r\\n Building Documents\\r\\n
    \\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n {{breadCrumb.Title}}\\r\\n  {{$last ? \\'\\' : \\'/\\'}}\\r\\n \\r\\n
    \\r\\n
    0\">\\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    Almost there...
    \\r\\n
    \\r\\n
    \\r\\n');\n$templateCache.put('compliance/compliance.html','
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    \\r\\n \\r\\n Compliance\\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    ');\n$templateCache.put('clearances/clearance-capture.html','
    \\r\\n \\r\\n Application for Clearance\\r\\n for\\r\\n unit {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.UnitNumber}}\\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.SchemeName}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Property Information\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Unit / Door Number\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.UnitNumber}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Building Name\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.SchemeName}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.IsHoa? \\'Company Reg Number\\' : \\'Sectional Title Number\\'}}\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.SchemeNumber}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Attorney Information\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Name\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.Attorney.Name}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Contact Person\\'s Email\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.Attorney.EmailAddress}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Contact Person\\'s Number\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.Attorney.ContractNumber}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Attorney File Reference\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.clearanceHeader.AttorneyRef}}\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Seller\\'s Information\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Name(s) of current registered owner(s)\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.SellerName}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ID Number(s)\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.SellerId}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Contact Number(s)\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.SellerContactNumber}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Email Address(es)\\r\\n
    \\r\\n
    \\r\\n {{clearanceCaptureVm.ClearanceCaptureService.clearanceCapture.SellerEmail}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Important Building Information\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    TypeContact PersonPhone No.EmailAdditional Info
    {{utility.UtilityType}}{{utility.ContactPerson}}{{utility.ContactNumber}}{{utility.EmailAddress}}{{utility.AdditionalInformation}}
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    TitleFull NamePhone No.Email
    Building Chairman{{clearanceCaptureVm.ClearanceCaptureService.schemeInformation.schemeChairmanName}}\\r\\n N/A
    Building Caretaker {{clearanceCaptureVm.ClearanceCaptureService.schemeInformation.schemeCaretakerName}}\\r\\n {{clearanceCaptureVm.ClearanceCaptureService.schemeInformation.schemeCaretakerContactNumber}}\\r\\n {{clearanceCaptureVm.ClearanceCaptureService.schemeInformation.schemeCaretakerEmail}}\\r\\n
    Portfolio Manager{{clearanceCaptureVm.ClearanceCaptureService.schemeInformation.schemePortfolioManager}}\\r\\n {{clearanceCaptureVm.ClearanceCaptureService.schemeInformation.schemeManagerEmail}}\\r\\n
    Portfolio Assistance {{clearanceCaptureVm.ClearanceCaptureService.schemeInformation.schemePortfolioAssistant}}\\r\\n {{clearanceCaptureVm.ClearanceCaptureService.schemeInformation.schemePortfolioAssistantEmail}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Clearance Information\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n Must be characters up to 200.\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n Must be characters up to 60.\\r\\n \\r\\n \\r\\n \\r\\n Required.\\r\\n Must be characters up to 60.\\r\\n \\r\\n \\r\\n \\r\\n Required.\\r\\n Must be characters up to 60.\\r\\n \\r\\n \\r\\n \\r\\n Required.\\r\\n Must be characters up to 40.\\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    * Valid until date can only be selected 3 months or more from the current date.
    \\r\\n\\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n Must be min 6 digits.\\r\\n Must be max 11 digits.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n Must be min 4 digits.\\r\\n Must be max 6 digits.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    * The details above is the bank account into which any levy credit due to the seller in respect of the sale will be paid.
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    0 && !clearanceCaptureVm.ClearanceCaptureService.isSubmitted\">\\r\\n
    \\r\\n
    \\r\\n The following Document(s) must be uploaded:\\r\\n
    \\r\\n
      \\r\\n \\r\\n {{docType}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Proof of Payment (Admin. Fees)\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n Acknowledgment Of Rules\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n Company Reg. Doc\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n Seller Banking Confirmation\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Hoa Membership Form\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{attachment.FileName}}\\r\\n ({{attachment.DocumentTypeDescription}})\\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{attachment.FileName}}\\r\\n ({{attachment.DocumentTypeDescription}})\\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
    0) && !clearanceCaptureVm.isPurchaserBusy\">\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Document NameRejected ByRejection Reason
    \\r\\n
    \\r\\n \\r\\n {{attachment.FileName}}\\r\\n ({{attachment.DocumentTypeDescription}})\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{attachment.WhoActioned}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{attachment.RejectionReason}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{attachment.FileName}}\\r\\n ({{attachment.DocumentTypeDescription}})\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{attachment.WhoActioned}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{attachment.RejectionReason}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Confirmation of registration and apportionment\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Upload Registration Document\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{attachment.FileName}}\\r\\n ({{attachment.DocumentTypeDescription}})\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Registration Document Submitted.\\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
    0) && !clearanceCaptureVm.isPurchaserBusy\">\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Document NameRejected ByRejection Reason
    \\r\\n
    \\r\\n \\r\\n {{attachment.FileName}}\\r\\n ({{attachment.DocumentTypeDescription}})\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{attachment.WhoActioned}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{attachment.RejectionReason}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Purchaser\\'s Information\\r\\n {{p.FirstName}}\\r\\n {{p.LastName}}\\r\\n New\\r\\n Purchaser\\r\\n
    \\r\\n
    \\r\\n \\r\\n {{clearanceCaptureVm.displayLabelForPurchaser}} Information\\r\\n \\r\\n {{p.FirstName}}\\r\\n {{p.LastName}}\\r\\n New\\r\\n {{clearanceCaptureVm.displayLabelForPurchaser}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n Must not exceed 24 characters. Please split\\r\\n the it between the First and Last Names\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Must be 10 digits.\\r\\n Must be 10 digits.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n Must be 10 digits.\\r\\n Must be 10 digits.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Must be 10 digits.\\r\\n Must be 10 digits.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n Invalid email\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n *\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Required.\\r\\n Must be at least 5 characters\\r\\n Must not exceed 50 characters\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n * Required Field\\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n
    0 && !clearanceCaptureVm.ClearanceCaptureService.isSubmitted\">\\r\\n
    \\r\\n
    \\r\\n The following Document(s) must be uploaded:\\r\\n
    \\r\\n
      \\r\\n
    • \\r\\n {{docType}}\\r\\n
    • \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n ID Document\\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Proof Of Residence\\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{attachment.FileName}}\\r\\n ({{attachment.DocumentTypeDescription}})\\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{attachment.FileName}}\\r\\n ({{attachment.DocumentTypeDescription}})\\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n
    0)\">\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Document NameRejected ByRejection Reason
    \\r\\n
    \\r\\n \\r\\n {{attachment.FileName}}\\r\\n ({{attachment.DocumentTypeDescription}})\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{attachment.WhoActioned}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{attachment.RejectionReason}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n +\\r\\n Add Purchaser\\r\\n
    \\r\\n
    \\r\\n \\r\\n + Add {{clearanceCaptureVm.displayLabelForPurchaser}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    0\">\\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n
    0)\">\\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    0) || (!!clearanceCaptureVm.documentsErrors && clearanceCaptureVm.documentsErrors.first.length > 0)\">\\r\\n \\r\\n \\r\\n
    \\r\\n
    0\">\\r\\n \\r\\n
    \\r\\n\\r\\n\\r\\n
    0) || (!!clearanceCaptureVm.documentsErrors && clearanceCaptureVm.documentsErrors.second.length > 0)\">\\r\\n \\r\\n \\r\\n
    \\r\\n
    0\">\\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Thank you for submitting the clearance application.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Delete Purchaser\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Are you sure you want to remove {{clearanceCaptureVm.purchaser.FirstName}}\\r\\n {{clearanceCaptureVm.purchaser.LastName}} as a\\r\\n purchaser?\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Delete Attachment\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Are you sure you want to remove this attachment?\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n');\n$templateCache.put('dashboard/dashboard.html','
    \\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Select which estate you would like to manage on your portfolio.\\r\\n
    \\r\\n
    0)\">\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Residential :\\r\\n
    \\r\\n
    \\r\\n House\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Stand Number :\\r\\n
    \\r\\n
    \\r\\n {{unit.UnitNumber}}\\r\\n
    \\r\\n
    \\r\\n Tenant :\\r\\n
    \\r\\n
    \\r\\n {{unit.Tenant}}\\r\\n
    \\r\\n
    \\r\\n Account status :\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ERF size :\\r\\n
    \\r\\n
    \\r\\n {{unit.UnitSize}}\\r\\n
    \\r\\n
    \\r\\n Registered Name :\\r\\n
    \\r\\n
    \\r\\n \\r\\n {{unit.RegisteredFullName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{DashboardVM.unitBalance(unit)}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n There is no unit information to show.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('payment-authorisation/payment-authorisation.html','
    \\r\\n\\r\\n
    \\r\\n Payment Bands and Contractual Payments Authorisation\\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n
    0 || paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio.length > 0)\">\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n Payment Authorisations\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    0\">\\r\\n \\r\\n
    1) || (paymentAuthorisationVm.paymentBandData.bandsData && paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio[0].IsNoBand)\">\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{portfolio.PortfolioName}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Approved By:\\r\\n Pretor portfolio manager\\r\\n
    \\r\\n
    \\r\\n REQUIRED APPROVERS:\\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'and\\'}}\\r\\n
    \\r\\n
    \\r\\n DISCRETIONARY APPROVERS \\r\\n 1\">\\r\\n (Any {{portfolio.NoPortfolioBand.NumberOfDiscretionaryApprovers}})\\r\\n :\\r\\n \\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'or\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    1 || (paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio.length == 1 && portfolio.HasAccounts) ? \\'upperAccordionToggle\\' : \\'\\' \">\\r\\n 1\\r\\n && (portfolio.HasAccounts || (!portfolio.IsNoBand\\r\\n && !portfolio.IsContractualPayments)))\\r\\n || (paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio.length == 1\\r\\n && portfolio.HasAccounts)\" ng-if=\"!paymentAuthorisationVm.shouldShowMandatory(portfolio.NoPortfolioBand.WebApproverBand) && !paymentAuthorisationVm.shouldShowDiscretionary(portfolio.NoPortfolioBand.WebApproverBand)\">\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Approved By:\\r\\n Pretor portfolio manager\\r\\n
    \\r\\n
    \\r\\n REQUIRED APPROVERS:\\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'and\\'}}\\r\\n
    \\r\\n
    \\r\\n DISCRETIONARY APPROVERS \\r\\n 1\">\\r\\n (Any {{portfolio.NoPortfolioBand.NumberOfDiscretionaryApprovers}})\\r\\n :\\r\\n \\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'or\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n R0 - R{{portfolio.LessAmount - 1}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n REQUIRED APPROVERS:\\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'and\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n DISCRETIONARY APPROVERS:\\r\\n \\r\\n (Any {{portfolio.LessThanPortfolioBand.NumberOfDiscretionaryApprovers}}):\\r\\n \\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'or\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n R{{portfolio.LessAmount}} - R{{portfolio.MoreAmount - 1}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n REQUIRED APPROVERS:\\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'and\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n DISCRETIONARY APPROVERS:\\r\\n \\r\\n (Any {{portfolio.BetweenPortfolioBand.NumberOfDiscretionaryApprovers}}):\\r\\n \\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'or\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n R{{portfolio.MoreAmount}} +\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n REQUIRED APPROVERS:\\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'and\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n DISCRETIONARY APPROVERS:\\r\\n \\r\\n (Any {{portfolio.MoreThanPortfolioBand.NumberOfDiscretionaryApprovers}}):\\r\\n \\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'or\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
      \\r\\n
    • \\r\\n {{account.AccountName}} ({{account.AccountCode}})\\r\\n
    • \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n R0 - R{{ paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio[0].LessAmount - 1 }}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n REQUIRED APPROVERS:\\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'and\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n DISCRETIONARY APPROVERS\\r\\n 1\">(Any {{paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio[0].LessThanPortfolioBand.NumberOfDiscretionaryApprovers}}):\\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'or\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n R{{paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio[0].LessAmount}} - R{{paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio[0].MoreAmount- 1}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n REQUIRED APPROVERS:\\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'and\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n DISCRETIONARY APPROVERS\\r\\n 1\">(Any {{paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio[0].BetweenPortfolioBand.NumberOfDiscretionaryApprovers}}):\\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'or\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n R{{paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio[0].MoreAmount}} +\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n REQUIRED APPROVERS:\\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'and\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n DISCRETIONARY APPROVERS\\r\\n 1\">(Any {{paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio[0].MoreThanPortfolioBand.NumberOfDiscretionaryApprovers}}):\\r\\n \\r\\n {{approverBand.FriendlyName}} {{$last ? \\'\\' : \\'or\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    0 || paymentAuthorisationVm.paymentBandData.bandsData.WebPortfolio.length > 0)\">\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n Monthly contractual payments\\r\\n
    \\r\\n
    0\">\\r\\n 0) || paymentAuthorisationVm.isBulkApproving\">\\r\\n {{paymentAuthorisationVm.bulkApproveLabel}}\\r\\n 0\">BULK APPROVING({{paymentAuthorisationVm.selectedContractualPayments.length}})...\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n 0\"\\r\\n ng-disabled=\"(!paymentAuthorisationVm.selectedContractualPayments.length > 0) || paymentAuthorisationVm.isBulkApproving\">\\r\\n {{paymentAuthorisationVm.bulkApproveLabel}}\\r\\n 0\">BULK APPROVING({{paymentAuthorisationVm.selectedContractualPayments.length}})...\\r\\n \\r\\n
    \\r\\n
    0\"\\r\\n ng-class=\"contractual.checked == true && contractual.Status < 3 ? \\'paymentApprovalLorderBlue\\' : \\'paymentApprovalLorderDefault\\'\">\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n QUERY THIS CONTRACT\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n QUERY THIS CONTRACT\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Comment is required\\r\\n \\r\\n \\r\\n
    \\r\\n
    0\">\\r\\n
    \\r\\n {{paymentApprovalLomments.WhoComment}} queried on\\r\\n {{paymentApprovalLomments.WhenCommented | date : \"dd MMM yyyy HH:mm a\"}}\\r\\n {{paymentApprovalLomments.Comment}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Payment Authorisation Query\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n {{paymentBandComments.WhoComment}} queried on\\r\\n {{paymentBandComments.WhenCommented | date : \"dd MMM yyyy HH:mm\"}}\\r\\n {{paymentBandComments.Comment}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    ');\n$templateCache.put('payments/payments.html','
    \\r\\n Payment Approvals\\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    0\"\\r\\n data-ng-class=\"checkedValue == true && paymentApproval.HasApproved == false ? \\'paymentApprovalBorderBlue\\' : \\'paymentApprovalBorderDefault\\'\">\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n QUERYING...\\r\\n QUERY\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n APPROVING...\\r\\n UN-APPROVING...\\r\\n APPROVE\\r\\n CANCEL\\r\\n APPROVAL\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Expense allocated to:\\r\\n
    \\r\\n {{paymentAllocations.AccountName}}\\r\\n ({{paymentAllocations.AccountNumber}})\\r\\n - \\r\\n R\\r\\n {{paymentAllocations.Amount | number : 2}} \\r\\n \\r\\n Remaining Annual Budget : R {{paymentAllocations.GLAccountBalanceAmount | number : 2}}  \\r\\n \\r\\n Remaining Annual Budget : NO BUDGET LOADED  \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Payment will only occur\\r\\n on:\\r\\n {{paymentApproval.FuturePaymentDate\\r\\n | date : \"dd MMM yyyy\"}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Approved\\r\\n
    \\r\\n \\r\\n Queried\\r\\n
    \\r\\n \\r\\n Not Actioned\\r\\n
    \\r\\n\\r\\n 0\">\\r\\n Required Approvers:\\r\\n
    \\r\\n {{paymentApprovers.ApproverFriendlyName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n {{paymentApprovers.ApproverFriendlyName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n {{paymentApprovers.ApproverFriendlyName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n 0\">\\r\\n Discretionary Approvers (Any\\r\\n {{paymentApproval.NumberOfDiscretionaryApprovers}}):\\r\\n
    \\r\\n {{paymentApprovers.ApproverFriendlyName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n {{paymentApprovers.ApproverFriendlyName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n {{paymentApprovers.ApproverFriendlyName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    0 || paymentApproval.Notes\">\\r\\n
    0\"\\r\\n ng-class=\"paymentApproval.Notes ? \\'col-md-6\\' : \\'col-md-12\\'\">\\r\\n
    \\r\\n {{paymentApprovalComments.WhoComment}}\\r\\n queried on\\r\\n {{paymentApprovalComments.WhenCommented\\r\\n | date : \"dd MMM yyyy HH:mm a\"}}\\r\\n {{paymentApprovalComments.Comment}}\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    0 ? \\'col-md-6\\' : \\'col-md-12\\'\">\\r\\n
    \\r\\n Notes\\r\\n {{paymentApproval.Notes}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Approvals:\\r\\n
    \\r\\n {{paymentApprovers.ApproverFriendlyName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Expense allocated to:\\r\\n
    \\r\\n {{paymentAllocations.AccountName}}\\r\\n ({{paymentAllocations.AccountNumber}})\\r\\n - \\r\\n R\\r\\n {{paymentAllocations.Amount | number : 2}} \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Payment will only occur on:\\r\\n \\r\\n \\r\\n {{paymentApprovalApproved.FuturePaymentDate | date : \"dd MMM yyyy\"}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n Notes*\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Displaying {{paymentApprovalVm.approvedPaymentsPaging.firstItemIndex}} to\\r\\n {{paymentApprovalVm.approvedPaymentsPaging.lastItemIndex}}\\r\\n of {{paymentApprovalVm.approvedPaymentsPaging.numberOfResults}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
      \\r\\n
    • \\r\\n \\r\\n
    • \\r\\n
    • \\r\\n \\r\\n
    • \\r\\n
    • \\r\\n \\r\\n Displaying {{paymentApprovalVm.approvedPaymentsPaging.firstItemIndex}}\\r\\n to {{paymentApprovalVm.approvedPaymentsPaging.lastItemIndex}}\\r\\n of {{paymentApprovalVm.approvedPaymentsPaging.numberOfResults}}\\r\\n \\r\\n
    • \\r\\n
    • \\r\\n \\r\\n
    • \\r\\n
    • \\r\\n \\r\\n
    • \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Warning: There appears to be an invoice with the same invoice number\\r\\n already loaded for the\\r\\n selected service provider. You will not be able to load this invoice.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n There was a problem checking for duplicate invoices. You will not be\\r\\n able to submit this payment.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Checking Invoice Number...\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    VAT Rate % :
    \\r\\n
    \\r\\n {{ paymentApprovalVm.addEditPayment.VatRatePercentage }}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    *\\r\\n Payment will be\\r\\n submitted for processing on the closest business day to your date\\r\\n selection.
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Allocation:\\r\\n
    \\r\\n
    \\r\\n  \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n  \\r\\n
    \\r\\n
    \\r\\n GL Account\\r\\n
    \\r\\n
    \\r\\n Amount\\r\\n
    \\r\\n
    \\r\\n  \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n  \\r\\n
    \\r\\n
    \\r\\n {{ allocationRow.accountName + \\' (\\' +\\r\\n allocationRow.accountCode + \\')\\' }}\\r\\n
    \\r\\n
    \\r\\n {{ allocationRow.amount | number : 2 }}\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n  \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n  \\r\\n
    \\r\\n
    \\r\\n Total\\r\\n
    \\r\\n
    \\r\\n \\r\\n {{ paymentApprovalVm.totalAllocationAmount()\\r\\n | number : 2 }}\\r\\n
    \\r\\n
    \\r\\n  \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Add Invoice\\r\\n \\r\\n \\r\\n \\r\\n or\\r\\n
    \\r\\n Drag + Drop\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{paymentApprovalVm.addEditPayment.Invoice.FileName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Add Supporting Documents\\r\\n \\r\\n \\r\\n \\r\\n or\\r\\n
    \\r\\n Drag + Drop\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    0\">\\r\\n
    \\r\\n \\r\\n {{attachment.FileName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    0\">\\r\\n
    \\r\\n
    \\r\\n The following errors are preventing completion:\\r\\n
    \\r\\n
      \\r\\n
    • \\r\\n {{requiredfield}}\\r\\n
    • \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    0 || (paymentApprovalVm.webPaymentApprovalIndividual.Notes && paymentApprovalVm.webPaymentApprovalIndividual.Notes != null)) ? \\'col-md-8\\' : \\'col-md-12\\'\">\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n This document preview is currently unavailable for your\\r\\n device, please Download and view the Document.\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n NOTES\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{paymentApprovalVm.webPaymentApprovalIndividual.Notes}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n QUERY\\r\\n THIS INVOICE\\r\\n 0\">QUERIES\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Comment is required\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    0\">\\r\\n
    \\r\\n {{paymentApprovalComments.WhoComment}} queried on\\r\\n {{paymentApprovalComments.WhenCommented | date : \"dd MMM yyyy\\r\\n HH:mm a\"}}\\r\\n {{paymentApprovalComments.Comment}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{serviceProvider.ServiceProviderName}}\\r\\n -\\r\\n {{serviceProvider.ServiceProviderSector}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n There is no service provider for the last 6 digits of account number,\\r\\n ensure that the correct account number entered or Kindly contact Pretor.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Please Confirm Your Payment\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Delete Attachment\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Are you sure you want to remove this attachment?\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('contractors/find-a-contractor.html','');\n$templateCache.put('personal-documents/personal-documents.html','');\n$templateCache.put('rentals/rentals-capture.html','
    \\r\\n
    \\r\\n
    \\r\\n \"Loading...\"\\r\\n
    \\r\\n
    \\r\\n \\r\\n Application for Rental Property\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n I/We\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n hereby apply to rent residential property (\"the Premises\") from the Land Owner.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n The address of the Premises is:\\r\\n
    \\r\\n
    \\r\\n {{rentalsCaptureVm.rentalsHeader.premisesAddress}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Rental Amount:\\r\\n
    \\r\\n
    \\r\\n R{{rentalsCaptureVm.rentalsHeader.rentalAmount}}\\r\\n
    \\r\\n
    \\r\\n Lease Period (Months):\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n Occupation Date:\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Personal Details\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Full name\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ID/Passport Number\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Nationality\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Date of Birth\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Telephone (Work)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Telephone (Cellular)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Email\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Marital status\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Next of Kin\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Next of Kin Telephone\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Your current residential address\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n RSA ID or Passport\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Proof of current address\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Do you own the property where you currently stay?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n If NO, please complete the following\\r\\n
    \\r\\n
    \\r\\n Name of Land Owner/Agent\\r\\n \\r\\n\\r\\n Land Owner Telephone Number\\r\\n \\r\\n\\r\\n Land Owner Email\\r\\n \\r\\n\\r\\n Rental amount paid \\r\\n \\r\\n\\r\\n How long have you lived there (Months)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Employment Details\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Occupation\\r\\n \\r\\n
    \\r\\n Employers Name\\r\\n \\r\\n
    \\r\\n Employers contact number\\r\\n \\r\\n
    \\r\\n Employers Email\\r\\n \\r\\n
    \\r\\n Period of employment (months)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Employers address\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Payslip\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n 3 months bank statements\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Affordability\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Gross monthly salary\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Current monthly expenses\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Personal Details\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Full name\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ID/Passport Number\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Nationality\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Date of Birth\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Telephone (Work)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Telephone (Cellular)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Email\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Marital status\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Next of Kin\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Next of Kin Telephone\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Do you stay with your married partner?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n
    \\r\\n Your current residential address\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n RSA ID or Passport\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Proof of current address\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Do you own the property where you currently stay?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n If NO, please complete the following\\r\\n
    \\r\\n
    \\r\\n Name of Land Owner/Agent\\r\\n \\r\\n\\r\\n Land Owner Telephone Number\\r\\n \\r\\n\\r\\n Land Owner Email\\r\\n \\r\\n\\r\\n Rental amount paid \\r\\n \\r\\n\\r\\n How long have you lived there (Months)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Employment Details\\r\\n
    \\r\\n
    \\r\\n Are you currently employed?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n Occupation\\r\\n \\r\\n
    \\r\\n Employers Name\\r\\n \\r\\n
    \\r\\n Employers contact number\\r\\n \\r\\n
    \\r\\n Employers Email\\r\\n \\r\\n
    \\r\\n Period of employment (months)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Employers address\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Payslip\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n 3 months bank statements\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Affordability\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Gross monthly salary\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Current monthly expenses\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Personal Details\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Full name\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ID/Passport Number\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Nationality\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Date of Birth\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Telephone (Work)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Telephone (Cellular)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Email\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Marital status\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Next of Kin\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Next of Kin Telephone\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Do you stay with your married partner?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n
    \\r\\n Your current residential address\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n RSA ID or Passport\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Proof of current address\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Do you own the property where you currently stay?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n If NO, please complete the following\\r\\n
    \\r\\n
    \\r\\n Name of Land Owner/Agent\\r\\n \\r\\n\\r\\n Land Owner Telephone Number\\r\\n \\r\\n\\r\\n Land Owner Email\\r\\n \\r\\n\\r\\n Rental amount paid \\r\\n \\r\\n\\r\\n How long have you lived there (Months)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Employment Details\\r\\n
    \\r\\n
    \\r\\n Are you currently employed?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n Occupation\\r\\n \\r\\n
    \\r\\n Employers Name\\r\\n \\r\\n
    \\r\\n Employers contact number\\r\\n \\r\\n
    \\r\\n Employers Email\\r\\n \\r\\n
    \\r\\n Period of employment (months)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Employers address\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Payslip\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n 3 months bank statements\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Affordability\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Gross monthly salary\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Current monthly expenses\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Personal Details\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Full name\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ID/Passport Number\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Nationality\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Date of Birth\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Telephone (Work)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Telephone (Cellular)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Email\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Marital status\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Next of Kin\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Next of Kin Telephone\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Your current residential address\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n RSA ID or Passport\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Proof of current address\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Do you own the property where you currently stay?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n If NO, please complete the following\\r\\n
    \\r\\n
    \\r\\n Name of Land Owner/Agent\\r\\n \\r\\n\\r\\n Land Owner Telephone Number\\r\\n \\r\\n\\r\\n Land Owner Email\\r\\n \\r\\n\\r\\n Rental amount paid \\r\\n \\r\\n\\r\\n How long have you lived there (Months)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Employment Details\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n Occupation\\r\\n \\r\\n
    \\r\\n Employers Name\\r\\n \\r\\n
    \\r\\n Employers contact number\\r\\n \\r\\n
    \\r\\n Employers Email\\r\\n \\r\\n
    \\r\\n Period of employment (months)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Employers address\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Payslip\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n 3 months bank statements\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Affordability\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Gross monthly salary\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Current monthly expenses\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Who will be staying at the Premises for the whole period of the lease? (Note No subletting allowed)\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Will you be occupying the property\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n Number of adults\\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n Number of children\\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Children\\'s ages\\'\\r\\n
    \\r\\n
    \\r\\n #1\\r\\n\\r\\n
    \\r\\n
    \\r\\n #2\\r\\n\\r\\n
    \\r\\n
    \\r\\n #3\\r\\n\\r\\n
    \\r\\n
    \\r\\n #4\\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Number of pets owned\\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n Type\\r\\n
    \\r\\n
    \\r\\n \\r\\n (Approval Required)\\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Number of vehicles at premises\\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Type1\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n Registration\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Type2\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n Registration\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Type3\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n Registration\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Type4\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n Registration\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Have you/either of you ever had any judgements/defaults granted against you?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n If Yes, please give details\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Have you seen the property?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Do you want to upload extra Supporting Documents?\\r\\n
    \\r\\n \\r\\n    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n Upon acceptance by the Land Owner/Pretor and the presenting of an Agreement of Lease, I/We agree to pay the admin fee within 48 hours of approval of the application.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Admin Fee:\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n R 1290.00\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Single Application\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Admin Fee:\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n R 1560.00\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n Joint application or company\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n I/We declare that the information we have given in this application form is true and correct to the best of my/our\\r\\n knowledge and that I/we have not failed to provide any information which, if the Land Owner had known such\\r\\n information, would have not allowed the application to be successful.\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n I/We agree or allow the Land Owner or Pretor at all times to contact, request and obtain information from any credit\\r\\n provider (or potential credit provider) or registered credit bureau that may be necessary to assess my/our\\r\\n behaviour, profile, payment patterns, indebtedness, whereabouts, and credit worthiness;\\r\\n furnish information concerning the behaviour, profile, payment patterns, indebtedness, whereabouts, and credit\\r\\n worthiness of me/us to any registered credit bureau or any credit provider (or potential credit provider) seeking a\\r\\n trade reference regarding my/our dealings with the Land Owner and/or Pretor.\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Signed by the applicants at \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n on this the \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n day of \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n {{rentalsCaptureVm.declarations.YearSigned}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n First Applicant Signature\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Application Missing Data\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Application Acknowledgment Missing Info\\r\\n
    \\r\\n
    \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n First Applicant Missing Info\\r\\n
      \\r\\n
      \\r\\n
        \\r\\n
        \\r\\n \\r\\n \\r\\n \\r\\n
        \\r\\n
        \\r\\n General Details Missing Info\\r\\n
        \\r\\n
        \\r\\n
          \\r\\n
          \\r\\n
          \\r\\n
          \\r\\n Declarations Missing Info\\r\\n
          \\r\\n
          \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n \\r\\n Uploading Documents and Data. Please wait...\\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n \\r\\n Rentals Application successfully sent!\\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n \\r\\n Rentals Application was not sent! Please contact Rentals at Pretor.\\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n \\r\\n Rentals Application was not sent! Please contact Rentals at Pretor.\\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('trustee-dashboard/trustee-dashboard.html','\\r\\n\\r\\n\\r\\n \\r\\n HIIIII This is the Trusteeee dashboard \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('utility-info/utility-info.html','
            \\r\\n
            \\r\\n
            \\r\\n Building Information\\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n There is no utility information.\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('accounts/accounts-history/accounts-history.html','
            \\r\\n Accounts History\\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
             
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
             
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Unit\\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n Current Balance\\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Date\\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n Description\\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n Amount \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n Balance\\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('accounts/historical-link/historical-link.html','\\r\\n\\r\\n');\n$templateCache.put('accounts/register/register.html','
            \\r\\n
            \\r\\n

            Register

            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{RegisterVM.progress}}%\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n Required\\r\\n Invalid email\\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n {{building.SchemeName}}\\r\\n \\r\\n \\r\\n {{building.SchemeRole}}\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{unit}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n Required\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n Required\\r\\n \\r\\n\\r\\n \\r\\n
            \\r\\n \\r\\n\\r\\n \\r\\n
            \\r\\n \\r\\n Required\\r\\n Invalid cellphone number\\r\\n Must be 9 digits without the country code\\r\\n Must be 9 digits without the country code\\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n Required\\r\\n Invalid email\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n Required\\r\\n Must be at least 7 characters\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n Required\\r\\n Must be at least 7 characters\\r\\n Passwords do not match\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n \\r\\n\\r\\n
            \\r\\n
            \\r\\n\\r\\n \\r\\n\\r\\n\\r\\n www.pretor.co.za \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n www.pretor.co.za \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Login\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('accounts/profile/profile.html','
            \\r\\n
            \\r\\n
            \\r\\n My Details
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n {{unit.FullName}}\\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            Login Details
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n *\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{ProfileVM.getFirstName}}\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n *\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{ProfileVM.getLastName}}\\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n Update Password\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            Personal Details
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n *\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n *\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Update\\r\\n \\r\\n \\r\\n Save\\r\\n \\r\\n \\r\\n Cancel\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n ×\\r\\n \\r\\n

            Confirm Save Changes?

            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Are you sure you want to update your details for\\r\\n {{ProfileVM.selectedUnit}}?\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n\\r\\n \\r\\n Yes\\r\\n \\r\\n\\r\\n \\r\\n Yes\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n\\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            Change details on multiple properties ?

            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n \\r\\n There are multiple properties linked to your profile.\\r\\n \\r\\n
            \\r\\n \\r\\n Would you like to update your details for all properties?\\r\\n \\r\\n

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n No\\r\\n \\r\\n \\r\\n No\\r\\n \\r\\n\\r\\n \\r\\n Yes\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n\\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n ×\\r\\n \\r\\n

            Confirmed multiple Properties

            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n \\r\\n Thank you.\\r\\n \\r\\n
            \\r\\n \\r\\n A Pretor staff member will be contacting you soon to assist in\\r\\n updating your details.\\r\\n \\r\\n

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n\\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n ×\\r\\n \\r\\n

            \\r\\n Email cannot be {{ProfileVM.emailAction === \\'edit\\' ? \\'edited\\':\\r\\n \\'removed\\'}}\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n The email\\r\\n {{ProfileVM.contactInformation.EmailAddress[ProfileVM.emailIndex]}}\\r\\n is linked to a payment authorisation band and therefor cannot be\\r\\n {{ProfileVM.emailAction === \\'edit\\' ? \\'edited\\': \\'removed\\'}}.\\r\\n

            \\r\\n

            \\r\\n If you would like to {{ProfileVM.emailAction===\\'edit\\' ? \\'edit\\' :\\r\\n \\'remove\\'}} this email, please contact the building\\'s manager\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Username updated\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Your username was successfully updated.
            \\r\\n Please note that you are now going to be logged out.\\r\\n

            \\r\\n

            Kindly log back in again.

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n');\n$templateCache.put('accounts/login/login.html','\\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"testing\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Login\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n Required\\r\\n Invalid email\\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n Required\\r\\n Must be at least 7 characters\\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Are you registered yet?  \\r\\n \\r\\n Register\\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n\\r\\n \\r\\n Required\\r\\n Invalid email\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('compliance/views/fire-compliance.html','
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            Fire Certification Quote\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n\\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Rejection Reason\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            Please type the reason for rejecting this quote

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Confirm Approval\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            You are about to Approve this Fire Quote.

            \\r\\n

            Please click on Confirm to continue, or Cancel to back out.

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Query the quote\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            Please type the query below?

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n');\n$templateCache.put('compliance/views/lift-compliance.html','
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Lift Certification Quote\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Rejection Reason\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            Please type the reason for rejecting this quote

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Confirm Approval\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            You are about to Approve this Lift Quote.

            \\r\\n

            Please click on Confirm to continue, or Cancel to back out.

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Query the quote\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            Please type the query below?

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('compliance/views/mini-sub-compliance.html','
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            Mini-sub Service Quote

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n\\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Confirm Approval\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n You are about to Approve this Mini-sub Service Quote.\\r\\n

            \\r\\n

            \\r\\n Pleace click on Confirm to continue,\\r\\n or Cancel to back out.\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Query Mini-sub service quote\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            Please type the query below

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Rejection Reason\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            Please provide a reason for rejecting this quote.

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n');\n$templateCache.put('clearances/clearance-request/clearance-request.html','
            \\r\\n \\r\\n Clearance Request Process\\r\\n \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Property Information\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n Property Name Required.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n Unit Number Required.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n Seller Name Required.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n Date with in Available Range Selection Required.\\r\\n \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Attorney Information\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n Attorney Name Required.\\r\\n \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n Attorney Contact Number Required.\\r\\n Contact Number must be 10 digits.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n Attorney Email Required.\\r\\n Invalid email.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n Attorney Reference Required.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/cashflow-statement.html','
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Cashflow Statement\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n {{cashflowStatementVm.selectedBuildingName}} (ACTUAL VS BUDGET)\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Actual
            \\r\\n
            \\r\\n
            \\r\\n
            Budget
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Actual
            \\r\\n
            \\r\\n
            \\r\\n
            Budget
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Budget
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Cash Availability Report\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Total Administrative Cash Available
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n\\r\\n
            0 || cashflowStatementVm.serviceData.cashflowData.ReserveFundExpense && cashflowStatementVm.serviceData.cashflowData.ReserveFundExpense.Children && cashflowStatementVm.serviceData.cashflowData.ReserveFundExpense.Children.length > 0)\">\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Actual
            \\r\\n
            \\r\\n
            \\r\\n
            Budget
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Actual
            \\r\\n
            \\r\\n
            \\r\\n
            Budget
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Budget
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            0 || cashflowStatementVm.serviceData.cashflowData.ReserveFundExpense && cashflowStatementVm.serviceData.cashflowData.ReserveFundExpense.Children && cashflowStatementVm.serviceData.cashflowData.ReserveFundExpense.Children.length > 0\">\\r\\n
            \\r\\n
            \\r\\n
            0 || cashflowStatementVm.serviceData.cashflowData.ReserveFundExpense && cashflowStatementVm.serviceData.cashflowData.ReserveFundExpense.Children && cashflowStatementVm.serviceData.cashflowData.ReserveFundExpense.Children.length > 0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{month.FriendlyNameMonthShort}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n YTD Actual\\r\\n
            \\r\\n
            \\r\\n Annual Budget\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n Cash Availability Report\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n This report is currently unavailable for your device, please\\r\\n \\r\\n download the PDF\\r\\n \\r\\n instead.\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n The document you are looking for has not been uploaded yet.\\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n\\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n Levies Received is Calculated as follows:\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Total Levy Receipts for the Month\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{cashflowStatementVm.leviesReceivedSummary().GrossLeviesRecieved}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n Less - Legal fees Paid and raised against levy account\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n ({{cashflowStatementVm.leviesReceivedSummary().TotalLegalFessPaid}})\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n Total Levy Income as per Levy Roll\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{cashflowStatementVm.leviesReceivedSummary().NetLeviesRecieved}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Do you wish to view the Levy Roll?
             \\r\\n
            \\r\\n No \\r\\n Yes\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n');\n$templateCache.put('accounts/tenant/tenant.html','
            \\r\\n \\r\\n \"Loading...\"\\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n There is no tenant registered for this unit\\r\\n
            \\r\\n
            \\r\\n\\r\\n \\r\\n
            \\r\\n Current tenant details\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \"Loading...\"\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n First Name\\r\\n *\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Last Name\\r\\n *\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n ID Number or Passport\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Home Number\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Must be 10 digits.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Cell Number\\r\\n *\\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Required.\\r\\n Must be 10 digits.\\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n Work Number\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Must be 10 digits.\\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Email Address\\r\\n *\\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Required.\\r\\n Invalid email\\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n Remove\\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n Register\\r\\n \\r\\n \\r\\n Save\\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n Update\\r\\n \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Are you sure you want to de-register this tenant?\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Yes\\r\\n
            \\r\\n
            \\r\\n No\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n\\r\\n');\n$templateCache.put('financials/cashflow-statement-new/cashflow-statement-new.html','
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Cashflow Statement New Version\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n In Progress .. Coming Soon ....\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n');\n$templateCache.put('financials/balance-sheet/balance-sheet.html','
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Balance Sheet\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n {{balanceSheetVm.selectedBuildingName}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{month.FriendlyNameMonthShort}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n This report is currently unavailable for your device, please\\r\\n \\r\\n download the PDF\\r\\n \\r\\n instead.\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{balanceSheetVm.reportModelHeader}}\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/contractors-roll/contractors-roll.html','
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Contractors Roll\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n {{contractorsRollVm.selectedBuildingName}}\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n\\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            Date of Payment
            \\r\\n
            \\r\\n
            \\r\\n
            Supplier
            \\r\\n
            \\r\\n
            \\r\\n
            Amount
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\" ng-repeat=\"detail in contractorsRollVm.ContractorsRollService.contractorsRollData\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Date of Payment
            \\r\\n
            {{detail.Date | date : \\'d MMMM yyyy\\'}}
            \\r\\n
            \\r\\n
            \\r\\n
            Supplier
            \\r\\n
            {{detail.Supplier}}
            \\r\\n
            \\r\\n
            \\r\\n
            Amount
            \\r\\n
            {{detail.Amount | number : 2}}
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            Total
            \\r\\n
            \\r\\n
            \\r\\n
            {{contractorsRollVm.ContractorsRollService.contractorsRollTotal | number : 2}}
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{contractorsRollVm.reportModelHeader}}\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/financial-summary/financial-summary.html','
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Financial Summary\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{financialSummaryVm.selectedBuildingName}}\\r\\n
            \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n
            \\r\\n
            \\r\\n\\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n \\r\\n\\r\\n  \\r\\n \\r\\n\\r\\n  \\r\\n \\r\\n\\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n Portfolio Manager:\\r\\n {{financialSummaryVm.FinancialSummaryService.financialSummary.PortfolioManagerName}}
            \\r\\n Bookkeeper:\\r\\n {{financialSummaryVm.FinancialSummaryService.financialSummary.BookkeeperName}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Rejection Reason\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            Please type the reason for rejecting this Financial Summary

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Confirm Approval\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            You are about to Approve this Financial Summary with the following distribution list:

            \\r\\n
            \\r\\n {{mailItem.EmailAddress}}\\r\\n

            \\r\\n

            Please click on Confirm to continue, or Cancel to back out.

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Mail Recipient List\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            Trustee Recipient Delivery MethodActionsInclude
            \\r\\n
            \\r\\n \\r\\n \\r\\n Email is required.\\r\\n Invalid is email.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n Delivery Method is required.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            {{mailItem.EmailAddress}}{{mailItem.CommunicationChannelDescription}}\\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            Ad hoc Recipient\\r\\n \\r\\n Delivery MethodActions
            \\r\\n
            \\r\\n \\r\\n \\r\\n Email is required.\\r\\n Invalid is email.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n Delivery Method is required.\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            {{mailItem.EmailAddress}}{{mailItem.CommunicationChannelDescription}}\\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n

            This may take a moment...

            \\r\\n

            Please be patient.

            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            ');\n$templateCache.put('financials/income-vs-budget/income-vs-budget.html','
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Income VS Budget\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n In Progress .. Coming Soon ....\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n');\n$templateCache.put('financials/levy-roll/levy-roll.html','
            \\r\\n\\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n    \\r\\n \\r\\n    \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Levy Roll\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n {{levyRollVm.selectedBuildingName}}\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n\\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Legal Collection Roll\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n {{levyRollVm.selectedBuildingName}}\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n\\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Consolidated Levy Roll\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n {{levyRollVm.selectedBuildingName}}\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n\\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            0 && levyRollVm.selectLevytype === \\'levyRoll\\'\">\\r\\n
            \\r\\n
            \\r\\n
            Unit
            \\r\\n
            \\r\\n
            \\r\\n
            Owner
            \\r\\n
            \\r\\n
            \\r\\n
            Opening Balance
            \\r\\n
            \\r\\n
            \\r\\n
            Admin Fund Levy
            \\r\\n
            \\r\\n
            \\r\\n
            Reserve Fund Levy
            \\r\\n
            \\r\\n
            \\r\\n
            Other Charges
            \\r\\n
            \\r\\n
            \\r\\n
            Amount
            \\r\\n
            \\r\\n
            \\r\\n
            Description
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            D/O
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Due
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Received
            \\r\\n
            \\r\\n
            \\r\\n
            Closing Balance
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Unit
            \\r\\n
            \\r\\n {{item.UnitItemCode}} \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Owner
            \\r\\n
            {{item.OwnerName}}
            \\r\\n
            \\r\\n
            \\r\\n
            Opening Balance
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Administrative Fund Levy
            \\r\\n
            {{item.AdministrativeFundLevy}}
            \\r\\n
            \\r\\n
            \\r\\n
            Reserve Fund Levy
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{other.Description}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Debit Order
            \\r\\n
            Y
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Due
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Received
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Closing Balance
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Legal Status: \\r\\n {{item.LegalStatusDescription}}\\r\\n \\r\\n
            \\r\\n
            \\r\\n Arrangement: \\r\\n {{item.HasArrangementDescription}}\\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n {{memos.Date | date : \"dd MMM yyyy\"}}     {{memos.MaskedMemoText}}\\r\\n \\r\\n There are no legal memos for this unit. \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Totals :\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Displaying {{levyRollVm.levyRollPaging.firstItemIndex}} to\\r\\n {{levyRollVm.levyRollPaging.lastItemIndex}}\\r\\n of {{levyRollVm.levyRollPaging.numberOfResults}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
              \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n Units {{levyRollVm.levyRollPaging.firstItemIndex}} to\\r\\n {{levyRollVm.levyRollPaging.lastItemIndex}}\\r\\n of {{levyRollVm.levyRollPaging.numberOfResults}}\\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Summary Of Other Charges\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{item.Description}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Total Summary Of Other Charges\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Summary of Levies Billed\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{item.Description}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Summary Of Totals\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{item.Description}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{itemDetail.Description}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0 && levyRollVm.selectLevytype === \\'consolidatedRoll\\'\">\\r\\n
            \\r\\n
            \\r\\n
            Unit
            \\r\\n
            \\r\\n
            \\r\\n
            Owner
            \\r\\n
            \\r\\n
            \\r\\n
            Opening Balance
            \\r\\n
            \\r\\n
            \\r\\n
            Admin Fund Levy
            \\r\\n
            \\r\\n
            \\r\\n
            Reserve Fund Levy
            \\r\\n
            \\r\\n
            \\r\\n
            Other Charges
            \\r\\n
            \\r\\n
            \\r\\n
            Amount
            \\r\\n
            \\r\\n
            \\r\\n
            Description
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            D/O
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Due
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Received
            \\r\\n
            \\r\\n
            \\r\\n
            Closing Balance
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Unit
            \\r\\n
            \\r\\n {{item.UnitItemCode}} \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Owner
            \\r\\n
            {{item.OwnerName}}
            \\r\\n
            \\r\\n
            \\r\\n
            Opening Balance
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Administrative Fund Levy
            \\r\\n
            {{item.AdministrativeFundLevy}}
            \\r\\n
            \\r\\n
            \\r\\n
            Reserve Fund Levy
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{other.Description}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Debit Order
            \\r\\n
            Y
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Due
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Received
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Closing Balance
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Legal Status: \\r\\n {{item.LegalStatusDescription}}\\r\\n \\r\\n
            \\r\\n
            \\r\\n Arrangement: \\r\\n {{item.HasArrangementDescription}}\\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n {{memos.Date | date : \"dd MMM yyyy\"}}     {{memos.MaskedMemoText}}\\r\\n \\r\\n There are no legal memos for this unit. \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Totals :\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Displaying {{levyRollVm.levyRollPaging.firstItemIndex}} to\\r\\n {{levyRollVm.levyRollPaging.lastItemIndex}}\\r\\n of {{levyRollVm.levyRollPaging.numberOfResults}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
              \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n Units {{levyRollVm.levyRollPaging.firstItemIndex}} to\\r\\n {{levyRollVm.levyRollPaging.lastItemIndex}}\\r\\n of {{levyRollVm.levyRollPaging.numberOfResults}}\\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Summary Of Other Charges\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{item.Description}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Total Summary Of Other Charges\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Summary of Levies Billed\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{item.Description}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Summary Of Totals\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Admin Fund Levies Received\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Reserve Fund Levies Received\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Total Payments Received\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Total Levies Outstanding\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Total Levies in Advance\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Closing Balance\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Unit
            \\r\\n
            \\r\\n
            \\r\\n
            Owner
            \\r\\n
            \\r\\n
            \\r\\n
            Opening Balance
            \\r\\n
            \\r\\n
            \\r\\n
            Other Charges
            \\r\\n
            \\r\\n
            \\r\\n
            Amount
            \\r\\n
            \\r\\n
            \\r\\n
            Description
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            D/O
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Due
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Received
            \\r\\n
            \\r\\n
            \\r\\n
            Closing Balance
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Unit
            \\r\\n
            \\r\\n {{itemLegal.UnitItemCode}} \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Owner
            \\r\\n
            {{itemLegal.OwnerName}}
            \\r\\n
            \\r\\n
            \\r\\n
            Opening Balance
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{otherLegal.Description}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Debit Order
            \\r\\n
            Y
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Due
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Payment Received
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Closing Balance
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Legal Status: \\r\\n {{itemLegal.LegalStatusDescription}}\\r\\n \\r\\n
            \\r\\n
            \\r\\n Arrangement: \\r\\n {{itemLegal.HasArrangementDescription}}\\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n {{memos.Date | date : \"dd MMM yyyy\"}}     {{memos.MaskedMemoText}}\\r\\n \\r\\n There are no legal memos for this unit. \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Displaying {{levyRollVm.levyRollPaging.firstItemIndexLegal}} to\\r\\n {{levyRollVm.levyRollPaging.lastItemIndexLegal}}\\r\\n of {{levyRollVm.levyRollPaging.numberOfResultsLegal}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
              \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n Units {{levyRollVm.levyRollPaging.firstItemIndexLegal}} to\\r\\n {{levyRollVm.levyRollPaging.lastItemIndexLegal}}\\r\\n of {{levyRollVm.levyRollPaging.numberOfResultsLegal}}\\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Summary Of Totals\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n {{item.Description}}\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n {{itemDetail.Description}}\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n This report is currently unavailable for your device, please\\r\\n \\r\\n download the PDF \\r\\n instead.\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n

            \\r\\n Legal Reports\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n

            Please select the number of months\\' worth of Legal Reports to see:

            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{levyRollVm.reportModelHeader}}\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n');\n$templateCache.put('financials/debtor-age-analysis/debtor-age-analysis.html','
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Debtor Age Analysis\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n {{debtorAgeAnalysisVm.selectedBuildingName}}\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            Unit
            \\r\\n
            \\r\\n
            \\r\\n
            Owner
            \\r\\n
            \\r\\n
            \\r\\n
            Legal Status
            \\r\\n
            \\r\\n
            \\r\\n
            Total
            \\r\\n
            \\r\\n
            \\r\\n
            Current
            \\r\\n
            \\r\\n
            \\r\\n
            30+ Days
            \\r\\n
            \\r\\n
            \\r\\n
            60+ Days
            \\r\\n
            \\r\\n
            \\r\\n
            90+ Days
            \\r\\n
            \\r\\n
            \\r\\n
            120+ Days
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Unit
            \\r\\n
            \\r\\n {{ debtorAgeAnalysisVm.getSubstring(item.CardCode) }} \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            {{item.Owner}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{item.LegalStatusDescription}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{item.Total}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{item.Current}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{item.ThirtyDays}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{item.SixtyDays}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{item.NinetyDays}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{item.OneTwentyDays}}
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Arrangement: \\r\\n {{item.HasArrangementDescription}}\\r\\n
            \\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n {{memos.Date| date : \"dd MMM yyyy\"}}\\r\\n \\r\\n {{ debtorAgeAnalysisVm.trimStart(memos.MaskedMemoText) }}\\r\\n There are no legal memos for this unit. \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Grand Total
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            {{debtorAgeAnalysisVm.serviceData.debtorAgeAnalysisData.GrandTotal}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{debtorAgeAnalysisVm.serviceData.debtorAgeAnalysisData.CurrentTotal}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{debtorAgeAnalysisVm.serviceData.debtorAgeAnalysisData.ThirtyDaysTotal}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{debtorAgeAnalysisVm.serviceData.debtorAgeAnalysisData.SixtyDaysTotal}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{debtorAgeAnalysisVm.serviceData.debtorAgeAnalysisData.NinetyDaysTotal}}
            \\r\\n
            \\r\\n
            \\r\\n
            {{debtorAgeAnalysisVm.serviceData.debtorAgeAnalysisData.OneTwentyDaysTotal}}
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n Displaying {{debtorAgeAnalysisVm.DebtorAgeAnalysisPaging.firstItemIndex}} to\\r\\n {{debtorAgeAnalysisVm.DebtorAgeAnalysisPaging.lastItemIndex}}\\r\\n of {{debtorAgeAnalysisVm.DebtorAgeAnalysisPaging.numberOfResults}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
              \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n Units {{debtorAgeAnalysisVm.DebtorAgeAnalysisPaging.firstItemIndex}} to\\r\\n {{debtorAgeAnalysisVm.DebtorAgeAnalysisPaging.lastItemIndex}}\\r\\n of {{debtorAgeAnalysisVm.DebtorAgeAnalysisPaging.numberOfResults}}\\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            • \\r\\n \\r\\n
            • \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/income-statement/income-statement.html','
            \\r\\n\\r\\n \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Income Statement\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n {{incomeStatementVm.selectedBuildingName}}\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{month.FriendlyNameMonthShort}}\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n YTD Actual\\r\\n
            \\r\\n
            \\r\\n Annual Budget\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n \\r\\n\\r\\n\\r\\n
            \\r\\n
            \\r\\n This report is currently unavailable for your device, please\\r\\n \\r\\n download the PDF\\r\\n \\r\\n instead.\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            ');\n$templateCache.put('financials/wages-roll/wages-roll.html','
            \\r\\n\\r\\n \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n

            \\r\\n Wages Roll\\r\\n

            \\r\\n
            \\r\\n
            \\r\\n {{wagesRollVm.selectedBuildingName}}\\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \"Loading...\"\\r\\n
            \\r\\n\\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            Date of Payment
            \\r\\n
            \\r\\n
            \\r\\n
            Employee
            \\r\\n
            \\r\\n
            \\r\\n
            Amount
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\" ng-repeat=\"detail in wagesRollVm.WagesRollService.wagesRollData\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            Date of Payment
            \\r\\n
            {{detail.Date | date : \\'d MMMM yyyy\\'}}
            \\r\\n
            \\r\\n
            \\r\\n
            Employee
            \\r\\n
            {{detail.Employee}}
            \\r\\n
            \\r\\n
            \\r\\n
            Amount
            \\r\\n
            {{detail.Amount | number : 2}}
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            Total
            \\r\\n
            \\r\\n
            \\r\\n
            {{wagesRollVm.WagesRollService.wagesRollTotal | number : 2}}
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{wagesRollVm.reportModelHeader}}\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/templates/inner-panel-cash-availability-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            {{item.AccountName}}
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/templates/inner-panel-tmpl.html','
            \\r\\n
            \\r\\n
            0) || item.AccountCode === 400000) ? \\'collapse\\': \\'\\'}}\"\\r\\n ng-attr-data-target=\"{{((item.Children && item.Children.length > 0) || item.AccountCode === 400000) ? \\'#\\' + type + \\'-\\' + item.AccountCode : \\'\\'}}\"\\r\\n ng-init=\"cashflowStatementVm.serviceData.cashflowData.isDesktop ? cashflowStatementVm.accordionEffect = \\'null\\' : cashflowStatementVm.accordionEffect = \\'\\'\"\\r\\n ng-class=\"[cashflowStatementVm.getBudgetIssueClass(item.IsOverBudget, item.AccountCode), { \\'border-divider-bold-top\\' : item.Level != 5, \\'border-divider\\' : item.Level == 5 }, { \\'clickable\\': (item.AccountCode === \\'1\\' || item.AccountCode === \\'400000\\' || item.AccountCode === \\'400075\\' || (item.Children && item.Children.length>0))}]\">\\r\\n
            0))}\"\\r\\n ng-click=\"(item.AccountCode === \\'1\\' || item.AccountCode === \\'400000\\' || item.AccountCode === \\'400075\\' || (item.Children && item.Children.length>0)) ? cashflowStatementVm.accountClick(item.AccountCode, $event, type) : null\">\\r\\n
            0) || item.AccountCode === 400000) ? \\'collapse\\': \\'\\'}}\"\\r\\n ng-attr-data-target=\"{{((item.Children && item.Children.length > 0) || item.AccountCode === 400000) ? \\'#\\' + type + \\'-\\' + item.AccountCode : \\'\\'}}\"\\r\\n ng-class=\"{ \\'clickable\\': (item.AccountCode === \\'1\\' || item.AccountCode === \\'400000\\' || item.AccountCode === \\'400075\\' || (item.Children && item.Children.length>0))}\">\\r\\n
            0) || item.AccountCode === 400000) ? \\'collapse\\': \\'\\'}}\"\\r\\n ng-attr-data-target=\"{{((item.Children && item.Children.length > 0) || item.AccountCode === 400000) ? \\'#\\' + type + \\'-\\' + item.AccountCode : \\'\\'}}\">\\r\\n
            0) || item.AccountCode === 400000) ? \\'collapse\\': \\'\\'}}\"\\r\\n ng-attr-data-target=\"{{((item.Children && item.Children.length > 0) || item.AccountCode === 400000) ? \\'#\\' + type + \\'-\\' + item.AccountCode : \\'\\'}}\"\\r\\n ng-bind-html=\"cashflowStatementVm.getAccountNameHtmlFromItem(item)\">
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            item.YearToDateBudget && item.Type === 1\"\\r\\n class=\"col-md-1 no-padding actualBudget\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            item.YearToDateBudget && item.Type === 2\"\\r\\n class=\"col-md-1 no-padding actualBudget\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            0\"\\r\\n class=\"panel-body no-border-top no-padding padding-left-15\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n Date\\r\\n
            \\r\\n
            \\r\\n Supplier/From\\r\\n Transaction Memo\\r\\n
            \\r\\n
            \\r\\n Amount\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{transaction.Date | date : \"dd MMM yyyy\"}}\\r\\n
            \\r\\n
            \\r\\n # \\r\\n {{transaction.WebPaymentApproval.ServiceProviderName}}\\r\\n {{transaction.LineMemo}}\\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{transaction.Date | date : \"dd MMM yyyy\"}}\\r\\n
            \\r\\n
            \\r\\n {{transaction.WebPaymentApproval.ServiceProviderName}}\\r\\n {{transaction.LineMemo}}\\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n\\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/templates/opening-closing-balance-inner-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            {{item.AccountName}}
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/templates/opening-closing-balance-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            {{main.OpeningBalance.AccountName}}
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            {{main.ClosingBalance.AccountName}}
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/templates/outer-panel-cash-availability-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            {{outerItem.AccountName}} 0\"\\r\\n class=\"glyphers glyphicon glyphicon-menu-down text-center glyphiconMobileResponsive\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/templates/outer-panel-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            {{outerItem.AccountName}} 0\"\\r\\n class=\"glyphers glyphicon glyphicon-menu-down text-center glyphiconMobileResponsive\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            outerItem.YearToDateBudget && outerItem.Type === 1\" class=\"col-md-1 no-padding actualBudget second\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            outerItem.YearToDateBudget && outerItem.Type === 2\" class=\"col-md-1 no-padding actualBudget second\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/templates/yearly-inner-panel-cash-availability-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{item.AccountName}}\\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n');\n$templateCache.put('financials/cashflow-statement/templates/yearly-inner-panel-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{item.AccountName}}\\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n Date\\r\\n
            \\r\\n
            \\r\\n Supplier/From\\r\\n Transaction Memo\\r\\n
            \\r\\n
            \\r\\n Amount\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{transaction.Date | date : \"dd MMM yyyy\"}}\\r\\n
            \\r\\n
            \\r\\n {{transaction.WebPaymentApproval.ServiceProviderName}}\\r\\n {{transaction.LineMemo}}\\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n');\n$templateCache.put('financials/cashflow-statement/templates/yearly-opening-closing-balance-inner-panel-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{item.AccountName}}\\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/templates/yearly-opening-closing-balance-outer-panel-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{outerItem.AccountName}}\\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/templates/yearly-outer-panel-cash-availability-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{outerItem.AccountName}}\\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/cashflow-statement/templates/yearly-outer-panel-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{outerItem.AccountName}}\\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/balance-sheet/templates/inner-panel-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n\\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/balance-sheet/templates/outer-panel-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/income-statement/templates/inner-panel-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{item.AccountName}}\\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');\n$templateCache.put('financials/income-statement/templates/outer-panel-tmpl.html','
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n {{outerItem.AccountName}}\\r\\n
            \\r\\n
            0\">\\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            0\">\\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            \\r\\n
            ');}]);/* jshint ignore:end */\n","//@ts-check\r\n\r\nimport { FEATURES } from './common';\r\n\r\nconst RoutesRouterConfig = ($stateProvider, $urlRouterProvider) => {\r\n\tconst _turnOffIsLoggingIn = ($rootScope) => {\r\n\t\t'ngInject';\r\n\t\tconst payLoad = {\r\n\t\t\terr: null,\r\n\t\t\tisBusy: false\r\n\t\t};\r\n\r\n\t\t$rootScope.$broadcast('change-is-busy', false);\r\n\r\n\t\t$rootScope.$broadcast('user-login-busy', payLoad);\r\n\t};\r\n\r\n\tconst registerRoutes = () => {\r\n\t\tregisterProfileRout();\r\n\t\tregisterTenantRoute();\r\n\t\tregisterLevyRollRoute();\r\n\t\tregisterRegisterRoute();\r\n\t\tregisterPaymentsRoute();\r\n\t\tregisterDashboardRoute();\r\n\t\tregisterDocumentsRoute();\r\n\t\tregisterComplianceRoute();\r\n\t\tregisterBalanceSheetRoute();\r\n\t\tregisterAccountsHistoryRoute();\r\n\t\tregisterIncomeStatementRoute();\r\n\t\tregisterContractorsRollRoute();\r\n\t\tregisterFinancialSummaryRoute();\r\n\t\tregisterClearanceCaptureRoute();\r\n\t\tregisterClearanceRequestRoute();\r\n\t\tregisterCashflowStatementRoute();\r\n\t\tregisterCashflowStatementNewRoute();\r\n\t\tregisterPersonalDocumentsRoute();\r\n\t\tregisterPaymentAuthorisationRoute();\r\n\t\tregisterUtilityRoute();\r\n\t\tregisterDocumentsApprovalRoute();\r\n\t\tregisterLoginRoute();\r\n\t\tregisterHistoricalLinkRoute();\r\n\t\tregisterRentalsCaptureRoute();\r\n registerAuditsCaptureRoute();\r\n\t\tregisterAuditorsDashboardRoute();\r\n registerWagesRollRoute();\r\n\t\tregisterTrusteeRoute();\r\n\t\tregisterIncomeVSBudgetRoute();\r\n\t\tregisterDebtorAgeAnalysisRoute();\r\n\t\tregisterFindAContractorRoute();\r\n\t\t$urlRouterProvider.otherwise(`/${FEATURES.LOGIN}`); //red become the default view\r\n\t};\r\n\r\n\tconst registerHistoricalLinkRoute = () => {\r\n\t\tconst historicallink = {\r\n\t\t\tcontroller: 'HistoricalLinkCtrl',\r\n\t\t\tcontrollerAs: 'HistoricalLinkVM',\r\n\t\t\tname: FEATURES.HISTORICAL_LINK,\r\n\t\t\turl: `/${FEATURES.HISTORICAL_LINK}`,\r\n\t\t\ttemplateUrl: 'accounts/historical-link/historical-link.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(historicallink);\r\n\t};\r\n\tconst registerLoginRoute = () => {\r\n\t\tconst login = {\r\n\t\t\tcontroller: 'LoginCtrl',\r\n\t\t\tcontrollerAs: 'LoginVM',\r\n\t\t\tname: FEATURES.LOGIN,\r\n\t\t\turl: `/${FEATURES.LOGIN}`,\r\n\t\t\ttemplateUrl: 'accounts/login/login.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(login);\r\n\t};\r\n\tconst registerProfileRout = () => {\r\n\t\tconst profile = {\r\n\t\t\tcontroller: 'ProfileCtrl',\r\n\t\t\tcontrollerAs: 'ProfileVM',\r\n\t\t\tname: FEATURES.MY_PROFILE,\r\n\t\t\turl: `/${FEATURES.MY_PROFILE}`,\r\n\t\t\ttemplateUrl: 'accounts/profile/profile.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(profile);\r\n\t};\r\n\tconst registerUtilityRoute = () => {\r\n\t\tconst utilityRoute = {\r\n\t\t\tcontroller: 'UtilityinfoCtrl',\r\n\t\t\tcontrollerAs: 'UtilityinfoVM',\r\n\t\t\tname: FEATURES.UTILITY,\r\n\t\t\turl: `/${FEATURES.UTILITY}`,\r\n\t\t\ttemplateUrl: 'utility-info/utility-info.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(utilityRoute);\r\n\t};\r\n\r\n const registerDocumentsApprovalRoute = () => {\r\n\t\tconst viewDocsApprovalRoute = {\r\n\t\t\tcontroller: 'DocumentsApprovalCtrl',\r\n\t\t\tcontrollerAs: 'DocumentsApprovalVM',\r\n\t\t\tname: FEATURES.DOCUMENTS_APPROVAL,\r\n\t\t\turl: `/${FEATURES.DOCUMENTS_APPROVAL}`,\r\n\t\t\ttemplateUrl: 'approval-documents/documents-approval.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(viewDocsApprovalRoute);\r\n\t};\r\n\r\n\tconst registerTenantRoute = () => {\r\n\t\tconst tenantRoute = {\r\n\t\t\tname: FEATURES.TENANT,\r\n\t\t\tcontroller: 'TenantCtrl',\r\n\t\t\tcontrollerAs: 'TenantVM',\r\n\t\t\turl: `/${FEATURES.TENANT}`,\r\n\t\t\ttemplateUrl: 'accounts/tenant/tenant.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(tenantRoute);\r\n\t};\r\n\r\n\tconst registerRegisterRoute = () => {\r\n\t\tconst registerRoute = {\r\n\t\t\tname: FEATURES.REGISTER,\r\n\t\t\tcontroller: 'RegisterCtrl',\r\n\t\t\tcontrollerAs: 'RegisterVM',\r\n\t\t\tresolve: {\r\n\t\t\t\tunused: _turnOffIsLoggingIn\r\n\t\t\t},\r\n\t\t\turl: `/${FEATURES.REGISTER}?email&token`,\r\n\t\t\ttemplateUrl: 'accounts/register/register.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(registerRoute);\r\n\t};\r\n\r\n\tconst registerPaymentsRoute = () => {\r\n\t\tconst paymentsRoute = {\r\n\t\t\tname: FEATURES.PAYMENTS,\r\n\t\t\tcontroller: 'PaymentCtrl',\r\n\t\t\tcontrollerAs: 'paymentApprovalVm',\r\n\t\t\turl: `/${FEATURES.PAYMENTS}?dbRef`,\r\n\t\t\ttemplateUrl: 'payments/payments.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(paymentsRoute);\r\n\t};\r\n\r\n\tconst registerLevyRollRoute = () => {\r\n\t\tconst levyRollRoute = {\r\n\t\t\tname: FEATURES.LEVY_ROLL,\r\n\t\t\tcontroller: 'LevyRollCtrl',\r\n\t\t\tcontrollerAs: 'levyRollVm',\r\n\t\t\turl: `/${FEATURES.LEVY_ROLL}?date`,\r\n\t\t\ttemplateUrl: 'financials/levy-roll/levy-roll.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(levyRollRoute);\r\n\t};\r\n\r\n\tconst registerDashboardRoute = () => {\r\n\t\tconst dashboardRoute = {\r\n\t\t\turl: '/',\r\n\t\t\tname: FEATURES.DASHBOARD,\r\n\t\t\tcontroller: 'DashboardCtrl',\r\n\t\t\tcontrollerAs: 'DashboardVM',\r\n\t\t\ttemplateUrl: 'dashboard/dashboard.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(dashboardRoute);\r\n\t};\r\n\r\n\tconst registerDocumentsRoute = () => {\r\n\t\tconst documentsRoute = {\r\n\t\t\tname: FEATURES.DOCUMENTS,\r\n\t\t\tcontrollerAs: 'documentsVm',\r\n\t\t\turl: `/${FEATURES.DOCUMENTS}?nav`,\r\n\t\t\tcontroller: 'BuildingDocumentsCtrl',\r\n\t\t\ttemplateUrl: 'building-documents/building-documents.html',\r\n\t\t\tparams: { isItFinancialsSection: false }\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(documentsRoute);\r\n\t};\r\n\r\n\tconst registerComplianceRoute = () => {\r\n\t\tconst complianceRoute = {\r\n\t\t\tname: FEATURES.COMPLIANCE,\r\n\t\t\tcontrollerAs: 'ComplianceVM',\r\n\t\t\tcontroller: 'ComplianceCtrl',\r\n\t\t\turl: `/${FEATURES.COMPLIANCE}`,\r\n\t\t\ttemplateUrl: 'compliance/compliance.html'\r\n\t\t};\r\n\r\n\t\tconst fireCompliance = {\r\n\t\t\turl: '/fire',\r\n\t\t\tname: 'compliance.fire',\r\n\t\t\ttemplateUrl: 'compliance/views/fire-compliance.html'\r\n\t\t};\r\n\r\n\t\tconst miniSubCompliance = {\r\n\t\t\turl: '/mini-sub',\r\n\t\t\tname: 'compliance.mini-sub',\r\n\t\t\ttemplateUrl: 'compliance/views/mini-sub-compliance.html'\r\n\t\t};\r\n\r\n\t\tconst liftCompliance = {\r\n\t\t\turl: '/lift',\r\n\t\t\tname: 'compliance.lift',\r\n\t\t\ttemplateUrl: 'compliance/views/lift-compliance.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(complianceRoute);\r\n\t\t$stateProvider.state(fireCompliance);\r\n\t\t$stateProvider.state(miniSubCompliance);\r\n\t\t$stateProvider.state(liftCompliance);\r\n\t};\r\n\r\n\tconst registerBalanceSheetRoute = () => {\r\n\t\tconst balanceSheetRoute = {\r\n\t\t\tname: FEATURES.BALANCE_SHEET,\r\n\t\t\tcontroller: 'BalanceSheetCtrl',\r\n\t\t\tcontrollerAs: 'balanceSheetVm',\r\n\t\t\turl: `/${FEATURES.BALANCE_SHEET}?date`,\r\n\t\t\ttemplateUrl: 'financials/balance-sheet/balance-sheet.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(balanceSheetRoute);\r\n\t};\r\n\r\n\tconst registerAccountsHistoryRoute = () => {\r\n\t\tconst accountsHistoryRoute = {\r\n\t\t\tname: FEATURES.ACCOUNT_HISTORY,\r\n\t\t\tcontroller: 'AccountsHistoryCtrl',\r\n\t\t\tcontrollerAs: 'accountsHistoryVm',\r\n\t\t\turl: `/${FEATURES.ACCOUNT_HISTORY}?cardCode`,\r\n\t\t\ttemplateUrl: 'accounts/accounts-history/accounts-history.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(accountsHistoryRoute);\r\n\t};\r\n\r\n\tconst registerContractorsRollRoute = () => {\r\n\t\tconst contractorsRollRoute = {\r\n\t\t\tname: FEATURES.CONTRACTORS_ROLL,\r\n\t\t\tcontroller: 'ContractorsRollCtrl',\r\n\t\t\tcontrollerAs: 'contractorsRollVm',\r\n\t\t\turl: `/${FEATURES.CONTRACTORS_ROLL}?date`,\r\n\t\t\ttemplateUrl: 'financials/contractors-roll/contractors-roll.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(contractorsRollRoute);\r\n\t};\r\n\r\n\tconst registerClearanceCaptureRoute = () => {\r\n\t\tconst clearanceCaptureRoute = {\r\n\t\t\tname: FEATURES.CLEARANCE_CAPTURE,\r\n\t\t\tcontrollerAs: 'clearanceCaptureVm',\r\n\t\t\tcontroller: 'ClearanceCaptureCtrl',\r\n\t\t\turl: `/${FEATURES.CLEARANCE_CAPTURE}`,\r\n\t\t\ttemplateUrl: 'clearances/clearance-capture.html',\r\n\t\t\tresolve: {\r\n\t\t\t\tunused: _turnOffIsLoggingIn\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(clearanceCaptureRoute);\r\n\t};\r\n\r\n\tconst registerClearanceRequestRoute = () => {\r\n\t\tconst clearanceRequestRoute = {\r\n\t\t\tname: FEATURES.CLEARANCE_REQUEST,\r\n\t\t\tcontrollerAs: 'clearanceRequestVm',\r\n\t\t\tcontroller: 'ClearanceRequestCtrl',\r\n\t\t\turl: `/${FEATURES.CLEARANCE_REQUEST}`,\r\n\t\t\ttemplateUrl: 'clearances/clearance-request/clearance-request.html',\r\n\t\t\tresolve: {\r\n\t\t\t\tunused: _turnOffIsLoggingIn\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(clearanceRequestRoute);\r\n\t};\r\n\r\n\tconst registerFinancialSummaryRoute = () => {\r\n\t\tconst financialSummaryRoute = {\r\n\t\t\tname: FEATURES.FINANCIAL_SUMMARY,\r\n\t\t\tcontroller: 'FinancialSummaryCtrl',\r\n\t\t\tcontrollerAs: 'financialSummaryVm',\r\n\t\t\turl: `/${FEATURES.FINANCIAL_SUMMARY}?date`,\r\n\t\t\ttemplateUrl: 'financials/financial-summary/financial-summary.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(financialSummaryRoute);\r\n\t};\r\n\r\n\tconst registerIncomeStatementRoute = () => {\r\n\t\tconst incomeStatementRoute = {\r\n\t\t\tname: FEATURES.INCOME_STATEMENT,\r\n\t\t\tcontroller: 'IncomeStatementCtrl',\r\n\t\t\tcontrollerAs: 'incomeStatementVm',\r\n\t\t\turl: `/${FEATURES.INCOME_STATEMENT}?date`,\r\n\t\t\ttemplateUrl: 'financials/income-statement/income-statement.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(incomeStatementRoute);\r\n\t};\r\n\r\n\tconst registerPersonalDocumentsRoute = () => {\r\n\t\tconst personalDocumentsRoute = {\r\n\t\t\tname: FEATURES.PERSONAL_DOCUMENTS,\r\n\t\t\tcontroller: 'PersonalDocumentsCtrl',\r\n\t\t\tcontrollerAs: 'personalDocumentsVm',\r\n\t\t\turl: `/${FEATURES.PERSONAL_DOCUMENTS}?cardCode&folder`,\r\n\t\t\ttemplateUrl: 'personal-documents/personal-documents.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(personalDocumentsRoute);\r\n\t};\r\n\r\n\tconst registerCashflowStatementRoute = () => {\r\n\t\tconst cashflowStatementRoute = {\r\n\t\t\tname: FEATURES.CASHFLOW_STATEMENT,\r\n\t\t\tcontroller: 'CashflowStatementCtrl',\r\n\t\t\tcontrollerAs: 'cashflowStatementVm',\r\n\t\t\turl: `/${FEATURES.CASHFLOW_STATEMENT}?date`,\r\n\t\t\ttemplateUrl: 'financials/cashflow-statement/cashflow-statement.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(cashflowStatementRoute);\r\n\t};\r\n\r\n\tconst registerCashflowStatementNewRoute = () => {\r\n\t\tconst cashflowStatementNewRoute = {\r\n\t\t\tname: FEATURES.CASHFLOW_STATEMENT_NEW,\r\n\t\t\tcontroller: 'CashflowStatementNewCtrl',\r\n\t\t\tcontrollerAs: 'cashflowStatementNewVm',\r\n\t\t\turl: `/${FEATURES.CASHFLOW_STATEMENT_NEW}?date`,\r\n\t\t\ttemplateUrl: 'financials/cashflow-statement-new/cashflow-statement-new.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(cashflowStatementNewRoute);\r\n\t};\r\n\r\n\tconst registerPaymentAuthorisationRoute = () => {\r\n\t\tconst paymentAuthorisationRoute = {\r\n\t\t\tname: FEATURES.PAYMENT_AUTHORISATION,\r\n\t\t\tcontroller: 'PaymentAuthorisationCtrl',\r\n\t\t\tcontrollerAs: 'paymentAuthorisationVm',\r\n\t\t\turl: `/${FEATURES.PAYMENT_AUTHORISATION}?DBRef`,\r\n\t\t\ttemplateUrl: 'payment-authorisation/payment-authorisation.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(paymentAuthorisationRoute);\r\n\t};\r\n\r\n\tconst registerRentalsCaptureRoute = () => {\r\n\t\tconst rentalsCaptureRoute = {\r\n\t\t\tname: FEATURES.RENTALS_CAPTURE,\r\n\t\t\tcontrollerAs: 'rentalsCaptureVm',\r\n\t\t\tcontroller: 'RentalsCaptureCtrl',\r\n\t\t\turl: `/${FEATURES.RENTALS_CAPTURE}`,\r\n\t\t\ttemplateUrl: 'rentals/rentals-capture.html',\r\n\t\t\tresolve: {\r\n\t\t\t\tunused: _turnOffIsLoggingIn\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(rentalsCaptureRoute);\r\n\t};\r\n\r\n\tconst registerAuditsCaptureRoute = () => {\r\n\t\tconst auditsCaptureRoute = {\r\n\t\t\tname: FEATURES.AUDITS_CAPTURE,\r\n\t\t\tcontrollerAs: 'auditsCaptureVm',\r\n\t\t\tcontroller: 'AuditsCaptureCtrl',\r\n\t\t\turl: `/${FEATURES.AUDITS_CAPTURE}`,\r\n\t\t\ttemplateUrl: 'audits/audits-capture.html',\r\n\t\t\tresolve: {\r\n\t\t\t\tunused: _turnOffIsLoggingIn\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(auditsCaptureRoute);\r\n };\r\n\r\n\tconst registerAuditorsDashboardRoute = () => {\r\n\t\tconst auditorsDashboardRoute = {\r\n\t\t\tname: FEATURES.AUDITORS_DASHBOARD,\r\n\t\t\tcontrollerAs: 'auditorsDashboardVm',\r\n\t\t\tcontroller: 'AuditorsDashboardCtrl',\r\n\t\t\turl: `/${FEATURES.AUDITORS_DASHBOARD}`,\r\n\t\t\ttemplateUrl: 'auditors-dashboard/auditors-dashboard.html',\r\n\t\t\tresolve: {\r\n\t\t\t\tunused: _turnOffIsLoggingIn\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(auditorsDashboardRoute);\r\n };\r\n\r\n const registerWagesRollRoute = () => {\r\n const wagesRollRoute = {\r\n name: FEATURES.WAGES_ROLL,\r\n controller: 'WagesRollCtrl',\r\n controllerAs: 'wagesRollVm',\r\n url: `/${FEATURES.WAGES_ROLL}?date`,\r\n templateUrl: 'financials/wages-roll/wages-roll.html'\r\n };\r\n\r\n $stateProvider.state(wagesRollRoute);\r\n\t};\r\n\r\n\tconst registerTrusteeRoute = () => {\r\n\t\tconst trusteeRoute = {\r\n\t\t\tcontroller: 'TrusteeDashboardCtrl',\r\n\t\t\tcontrollerAs: 'TrusteeDashboardVM',\r\n\t\t\tname: FEATURES.TRUSTEE_DASHBOARD,\r\n\t\t\turl: `/${FEATURES.TRUSTEE_DASHBOARD}`,\r\n\t\t\ttemplateUrl: 'trustee-dashboard/trustee-dashboard.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(trusteeRoute);\r\n\t};\r\n\r\n\tconst registerIncomeVSBudgetRoute = () => {\r\n\t\tconst incomeVsBudgetRoute = {\r\n\t\t\tcontroller: 'IncomeVSBudgetCtrl',\r\n\t\t\tcontrollerAs: 'incomeVSBudgetVm',\r\n\t\t\tname: FEATURES.INCOME_VS_BUDGET,\r\n\t\t\turl: `/${FEATURES.INCOME_VS_BUDGET}`,\r\n\t\t\ttemplateUrl: 'financials/income-vs-budget/income-vs-budget.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(incomeVsBudgetRoute);\r\n\t};\r\n\r\n\tconst registerDebtorAgeAnalysisRoute = () => {\r\n\t\tconst debtorAgeAnalysisRoute = {\r\n\t\t\tcontroller: 'DebtorAgeAnalysisCtrl',\r\n\t\t\tcontrollerAs: 'debtorAgeAnalysisVm',\r\n\t\t\tname: FEATURES.DEBTOR_AGE_ANALYSIS,\r\n\t\t\turl: `/${FEATURES.DEBTOR_AGE_ANALYSIS}`,\r\n\t\t\ttemplateUrl: 'financials/debtor-age-analysis/debtor-age-analysis.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(debtorAgeAnalysisRoute);\r\n\t};\r\n\r\n\tconst registerFindAContractorRoute = () => {\r\n\t\tconst contractorRoute = {\r\n\t\t\tcontroller: 'FindAContractorCtrl',\r\n\t\t\tcontrollerAs: 'findAContractorVm',\r\n\t\t\tname: FEATURES.SHOW_FIND_A_CONTRACTOR,\r\n\t\t\turl: `/${FEATURES.SHOW_FIND_A_CONTRACTOR}`,\r\n\t\t\ttemplateUrl: 'contractors/find-a-contractor.html'\r\n\t\t};\r\n\r\n\t\t$stateProvider.state(contractorRoute);\r\n\t};\r\n\r\n\tregisterRoutes();\r\n};\r\n\r\nexport default RoutesRouterConfig;\r\n","class BuildingsService {\r\n\tconstructor(\r\n\t\t$q,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$interval,\r\n\t\t$rootScope,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService,\r\n\t\tAuthenticationService,\r\n\t\t$sce\r\n\t) {\r\n\t\tthis.$q = $q;\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$interval = $interval;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\t\tthis.AuthenticationService = AuthenticationService;\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.hasInitted = false;\r\n\r\n\t\tthis.$rootScope.$on('user-logged-in-load-building-data', (event, params) => {\r\n\t\t\tthis.init();\r\n\t\t});\r\n\r\n\t\t//this.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis._await = undefined;\r\n\t\tthis.buildingsData = {};\r\n\r\n\t\tthis.deferred = this.$q.defer();\r\n\t\tthis.intervalPromise = undefined;\r\n\t\tthis.promise = this.deferred.promise;\r\n\t\tthis.buildingsFeatures = null;\r\n\r\n\t\tconst currentUser = this.AuthenticationService.currentUser();\r\n\t\tif (currentUser) {\r\n\r\n\t\t\tlet currentlySelectedSchemeReference = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\t\t\tcurrentUser.BuildingProfiles = this.addBuildingImagesToArrayOfBuildingProfiles(currentUser.BuildingProfiles);\r\n\r\n\t\t\tlet selectedProfile = undefined;\r\n\r\n\t\t\tif(!currentlySelectedSchemeReference){\r\n\t\t\t\tselectedProfile = currentUser.BuildingProfiles && currentUser.BuildingProfiles.length > 0\r\n\t\t\t\t? currentUser.BuildingProfiles[0]\r\n\t\t\t\t: undefined\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tselectedProfile = currentUser.BuildingProfiles && currentUser.BuildingProfiles.length > 0\r\n\t\t\t\t? currentUser.BuildingProfiles.find(x => x.SchemeReference == currentlySelectedSchemeReference)\r\n\t\t\t\t: undefined\r\n\t\t\t}\r\n\r\n\t\t\tthis.buildingsData = {\r\n\t\t\t\tallBuildings: currentUser.BuildingProfiles,\r\n\t\t\t\tselectedBuilding: selectedProfile\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tif (currentUser && this.buildingsData['selectedBuilding']) {\r\n\t\t\tthis.LocalStorageService.save(\r\n\t\t\t\t'selectedBuildingRef',\r\n\t\t\t\tthis.buildingsData['selectedBuilding'].SchemeReference\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tthis.$rootScope.$on('building-reference-changed', (event, selectedBuildingRef) => {\r\n\t\t\tthis.setSelectedBuildingRef(selectedBuildingRef);\r\n\t\t});\r\n\r\n\t\tthis.hasInitted = true;\r\n\t}\r\n\r\n\taddBuildingImagesToArrayOfBuildingProfiles(arrayOfBuildingProfiles) {\r\n\r\n\t\tif(!!!arrayOfBuildingProfiles || arrayOfBuildingProfiles.length == 0){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst buildings = arrayOfBuildingProfiles;\r\n\t\tconst mapped = buildings.map(building => {\r\n\t\t const { SchemeReference: schemeReference } = building;\r\n\t\t const imgUrl = this.getTrustedBuildingImageUrl(schemeReference);\r\n\t\t return {\r\n\t\t\timgUrl,\r\n\t\t\t...building,\r\n\t\t\tisSelected: false\r\n\t\t };\r\n\t\t});\r\n\t\r\n\t\treturn mapped;\r\n\t }\r\n\r\n\tgetTrustedBuildingImageUrl(schemeReference) {\r\n\t\tconst imgUrl = this.$sce.trustAsResourceUrl(\r\n\t\t\t`${PretorCDNAddress}/images/buildings/${schemeReference}/${schemeReference}.png`\r\n\t\t);\r\n\t\tconst trustedUrl = this.$sce.valueOf(imgUrl);\r\n\t\treturn trustedUrl;\r\n\t};\r\n\r\n\tloadBySchemeRef(schemeRef) {\r\n\t\tconst currentUser = this.AuthenticationService.currentUser();\r\n\t\tif (currentUser) {\r\n\t\t\tthis.buildingsData = {\r\n\t\t\t\tallBuildings: _.sortBy(currentUser.BuildingProfiles, [\r\n\t\t\t\t\t(bp) => {\r\n\t\t\t\t\t\treturn bp.SchemeName;\r\n\t\t\t\t\t}\r\n\t\t\t\t]).map((buildingProfile) => {\r\n\t\t\t\t\tbuildingProfile.SchemeReference = buildingProfile.SchemeReference.trim();\r\n\t\t\t\t\treturn buildingProfile;\r\n\t\t\t\t}),\r\n\t\t\t\tselectedBuilding: undefined\r\n\t\t\t};\r\n\r\n\t\t\tconst building = _.find(this.buildingsData.allBuildings, (buildingProfile) => {\r\n\t\t\t\tlet found = false;\r\n\t\t\t\tfound = buildingProfile.SchemeReference == schemeRef;\r\n\t\t\t\treturn found;\r\n\t\t\t});\r\n\t\t\tif (building) {\r\n\t\t\t\tthis.buildingsData.selectedBuilding = building;\r\n\t\t\t\treturn this.$q.resolve(building);\r\n\t\t\t}\r\n\t\t\treturn this.$q.reject('BuildingsService: Building information could not be found...');\r\n\t\t} else {\r\n\t\t\treturn this.$q.reject('BuildingsService: User information could not be found...');\r\n\t\t}\r\n\t}\r\n\r\n\tsetSelectedBuildingRef(buildingRef) {\r\n\t\tif (!this._await) {\r\n\t\t\tthis._await = this.$timeout(() => {\r\n\t\t\t\tif (typeof buildingRef === 'object' && buildingRef.hasOwnProperty('SchemeReference'))\r\n\t\t\t\t\tbuildingRef = buildingRef.SchemeReference;\r\n\r\n\t\t\t\tif (this.buildingsData && this.buildingsData.allBuildings) {\r\n\t\t\t\t\tconst selectedBuilding = _.find(this.buildingsData.allBuildings, (building) => {\r\n\t\t\t\t\t\treturn building.SchemeReference === buildingRef;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tselectedBuilding &&\r\n\t\t\t\t\t\tselectedBuilding.hasOwnProperty('SchemeReference') &&\r\n\t\t\t\t\t\tbuildingRef !== selectedBuilding.SchemeReference\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tthis.buildingsData.selectedBuilding = selectedBuilding;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._await = undefined;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.promise.then((results) => {\r\n\t\t\t\t\t\tconst selectedBuilding = _.find(this.buildingsData.allBuildings, (building) => {\r\n\t\t\t\t\t\t\treturn building.SchemeReference === buildingRef;\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif (buildingRef !== selectedBuilding.SchemeReference)\r\n\t\t\t\t\t\t\tthis.buildingsData.selectedBuilding = selectedBuilding;\r\n\t\t\t\t\t\tthis._await = undefined;\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}, this.Utility.apiRetry.value / 2);\r\n\t\t}\r\n\t}\r\n\r\n\tgetSelectedBuildingRef() {\r\n\t\tlet selectedBuildingRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\r\n\t\tif (selectedBuildingRef && typeof selectedBuildingRef === 'object')\r\n\t\t\tselectedBuildingRef = selectedBuildingRef.SchemeReference;\r\n\r\n\t\tif (!selectedBuildingRef) {\r\n\t\t\tlet selectedBuildingRefQueryString = this.Utility.QueryString('DBRef');\r\n\t\t\tif (selectedBuildingRefQueryString) {\r\n\t\t\t\tthis.selectedBuildingRef = selectedBuildingRefQueryString.toUpperCase();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn selectedBuildingRef;\r\n\t}\r\n\r\n\t//TODO: THis must be called by the 'My Profile' Ctrl\r\n\tasync getSelectedBuildingReferenceObject() {\r\n\t\tconst deferred = this.$q.defer();\r\n\t\tconst promise = deferred.promise;\r\n\r\n\t\tlet selectedBuildingObj;\r\n\t\tlet selectedBuilding = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\t\tif (!selectedBuilding) {\r\n\t\t\tlet selectedBuildingRefQueryString = this.Utility.QueryString('DBRef');\r\n\t\t\tif (selectedBuildingRefQueryString) {\r\n\t\t\t\tthis.selectedBuildingRef = selectedBuildingRefQueryString.toUpperCase();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (selectedBuilding) {\r\n\t\t\tif (typeof selectedBuilding === 'object') {\r\n\t\t\t\treturn deferred.resolve(selectedBuilding);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n\t\tif (!userProfile) {\r\n\t\t\tconst awaitedPromise = await this.$interval(\r\n\t\t\t\t() => {\r\n\t\t\t\t\tuserProfile = this.LocalStorageService.retrieve('userProfile');\r\n\t\t\t\t\tif (userProfile) {\r\n\t\t\t\t\t\tthis.$interval.cancel(awaitedPromise);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t350,\r\n\t\t\t\t1\r\n\t\t\t);\r\n\t\t}\r\n\r\n\r\n\t\tselectedBuildingObj = userProfile.BuildingProfiles.find((buildingProf) => {\r\n\t\t\tconst buildingRef = buildingProf.SchemeReference.toLowerCase().trim();\r\n\t\t\tif (buildingRef === selectedBuilding.toLowerCase().trim()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (!selectedBuildingObj) {\r\n\t\t\tselectedBuilding = await this.loadBySchemeRef(selectedBuilding);\r\n\t\t}\r\n\r\n\t\tif (!selectedBuilding) {\r\n\t\t\treturn deferred.reject(`Error while retrieving 'Selected Building Reference'`);\r\n\t\t}\r\n\r\n\t\t//return selectedBuildingObj;\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getBuildingFeatureSettings(schemeRef) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('DashboardFeature');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/settings/links');\r\n\t\t\t\turl = await this.InternalLinksService.getLink('DashboardFeature');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.basicHeaders;\r\n\r\n\t\t\turl = `${url.replace('{schemeRef}', schemeRef)}`;\r\n\r\n\t\t\tif (!!!headers) {\r\n\t\t\t\tthrow new Error(`Could not load headers for request: ${url}`);\r\n\t\t\t}\r\n\r\n\t\t\tconst results = await this.$http.get(url, headers);\r\n\r\n\t\t\tconst { Data: data, WasSuccessful: wasSuccessful } = results.data;\r\n\r\n\t\t\tif (wasSuccessful) {\r\n\t\t\t\tthis.buildingsFeatures = {\r\n\t\t\t\t\t...this.buildingsFeatures,\r\n\t\t\t\t\t[schemeRef.toUpperCase().trim()]: data\r\n\t\t\t\t};\r\n\r\n\t\t\t\tthis.LocalStorageService.save('buildingsFeatures', this.buildingsFeatures);\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Error while loading the Dashboard feature flag for ${schemeRef}`);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tif (this.buildingsFeatures && `${schemeRef}` in this.buildingsFeatures) {\r\n\t\t\t\tdelete this.buildingsFeatures[schemeRef];\r\n\t\t\t}\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$q,\r\n\t$http,\r\n\tUtility,\r\n\t$timeout,\r\n\t$interval,\r\n\t$rootScope,\r\n\tLocalStorageService,\r\n\tInternalLinksService,\r\n\tAuthenticationService,\r\n\t$sce\r\n) =>\r\n\tnew BuildingsService(\r\n\t\t$q,\r\n\t\t$http,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$interval,\r\n\t\t$rootScope,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService,\r\n\t\tAuthenticationService,\r\n\t\t$sce\r\n\t);\r\n","/* @ngInject */\r\n\r\nexport default function AuthInterceptorService(\r\n\t$q,\r\n\t$state,\r\n\t$window,\r\n\t$timeout,\r\n\t$location,\r\n\t$rootScope,\r\n\tPretorCache,\r\n\t$cacheFactory,\r\n\tLocalStorageService,\r\n\tAuthorizationService\r\n) {\r\n\tvar cacheName = 'pretorCache';\r\n\tvar isLoaderCached = false;\r\n\tvar cache = $cacheFactory(cacheName);\r\n\tvar sessionPromise;\r\n\tvar _intervalPromise;\r\n\tvar requestsCollection = [];\r\n\r\n\t/**\r\n\t * Function for attaching the authorization token for each call\r\n\t * @param {Object} config The config object\r\n\t * @returns {Object} config The config object\r\n\t */\r\n\tfunction request(config) {\r\n\t\tvar requestObj;\r\n\t\tconfig.headers = config && config.hasOwnProperty('headers') ? config.headers : {};\r\n\t\tconfig = setSchemeRef(config);\r\n\r\n\t\tvar url = config.url.toLowerCase().trim();\r\n\r\n\t\tvar oldRequest = _getOldRequest(url);\r\n\r\n\t\tif (oldRequest) return $q.when(config);\r\n\r\n\t\t_saveRequest(url);\r\n\r\n\t\tif (\r\n\t\t\turl.indexOf(pretorOnlineUrl.toLowerCase()) > -1 &&\r\n\t\t\turl.indexOf('link') == -1 &&\r\n\t\t\turl.indexOf('api') > -1 &&\r\n\t\t\turl.indexOf('impersonate') === -1 &&\r\n\t\t\turl.indexOf('schemelogin') === -1 &&\r\n\t\t\turl.indexOf('contactus') === -1 &&\r\n\t\t\turl.indexOf('clearance') === -1 &&\r\n\t\t\turl.indexOf('contractors') === -1\r\n\t\t) {\r\n\t\t\tvar session = LocalStorageService.retrieve('userSession');\r\n\t\t\tvar user = LocalStorageService.retrieve('userProfile');\r\n\t\t\tif (session && user) {\r\n\t\t\t\tif (session['SessionToken'] && user['UserName']) {\r\n\t\t\t\t\trequestObj = _continueRequest(config, session, user);\r\n\t\t\t\t} else {\r\n\t\t\t\t\trequestObj = $q.reject(config);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\trequestObj = $q.when(config);\r\n\t\t}\r\n\r\n\t\tif (requestObj) {\r\n\t\t\trequestObj.finally(function(results) {\r\n\t\t\t\t_removeRequest(url);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn requestObj;\r\n\t}\r\n\r\n\t/**\r\n\t * Ensures that the Scheme Reference header is set in all XHR calls\r\n\t * @param {object} config The configuration object\r\n\t * @returns {object} config The configuration object with scheme reference\r\n\t */\r\n\tfunction setSchemeRef(config) {\r\n\t\tconst url = config.url.toLowerCase().trim();\r\n\r\n\t\tlet schemeRef = LocalStorageService.retrieve('selectedBuildingRef');\r\n\t\tif (schemeRef && typeof schemeRef === 'object') {\r\n\t\t\tschemeRef = schemeRef.SchemeReference;\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\turl.indexOf(pretorOnlineUrl.toLowerCase()) > -1 &&\r\n\t\t\turl.indexOf('link') === -1 &&\r\n\t\t\turl.indexOf('api') > -1 &&\r\n\t\t\turl.indexOf('impersonate') === -1 &&\r\n\t\t\turl.indexOf('contactus') === -1\r\n\t\t) {\r\n\t\t\tif (schemeRef) {\r\n\t\t\t\tconfig.headers.schemeRef = schemeRef;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\t/**\r\n\t * Function for handling errors\r\n\t * @param {Object} rejection The rejection object\r\n\t * @returns {Promise} The rejected promise\r\n\t */\r\n\tfunction responseError(rejection) {\r\n\t\tconst { status, config } = rejection;\r\n\r\n\t\tif (!config) {\r\n\t\t\treturn $q.reject(rejection);\r\n\t\t}\r\n\r\n\t\tlet url = config.url.toLowerCase();\r\n\t\tif (status === 401 && (!url.includes('auth') || url.includes('payment'))) {\r\n\t\t\tconst path = AuthorizationService.unProtectedRoute;\r\n\t\t\t$state.go(path);\r\n\t\t}\r\n\t\treturn $q.reject(rejection);\r\n\t}\r\n\r\n\tfunction _continueRequest(config, session, user) {\r\n\t\tvar requestObj;\r\n\t\tvar token = session.SessionToken;\r\n\t\tif (token) {\r\n\t\t\tconfig.headers.sessionToken = config.headers.sessionToken || token;\r\n\t\t\tconfig.headers.userName = config.headers.userName || user.UserName;\r\n\r\n\t\t\trequestObj = $q.when(config);\r\n\t\t} else {\r\n\t\t\trequestObj = $q.reject(config);\r\n\t\t}\r\n\r\n\t\treturn requestObj;\r\n\t}\r\n\r\n\tfunction _getOldRequest(url) {\r\n\t\tvar oldRequest = _.find(requestsCollection, function(req) {\r\n\t\t\tvar found = req.toLowerCase().trim() === url;\r\n\t\t\treturn found;\r\n\t\t});\r\n\r\n\t\treturn oldRequest;\r\n\t}\r\n\r\n\tfunction _saveRequest(url) {\r\n\t\trequestsCollection.push(url);\r\n\t}\r\n\r\n\tfunction _removeRequest(url) {\r\n\t\t$timeout(function() {\r\n\t\t\trequestsCollection = _.remove(requestsCollection, function(request) {\r\n\t\t\t\treturn request.toLowerCase().trim() === url;\r\n\t\t\t});\r\n\t\t}, 1500);\r\n\t}\r\n\r\n\treturn {\r\n\t\trequest: request,\r\n\t\tresponseError: responseError\r\n\t};\r\n}\r\n","//@ts-check\r\n\r\nclass AuthenticationService {\r\n\tconstructor($q, $http, $window, Utility, $timeout, $rootScope, LocalStorageService, InternalLinksService, $sce) {\r\n\t\tthis.$q = $q;\r\n\t\tthis.$http = $http;\r\n\t\tthis.$window = $window;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\t\tthis.$sce = $sce;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.links = undefined;\r\n\t\tthis._await = undefined;\r\n\t\tthis.isAuthorized = false;\r\n\t}\r\n\r\n\tasync registerUser(userDetails) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('RegisterUser');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('RegisterUser');\r\n\t\t\t}\r\n\r\n\t\t\tlet results = await this.$http.post(url, userDetails);\r\n\t\t\tresults = results.hasOwnProperty('data') ? results.data : results;\r\n\r\n\t\t\tconst oldUserProfile = this.LocalStorageService.retrieve('userProfile');\r\n\r\n\t\t\tdelete userDetails.Password;\r\n\t\t\tuserDetails.FullName = userDetails.FirstName + ' ' + userDetails.LastName;\r\n\r\n\t\t\t//Potential Bug/Issue\r\n\t\t\tconst updatedUserProfile = {\r\n\t\t\t\t...oldUserProfile,\r\n\t\t\t\tuserDetails\r\n\t\t\t};\r\n\r\n\t\t\tthis.LocalStorageService.save('userProfile', this._fixBDRefTrim(updatedUserProfile));\r\n\t\t\tthis.$rootScope.$broadcast('user-profile-updated', updatedUserProfile);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync dontShowRegisterPrompt() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst currentUserDetails = this.currentUser();\r\n\t\t\tif (!currentUserDetails) {\r\n\t\t\t\tthrow new Error('No authenticated user found..');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ChangePromptFlag');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ChangePromptFlag');\r\n\t\t\t}\r\n\r\n\t\t\tconst payLoad = {\r\n\t\t\t\tShowPrompt: false,\r\n\t\t\t\tProfileId: currentUserDetails.ProfileId\r\n\t\t\t};\r\n\r\n\t\t\tconst results = await this.$http.post(url, payLoad);\r\n\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\tconst oldUserProfile = this.LocalStorageService.retrieve('userProfile');\r\n\t\t\t\toldUserProfile.ProfileReminder.ShowUserAuthenticationNotSecure = false;\r\n\t\t\t\tthis.LocalStorageService.save('userProfile', this._fixBDRefTrim(oldUserProfile));\r\n\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Error while trying to update the 'Register Prompt'`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync loginUser(userName, password) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!userName) {\r\n\t\t\t\tthrow new Error('No username found..');\r\n\t\t\t}\r\n\t\t\tif (!password) {\r\n\t\t\t\tthrow new Error('No password found..');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('UserLogin');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('UserLogin');\r\n\t\t\t}\r\n\r\n\t\t\tconst payLoad = {\r\n\t\t\t\tUserName: userName,\r\n\t\t\t\tPassword: password\r\n\t\t\t};\r\n\r\n\t\t\tthis._notifyLoadingIndicator(true);\r\n\t\t\tlet sessionResult = await this.$http.post(url, payLoad);\r\n\r\n\t\t\tsessionResult = sessionResult.hasOwnProperty('data') ? sessionResult.data : sessionResult;\r\n\t\t\tlet profileResult = await this.requestProfile(sessionResult.SessionToken);\r\n\r\n\t\t\tprofileResult = this._fixBDRefTrim(profileResult);\r\n\t\t\tawait this.LocalStorageService.save('userSession', sessionResult);\r\n\t\t\tthis.$rootScope.$broadcast('user-session-set', undefined);\r\n\r\n\t\t\tawait this.LocalStorageService.save('userProfile', profileResult);\r\n\r\n\t\t\tconst results = [sessionResult, profileResult];\r\n\r\n\t\t\tthis._notifyLoadingIndicator(false);\r\n\t\t\tthis.$rootScope.$broadcast('user-logged-in', results);\r\n\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t} catch (err) {\r\n\t\t\tthis._notifyLoadingIndicator(false, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\t\tthis._notifyLoadingIndicator(false);\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync userForgotPassword(userName) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!userName) {\r\n\t\t\t\tthrow new Error('No username found..');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('ForgotPassword');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('ForgotPassword');\r\n\t\t\t}\r\n\r\n\t\t\tconst payLoad = {\r\n\t\t\t\tUserName: userName\r\n\t\t\t};\r\n\r\n\t\t\tlet results = await this.$http.post(url, payLoad);\r\n\t\t\tresults = results.hasOwnProperty('data') ? results.data : results;\r\n\r\n\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Error while calling 'Reset Password'.`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync promptForNewPassword(token) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!token) {\r\n\t\t\t\tthrow new Error('No reset password token found..');\r\n\t\t\t}\r\n\r\n\t\t\tthis.LocalStorageService.delete('resetPasswordToken');\r\n\t\t\tthis.$rootScope.$broadcast('show-reset-password-auth-modal', token);\r\n\t\t\tif (this.LocalStorageService.retrieve('resetPasswordToken')) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve('User was prompt for the new password'));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`'Reset Password Token' could not be saved.`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync userResetPassword(newPassword, resetToken) {\r\n\r\n\t\tlet promise, promiseHandler;\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tif (!resetToken) {\r\n\t\t\t\tthrow new Error('No reset password token found..');\r\n\t\t\t}\r\n\r\n\t\t\tif (!newPassword) {\r\n\t\t\t\tthrow new Error('No new password provided..');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = this.InternalLinksService.getLink('ResetPassword');\r\n\t\t\tif (!url) {\r\n\t\t\t\tthis.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = this.InternalLinksService.getLink('ResetPassword');\r\n\t\t\t}\r\n\r\n\t\t\tconst payLoad = {\r\n\t\t\t\tToken: resetToken,\r\n\t\t\t\tNewPassword: newPassword\r\n\t\t\t};\r\n\t\t\tlet results = await this.$http.post(url, payLoad);\r\n\r\n\t\t\tresults = results.hasOwnProperty('data') ? results.data : results;\r\n\r\n\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Error while 'Resetting User Password'.`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync authorize(forceRefresh) {\r\n\t\tlet results, promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tconst urlAuthToken = this.Utility.QueryString('authtoken');\r\n\t\t\tconst currentUser = this.currentUser();\r\n\r\n\r\n\t\t\tthis._notifyLoadingIndicator(true);\r\n\t\t\t//console.log(\"forceRefresh: \" + JSON.stringify(forceRefresh));\r\n\t\t\tif (forceRefresh) {\r\n\t\t\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\t\t\t\tresults = await this.reAuthenticateUser(userProfile);\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t\t} else if (urlAuthToken) {\r\n\t\t\t\t//console.log(\"urlAuthToken: \" + JSON.stringify(urlAuthToken));\r\n\t\t\t\tresults = await this.authenticateUserViaRest(urlAuthToken);\r\n\t\t\t\t//is.LocalStorageService.clearAll();\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t\t} else if (currentUser) {\r\n\t\t\t\t//console.log(\"currentUser: \" + JSON.stringify(currentUser));\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(currentUser));\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tconst errMsg = `Error while tying to Authorize user`;\r\n\t\t\tconsole.error(errMsg, err);\r\n\r\n\t\t\tthis._notifyLoadingIndicator(false, err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t} finally {\r\n\t\t\tconst lastLoggedIn = moment().format('DD MMM YYYY HH:mm A');\r\n\t\t\tthis.LocalStorageService.save('lastLoggedIn', lastLoggedIn);\r\n\t\t\tconst userDetails = results ? results : this._fixBDRefTrim(results);\r\n\t\t\tconst profile = userDetails && userDetails.length > 0 ? userDetails[1] : userDetails;\r\n\t\t\tthis._notifyLoadingIndicator(false);\r\n\t\t\t//console.log(\"profile: \" + JSON.stringify(profile));\r\n\t\t\t//console.log(\"userDetails: \" + JSON.stringify(userDetails));\r\n\r\n\t\t\tthis.$rootScope.$broadcast('user-logged-in-load-building-data', undefined);\r\n\t\t\tthis.$rootScope.$broadcast('user-logged-in', userDetails);\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync authorizeClearanceToken(clearanceToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst results = await this.authenticateUserViaRestWithClearanceToken(clearanceToken);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\tasync authorizeRentalsToken(rentalsToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst results = await this.authenticateUserViaRestWithRentalsToken(rentalsToken);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync authorizeAuditsToken(auditsToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst results = await this.authenticateUserViaRestWithAuditsToken(auditsToken);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync authenticateUserViaRestWithAuditsToken(auditsToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst auditsResult = await this.authenticateByAuditsToken(auditsToken);\r\n\t\t\tif (!!auditsResult) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(auditsResult));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error('Error, user with audits token: ' + auditsToken + ' could not be authenticated');\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync authenticateByAuditsToken(credentialToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tlet url = await this.InternalLinksService.getLink('AuthenticateAuditsToken');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('AuthenticateAuditsToken');\r\n\t\t\t}\r\n\r\n\t\t\turl = url + '?token=' + credentialToken;\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Error while authenticating user by token: ', err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\t\r\n\t_fixBDRefTrim(userProfile) {\r\n\t\tconst results = _.map(userProfile.BuildingProfiles, (building) => {\r\n\t\t\tbuilding.SchemeReference = building.SchemeReference.trim();\r\n\t\t\treturn building;\r\n\t\t});\r\n\r\n\t\tuserProfile.BuildingProfiles = _.sortBy(results, (pb) => {\r\n\t\t\treturn pb.SchemeName;\r\n\t\t});\r\n\r\n\t\tuserProfile.BuildingProfiles = this.addBuildingImagesToArrayOfBuildingProfiles(userProfile.BuildingProfiles)\r\n\r\n\t\treturn userProfile;\r\n\t}\r\n\r\n\taddBuildingImagesToArrayOfBuildingProfiles(arrayOfBuildingProfiles) {\r\n\r\n\t\tif (!!!arrayOfBuildingProfiles || arrayOfBuildingProfiles.length == 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst buildings = arrayOfBuildingProfiles;\r\n\t\tconst mapped = buildings.map(building => {\r\n\t\t\tconst { SchemeReference: schemeReference } = building;\r\n\t\t\tconst imgUrl = this.getTrustedBuildingImageUrl(schemeReference);\r\n\t\t\treturn {\r\n\t\t\t\timgUrl,\r\n\t\t\t\t...building,\r\n\t\t\t\tisSelected: false\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn mapped;\r\n\t}\r\n\r\n\tgetTrustedBuildingImageUrl(schemeReference) {\r\n\t\tconst imgUrl = this.$sce.trustAsResourceUrl(\r\n\t\t\t`${PretorCDNAddress}/images/buildings/${schemeReference}/${schemeReference}.png`\r\n\t\t);\r\n\t\tconst trustedUrl = this.$sce.valueOf(imgUrl);\r\n\t\treturn trustedUrl;\r\n\t};\r\n\r\n\t/**\r\n\t * Helper with logic for authenticating user via the Authentication REST API by an auth => token\r\n\t * @async\r\n\t * @param {string} authToken The authentication token string\r\n\t * @returns {Promise} The Promise of type Collection of results.\r\n\t */\r\n\tasync authenticateUserViaRest(authToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst sessionResult = await this.authenticateByToken(authToken);\r\n\r\n\t\t\tif (!!sessionResult && sessionResult.hasOwnProperty('SessionToken')) {\r\n\t\t\t\tlet profileResult = await this.requestProfile(sessionResult.SessionToken);\r\n\r\n\t\t\t\tprofileResult = this._fixBDRefTrim(profileResult);\r\n\t\t\t\tsessionResult.AuthToken = authToken;\r\n\t\t\t\tawait this.LocalStorageService.save('userSession', sessionResult);\r\n\t\t\t\tthis.$rootScope.$broadcast('user-session-set', undefined);\r\n\r\n\t\t\t\tawait this.LocalStorageService.save('userProfile', profileResult);\r\n\r\n\t\t\t\tconst results = [sessionResult, profileResult];\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error('Error while authenticating with the provided token.');\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\t\t//this.$rootScope.$broadcast('user-logged-in-load-building-data', undefined);\r\n\t\t//this.$rootScope.$broadcast('user-logged-in', userDetails);\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync authenticateUserViaRestWithClearanceToken(clearanceToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst clearanceResult = await this.authenticateByClearanceToken(clearanceToken);\r\n\t\t\tif (!!clearanceResult) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(clearanceResult));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error('Error, user with clearance token: ' + clearanceToken + ' could not be authenticated');\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync authenticateUserViaRestWithRentalsToken(rentalsToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst rentalsResult = await this.authenticateByRentalsToken(rentalsToken);\r\n\t\t\tif (!!rentalsResult) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(rentalsResult));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error('Error, user with rentals token: ' + rentalsToken + ' could not be authenticated');\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync reAuthenticateUser(userProfile) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet profileId = undefined;\r\n\t\t\tif (userProfile) {\r\n\t\t\t\tif (userProfile.hasOwnProperty('ProfileId')) {\r\n\t\t\t\t\tprofileId = userProfile.ProfileId;\r\n\t\t\t\t} else if (userProfile.hasOwnProperty('WebProfileId')) {\r\n\t\t\t\t\tprofileId = userProfile.WebProfileId;\r\n\t\t\t\t} else if (userProfile.hasOwnProperty('Id')) {\r\n\t\t\t\t\tprofileId = userProfile.Id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('CreateSessionByProfileId');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('CreateSessionByProfileId');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{profileId}', profileId);\r\n\r\n\t\t\tif (profileId) {\r\n\t\t\t\t//call REST API Auth(CreateSessionByProfileId)\r\n\t\t\t\tlet sessionResult = await this.$http.post(url);\r\n\t\t\t\t//Save the new user session\r\n\t\t\t\tsessionResult = sessionResult.data ? sessionResult.data : sessionResult;\r\n\r\n\t\t\t\tawait this.LocalStorageService.save('userSession', sessionResult);\r\n\t\t\t\tthis.$rootScope.$broadcast('user-session-set', undefined);\r\n\r\n\r\n\t\t\t\t//Call REST API Auth(GetProfileById)\r\n\t\t\t\turl = this.InternalLinksService.getLink('RequestProfile');\r\n\t\t\t\turl = url.replace('{tokenString}', sessionResult.SessionToken);\r\n\t\t\t\tlet profileResults = await this.$http.get(url);\r\n\t\t\t\t//Save Profile\r\n\t\t\t\tprofileResults = profileResults.data\r\n\t\t\t\t\t? this._fixBDRefTrim(profileResults.data)\r\n\t\t\t\t\t: this._fixBDRefTrim(profileResults);\r\n\r\n\t\t\t\tthis.LocalStorageService.save('userProfile', profileResults);\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve([sessionResult, profileResults]));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(`Could not get the user's profile ID`);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.LocalStorageService.clear();\r\n\t\t\tthis.$window.location = '/';\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync requestProfile(tokenString) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('RequestProfile');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('RequestProfile');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{tokenString}', tokenString);\r\n\r\n\t\t\tconst headers = this._unauthenticatedHeader;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tconst profile = this._mapProfile(results.data);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(this._fixBDRefTrim(profile)));\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Error while retrieving user session profile: ', err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n\t * Mapped the raw profile from the server into an angular profile\r\n\t * @param {object} profile Raw profile to be mapped\r\n\t * @returns {object} mappedProfile The mapped profile\r\n\t */\r\n\t_mapProfile(profile) {\r\n\t\tconst Id = profile.WebProfileId;\r\n\t\tconst UserName = profile.WebUsername || profile.UserName;\r\n\r\n\t\tconst mappedProfile = {\r\n\t\t\tBuildingProfiles: profile.BuildingProfiles,\r\n\t\t\tCurrentPasswordCredentialId: profile.CurrentPasswordCredentialId,\r\n\t\t\tDateCreated: profile.DateCreated,\r\n\t\t\tIsActiveDirectoryUser: profile.IsActiveDirectoryUser,\r\n\t\t\tIsAnonymous: profile.IsAnonymous,\r\n\t\t\tProfileReminder: profile.ProfileReminder,\r\n\t\t\tMasterProfileId: profile.MasterProfileId,\r\n\t\t\tFullName: profile.FullName,\r\n\t\t\tId,\r\n\t\t\tUserName\r\n\t\t};\r\n\r\n\t\treturn mappedProfile;\r\n\t}\r\n\r\n\tasync authenticateByToken(credentialToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('AuthenticateByToken');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('AuthenticateByToken');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this._unauthenticatedHeader;\r\n\t\t\turl = url.replace('{credentialToken}', credentialToken);\r\n\t\t\tconst results = await this.$http.get(url, { headers });\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Error while authenticating user by token: ', err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync authenticateByClearanceToken(credentialToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tlet url = await this.InternalLinksService.getLink('AuthenticateClearanceToken');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('AuthenticateClearanceToken');\r\n\t\t\t}\r\n\r\n\t\t\turl = url + '?token=' + credentialToken;\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Error while authenticating user by token: ', err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync authenticateByRentalsToken(credentialToken) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tlet url = await this.InternalLinksService.getLink('AuthenticateRentalsToken');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('links', true);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('AuthenticateRentalsToken');\r\n\t\t\t}\r\n\r\n\t\t\turl = url + '?token=' + credentialToken;\r\n\t\t\tconst results = await this.$http.get(url);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Error while authenticating user by token: ', err);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tcurrentUser() {\r\n\t\tconst currentUser = this.LocalStorageService.retrieve('userProfile');\r\n\t\treturn currentUser;\r\n\t}\r\n\r\n\tlogout() {\r\n\t\tthis.LocalStorageService.clearAll();\r\n\t\tthis.$rootScope.$broadcast('user-logged-out');\r\n\t}\r\n\r\n\timpersonateUser(userName) {\r\n\t\tconst deferred = this.$q.defer();\r\n\t\tconst promise = deferred.promise;\r\n\r\n\t\t//Possible Impersonation Error\r\n\t\t//const userName = this.Utility.QueryString('impersonateUser');\r\n\r\n\t\tlet loadLinksPromise;\r\n\t\tlet url = this.InternalLinksService.getLink('ImpersonateUser');\r\n\r\n\t\tif (!url) loadLinksPromise = this.InternalLinksService.getLinks('/api/accounts/links');\r\n\t\telse {\r\n\t\t\tconst linksDeferred = this.$q.defer();\r\n\t\t\tloadLinksPromise = linksDeferred.promise;\r\n\t\t\tlinksDeferred.resolve();\r\n\t\t}\r\n\r\n\t\tif (!userName) deferred.reject('No user name provided...');\r\n\r\n\t\tloadLinksPromise.then(() => {\r\n\t\t\tif (!url) url = this.InternalLinksService.getLink('ImpersonateUser');\r\n\r\n\t\t\turl = url.replace('{userName}', userName);\r\n\r\n\t\t\tthis._notifyLoadingIndicator(true);\r\n\t\t\tthis.$http.get(url).then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tconst userAuthToken = results.hasOwnProperty('data') ? results.data : results;\r\n\r\n\t\t\t\t\tthis.authenticateUserViaRest(userAuthToken).then(\r\n\t\t\t\t\t\t(results) => {\r\n\t\t\t\t\t\t\tthis._notifyLoadingIndicator(false);\r\n\t\t\t\t\t\t\tconst lastLoggedIn = moment().format('DD MMM YYYY HH:mm A');\r\n\t\t\t\t\t\t\tthis.LocalStorageService.save('lastLoggedIn', lastLoggedIn);\r\n\t\t\t\t\t\t\tthis.$rootScope.$broadcast('user-logged-in', results);\r\n\t\t\t\t\t\t\tdeferred.resolve(results);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\t\tthis._notifyLoadingIndicator(false, err);\r\n\t\t\t\t\t\t\tdeferred.reject(err);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t);\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tthis._notifyLoadingIndicator(false, err);\r\n\t\t\t\t\tdeferred.reject(err);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tschemeLogin(schemeReference) {\r\n\t\tconst deferred = this.$q.defer();\r\n\t\tconst promise = deferred.promise;\r\n\r\n\t\tlet loadLinksPromise;\r\n\t\tlet url = this.InternalLinksService.getLink('SchemeLogin');\r\n\r\n\t\tif (!url) loadLinksPromise = this.InternalLinksService.getLinks('/api/accounts/links');\r\n\t\telse {\r\n\t\t\tconst linksDeferred = this.$q.defer();\r\n\t\t\tloadLinksPromise = linksDeferred.promise;\r\n\t\t\tlinksDeferred.resolve();\r\n\t\t}\r\n\r\n\t\tif (!schemeReference) deferred.reject('No scheme ref name provided...');\r\n\r\n\t\tloadLinksPromise.then(() => {\r\n\t\t\tif (!url) url = this.InternalLinksService.getLink('SchemeLogin');\r\n\r\n\t\t\turl = url.replace('{schemeReference}', schemeReference);\r\n\r\n\t\t\tthis._notifyLoadingIndicator(true);\r\n\t\t\tthis.$http.get(url).then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tconst userAuthToken = results.hasOwnProperty('data') ? results.data : results;\r\n\r\n\t\t\t\t\tthis.authenticateUserViaRest(userAuthToken).then(\r\n\t\t\t\t\t\t(results) => {\r\n\t\t\t\t\t\t\tthis._notifyLoadingIndicator(false);\r\n\t\t\t\t\t\t\tdebugger;\r\n\t\t\t\t\t\t\tconst lastLoggedIn = moment().format('DD MMM YYYY HH:mm A');\r\n\t\t\t\t\t\t\tthis.LocalStorageService.save('lastLoggedIn', lastLoggedIn);\r\n\t\t\t\t\t\t\tthis.$rootScope.$broadcast('user-logged-in', results);\r\n\t\t\t\t\t\t\tdeferred.resolve(results);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\t\tthis._notifyLoadingIndicator(false, err);\r\n\t\t\t\t\t\t\tdeferred.reject(err);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t);\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tthis._notifyLoadingIndicator(false, err);\r\n\t\t\t\t\tdeferred.reject(err);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks if the current user has the specified role for the specified building\r\n\t * @param {string} buildingRef The building reference\r\n\t * @param {string} role The building role \r\n\t */\r\n\thasRoleForBuilding(buildingRef, role) {\r\n\t\tconst currentUser = this.currentUser();\r\n\t\tif (!currentUser) return false;\r\n\r\n\t\tconst buildingProfiles = currentUser.BuildingProfiles;\r\n\t\tif (!buildingProfiles || buildingProfiles.length < 1) return false;\r\n\r\n\t\tconst building = _.find(buildingProfiles, (buildingProfile) => {\r\n\t\t\tconst rightBuilding =\r\n\t\t\t\tbuildingProfile.SchemeReference.toUpperCase().trim() === buildingRef.toUpperCase().trim();\r\n\r\n\t\t\treturn rightBuilding;\r\n\t\t});\r\n\t\tif (!building) return false;\r\n\r\n\t\tconst buildingClaim = building.Role.find((claim) => {\r\n\t\t\treturn claim.toUpperCase().trim() === role.toUpperCase().trim();\r\n\t\t});\r\n\r\n\t\tif (buildingClaim) return true;\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tasync unsubscribeMonthlyFinancialDocs() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst user = this.currentUser();\r\n\t\t\tif (!user) {\r\n\t\t\t\tthrow new Error('No user found...');\r\n\t\t\t}\r\n\r\n\t\t\tlet url = await this.InternalLinksService.getLink('OptOutMonthlyFinancialDocs');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('/api/accounts/links');\r\n\t\t\t\tawait this.InternalLinksService.getLink('OptOutMonthlyFinancialDocs');\r\n\t\t\t}\r\n\r\n\t\t\turl = url.replace('{userName}', user.UserName);\r\n\t\t\tlet results = await this.$http.get(url);\r\n\t\t\tresults = results.hasOwnProperty('data') ? results.data : results;\r\n\r\n\t\t\tif (results.WasSuccessful) {\r\n\t\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error(\r\n\t\t\t\t\t'Error while unsubscribing from the monthly financial emails:\\n' + JSON.stringify(results.Errors)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t_notifyLoadingIndicator(isBusy, err) {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tthis.$rootScope.$broadcast('user-login-busy', { isBusy, err });\r\n\t\t}, 1200);\r\n\t}\r\n\r\n\tget _headers() {\r\n\t\treturn this.Utility.headersWithContentType;\r\n\t}\r\n\r\n\tget _unauthenticatedHeader() {\r\n\t\treturn this.Utility.basicHeaders;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$q,\r\n\t$http,\r\n\t$window,\r\n\tUtility,\r\n\t$timeout,\r\n\t$rootScope,\r\n\tLocalStorageService,\r\n\tInternalLinksService,\r\n\t$sce\r\n) =>\r\n\tnew AuthenticationService(\r\n\t\t$q,\r\n\t\t$http,\r\n\t\t$window,\r\n\t\tUtility,\r\n\t\t$timeout,\r\n\t\t$rootScope,\r\n\t\tLocalStorageService,\r\n\t\tInternalLinksService,\r\n\t\t$sce\r\n\t);\r\n","//@ts-check\r\n\r\nimport { FEATURES, USER_CLAIMS, capitalize } from '../../common/';\r\n\r\nclass AuthorizationService {\r\n\tconstructor(LocalStorageService) {\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() { }\r\n\r\n\tget unProtectedRoute() {\r\n\t\tconst paymentsAllowed = this.isAuthorized(this.mapPath(FEATURES.PAYMENTS));\r\n\r\n\t\tconst savedIsHome = this.LocalStorageService.retrieve('isHome');\r\n\t\tconst isHome = !!savedIsHome ? JSON.parse(savedIsHome) : false;\r\n\r\n\t\tif (!isHome) {\r\n\t\t\tif (paymentsAllowed) {\r\n\t\t\t\treturn FEATURES.PAYMENTS;\r\n\t\t\t}\r\n\t\t\treturn FEATURES.DASHBOARD;\r\n\t\t} else {\r\n\t\t\treturn FEATURES.DASHBOARD;\r\n\t\t}\r\n\t}\r\n\r\n\tmapPath(path) {\r\n\t\tlet mappedPath;\r\n\t\tpath = path.toLowerCase();\r\n\r\n\t\tif (path.includes(FEATURES.FINANCIAL_SUMMARY)) {\r\n\t\t\tpath = FEATURES.FINANCIAL_SUMMARY;\r\n\t\t}\r\n\r\n\t\tswitch (path) {\r\n\t\t\tcase FEATURES.LEVY_ROLL:\r\n\t\t\tcase FEATURES.BALANCE_SHEET:\r\n\t\t\tcase FEATURES.INCOME_STATEMENT:\r\n\t\t\tcase FEATURES.CONTRACTORS_ROLL:\r\n\t\t\tcase FEATURES.WAGES_ROLL:\r\n\t\t\tcase FEATURES.FINANCIAL_SUMMARY:\r\n\t\t\tcase FEATURES.CASHFLOW_STATEMENT:\r\n\t\t\tcase FEATURES.CASHFLOW_STATEMENT_NEW:\r\n\t\t\tcase FEATURES.INCOME_VS_BUDGET:\r\n\t\t\t\tmappedPath = USER_CLAIMS.VIEW_FINANCIALS;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.PAYMENTS:\r\n\t\t\t\tmappedPath = USER_CLAIMS.VIEW_PAYMENTS;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.PAYMENT_AUTHORISATION:\r\n\t\t\t\tmappedPath = USER_CLAIMS.VIEW_PAYMENT_BANDS;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.DOCUMENTS:\r\n\t\t\t\tmappedPath = USER_CLAIMS.VIEW_BUILDING_DOCUMENTS;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.PERSONAL_DOCUMENTS:\r\n\t\t\t\tmappedPath = USER_CLAIMS.VIEW_PERSONAL_DOCUMENTS;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.DASHBOARD:\r\n\t\t\t\tmappedPath = USER_CLAIMS.VIEW_PROPERTY_LIST;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.CLEARANCE_CAPTURE:\r\n\t\t\t\tmappedPath = USER_CLAIMS.CLEARANCE_CAPTURE;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.MY_PROFILE:\r\n\t\t\t\tmappedPath = FEATURES.MY_PROFILE;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.ACCOUNT_HISTORY:\r\n\t\t\t\tmappedPath = USER_CLAIMS.VIEW_ACCOUNTS_HISTORY;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.UTILITY:\r\n\t\t\t\tmappedPath = FEATURES.UTILITY;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.DOCUMENTS_APPROVAL:\r\n\t\t\t\tmappedPath = USER_CLAIMS.VIEW_DOCUMENTS_APPROVAL;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.RENTALS_CAPTURE:\r\n\t\t\t\tmappedPath = USER_CLAIMS.RENTALS_CAPTURE;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.AUDITS_CAPTURE:\r\n\t\t\t\tmappedPath = USER_CLAIMS.AUDITS_CAPTURE;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.AUDITORS_DASHBOARD:\r\n\t\t\t\tmappedPath = USER_CLAIMS.AUDITORS_DASHBOARD;\r\n\t\t\t\tbreak;\r\n\t\t\tcase FEATURES.DEBTOR_AGE_ANALYSIS:\r\n\t\t\t\tmappedPath = USER_CLAIMS.DEBTOR_AGE_ANALYSIS;\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase FEATURES.SHOW_FIND_A_CONTRACTOR:\r\n\t\t\t\t\tmappedPath = USER_CLAIMS.SHOW_FIND_A_CONTRACTOR;\r\n\t\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mappedPath;\r\n\t}\r\n\r\n\t/**\r\n\t * Checks whether a user should have access or not\r\n\t * @param {string} claim Section that a user is operating/viewing\r\n\t * @returns {boolean} true or false\r\n\t */\r\n\tisAuthorized(claim = '') {\r\n\t\tclaim = claim.toLowerCase();\r\n\t\tlet shouldAuthorize = false;\r\n\r\n\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\t\tlet selectedBuildingRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\r\n\t\tif (!!!selectedBuildingRef && !!userProfile) {\r\n\t\t\tif (!!userProfile.BuildingProfiles && userProfile.BuildingProfiles.length > 0) {\r\n\t\t\t\tselectedBuildingRef = userProfile.BuildingProfiles[0].SchemeReference;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (selectedBuildingRef && userProfile) {\r\n\t\t\tif (typeof selectedBuildingRef === 'object') {\r\n\t\t\t\tselectedBuildingRef = selectedBuildingRef.SchemeReference;\r\n\t\t\t}\r\n\r\n\t\t\tif (selectedBuildingRef) {\r\n\t\t\t\tconst selectedBuilding = userProfile.BuildingProfiles.find((buildingProf) => {\r\n\t\t\t\t\tconst buildingRef = buildingProf.SchemeReference.toLowerCase().trim();\r\n\t\t\t\t\tif (buildingRef === selectedBuildingRef.toLowerCase().trim()) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (selectedBuilding) {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t//claim === FEATURES.MY_PROFILE ||\r\n\t\t\t\t\t\tclaim === FEATURES.DASHBOARD ||\r\n\t\t\t\t\t\tclaim === '' ||\r\n\t\t\t\t\t\tclaim === '/'\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else if (\r\n\t\t\t\t\t\tclaim === USER_CLAIMS.VIEW_PROPERTY_LIST.toLowerCase() ||\r\n\t\t\t\t\t\tclaim === FEATURES.MY_PROFILE.toLowerCase()\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tconst userRole = selectedBuilding.Role.find(\r\n\t\t\t\t\t\t\t(role) => role === 'Owner' /* || role === 'Chairman'*/\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tshouldAuthorize = !!userRole;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconst hasClaim = selectedBuilding.BuildingClaimMapped.find((desc) => {\r\n\t\t\t\t\t\t\tconst results = desc.Description.toLowerCase().trim() === claim.toLowerCase().trim();\r\n\t\t\t\t\t\t\treturn results;\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif (!hasClaim) {\r\n\t\t\t\t\t\t\tconst owner = selectedBuilding.Role.find((role) => role.toLowerCase() === 'owner');\r\n\t\t\t\t\t\t\tif (!!owner && capitalize(claim) === USER_CLAIMS.VIEW_PERSONAL_DOCUMENTS) {\r\n\t\t\t\t\t\t\t\tshouldAuthorize = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tshouldAuthorize = !!hasClaim;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn shouldAuthorize;\r\n\t}\r\n\r\n\tmapPageToFeature(page) {\r\n\t\tlet feature;\r\n\t\tpage = capitalize(page);\r\n\r\n\t\tswitch (page) {\r\n\t\t\tcase USER_CLAIMS.MY_PROFILE:\r\n\t\t\t\tfeature = FEATURES.MY_PROFILE;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_LEVY_ROLL:\r\n\t\t\t\tfeature = FEATURES.LEVY_ROLL;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_PAYMENTS:\r\n\t\t\t\tfeature = FEATURES.PAYMENTS;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.REGISTER_TENANT:\r\n\t\t\t\tfeature = FEATURES.TENANT;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_ACCOUNTS_HISTORY:\r\n\t\t\t\tfeature = FEATURES.ACCOUNT_HISTORY;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_BALANCE_SHEET:\r\n\t\t\t\tfeature = FEATURES.BALANCE_SHEET;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_BUILDING_DOCUMENTS:\r\n\t\t\t\tfeature = FEATURES.DOCUMENTS;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_CASHFLOW_STATEMENT:\r\n\t\t\t\tfeature = FEATURES.CASHFLOW_STATEMENT;\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase USER_CLAIMS.VIEW_CASHFLOW_STATEMENT_NEW:\r\n\t\t\t\tfeature = FEATURES.CASHFLOW_STATEMENT_NEW;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_CONTRACTORS_ROLL:\r\n\t\t\t\tfeature = FEATURES.CONTRACTORS_ROLL;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_WAGES_ROLL:\r\n\t\t\t\tfeature = FEATURES.WAGES_ROLL;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_FINANCIALS:\r\n\t\t\t\tfeature = FEATURES.FINANCIAL_SUMMARY;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_INCOME_STATEMENT:\r\n\t\t\t\tfeature = FEATURES.INCOME_STATEMENT;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_INCOME_VS_BUDGET:\r\n\t\t\t\tfeature = FEATURES.INCOME_VS_BUDGET;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_PAYMENT_BANDS:\r\n\t\t\tcase USER_CLAIMS.VIEW_CONTRACTUAL_PAYMENTS:\r\n\t\t\t\tfeature = FEATURES.PAYMENT_AUTHORISATION;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_PERSONAL_DOCUMENTS:\r\n\t\t\t\tfeature = FEATURES.PERSONAL_DOCUMENTS;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.UTILITY:\r\n\t\t\t\tfeature = FEATURES.UTILITY;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.VIEW_DOCUMENTS_APPROVAL:\r\n\t\t\t\tfeature = FEATURES.DOCUMENTS_APPROVAL;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.DEBTOR_AGE_ANALYSIS:\r\n\t\t\t\tfeature = FEATURES.DEBTOR_AGE_ANALYSIS;\r\n\t\t\t\tbreak;\r\n\t\t\tcase USER_CLAIMS.SHOW_FIND_A_CONTRACTOR:\r\n\t\t\t\tfeature = FEATURES.SHOW_FIND_A_CONTRACTOR;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn feature;\r\n\t}\r\n\r\n\t_getSelectedBuildingRef() {\r\n\t\tlet selectedBuildingRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\r\n\t\tif (selectedBuildingRef && typeof selectedBuildingRef === 'object')\r\n\t\t\tselectedBuildingRef = selectedBuildingRef.SchemeReference;\r\n\r\n\t\treturn selectedBuildingRef;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (LocalStorageService) => new AuthorizationService(LocalStorageService);\r\n"," \r\n\r\n\r\n/* @ngInject */ \r\nexport default function CacheService($cacheFactory) {\r\n\treturn $cacheFactory('PretorCache');\r\n}\r\n","//@ts-check\r\n\r\nclass CommonService {\r\n\tconstructor($location, LocalStorageService) {\r\n\t\tthis.$location = $location;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\r\n\t\tthis.deletedQueryStringParameters = [];\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.apiRetry = {\r\n\t\t\tunits: 'ms',\r\n\t\t\tvalue: 1800\r\n\t\t};\r\n\t}\r\n\r\n\tQueryString(queryStringName) {\r\n\r\n\t\tlet deletedParameter = this.deletedQueryStringParameters.find(x => x == queryStringName);\r\n\r\n\t\tif(deletedParameter){\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\r\n\t\tlet url = this.$location.absUrl().toLowerCase();\r\n\t\tlet name = queryStringName.toLowerCase().replace(/[\\[\\]]/g, '\\\\$&');\r\n\r\n\t\tif (!url) {\r\n\t\t\turl = this.$location.absUrl().toLowerCase();\r\n\t\t}\r\n\r\n\t\tconst regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`),\r\n\t\t\tresults = regex.exec(url);\r\n\r\n\t\tif (!results) return null;\r\n\r\n\t\tif (!results[2]) return '';\r\n\r\n\t\treturn decodeURIComponent(results[2].replace(/\\+/g, ' '));\r\n\t}\r\n\r\n\tasync DeleteQueryStringParameter(queryStringParameterName) {\r\n\t\tthis.deletedQueryStringParameters.push(queryStringParameterName);\r\n\t\tawait this.$location.search(queryStringParameterName, null);\r\n\t\tawait this.$location.$$compose();\r\n\t}\r\n\r\n\tget headersWithContentType() {\r\n\t\tconst headers = this.headers;\r\n\t\treturn {\r\n\t\t\t...headers,\r\n\t\t\t'content-type': 'application/json'\r\n\t\t};\r\n\t}\r\n\r\n\tget basicHeaders() {\r\n\t\treturn {\r\n\t\t\t'content-type': 'application/json'\r\n\t\t};\r\n\t}\r\n\r\n\tget headers() {\r\n\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\t\tconst sessionProfile = this.LocalStorageService.retrieve('userSession');\r\n\r\n\t\tconst sessionToken = sessionProfile.SessionToken;\r\n\t\tconst userName = userProfile.UserName || userProfile.WebUsername;\r\n\r\n\t\tif (!(sessionToken && sessionToken.length > 2) || !(userName && userName.length > 2)) {\r\n\t\t\tthrow `Could not retrieve 'sessionToken' and\\or 'userName' to send as the HTTP Headers`;\r\n\t\t}\r\n\r\n\t\tconst headers = {\r\n\t\t\tuserName,\r\n\t\t\tsessionToken\r\n\t\t};\r\n\r\n\t\treturn headers;\r\n\t}\r\n\r\n\tget selectedBuildingRef() {\r\n\t\tlet selectedBuilding;\r\n\r\n\t\tconst selectedRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\t\tif (typeof selectedRef === 'object') {\r\n\t\t\tselectedBuilding = selectedRef.SchemeReference.trim();\r\n\t\t} else {\r\n\t\t\tselectedBuilding = selectedRef.trim();\r\n\t\t}\r\n\t\tif (!selectedBuilding) {\r\n\t\t\tlet selectedBuildingRefQueryString = this.QueryString('DBRef');\r\n\t\t\tif (selectedBuildingRefQueryString) {\r\n\t\t\t\tthis.selectedBuilding = selectedBuildingRefQueryString.toUpperCase();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn selectedBuilding;\r\n\t}\r\n\r\n\tcleanUpStrings(text) {\r\n\t\tconst cleanedString = text\r\n\t\t\t.trim()\r\n\t\t\t.replace(/[\\n\\r]+/g, ' ')\r\n\t\t\t.replace(/\\s{2,}/g, ' ')\r\n\t\t\t.replace(/^\\s+|\\s+$/, '')\r\n\t\t\t.replace('*', '');\r\n\r\n\t\treturn cleanedString;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($location, LocalStorageService) => new CommonService($location, LocalStorageService);\r\n","class ContentService {\r\n\t\r\n\tconstructor($q, $sce, $http, $rootScope, InternalLinksService) {\r\n\t\tthis.$q = $q;\r\n\t\tthis.$sce = $sce;\r\n\t\tthis.$http = $http;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\t}\r\n\r\n\t/**\r\n\t * Function for fetching content\r\n\t * @param {string} contentUrl The content URL for the Pretor.Online\r\n\t * @param {string} linksUrl The links URL for the Pretor.Online to get links\r\n\t * @return {Promise} The html content promise\r\n\t */\r\n\tload(contentUrl, linksUrl) {\r\n\t\tconst deferred = this.$q.defer();\r\n\t\tlet loadLinksPromise;\r\n\t\tlet url = this.InternalLinksService.getLink(contentUrl);\r\n\r\n\t\tif (!url) {\r\n\t\t\tloadLinksPromise = this.InternalLinksService.getLinks(linksUrl);\r\n\t\t} else {\r\n\t\t\tconst linksDeferred = this.$q.defer();\r\n\t\t\tloadLinksPromise = linksDeferred.promise;\r\n\t\t\tlinksDeferred.resolve();\r\n\t\t}\r\n\r\n\t\tloadLinksPromise.then(() => {\r\n\t\t\tif (!url) url = this.InternalLinksService.getLink(contentUrl);\r\n\r\n\t\t\tthis.$http.get(url).then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tconst content = results.hasOwnProperty('data') ? results.data : results;\r\n\r\n\t\t\t\t\tdeferred.resolve(content);\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tdeferred.reject(err);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\treturn deferred.promise;\r\n\t}\r\n\r\n\tgeneralLoad(url) {\r\n\t\tconst deferred = this.$q.defer();\r\n\t\tconst promise = deferred.promise;\r\n\r\n\t\tif (!url) {\r\n\t\t\tthrow 'No URL was supplied.';\r\n\t\t}\r\n\r\n\t\tconst headers = {\r\n\t\t\t'Access-Control-Allow-Origin': '*',\r\n\t\t\tresponseType: 'arraybuffer'\r\n\t\t};\r\n\r\n\t\tthis.$http({\r\n\t\t\tmethod: 'GET',\r\n\t\t\turl: url,\r\n\t\t\theaders: headers\r\n\t\t}).then(\r\n\t\t\t(results) => {\r\n\t\t\t\tconst content = results.hasOwnProperty('data') ? results.data : results;\r\n\t\t\t\tdeferred.resolve(content);\r\n\t\t\t},\r\n\t\t\t(err) => {\r\n\t\t\t\tdeferred.reject(err);\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\nexport default /* @ngInject */ ($q, $sce, $http, $rootScope, InternalLinksService) =>\r\n\tnew ContentService($q, $sce, $http, $rootScope, InternalLinksService);\r\n","export default /* @ngInject */ ($q, $http) => new CountriesUtilService($q, $http);\r\n\r\nclass CountriesUtilService {\r\n\t\r\n\tconstructor($q, $http) {\r\n\t\tthis.$q = $q;\r\n\t\tthis.$http = $http;\r\n\r\n\t\tthis.countries = [];\r\n\t\t//this.load();\r\n\t}\r\n\r\n\tload() {\r\n\t\tconst deferred = this.$q.defer();\r\n\t\tconst promise = deferred.promise;\r\n\t\tconst url = `${pretorOnlineUrl}${pretorOnlineUrl.endsWith('/')\r\n\t\t\t? ''\r\n\t\t\t: '/'}Scripts/app/services/common/countries/countries.json`;\r\n\r\n\t\tthis.$http.get(url).then(\r\n\t\t\t(results) => {\r\n\t\t\t\tthis.countries = this.map(results.data);\r\n\t\t\t\tdeferred.resolve(results.data);\r\n\t\t\t},\r\n\t\t\t(err) => {\r\n\t\t\t\tconst msg = `Error while loading 'countries.json'`;\r\n\t\t\t\tconsole.error(msg, err);\r\n\t\t\t\tdeferred.reject(msg);\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tmap(countryList) {\r\n\t\tlet mappedList = [];\r\n\r\n\t\tcountryList.forEach((country) => {\r\n\t\t\tconst mapped = {\r\n\t\t\t\tcountry: country.country,\r\n\t\t\t\tcountryCode: country['country-code']\r\n\t\t\t};\r\n\r\n\t\t\tmappedList.push(mapped);\r\n\t\t});\r\n\r\n\t\treturn mappedList;\r\n\t}\r\n}\r\n\r\n/*\r\n\r\n serviceModule.factory('CountriesUtilService', CountriesUtilServiceInstance);\r\n})(angular.module(\"pretor.online.factories\"));\r\n*/\r\n","//@ts-check\r\n\r\nclass InternalLinksService {\r\n\tconstructor($http, $window, $timeout, $rootScope, LocalStorageService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t}\r\n\r\n\t/**\r\n\t * Function for getting the links allowed on an API\r\n\t * @param {string} path The path to be added to the base URL\r\n\t * @param {boolean} isAuthenticating The flag for whether to use the authentication URL or not\r\n\t * @return {Promise} the links promise\r\n\t */\r\n\tasync getLinks(path, isAuthenticating, isNew, isMobileApp) {\r\n\t\tlet url, promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\turl = isAuthenticating\r\n\t\t\t\t? `${authenticationAPIAddress}${authenticationAPIAddress.endsWith('/') ? '' : '/'}authentication/`\r\n\t\t\t\t: pretorOnlineUrl;\r\n\r\n\t\t\turl = isNew ? `${url.toLowerCase().replace('authentication', 'accounts')}` : url;\r\n\t\t\turl = isNew ? `${url.toLowerCase().indexOf('account') !== -1 ? url : url + '/api/accounts'}/${path}` : url;\r\n\r\n\t\t\tif (isMobileApp) {\r\n\t\t\t\t//TODO: Start here for mobile app(Glovent)\r\n\t\t\t\tconst mobileApiAddress = this.LocalStorageService.retrieve('mobileApiAddress');\r\n\t\t\t\turl = `${mobileApiAddress}${mobileApiAddress.endsWith('/') ? '' : '/'}${path}`;\r\n\t\t\t}\r\n\r\n\t\t\tif (url.indexOf(path) === -1) {\r\n\t\t\t\turl = url + path;\r\n\t\t\t}\r\n\r\n\t\t\tconst urls = await this.$http.get(url);\r\n\t\t\t//console.log('Got new links: ' + JSON.stringify(urls));\r\n\t\t\tthis.saveLink(urls.data);\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(urls.data));\r\n\t\t} catch (error) {\r\n\t\t\tconst msg = `Error loading URL links from: ${url}\\nError: `;\r\n\t\t\tconsole.error(msg, error);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(msg));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\t/**\r\n\t * Function for getting a stored link\r\n\t * @param {string} name The name of the URL required\r\n\t * @return {string} the required URL\r\n\t */\r\n\tgetLink(name) {\r\n\t\tvar link = undefined;\r\n\t\tlink = this.LocalStorageService.retrieve(name);\r\n\t\treturn link;\r\n\t}\r\n\r\n\t/**\r\n\t * Function for storing a link\r\n\t * @param {string} name The name of the URL required\r\n\t * @return {string} the required URL\r\n\t */\r\n\tsaveLink(urls) {\r\n\t\tvar linksToSave = urls.hasOwnProperty('data') ? urls.data : urls;\r\n\t\tObject.keys(linksToSave).forEach((key) => {\r\n\t\t\tvar value = linksToSave[key];\r\n\t\t\tthis.LocalStorageService.save(key, value);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, $window, $timeout, $rootScope, LocalStorageService) =>\r\n\tnew InternalLinksService($http, $window, $timeout, $rootScope, LocalStorageService);\r\n","class LayoutService {\r\n\tconstructor($timeout, $location, LocalStorageService, BuildingsService) {\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t}\r\n\r\n\tgetSelectedBuildingReference(value) {\r\n\t\tif (!value) {\r\n\t\t\tvalue = this.getDefaultSelectedBuildingRef();\r\n\t\t}\r\n\t\tif (value && typeof value === 'object') {\r\n\t\t\treturn value.SchemeReference;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tget isHome() {\r\n\t\treturn !!!this.$location.$$url || this.$location.$$url === '/';\r\n\t}\r\n\r\n\tgetDefaultSelectedBuildingRef() {\r\n\t\tconst user = this.LocalStorageService.retrieve('userProfile');\r\n\t\tif (!user) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst { BuildingProfiles } = user;\r\n\t\tconst buildingProfile = BuildingProfiles[0];\r\n\t\tconst { SchemeReference } = buildingProfile;\r\n\r\n\t\treturn SchemeReference;\r\n\t}\r\n\r\n\tsetSelectedBuildingRef() {\r\n\t\tthis.$timeout(() => {\r\n\t\t\tlet selectedBuildingRef = this.getSelectedBuildingReference(\r\n\t\t\t\tthis.LocalStorageService.retrieve('selectedBuildingRef')\r\n\t\t\t);\r\n\r\n\t\t\tangular\r\n\t\t\t\t.element('#homeMenu .list-group button')\r\n\t\t\t\t.each((i, ele) => angular.element(ele).removeClass('active'));\r\n\t\t\tlet foundSelectedBuildingRef = this.BuildingsService.buildingsData.allBuildings.find((building) => {\r\n\t\t\t\treturn building.SchemeReference === selectedBuildingRef;\r\n\t\t\t});\r\n\r\n\t\t\tif (foundSelectedBuildingRef) {\r\n\t\t\t\tconst selectedBuildingButton = angular.element('#homeMenu .list-group button').toArray().find((ele) => {\r\n\t\t\t\t\tconst ref = angular.element(ele).data('ref');\r\n\t\t\t\t\treturn selectedBuildingRef === ref;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (selectedBuildingButton) {\r\n\t\t\t\t\tangular.element(selectedBuildingButton).addClass('active');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($timeout, $location, LocalStorageService, BuildingsService) =>\r\n\tnew LayoutService($timeout, $location, LocalStorageService, BuildingsService);\r\n","//@ts-check\r\n\r\nclass LocalStorageService {\r\n\tconstructor() {\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {}\r\n\r\n\t/**\r\n\t * Function saving items in the local storage\r\n\t * @param {string} itemName The item name/key\r\n\t * @param {any} itemValue The item value/content\r\n\t */\r\n\tasync save(itemName, itemValue) {\r\n\r\n\r\n\t\tvar value = itemValue;\r\n\t\tif (typeof itemValue == 'object') {\r\n\t\t\tvalue = JSON.stringify(itemValue);\r\n\t\t}\r\n\r\n\t\tawait localStorage.setItem(itemName, value);\r\n\t}\r\n\r\n\t/**\r\n\t * Clears out the locally saved dates * \r\n\t */\r\n\tclearSavedDates() {\r\n\t\tlocalStorage.setItem('selectedReportYear', '');\r\n\t\tlocalStorage.setItem('selectedReportMonth', '');\r\n\t}\r\n\r\n\t/**\r\n\t * Function for retrieving items from local storage\r\n\t * @param {string} itemName The item name/key\r\n\t * @returns {any} The item\r\n\t */\r\n\tretrieve(itemName) {\r\n\t\tvar item = localStorage.getItem(itemName);\r\n\r\n\t\tif (item && ((item.indexOf('{') > -1 && item.indexOf('http') == -1) || item.indexOf('[') > -1)) {\r\n\t\t\titem = JSON.parse(item);\r\n\t\t}\r\n\t\tif (itemName === 'userProfile') {\r\n\t\t\tthis.mapUser(item);\r\n\t\t}\r\n\r\n\t\treturn item;\r\n\t}\r\n\r\n\tmapUser(user) {\r\n\t\tif (user && user.hasOwnProperty('WebUsername')) {\r\n\t\t\tuser.UserName = user.WebUsername || user.UserName;\r\n\t\t}\r\n\r\n\t\treturn user;\r\n\t}\r\n\r\n\tclear() {\r\n\t\tvar itemsToBeCleared = [\r\n\t\t\t'lastLoggedIn',\r\n\t\t\t'mainProcessesDone',\r\n\t\t\t'selectedBuildingRef',\r\n\t\t\t'userProfile',\r\n\t\t\t'userSession',\r\n\t\t\t'resetPasswordToken',\r\n\t\t\t'isBusyLastShown',\r\n\t\t\t'clearanceCorrelationId',\r\n\t\t\t'rentalsCorrelationId',\r\n\t\t\t'auditsCorrelationId',\r\n\t\t\t'auditorsCorrelationId'\r\n\t\t];\r\n\t\t_.each(itemsToBeCleared, (itemName) => {\r\n\t\t\tthis.delete(itemName);\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Function for clearing out all items from local storage\r\n\t */\r\n\tclearAll() {\r\n\t\tlocalStorage.clear();\r\n\t}\r\n\r\n /**\r\n\t * Function for clearing out all items from local storage\r\n\t */\r\n clearPartial() {\r\n var itemsToBeCleared = [\r\n 'lastLoggedIn',\r\n 'mainProcessesDone',\r\n 'selectedBuildingRef',\r\n 'userProfile',\r\n 'userSession',\r\n 'isBusyLastShown',\r\n 'clearanceCorrelationId',\r\n\t\t\t'rentalsCorrelationId',\r\n\t\t\t'auditsCorrelationId',\r\n\t\t\t'auditorsCorrelationId'\r\n\r\n ];\r\n _.each(itemsToBeCleared, (itemName) => {\r\n this.delete(itemName);\r\n });\r\n }\r\n\r\n\t/**\r\n\t * Function for removing an item from local storage\r\n\t * @param {string} name The name/key of the item in local storage to be removed\r\n\t */\r\n\tdelete(name) {\r\n\t\tlocalStorage.removeItem(name);\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ () => new LocalStorageService();\r\n","import * as angular from \"angular\";\r\n\r\n//@ts-check\r\n\r\nclass NavigationService {\r\n\tconstructor(\r\n\t\t$http,\r\n\t\t$window,\r\n\t\t$timeout,\r\n\t\t$location,\r\n\t\t$interval,\r\n\t\t$rootScope,\r\n\t\tCommonService,\r\n\t\tRegisterService,\r\n\t\tBuildingsService,\r\n\t\tLocalStorageService,\r\n\t\tAuthenticationService,\r\n\t\tNotificationService,\r\n\t\t$state\r\n\t) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.$window = $window;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$location = $location;\r\n\t\tthis.$interval = $interval;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.CommonService = CommonService;\r\n\t\tthis.RegisterService = RegisterService;\r\n\t\tthis.BuildingsService = BuildingsService;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.AuthenticationService = AuthenticationService;\r\n\t\tthis.NotificationService = NotificationService;\r\n this.$state = $state;\r\n\r\n\t\tthis.isBusySettingLocalUserObjects = false;\r\n\t\tthis.hasLocalUserObjectsBeenSet = false;\r\n\r\n\t\tthis.isBusyActivating = false;\r\n\t\tthis.hasActivated = false;\r\n\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.again;\r\n\t\tthis.navigationData = {\r\n\t\t\tselectedTab: undefined,\r\n\t\t\tselectedBuildingRef: undefined,\r\n\t\t\tnavigated: undefined\r\n\t\t};\r\n\t}\r\n\r\n\tasync activate(){\r\n\r\n\t}\r\n\r\n\tasync InitialiseNavigation() {\r\n\r\n\t\tif (this.isBusyActivating || this.hasActivated) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isBusyActivating = true;\r\n\t\tawait this.logoutUser();\r\n\t\tawait this.setLocalUserObjects();\r\n\t\tthis.confirmEmail();\r\n\t\tthis.schemeLogin();\r\n\t\tthis.getClearanceInfo();\r\n\t\tthis.getRentalsInfo();\r\n\t\tthis.getAuditsInfo();\r\n\t\tthis.getAuditorsInfo();\r\n\t\tthis.getResetPasswordInfo();\r\n\t\tthis.unsubscribeToMonthlyFinancialDoc();\r\n\t\tawait this.selectedBuilding();\r\n\t\tthis.isBusyActivating = false;\r\n\t\tthis.hasActivated = true;\r\n\r\n\t\tawait this.checkValidProfile();\r\n\r\n\t\tthis.gotoTab();\r\n\r\n\t\tthis.$rootScope.$on('$stateChangeStart',\r\n\t\t\tfunction (event, toState, toParams, fromState, fromParams) {\r\n\t\t\t\tif(!this.hasActivated){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t}\r\n\r\n\tasync checkValidProfile(){\r\n\t\tlet currentUser = this.AuthenticationService.currentUser();\r\n\r\n\t\tif (!!currentUser) {\r\n\r\n\t\t\tlet profileIsNotValid = false\r\n\t\t\tif (!currentUser.BuildingProfiles) {\r\n\t\t\t\tprofileIsNotValid = true;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tlet allClaims = [...currentUser.BuildingProfiles].flatMap(x => x.BuildingClaimMapped);\r\n\t\t\t\tif ([...allClaims].length == 0) {\r\n\t\t\t\t\tprofileIsNotValid = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (profileIsNotValid) {\r\n\t\t\t\tthis.AuthenticationService.logout();\r\n\t\t\t\talert('No profile could be established - Please contact our offices');\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\tasync redirectedFrom() {\r\n\t\tconst redirectedFrom = this.CommonService.QueryString('redirectedFrom');\r\n\t\tif (redirectedFrom == 'register-complete') {\r\n\t\t\tthis.$rootScope.$broadcast('show-login-auth-modal');\r\n\t\t\tthis.CommonService.DeleteQueryStringParameter('redirectedFrom');\r\n\t\t}\r\n\t}\r\n\r\n\tasync setLocalUserObjects() {\r\n\r\n\t\tconst confirmToken = this.CommonService.QueryString('confirmToken');\r\n\t\tif (confirmToken) {\r\n\t\t\tthis.confirmEmail();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.isBusySettingLocalUserObjects || this.hasLocalUserObjectsBeenSet) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isBusySettingLocalUserObjects = true;\r\n\t\tthis.$rootScope.$broadcast('change-is-busy', true);\r\n\r\n\t\tawait this.impersonateUser();\r\n\t\tawait this.getTokenAndAuthUser();\r\n\t\tawait this.selectedBuilding();\r\n\r\n\t\tthis.isBusySettingLocalUserObjects = false;\r\n\t\tthis.$rootScope.$broadcast('change-is-busy', false);\r\n\r\n\t\tthis.hasLocalUserObjectsBeenSet = true;\r\n\t}\r\n\r\n\tgetResetPasswordInfo() {\r\n\t\tconst resetToken = this.CommonService.QueryString('ResetToken');\r\n\t\tif (resetToken) {\r\n\t\t\tif (this.again) return;\r\n\r\n\t\t\tthis.again = this.$interval(() => {\r\n\t\t\t\tlet retries = this.$timeout(() => {\r\n\t\t\t\t\tthis.AuthenticationService\r\n\t\t\t\t\t\t.promptForNewPassword(resetToken)\r\n\t\t\t\t\t\t.then(\r\n\t\t\t\t\t\t\t(results) => {\r\n\t\t\t\t\t\t\t\tconst isDone = this.LocalStorageService.retrieve('resetPasswordToken');\r\n\t\t\t\t\t\t\t\tif (isDone) {\r\n\t\t\t\t\t\t\t\t\tthis.$interval.cancel(this.again);\r\n\t\t\t\t\t\t\t\t\tthis.$timeout.cancel(retries);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t(err) => {\r\n\t\t\t\t\t\t\t\tconsole.error(\"Couldn't prompt the user for a new password.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\t\tretries = undefined;\r\n\t\t\t\t\t\t}, this.CommonService.apiRetry.value / 2);\r\n\t\t\t\t});\r\n\t\t\t}, this.CommonService.apiRetry.value / 2);\r\n\t\t}\r\n\t}\r\n\r\n\tgotoTab(tabToShow) {\r\n\t\tconst selectedTab = this.CommonService.QueryString('Tab');\r\n\r\n\t\tif (selectedTab) {\r\n\t\t\tconst date = this.CommonService.QueryString('date');\r\n\t\t\tthis.navigationData.selectedTab = selectedTab;\r\n\t\t\tthis.$rootScope.$broadcast('navigation-onload-changed', { selectedTab, date });\r\n\t\t}\r\n\r\n\t\tthis.gotoTop();\r\n\t}\r\n\r\n\tconfirmEmail() {\r\n\t\tconst confirmEmail = this.CommonService.QueryString('confirmEmail'); \r\n\t\tconst confirmToken = this.CommonService.QueryString('confirmToken');\r\n\t\tif (confirmEmail || confirmToken) {\r\n\t\t\tthis.LocalStorageService.clear();\r\n\t\t\tthis.$rootScope.$broadcast('accounts-confirm-email', { confirmEmail, confirmToken });\r\n\t\t}\r\n\t}\r\n\r\n\tasync selectedBuilding() {\r\n\t\tconst queryStringBuildingRef = this.CommonService.QueryString('DBRef')\r\n\t\t\t? this.CommonService.QueryString('DBRef').toUpperCase()\r\n\t\t\t: undefined;\r\n\r\n\t\tif (!queryStringBuildingRef) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet oldSelectedBuildingRef = this.navigationData.selectedBuildingRef;\r\n\t\tif (typeof oldSelectedBuildingRef === 'object')\r\n\t\t\toldSelectedBuildingRef = oldSelectedBuildingRef.SchemeReference.toUpperCase();\r\n\r\n\t\tif (queryStringBuildingRef !== oldSelectedBuildingRef) {\r\n\t\t\tawait this.LocalStorageService.save('selectedBuildingRef', queryStringBuildingRef);\r\n\t\t\tthis.navigationData.selectedBuildingRef = queryStringBuildingRef;\r\n\t\t\tthis.$rootScope.$broadcast('building-reference-changed', queryStringBuildingRef);\r\n\t\t}\r\n\r\n\t\tif (!!queryStringBuildingRef) {\r\n\t\t\tawait this.CommonService.DeleteQueryStringParameter('DBRef')\r\n\t\t}\r\n\t}\r\n\r\n\tasync impersonateUser() {\r\n\t\tconst userName = this.CommonService.QueryString('impersonateUser');\r\n\t\tif (userName) {\r\n\t\t\tthis.LocalStorageService.clear();\r\n\t\t\tthis.AuthenticationService.impersonateUser(userName);\r\n\t\t}\r\n\t}\r\n\r\n\tschemeLogin() {\r\n\t\tconst schemeReference = this.CommonService.QueryString('schemeLogin');\r\n\t\tif (schemeReference) {\r\n\t\t\tthis.LocalStorageService.clear();\r\n\t\t\tthis.AuthenticationService.schemeLogin(schemeReference);\r\n\t\t}\r\n\t}\r\n\r\n\tnavigate() {\r\n\t\tthis.navigationData.navigated = true;\r\n\t}\r\n\r\n\tasync logoutUser() {\r\n\t\tconst url = this.$location.absUrl().toLowerCase();\r\n\t\tconst shouldLogOut = url.indexOf('resetuser') > -1;\r\n\r\n\t\tif (shouldLogOut) this.AuthenticationService.logout();\r\n\t}\r\n\r\n\tasync getTokenAndAuthUser() {\r\n\t\tconst token = this.CommonService.QueryString('authtoken');\r\n\t\tconst oldSession = this.LocalStorageService.retrieve('userSession');\r\n\t\tconst lastLogin = this.LocalStorageService.retrieve('lastLoggedIn');\r\n\r\n\t\tif (token) {\r\n\t\t\tthis.NotificationService.success('LOGGING YOU IN');\r\n\t\t\tlet isInvalidOldToken = true;\r\n\r\n\t\t\tif (oldSession) {\r\n\t\t\t\tif (angular.isUndefined(oldSession.AuthToken) || oldSession.AuthToken === null) {\r\n\t\t\t\t\tthis.isInvalidOldToken = false;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthis.isInvalidOldToken = false;\r\n\t\t\t}\r\n\r\n\t\t\tthis.LocalStorageService.clear();\r\n\r\n\t\t\tif (this.isInvalidOldToken /* && oldSession.length > 0*/) {\r\n\t\t\t\tif (oldSession.AuthToken.toLowerCase() === token.toLowerCase()) {\r\n\t\t\t\t\tthis.LocalStorageService.save('lastLoggedIn', lastLogin);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tawait this.AuthenticationService.authorize();\r\n\t\t\tawait this.BuildingsService.init();\r\n\t\t}\r\n\t}\r\n\r\n\tgetClearanceInfo() {\r\n\t\tconst clearanceToken = this.CommonService.QueryString('clearancetoken');\r\n\t\tif (clearanceToken) {\r\n\t\t\tthis.LocalStorageService.clear();\r\n\r\n\t\t\tthis.AuthenticationService.authorizeClearanceToken(clearanceToken).then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.Data && (results.Data.hasOwnProperty('CorrelationId') && results.Data.CorrelationId)) {\r\n\t\t\t\t\t\tconst clearanceCorrelationId = results.Data.CorrelationId;\r\n\t\t\t\t\t\tthis.LocalStorageService.save('clearanceCorrelationId', clearanceCorrelationId);\r\n\t\t\t\t\t\tthis.$rootScope.$broadcast('clearance-user-logged-in', clearanceCorrelationId);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.log('Data malformed in clearance token result');\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tconsole.error(err);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tgetRentalsInfo() {\r\n\t\tconst rentalsToken = this.CommonService.QueryString('rentalstoken');\r\n\t\tif (rentalsToken) {\r\n\t\t\tthis.LocalStorageService.clear();\r\n\r\n\t\t\tthis.AuthenticationService.authorizeRentalsToken(rentalsToken).then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.Data && (results.Data.hasOwnProperty('CorrelationId') && results.Data.CorrelationId)) {\r\n\t\t\t\t\t\tconst rentalsCorrelationId = results.Data.CorrelationId;\r\n\t\t\t\t\t\tthis.LocalStorageService.save('rentalsCorrelationId', rentalsCorrelationId);\r\n\t\t\t\t\t\tthis.$rootScope.$broadcast('rentals-user-logged-in', rentalsCorrelationId);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.log('Data malformed in rentals token result');\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tconsole.error(err);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tgetAuditsInfo() {\r\n\t\tconst auditsToken = this.CommonService.QueryString('auditstoken');\r\n\t\tif (auditsToken) {\r\n\t\t\tthis.LocalStorageService.clear();\r\n\r\n\t\t\tthis.AuthenticationService.authorizeAuditsToken(auditsToken).then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.Data && (results.Data.hasOwnProperty('CorrelationId') && results.Data.CorrelationId)) {\r\n\t\t\t\t\t\tconst auditsCorrelationId = results.Data.CorrelationId;\r\n\t\t\t\t\t\tthis.LocalStorageService.save('auditsCorrelationId', auditsCorrelationId);\r\n\t\t\t\t\t\tthis.$rootScope.$broadcast('audits-user-logged-in', auditsCorrelationId);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.log('Data malformed in audits token result');\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tconsole.error(err);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tgetAuditorsInfo() {\r\n\t\tconst auditorsToken = this.CommonService.QueryString('auditorstoken');\r\n\t\tif (auditorsToken) {\r\n\t\t\tthis.LocalStorageService.clear();\r\n\t\t\tthis.AuthenticationService.authorizeAuditsToken(auditorsToken).then(\r\n\t\t\t\t(results) => {\r\n\t\t\t\t\tif (results.Data && (results.Data.hasOwnProperty('CorrelationId') && results.Data.CorrelationId)) {\r\n\t\t\t\t\t\tconst auditorsCorrelationId = results.Data.CorrelationId;\r\n\t\t\t\t\t\tthis.LocalStorageService.save('auditorsCorrelationId', auditorsCorrelationId);\r\n\t\t\t\t\t\tthis.$rootScope.$broadcast('auditors-user-logged-in', auditorsCorrelationId);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.log('Data malformed in auditors token result');\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(err) => {\r\n\t\t\t\t\tconsole.error(err);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tunsubscribeToMonthlyFinancialDoc() {\r\n\t\tconst shouldUnsubscribeToMonthlyFinancialDocs = this.CommonService.QueryString('unsubscribe');\r\n\t\tif (shouldUnsubscribeToMonthlyFinancialDocs) {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tthis.$rootScope.$broadcast('unsubscribe-monthly-financial-docs');\r\n\t\t\t}, 800);\r\n\t\t}\r\n\t}\r\n\r\n\tgotoTop(speed) {\r\n\t\t$('html, body').animate({ scrollTop: 0 }, speed || 'fast', 'swing');\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (\r\n\t$http,\r\n\t$window,\r\n\t$timeout,\r\n\t$location,\r\n\t$interval,\r\n\t$rootScope,\r\n\tCommonService,\r\n\tRegisterService,\r\n\tBuildingsService,\r\n\tLocalStorageService,\r\n\tAuthenticationService,\r\n\tNotificationService,\r\n\t$state\r\n) =>\r\n\tnew NavigationService(\r\n\t\t$http,\r\n\t\t$window,\r\n\t\t$timeout,\r\n\t\t$location,\r\n\t\t$interval,\r\n\t\t$rootScope,\r\n\t\tCommonService,\r\n\t\tRegisterService,\r\n\t\tBuildingsService,\r\n\t\tLocalStorageService,\r\n\t\tAuthenticationService,\r\n\t\tNotificationService,\r\n\t\t$state\r\n\t);\r\n","class NotificationService {\r\n\tconstructor($rootScope) {\r\n\t\tthis.$rootScope = $rootScope;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {}\r\n\r\n\tsuccess(msg, timeout = 5000) {\r\n\t\tthis.$rootScope.$broadcast('show-notification', msg, undefined, timeout);\r\n\t}\r\n\r\n\terror(msg, err, timeout = 5000) {\r\n\t\tthis.$rootScope.$broadcast('show-notification', msg, err || 'FAILED', timeout);\r\n\t}\r\n\r\n\tsuccessModal(msg) {\r\n\t\tthis.$rootScope.$broadcast('show-success-modal', msg);\r\n\t}\r\n\r\n\tshowModal(success, error) {\r\n\t\tthis.$rootScope.$broadcast('show-register-prompt-auth-modal', success, error);\r\n\t}\r\n\r\n\tshowForgotPassword() {\r\n\t\tthis.$rootScope.$broadcast('show-login-auth-modal');\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($rootScope) => new NotificationService($rootScope);\r\n","//@ts-check\r\n\r\nclass PagingService {\r\n\tconstructor(NavigationService) {\r\n\t\tthis.NavigationService = NavigationService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.limit = 5;\r\n\t\tthis.maxPage = 1;\r\n\t\tthis.pageNumber = 1;\r\n\t\tthis.lastItemIndex = 5;\r\n\t\tthis.scrollSpeed = 100;\r\n\t\tthis.firstItemIndex = 1;\r\n\t\tthis.numberOfResults = 0;\r\n\r\n\t\tthis.maxPageLegal = 1;\r\n\t\tthis.lastItemIndexLegal = 5;\r\n\t\tthis.firstItemIndexLegal = 1;\r\n\t\tthis.numberOfResultsLegal = 0;\r\n\t}\r\n\r\n\tgetFirstLegal() {\r\n\t\tif (this.pageNumber !== 1) {\r\n\t\t\tthis.pageNumber = 1;\r\n\r\n\t\t\tthis.NavigationService.gotoTop(this.scrollSpeed);\r\n\t\t}\r\n\t}\r\n\r\n\tgetPreviousLegal() {\r\n\t\tif (this.pageNumber > 1) {\r\n\t\t\tthis.pageNumber = this.pageNumber - 1;\r\n\t\t\tthis.NavigationService.gotoTop(this.scrollSpeed);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextLegal() {\r\n\t\tif (this.pageNumber < this.maxPageLegal) {\r\n\t\t\tthis.pageNumber = this.pageNumber + 1;\r\n\t\t\tthis.NavigationService.gotoTop(this.scrollSpeed);\r\n\t\t}\r\n\t}\r\n\r\n\tgetLastLegal() {\r\n\t\tif (this.pageNumber !== this.maxPageLegal) {\r\n\t\t\tthis.pageNumber = this.maxPageLegal;\r\n\t\t\tthis.NavigationService.gotoTop(this.scrollSpeed);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetFirst() {\r\n\t\tif (this.pageNumber !== 1) {\r\n\t\t\tthis.pageNumber = 1;\r\n\r\n\t\t\tthis.NavigationService.gotoTop(this.scrollSpeed);\r\n\t\t}\r\n\t}\r\n\r\n\tgetPrevious() {\r\n\t\tif (this.pageNumber > 1) {\r\n\t\t\tthis.pageNumber = this.pageNumber - 1;\r\n\t\t\tthis.NavigationService.gotoTop(this.scrollSpeed);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNext() {\r\n\t\tif (this.pageNumber < this.maxPage) {\r\n\t\t\tthis.pageNumber = this.pageNumber + 1;\r\n\t\t\tthis.NavigationService.gotoTop(this.scrollSpeed);\r\n\t\t}\r\n\t}\r\n\r\n\tgetLast() {\r\n\t\tif (this.pageNumber !== this.maxPage) {\r\n\t\t\tthis.pageNumber = this.maxPage;\r\n\t\t\tthis.NavigationService.gotoTop(this.scrollSpeed);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ (NavigationService) => new PagingService(NavigationService);\r\n","//@ts-check\r\n\r\nclass TelemetryService {\r\n\tconstructor($http, Utility, $timeout, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\t}\r\n\r\n\tasync logTelemetry(action, description) {\r\n\t\tlet url;\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\turl = await this.InternalLinksService.getLink('LogTelemetry');\r\n\t\t\tif (!!!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/telemetry/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('LogTelemetry');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\t\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n\t\t\tconst telemetryLog = {\r\n\t\t\t\taction,\r\n\t\t\t\tuserProfile,\r\n\t\t\t\tdescription\r\n\t\t\t};\r\n\r\n\t\t\tawait this.$http.post(url, telemetryLog, { headers });\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve());\r\n\t\t} catch (error) {\r\n\t\t\tconst msg = 'Error while logging telemetry';\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(`${msg}\\n${error}`));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, Utility, $timeout, LocalStorageService, InternalLinksService) =>\r\n\tnew TelemetryService($http, Utility, $timeout, LocalStorageService, InternalLinksService);\r\n","//@ts-check\r\n\r\nclass UserUnitsService {\r\n\tconstructor($http, $timeout, Utility, $rootScope, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.Utility = Utility;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$rootScope = $rootScope;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {}\r\n\r\n\tasync getUserUnits() {\r\n\t\tlet unitList;\r\n\r\n\t\tlet promise;\r\n\t\tlet promiseHandler = {};\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst user = this.LocalStorageService.retrieve('userProfile');\r\n\t\t\tif (user) {\r\n\t\t\t\tuser.BuildingProfiles.forEach((buildingProfile) => {\r\n\t\t\t\t\tif (!unitList) {\r\n\t\t\t\t\t\tunitList = [];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconst schemeName = buildingProfile.SchemeName;\r\n\t\t\t\t\tconst units = buildingProfile.BuildingProfileUnit;\r\n\t\t\t\t\tconst schemeReference = buildingProfile.SchemeReference;\r\n\r\n\t\t\t\t\tlet buildingUnitList = [];\r\n\r\n\t\t\t\t\tunits.forEach((unit) => {\r\n\t\t\t\t\t\tconst temp = {\r\n\t\t\t\t\t\t\tSchemeName: schemeName,\r\n\t\t\t\t\t\t\tCardCode: unit.CardCode,\r\n\t\t\t\t\t\t\tSchemeReference: schemeReference\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\tbuildingUnitList = [ ...buildingUnitList, temp ];\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tunitList = [ ...unitList, ...buildingUnitList ];\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tunitList = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromiseHandler.resolve(unitList);\r\n\t\t\t});\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => {\r\n\t\t\t\tpromiseHandler.reject(err);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getFriendlyUnitNames() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\tlet url = await this.InternalLinksService.getLink('GetFriendlyUnitNames');\r\n\t\t\tif (!url) {\r\n\t\t\t\tawait this.InternalLinksService.getLinks('api/tenant/links', false);\r\n\t\t\t\turl = await this.InternalLinksService.getLink('GetFriendlyUnitNames');\r\n\t\t\t}\r\n\r\n\t\t\tconst cardCodes = await this.getFriendlyUnitNamesStringArray();\r\n\r\n\t\t\tconst headers = this.Utility.headersWithContentType;\r\n\r\n\t\t\tconst results = await this.$http.post(url, cardCodes, { headers });\r\n\t\t\tconst { data } = results;\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(data));\r\n\t\t} catch (error) {\r\n\t\t\tconst msg = `Could not get friendly unit names.`;\r\n\t\t\tconsole.error(msg, error);\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(error));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync getFriendlyUnitNamesStringArray() {\r\n\t\tconst cardCodes = await this.getUserUnits();\r\n\t\tconst stringCardCodes = this._cardCodesToString(cardCodes);\r\n\r\n\t\treturn stringCardCodes;\r\n\t}\r\n\r\n\tasync getFriendlyUnitNamesWithUserBuildingNames() {\r\n\t\tlet unitsWithDistinctBuildings;\r\n\r\n\t\tconst allUserUnits = await this.getUserUnits();\r\n\t\tconst buildings = allUserUnits.map((unit) => unit.SchemeReference);\r\n\t\tunitsWithDistinctBuildings = buildings.map((building) => {\r\n\t\t\tconst units = allUserUnits.filter((unit) => unit.SchemeReference === building);\r\n\r\n\t\t\treturn {\r\n\t\t\t\tunits: units.map((unit) => unit.CardCode),\r\n\t\t\t\tbuilding\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\treturn unitsWithDistinctBuildings;\r\n\t}\r\n\r\n\t_cardCodesToString(cardCodes) {\r\n\t\tconst mapped = cardCodes.map((cardCode) => {\r\n\t\t\tconst { CardCode } = cardCode;\r\n\t\t\treturn CardCode;\r\n\t\t});\r\n\r\n\t\treturn mapped;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, $timeout, Utility, $rootScope, LocalStorageService, InternalLinksService) =>\r\n\tnew UserUnitsService($http, $timeout, Utility, $rootScope, LocalStorageService, InternalLinksService);\r\n","//@ts-check\r\n\r\nif (!PretorCDNAddress) {\r\n\t//replace starts here\r\n\tvar PretorCDNAddress = 'https://ptgweblivestaging.pretor.co.za:444/';\r\n\t//replace ends here\r\n\t//DO NOT DELETE THE ABOVE COMMENTS - ITS BEING USED BY THE BUILD STEP!!!\r\n}\r\n\r\nclass UtilityService {\r\n\tconstructor($http, $timeout, $location, PretorCache, LocalStorageService, InternalLinksService) {\r\n\t\tthis.$http = $http;\r\n\t\tthis.$timeout = $timeout;\r\n\t\tthis.$location = $location;\r\n\t\tthis.PretorCache = PretorCache;\r\n\t\tthis.LocalStorageService = LocalStorageService;\r\n\t\tthis.InternalLinksService = InternalLinksService;\r\n\r\n\t\tthis.init();\r\n\t}\r\n\r\n\tinit() {\r\n\t\tthis.apiRetry = {\r\n\t\t\tunits: 'ms',\r\n\t\t\tvalue: 1800\r\n\t\t};\r\n\t\tthis.dateTimeFormat = 'DD MMM YYYY HH:mm:ss A';\r\n\r\n\t\tthis.loadingImage =\r\n\t\t\t(_.endsWith(PretorCDNAddress, '/') ? PretorCDNAddress : PretorCDNAddress + '/') + 'images/pretor.gif';\r\n\r\n\t\tthis.loadingDocumentImage =\r\n\t\t\t(_.endsWith(PretorCDNAddress, '/') ? PretorCDNAddress : PretorCDNAddress + '/') + 'images/loading doc.gif';\r\n\r\n\t\tthis.largePretorLogo =\r\n\t\t\t(_.endsWith(PretorCDNAddress, '/') ? PretorCDNAddress : PretorCDNAddress + '/') +\r\n\t\t\t'images/email/pretor_group_logo.png';\r\n\r\n\t\tthis.smallPretorLogo =\r\n\t\t\t(_.endsWith(PretorCDNAddress, '/') ? PretorCDNAddress : PretorCDNAddress + '/') +\r\n\t\t\t'images/logo_pretor.png';\r\n\t}\r\n\r\n\tQueryString(queryStringName) {\r\n\t\tlet url = this.$location.absUrl().toLowerCase();\r\n\t\tlet name = queryStringName.toLowerCase().replace(/[\\[\\]]/g, '\\\\$&');\r\n\r\n\t\tif (!url) {\r\n\t\t\turl = this.$location.absUrl().toLowerCase();\r\n\t\t}\r\n\r\n\t\tconst regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`),\r\n\t\t\tresults = regex.exec(url);\r\n\r\n\t\tif (!results) return null;\r\n\r\n\t\tif (!results[2]) return '';\r\n\r\n\t\treturn decodeURIComponent(results[2].replace(/\\+/g, ' '));\r\n\t}\r\n\r\n\tbuildingRefsAreEqual(newValue, oldValue) {\r\n\t\tlet oldRef = oldValue;\r\n\t\tlet newRef = newValue;\r\n\t\tif (!!oldRef && typeof oldRef === 'object') {\r\n\t\t\toldRef = oldRef.SchemeReference.toLowerCase().trim();\r\n\t\t}\r\n\r\n\t\tif (!!newRef && typeof newRef === 'object') {\r\n\t\t\tnewRef = newRef.SchemeReference.toLowerCase().trim();\r\n\t\t}\r\n\t\tconst results = oldRef === newRef;\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tbuildingRefSameAsOld(newRef) {\r\n\t\tlet oldRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\t\tif (typeof oldRef === 'object') {\r\n\t\t\toldRef = oldRef.SchemeReference.toLowerCase().trim();\r\n\t\t}\r\n\r\n\t\tif (typeof newRef === 'object') {\r\n\t\t\tnewRef = newRef.SchemeReference.toLowerCase().trim();\r\n\t\t}\r\n\t\tconst results = oldRef === newRef;\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tasync loadLoader() {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tconst url = PretorCDNAddress.endsWith('/') ? PretorCDNAddress : `${PretorCDNAddress}/'images/pretor.gif`;\r\n\r\n\t\t\tconst results = await this.$http.get(url, { cache: this.PretorCache });\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results));\r\n\t\t} catch (err) {\r\n\t\t\tconsole.error('Pretor Loader could not be cached :(');\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tasync checkIfFileExists(fileUrl) {\r\n\t\tlet promise, promiseHandler;\r\n\r\n\t\ttry {\r\n\t\t\tpromise = new Promise((resolve, reject) => {\r\n\t\t\t\tpromiseHandler = {\r\n\t\t\t\t\treject,\r\n\t\t\t\t\tresolve\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\t\tlet url = this.InternalLinksService.getLink('CheckIfFileExists');\r\n\r\n\t\t\tif (!url) {\r\n\t\t\t\tthis.InternalLinksService.getLinks('/api/documents/links');\r\n\t\t\t\turl = this.InternalLinksService.getLink('CheckIfFileExists');\r\n\t\t\t}\r\n\r\n\t\t\tconst headers = this.headersWithContentType;\r\n\t\t\tconst results = await this.$http.post(url, { fileUrl: fileUrl }, { headers });\r\n\t\t\tthis.$timeout(() => promiseHandler.resolve(results.data));\r\n\t\t} catch (err) {\r\n\t\t\tthis.$timeout(() => promiseHandler.reject(err));\r\n\t\t}\r\n\r\n\t\treturn promise;\r\n\t}\r\n\r\n\tgetFormatedDate(date, isString) {\r\n\t\tconst momentDate = isString ? moment(date, 'MM-DD-YYYY') : moment(date);\r\n\t\tconst formatedDateString = momentDate.format('MM-DD-YYYY');\r\n\t\tconst formatedDate = moment(formatedDateString, 'MM-DD-YYYY').add(3, 'h').toDate();\r\n\r\n\t\treturn formatedDate;\r\n\t}\r\n\r\n\thasQueryString(queryString) {\r\n\t\tqueryString = queryString.toLowerCase().trim();\r\n\t\tconst foundQueryString = this.QueryString(queryString);\r\n\r\n\t\treturn foundQueryString;\r\n\t}\r\n\r\n\tgenerateDocumentUrl(guid, ext) {\r\n\t\tconst baseAddress = `${pretorOnlineUrl}${pretorOnlineUrl.endsWith('/') ? '' : '/'}`;\r\n\t\tconst url = `${baseAddress}documents/byId/${guid}${ext || ''}/?handleNotFound=false`;\r\n\r\n\t\treturn url;\r\n\t}\r\n\r\n\tsafeApply(scope, fn) {\r\n\t\treturn scope.$$phase || scope.$root.$$phase ? fn() : scope.$apply(fn);\r\n\t}\r\n\r\n\tmapForClient(original) {\r\n\t\tconst transformed = {};\r\n\r\n\t\tif (!original) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tObject.keys(original).map((key) => {\r\n\t\t\tconst newKey = `${key.substr(0, 1).toLowerCase()}${key.substr(1)}`;\r\n\t\t\ttransformed[newKey] = original[key];\r\n\t\t});\r\n\r\n\t\treturn transformed;\r\n\t}\r\n\r\n\tmapForServer(original) {\r\n\t\tconst transformed = {};\r\n\r\n\t\tif (!original) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tObject.keys(original).map((key) => {\r\n\t\t\tconst newKey = `${key.substr(0, 1).toUpperCase()}${key.substr(1)}`;\r\n\t\t\ttransformed[newKey] = original[key];\r\n\t\t});\r\n\r\n\t\treturn transformed;\r\n\t}\r\n\r\n get headersWithContentType() {\r\n \r\n\t\tconst headers = this.headers;\r\n\t\treturn {\r\n\t\t\t...headers,\r\n\t\t\t'content-type': 'application/json'\r\n\t\t};\r\n\t}\r\n\r\n\tget basicHeaders() {\r\n\t\treturn {\r\n\t\t\t'content-type': 'application/json'\r\n\t\t};\r\n\t}\r\n\r\n\tget headers() {\r\n\t\tconst userProfile = this.LocalStorageService.retrieve('userProfile');\r\n const userSession = this.LocalStorageService.retrieve('userSession');\r\n\r\n if(!!!userSession){\r\n\t\t\tconsole.log(\"Session Profile not loaded\");\r\n throw `Could not retrieve 'sessionToken' and\\or 'userName' to send as the HTTP Headers`;\r\n\t\t}\r\n \r\n const sessionToken = userSession.SessionToken;\r\n\t\tconst userName = userProfile.UserName || userProfile.WebUsername;\r\n //\r\n\t\tif (!(sessionToken && sessionToken.length > 2) || !(userName && userName.length > 2)) {\r\n\t\t\tthrow `Could not retrieve 'sessionToken' and\\or 'userName' to send as the HTTP Headers`;\r\n\t\t}\r\n\r\n\t\tconst headers = {\r\n\t\t\tuserName,\r\n\t\t\tsessionToken\r\n\t\t};\r\n\r\n\t\treturn headers;\r\n\t}\r\n\r\n\tget selectedBuildingRef() {\r\n\t\tlet selectedBuilding;\r\n\r\n\t\tconst selectedRef = this.LocalStorageService.retrieve('selectedBuildingRef');\r\n\t\tif (typeof selectedRef === 'object') {\r\n\t\t\tselectedBuilding = selectedRef.SchemeReference.trim();\r\n\t\t} else {\r\n\t\t\tselectedBuilding = selectedRef.trim();\r\n\t\t}\r\n if (!selectedBuilding) {\r\n let selectedBuildingRefQueryString = this.QueryString('DBRef');\r\n if (selectedBuildingRefQueryString) {\r\n this.selectedBuilding = selectedBuildingRefQueryString.toUpperCase();\r\n }\r\n }\r\n\r\n\t\treturn selectedBuilding;\r\n\t}\r\n}\r\n\r\nexport default /* @ngInject */ ($http, $timeout, $location, PretorCache, LocalStorageService, InternalLinksService) =>\r\n\tnew UtilityService($http, $timeout, $location, PretorCache, LocalStorageService, InternalLinksService);\r\n","/**\n * Random utility functions used in the UI-Router code\n *\n * These functions are exported, but are subject to change without notice.\n *\n * @preferred @publicapi @module common\n */ /** */\nimport { isFunction, isString, isArray, isRegExp, isDate } from './predicates';\nimport { all, any, prop, curry, not } from './hof';\nimport { services } from './coreservices';\nexport var root = (typeof self === 'object' && self.self === self && self) ||\n (typeof global === 'object' && global.global === global && global) ||\n this;\nvar angular = root.angular || {};\nexport var fromJson = angular.fromJson || JSON.parse.bind(JSON);\nexport var toJson = angular.toJson || JSON.stringify.bind(JSON);\nexport var forEach = angular.forEach || _forEach;\nexport var extend = Object.assign || _extend;\nexport var equals = angular.equals || _equals;\nexport function identity(x) {\n return x;\n}\nexport function noop() { }\n/**\n * Builds proxy functions on the `to` object which pass through to the `from` object.\n *\n * For each key in `fnNames`, creates a proxy function on the `to` object.\n * The proxy function calls the real function on the `from` object.\n *\n *\n * #### Example:\n * This example creates an new class instance whose functions are prebound to the new'd object.\n * ```js\n * class Foo {\n * constructor(data) {\n * // Binds all functions from Foo.prototype to 'this',\n * // then copies them to 'this'\n * bindFunctions(Foo.prototype, this, this);\n * this.data = data;\n * }\n *\n * log() {\n * console.log(this.data);\n * }\n * }\n *\n * let myFoo = new Foo([1,2,3]);\n * var logit = myFoo.log;\n * logit(); // logs [1, 2, 3] from the myFoo 'this' instance\n * ```\n *\n * #### Example:\n * This example creates a bound version of a service function, and copies it to another object\n * ```\n *\n * var SomeService = {\n * this.data = [3, 4, 5];\n * this.log = function() {\n * console.log(this.data);\n * }\n * }\n *\n * // Constructor fn\n * function OtherThing() {\n * // Binds all functions from SomeService to SomeService,\n * // then copies them to 'this'\n * bindFunctions(SomeService, this, SomeService);\n * }\n *\n * let myOtherThing = new OtherThing();\n * myOtherThing.log(); // logs [3, 4, 5] from SomeService's 'this'\n * ```\n *\n * @param source A function that returns the source object which contains the original functions to be bound\n * @param target A function that returns the target object which will receive the bound functions\n * @param bind A function that returns the object which the functions will be bound to\n * @param fnNames The function names which will be bound (Defaults to all the functions found on the 'from' object)\n * @param latebind If true, the binding of the function is delayed until the first time it's invoked\n */\nexport function createProxyFunctions(source, target, bind, fnNames, latebind) {\n if (latebind === void 0) { latebind = false; }\n var bindFunction = function (fnName) { return source()[fnName].bind(bind()); };\n var makeLateRebindFn = function (fnName) {\n return function lateRebindFunction() {\n target[fnName] = bindFunction(fnName);\n return target[fnName].apply(null, arguments);\n };\n };\n fnNames = fnNames || Object.keys(source());\n return fnNames.reduce(function (acc, name) {\n acc[name] = latebind ? makeLateRebindFn(name) : bindFunction(name);\n return acc;\n }, target);\n}\n/**\n * prototypal inheritance helper.\n * Creates a new object which has `parent` object as its prototype, and then copies the properties from `extra` onto it\n */\nexport var inherit = function (parent, extra) { return extend(Object.create(parent), extra); };\n/** Given an array, returns true if the object is found in the array, (using indexOf) */\nexport var inArray = curry(_inArray);\nexport function _inArray(array, obj) {\n return array.indexOf(obj) !== -1;\n}\n/**\n * Given an array, and an item, if the item is found in the array, it removes it (in-place).\n * The same array is returned\n */\nexport var removeFrom = curry(_removeFrom);\nexport function _removeFrom(array, obj) {\n var idx = array.indexOf(obj);\n if (idx >= 0)\n array.splice(idx, 1);\n return array;\n}\n/** pushes a values to an array and returns the value */\nexport var pushTo = curry(_pushTo);\nexport function _pushTo(arr, val) {\n return arr.push(val), val;\n}\n/** Given an array of (deregistration) functions, calls all functions and removes each one from the source array */\nexport var deregAll = function (functions) {\n return functions.slice().forEach(function (fn) {\n typeof fn === 'function' && fn();\n removeFrom(functions, fn);\n });\n};\n/**\n * Applies a set of defaults to an options object. The options object is filtered\n * to only those properties of the objects in the defaultsList.\n * Earlier objects in the defaultsList take precedence when applying defaults.\n */\nexport function defaults(opts) {\n var defaultsList = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n defaultsList[_i - 1] = arguments[_i];\n }\n var defaultVals = extend.apply(void 0, [{}].concat(defaultsList.reverse()));\n return extend(defaultVals, pick(opts || {}, Object.keys(defaultVals)));\n}\n/** Reduce function that merges each element of the list into a single object, using extend */\nexport var mergeR = function (memo, item) { return extend(memo, item); };\n/**\n * Finds the common ancestor path between two states.\n *\n * @param {Object} first The first state.\n * @param {Object} second The second state.\n * @return {Array} Returns an array of state names in descending order, not including the root.\n */\nexport function ancestors(first, second) {\n var path = [];\n // tslint:disable-next-line:forin\n for (var n in first.path) {\n if (first.path[n] !== second.path[n])\n break;\n path.push(first.path[n]);\n }\n return path;\n}\n/**\n * Return a copy of the object only containing the whitelisted properties.\n *\n * #### Example:\n * ```\n * var foo = { a: 1, b: 2, c: 3 };\n * var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 }\n * ```\n * @param obj the source object\n * @param propNames an Array of strings, which are the whitelisted property names\n */\nexport function pick(obj, propNames) {\n var objCopy = {};\n for (var _prop in obj) {\n if (propNames.indexOf(_prop) !== -1) {\n objCopy[_prop] = obj[_prop];\n }\n }\n return objCopy;\n}\n/**\n * Return a copy of the object omitting the blacklisted properties.\n *\n * @example\n * ```\n *\n * var foo = { a: 1, b: 2, c: 3 };\n * var ab = omit(foo, ['a', 'b']); // { c: 3 }\n * ```\n * @param obj the source object\n * @param propNames an Array of strings, which are the blacklisted property names\n */\nexport function omit(obj, propNames) {\n return Object.keys(obj)\n .filter(not(inArray(propNames)))\n .reduce(function (acc, key) { return ((acc[key] = obj[key]), acc); }, {});\n}\n/**\n * Maps an array, or object to a property (by name)\n */\nexport function pluck(collection, propName) {\n return map(collection, prop(propName));\n}\n/** Filters an Array or an Object's properties based on a predicate */\nexport function filter(collection, callback) {\n var arr = isArray(collection), result = arr ? [] : {};\n var accept = arr ? function (x) { return result.push(x); } : function (x, key) { return (result[key] = x); };\n forEach(collection, function (item, i) {\n if (callback(item, i))\n accept(item, i);\n });\n return result;\n}\n/** Finds an object from an array, or a property of an object, that matches a predicate */\nexport function find(collection, callback) {\n var result;\n forEach(collection, function (item, i) {\n if (result)\n return;\n if (callback(item, i))\n result = item;\n });\n return result;\n}\n/** Given an object, returns a new object, where each property is transformed by the callback function */\nexport var mapObj = map;\n/** Maps an array or object properties using a callback function */\nexport function map(collection, callback, target) {\n target = target || (isArray(collection) ? [] : {});\n forEach(collection, function (item, i) { return (target[i] = callback(item, i)); });\n return target;\n}\n/**\n * Given an object, return its enumerable property values\n *\n * @example\n * ```\n *\n * let foo = { a: 1, b: 2, c: 3 }\n * let vals = values(foo); // [ 1, 2, 3 ]\n * ```\n */\nexport var values = function (obj) { return Object.keys(obj).map(function (key) { return obj[key]; }); };\n/**\n * Reduce function that returns true if all of the values are truthy.\n *\n * @example\n * ```\n *\n * let vals = [ 1, true, {}, \"hello world\"];\n * vals.reduce(allTrueR, true); // true\n *\n * vals.push(0);\n * vals.reduce(allTrueR, true); // false\n * ```\n */\nexport var allTrueR = function (memo, elem) { return memo && elem; };\n/**\n * Reduce function that returns true if any of the values are truthy.\n *\n * * @example\n * ```\n *\n * let vals = [ 0, null, undefined ];\n * vals.reduce(anyTrueR, true); // false\n *\n * vals.push(\"hello world\");\n * vals.reduce(anyTrueR, true); // true\n * ```\n */\nexport var anyTrueR = function (memo, elem) { return memo || elem; };\n/**\n * Reduce function which un-nests a single level of arrays\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * input.reduce(unnestR, []) // [ \"a\", \"b\", \"c\", \"d\", [ \"double, \"nested\" ] ]\n * ```\n */\nexport var unnestR = function (memo, elem) { return memo.concat(elem); };\n/**\n * Reduce function which recursively un-nests all arrays\n *\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * input.reduce(unnestR, []) // [ \"a\", \"b\", \"c\", \"d\", \"double, \"nested\" ]\n * ```\n */\nexport var flattenR = function (memo, elem) {\n return isArray(elem) ? memo.concat(elem.reduce(flattenR, [])) : pushR(memo, elem);\n};\n/**\n * Reduce function that pushes an object to an array, then returns the array.\n * Mostly just for [[flattenR]] and [[uniqR]]\n */\nexport function pushR(arr, obj) {\n arr.push(obj);\n return arr;\n}\n/** Reduce function that filters out duplicates */\nexport var uniqR = function (acc, token) { return (inArray(acc, token) ? acc : pushR(acc, token)); };\n/**\n * Return a new array with a single level of arrays unnested.\n *\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * unnest(input) // [ \"a\", \"b\", \"c\", \"d\", [ \"double, \"nested\" ] ]\n * ```\n */\nexport var unnest = function (arr) { return arr.reduce(unnestR, []); };\n/**\n * Return a completely flattened version of an array.\n *\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * flatten(input) // [ \"a\", \"b\", \"c\", \"d\", \"double, \"nested\" ]\n * ```\n */\nexport var flatten = function (arr) { return arr.reduce(flattenR, []); };\n/**\n * Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass.\n * @example\n * ```\n *\n * let isNumber = (obj) => typeof(obj) === 'number';\n * let allNumbers = [ 1, 2, 3, 4, 5 ];\n * allNumbers.filter(assertPredicate(isNumber)); //OK\n *\n * let oneString = [ 1, 2, 3, 4, \"5\" ];\n * oneString.filter(assertPredicate(isNumber, \"Not all numbers\")); // throws Error(\"\"Not all numbers\"\");\n * ```\n */\nexport var assertPredicate = assertFn;\n/**\n * Given a .map function, builds a .map function which throws an error if any mapped elements do not pass a truthyness test.\n * @example\n * ```\n *\n * var data = { foo: 1, bar: 2 };\n *\n * let keys = [ 'foo', 'bar' ]\n * let values = keys.map(assertMap(key => data[key], \"Key not found\"));\n * // values is [1, 2]\n *\n * let keys = [ 'foo', 'bar', 'baz' ]\n * let values = keys.map(assertMap(key => data[key], \"Key not found\"));\n * // throws Error(\"Key not found\")\n * ```\n */\nexport var assertMap = assertFn;\nexport function assertFn(predicateOrMap, errMsg) {\n if (errMsg === void 0) { errMsg = 'assert failure'; }\n return function (obj) {\n var result = predicateOrMap(obj);\n if (!result) {\n throw new Error(isFunction(errMsg) ? errMsg(obj) : errMsg);\n }\n return result;\n };\n}\n/**\n * Like _.pairs: Given an object, returns an array of key/value pairs\n *\n * @example\n * ```\n *\n * pairs({ foo: \"FOO\", bar: \"BAR }) // [ [ \"foo\", \"FOO\" ], [ \"bar\": \"BAR\" ] ]\n * ```\n */\nexport var pairs = function (obj) { return Object.keys(obj).map(function (key) { return [key, obj[key]]; }); };\n/**\n * Given two or more parallel arrays, returns an array of tuples where\n * each tuple is composed of [ a[i], b[i], ... z[i] ]\n *\n * @example\n * ```\n *\n * let foo = [ 0, 2, 4, 6 ];\n * let bar = [ 1, 3, 5, 7 ];\n * let baz = [ 10, 30, 50, 70 ];\n * arrayTuples(foo, bar); // [ [0, 1], [2, 3], [4, 5], [6, 7] ]\n * arrayTuples(foo, bar, baz); // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ]\n * ```\n */\nexport function arrayTuples() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 0)\n return [];\n var maxArrayLen = args.reduce(function (min, arr) { return Math.min(arr.length, min); }, 9007199254740991); // aka 2^53 − 1 aka Number.MAX_SAFE_INTEGER\n var result = [];\n var _loop_1 = function (i) {\n // This is a hot function\n // Unroll when there are 1-4 arguments\n switch (args.length) {\n case 1:\n result.push([args[0][i]]);\n break;\n case 2:\n result.push([args[0][i], args[1][i]]);\n break;\n case 3:\n result.push([args[0][i], args[1][i], args[2][i]]);\n break;\n case 4:\n result.push([args[0][i], args[1][i], args[2][i], args[3][i]]);\n break;\n default:\n result.push(args.map(function (array) { return array[i]; }));\n break;\n }\n };\n for (var i = 0; i < maxArrayLen; i++) {\n _loop_1(i);\n }\n return result;\n}\n/**\n * Reduce function which builds an object from an array of [key, value] pairs.\n *\n * Each iteration sets the key/val pair on the memo object, then returns the memo for the next iteration.\n *\n * Each keyValueTuple should be an array with values [ key: string, value: any ]\n *\n * @example\n * ```\n *\n * var pairs = [ [\"fookey\", \"fooval\"], [\"barkey\", \"barval\"] ]\n *\n * var pairsToObj = pairs.reduce((memo, pair) => applyPairs(memo, pair), {})\n * // pairsToObj == { fookey: \"fooval\", barkey: \"barval\" }\n *\n * // Or, more simply:\n * var pairsToObj = pairs.reduce(applyPairs, {})\n * // pairsToObj == { fookey: \"fooval\", barkey: \"barval\" }\n * ```\n */\nexport function applyPairs(memo, keyValTuple) {\n var key, value;\n if (isArray(keyValTuple))\n key = keyValTuple[0], value = keyValTuple[1];\n if (!isString(key))\n throw new Error('invalid parameters to applyPairs');\n memo[key] = value;\n return memo;\n}\n/** Get the last element of an array */\nexport function tail(arr) {\n return (arr.length && arr[arr.length - 1]) || undefined;\n}\n/**\n * shallow copy from src to dest\n */\nexport function copy(src, dest) {\n if (dest)\n Object.keys(dest).forEach(function (key) { return delete dest[key]; });\n if (!dest)\n dest = {};\n return extend(dest, src);\n}\n/** Naive forEach implementation works with Objects or Arrays */\nfunction _forEach(obj, cb, _this) {\n if (isArray(obj))\n return obj.forEach(cb, _this);\n Object.keys(obj).forEach(function (key) { return cb(obj[key], key); });\n}\nexport function _extend(toObj) {\n for (var i = 1; i < arguments.length; i++) {\n var obj = arguments[i];\n if (!obj)\n continue;\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; j++) {\n toObj[keys[j]] = obj[keys[j]];\n }\n }\n return toObj;\n}\nfunction _equals(o1, o2) {\n if (o1 === o2)\n return true;\n if (o1 === null || o2 === null)\n return false;\n if (o1 !== o1 && o2 !== o2)\n return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2;\n if (t1 !== t2 || t1 !== 'object')\n return false;\n var tup = [o1, o2];\n if (all(isArray)(tup))\n return _arraysEq(o1, o2);\n if (all(isDate)(tup))\n return o1.getTime() === o2.getTime();\n if (all(isRegExp)(tup))\n return o1.toString() === o2.toString();\n if (all(isFunction)(tup))\n return true; // meh\n var predicates = [isFunction, isArray, isDate, isRegExp];\n if (predicates.map(any).reduce(function (b, fn) { return b || !!fn(tup); }, false))\n return false;\n var keys = {};\n // tslint:disable-next-line:forin\n for (var key in o1) {\n if (!_equals(o1[key], o2[key]))\n return false;\n keys[key] = true;\n }\n for (var key in o2) {\n if (!keys[key])\n return false;\n }\n return true;\n}\nfunction _arraysEq(a1, a2) {\n if (a1.length !== a2.length)\n return false;\n return arrayTuples(a1, a2).reduce(function (b, t) { return b && _equals(t[0], t[1]); }, true);\n}\n// issue #2676\nexport var silenceUncaughtInPromise = function (promise) { return promise.catch(function (e) { return 0; }) && promise; };\nexport var silentRejection = function (error) { return silenceUncaughtInPromise(services.$q.reject(error)); };\n//# sourceMappingURL=common.js.map","var noImpl = function (fnname) { return function () {\n throw new Error(\"No implementation for \" + fnname + \". The framework specific code did not implement this method.\");\n}; };\nexport var makeStub = function (service, methods) {\n return methods.reduce(function (acc, key) { return ((acc[key] = noImpl(service + \".\" + key + \"()\")), acc); }, {});\n};\nvar services = {\n $q: undefined,\n $injector: undefined,\n};\nexport { services };\n//# sourceMappingURL=coreservices.js.map","/** @publicapi @module core */\n/**\n * Matches state names using glob-like pattern strings.\n *\n * Globs can be used in specific APIs including:\n *\n * - [[StateService.is]]\n * - [[StateService.includes]]\n * - The first argument to Hook Registration functions like [[TransitionService.onStart]]\n * - [[HookMatchCriteria]] and [[HookMatchCriterion]]\n *\n * A `Glob` string is a pattern which matches state names.\n * Nested state names are split into segments (separated by a dot) when processing.\n * The state named `foo.bar.baz` is split into three segments ['foo', 'bar', 'baz']\n *\n * Globs work according to the following rules:\n *\n * ### Exact match:\n *\n * The glob `'A.B'` matches the state named exactly `'A.B'`.\n *\n * | Glob |Matches states named|Does not match state named|\n * |:------------|:--------------------|:---------------------|\n * | `'A'` | `'A'` | `'B'` , `'A.C'` |\n * | `'A.B'` | `'A.B'` | `'A'` , `'A.B.C'` |\n * | `'foo'` | `'foo'` | `'FOO'` , `'foo.bar'`|\n *\n * ### Single star (`*`)\n *\n * A single star (`*`) is a wildcard that matches exactly one segment.\n *\n * | Glob |Matches states named |Does not match state named |\n * |:------------|:---------------------|:--------------------------|\n * | `'*'` | `'A'` , `'Z'` | `'A.B'` , `'Z.Y.X'` |\n * | `'A.*'` | `'A.B'` , `'A.C'` | `'A'` , `'A.B.C'` |\n * | `'A.*.*'` | `'A.B.C'` , `'A.X.Y'`| `'A'`, `'A.B'` , `'Z.Y.X'`|\n *\n * ### Double star (`**`)\n *\n * A double star (`'**'`) is a wildcard that matches *zero or more segments*\n *\n * | Glob |Matches states named |Does not match state named |\n * |:------------|:----------------------------------------------|:----------------------------------|\n * | `'**'` | `'A'` , `'A.B'`, `'Z.Y.X'` | (matches all states) |\n * | `'A.**'` | `'A'` , `'A.B'` , `'A.C.X'` | `'Z.Y.X'` |\n * | `'**.X'` | `'X'` , `'A.X'` , `'Z.Y.X'` | `'A'` , `'A.login.Z'` |\n * | `'A.**.X'` | `'A.X'` , `'A.B.X'` , `'A.B.C.X'` | `'A'` , `'A.B.C'` |\n *\n */\nvar Glob = /** @class */ (function () {\n function Glob(text) {\n this.text = text;\n this.glob = text.split('.');\n var regexpString = this.text\n .split('.')\n .map(function (seg) {\n if (seg === '**')\n return '(?:|(?:\\\\.[^.]*)*)';\n if (seg === '*')\n return '\\\\.[^.]*';\n return '\\\\.' + seg;\n })\n .join('');\n this.regexp = new RegExp('^' + regexpString + '$');\n }\n /** Returns true if the string has glob-like characters in it */\n Glob.is = function (text) {\n return !!/[!,*]+/.exec(text);\n };\n /** Returns a glob from the string, or null if the string isn't Glob-like */\n Glob.fromString = function (text) {\n return Glob.is(text) ? new Glob(text) : null;\n };\n Glob.prototype.matches = function (name) {\n return this.regexp.test('.' + name);\n };\n return Glob;\n}());\nexport { Glob };\n//# sourceMappingURL=glob.js.map","/**\n * Higher order functions\n *\n * These utility functions are exported, but are subject to change without notice.\n *\n * @module common_hof\n */ /** */\n/**\n * Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function.\n *\n * Given a function with N parameters, returns a new function that supports partial application.\n * The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters,\n * where M is less than N, it returns a new function that accepts the remaining parameters. It continues to\n * accept more parameters until all N parameters have been supplied.\n *\n *\n * This contrived example uses a partially applied function as an predicate, which returns true\n * if an object is found in both arrays.\n * @example\n * ```\n * // returns true if an object is in both of the two arrays\n * function inBoth(array1, array2, object) {\n * return array1.indexOf(object) !== -1 &&\n * array2.indexOf(object) !== 1;\n * }\n * let obj1, obj2, obj3, obj4, obj5, obj6, obj7\n * let foos = [obj1, obj3]\n * let bars = [obj3, obj4, obj5]\n *\n * // A curried \"copy\" of inBoth\n * let curriedInBoth = curry(inBoth);\n * // Partially apply both the array1 and array2\n * let inFoosAndBars = curriedInBoth(foos, bars);\n *\n * // Supply the final argument; since all arguments are\n * // supplied, the original inBoth function is then called.\n * let obj1InBoth = inFoosAndBars(obj1); // false\n *\n * // Use the inFoosAndBars as a predicate.\n * // Filter, on each iteration, supplies the final argument\n * let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ];\n * let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ]\n *\n * ```\n *\n * Stolen from: http://stackoverflow.com/questions/4394747/javascript-curry-function\n *\n * @param fn\n * @returns {*|function(): (*|any)}\n */\nexport function curry(fn) {\n var initial_args = [].slice.apply(arguments, [1]);\n var func_args_length = fn.length;\n function curried(args) {\n if (args.length >= func_args_length)\n return fn.apply(null, args);\n return function () {\n return curried(args.concat([].slice.apply(arguments)));\n };\n }\n return curried(initial_args);\n}\n/**\n * Given a varargs list of functions, returns a function that composes the argument functions, right-to-left\n * given: f(x), g(x), h(x)\n * let composed = compose(f,g,h)\n * then, composed is: f(g(h(x)))\n */\nexport function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function () {\n var i = start, result = args[start].apply(this, arguments);\n while (i--)\n result = args[i].call(this, result);\n return result;\n };\n}\n/**\n * Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right\n * given: f(x), g(x), h(x)\n * let piped = pipe(f,g,h);\n * then, piped is: h(g(f(x)))\n */\nexport function pipe() {\n var funcs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n funcs[_i] = arguments[_i];\n }\n return compose.apply(null, [].slice.call(arguments).reverse());\n}\n/**\n * Given a property name, returns a function that returns that property from an object\n * let obj = { foo: 1, name: \"blarg\" };\n * let getName = prop(\"name\");\n * getName(obj) === \"blarg\"\n */\nexport var prop = function (name) { return function (obj) { return obj && obj[name]; }; };\n/**\n * Given a property name and a value, returns a function that returns a boolean based on whether\n * the passed object has a property that matches the value\n * let obj = { foo: 1, name: \"blarg\" };\n * let getName = propEq(\"name\", \"blarg\");\n * getName(obj) === true\n */\nexport var propEq = curry(function (name, _val, obj) { return obj && obj[name] === _val; });\n/**\n * Given a dotted property name, returns a function that returns a nested property from an object, or undefined\n * let obj = { id: 1, nestedObj: { foo: 1, name: \"blarg\" }, };\n * let getName = prop(\"nestedObj.name\");\n * getName(obj) === \"blarg\"\n * let propNotFound = prop(\"this.property.doesnt.exist\");\n * propNotFound(obj) === undefined\n */\nexport var parse = function (name) { return pipe.apply(null, name.split('.').map(prop)); };\n/**\n * Given a function that returns a truthy or falsey value, returns a\n * function that returns the opposite (falsey or truthy) value given the same inputs\n */\nexport var not = function (fn) { return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return !fn.apply(null, args);\n}; };\n/**\n * Given two functions that return truthy or falsey values, returns a function that returns truthy\n * if both functions return truthy for the given arguments\n */\nexport function and(fn1, fn2) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fn1.apply(null, args) && fn2.apply(null, args);\n };\n}\n/**\n * Given two functions that return truthy or falsey values, returns a function that returns truthy\n * if at least one of the functions returns truthy for the given arguments\n */\nexport function or(fn1, fn2) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fn1.apply(null, args) || fn2.apply(null, args);\n };\n}\n/**\n * Check if all the elements of an array match a predicate function\n *\n * @param fn1 a predicate function `fn1`\n * @returns a function which takes an array and returns true if `fn1` is true for all elements of the array\n */\nexport var all = function (fn1) { return function (arr) { return arr.reduce(function (b, x) { return b && !!fn1(x); }, true); }; };\n// tslint:disable-next-line:variable-name\nexport var any = function (fn1) { return function (arr) { return arr.reduce(function (b, x) { return b || !!fn1(x); }, false); }; };\n/** Given a class, returns a Predicate function that returns true if the object is of that class */\nexport var is = function (ctor) { return function (obj) {\n return (obj != null && obj.constructor === ctor) || obj instanceof ctor;\n}; };\n/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */\nexport var eq = function (value) { return function (other) { return value === other; }; };\n/** Given a value, returns a function which returns the value */\nexport var val = function (v) { return function () { return v; }; };\nexport function invoke(fnName, args) {\n return function (obj) { return obj[fnName].apply(obj, args); };\n}\n/**\n * Sorta like Pattern Matching (a functional programming conditional construct)\n *\n * See http://c2.com/cgi/wiki?PatternMatching\n *\n * This is a conditional construct which allows a series of predicates and output functions\n * to be checked and then applied. Each predicate receives the input. If the predicate\n * returns truthy, then its matching output function (mapping function) is provided with\n * the input and, then the result is returned.\n *\n * Each combination (2-tuple) of predicate + output function should be placed in an array\n * of size 2: [ predicate, mapFn ]\n *\n * These 2-tuples should be put in an outer array.\n *\n * @example\n * ```\n *\n * // Here's a 2-tuple where the first element is the isString predicate\n * // and the second element is a function that returns a description of the input\n * let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];\n *\n * // Second tuple: predicate \"isNumber\", mapfn returns a description\n * let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];\n *\n * let third = [ (input) => input === null, (input) => `Oh, null...` ];\n *\n * let fourth = [ (input) => input === undefined, (input) => `notdefined` ];\n *\n * let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);\n *\n * console.log(descriptionOf(undefined)); // 'notdefined'\n * console.log(descriptionOf(55)); // '(55) That's a number!'\n * console.log(descriptionOf(\"foo\")); // 'Here's your string foo'\n * ```\n *\n * @param struct A 2D array. Each element of the array should be an array, a 2-tuple,\n * with a Predicate and a mapping/output function\n * @returns {function(any): *}\n */\nexport function pattern(struct) {\n return function (x) {\n for (var i = 0; i < struct.length; i++) {\n if (struct[i][0](x))\n return struct[i][1](x);\n }\n };\n}\n//# sourceMappingURL=hof.js.map","/** @publicapi @module common */ /** */\nexport * from './common';\nexport * from './coreservices';\nexport * from './glob';\nexport * from './hof';\nexport * from './predicates';\nexport * from './queue';\nexport * from './strings';\nexport * from './trace';\n//# sourceMappingURL=index.js.map","/** Predicates\n *\n * These predicates return true/false based on the input.\n * Although these functions are exported, they are subject to change without notice.\n *\n * @module common_predicates\n */ /** */\nimport { and, not, pipe, prop, or } from './hof';\nvar toStr = Object.prototype.toString;\nvar tis = function (t) { return function (x) { return typeof x === t; }; };\nexport var isUndefined = tis('undefined');\nexport var isDefined = not(isUndefined);\nexport var isNull = function (o) { return o === null; };\nexport var isNullOrUndefined = or(isNull, isUndefined);\nexport var isFunction = tis('function');\nexport var isNumber = tis('number');\nexport var isString = tis('string');\nexport var isObject = function (x) { return x !== null && typeof x === 'object'; };\nexport var isArray = Array.isArray;\nexport var isDate = (function (x) { return toStr.call(x) === '[object Date]'; });\nexport var isRegExp = (function (x) { return toStr.call(x) === '[object RegExp]'; });\n/**\n * Predicate which checks if a value is injectable\n *\n * A value is \"injectable\" if it is a function, or if it is an ng1 array-notation-style array\n * where all the elements in the array are Strings, except the last one, which is a Function\n */\nexport function isInjectable(val) {\n if (isArray(val) && val.length) {\n var head = val.slice(0, -1), tail = val.slice(-1);\n return !(head.filter(not(isString)).length || tail.filter(not(isFunction)).length);\n }\n return isFunction(val);\n}\n/**\n * Predicate which checks if a value looks like a Promise\n *\n * It is probably a Promise if it's an object, and it has a `then` property which is a Function\n */\nexport var isPromise = and(isObject, pipe(prop('then'), isFunction));\n//# sourceMappingURL=predicates.js.map","/** @publicapi @module common */ /** */\nimport { pushTo } from './common';\nvar Queue = /** @class */ (function () {\n function Queue(_items, _limit) {\n if (_items === void 0) { _items = []; }\n if (_limit === void 0) { _limit = null; }\n this._items = _items;\n this._limit = _limit;\n this._evictListeners = [];\n this.onEvict = pushTo(this._evictListeners);\n }\n Queue.prototype.enqueue = function (item) {\n var items = this._items;\n items.push(item);\n if (this._limit && items.length > this._limit)\n this.evict();\n return item;\n };\n Queue.prototype.evict = function () {\n var item = this._items.shift();\n this._evictListeners.forEach(function (fn) { return fn(item); });\n return item;\n };\n Queue.prototype.dequeue = function () {\n if (this.size())\n return this._items.splice(0, 1)[0];\n };\n Queue.prototype.clear = function () {\n var current = this._items;\n this._items = [];\n return current;\n };\n Queue.prototype.size = function () {\n return this._items.length;\n };\n Queue.prototype.remove = function (item) {\n var idx = this._items.indexOf(item);\n return idx > -1 && this._items.splice(idx, 1)[0];\n };\n Queue.prototype.peekTail = function () {\n return this._items[this._items.length - 1];\n };\n Queue.prototype.peekHead = function () {\n if (this.size())\n return this._items[0];\n };\n return Queue;\n}());\nexport { Queue };\n//# sourceMappingURL=queue.js.map","/**\n * Functions that manipulate strings\n *\n * Although these functions are exported, they are subject to change without notice.\n *\n * @module common_strings\n */ /** */\nimport { isArray, isFunction, isInjectable, isNull, isObject, isPromise, isString, isUndefined } from './predicates';\nimport { Rejection } from '../transition/rejectFactory';\nimport { identity, pushR, tail } from './common';\nimport { pattern, val } from './hof';\n/**\n * Returns a string shortened to a maximum length\n *\n * If the string is already less than the `max` length, return the string.\n * Else return the string, shortened to `max - 3` and append three dots (\"...\").\n *\n * @param max the maximum length of the string to return\n * @param str the input string\n */\nexport function maxLength(max, str) {\n if (str.length <= max)\n return str;\n return str.substr(0, max - 3) + '...';\n}\n/**\n * Returns a string, with spaces added to the end, up to a desired str length\n *\n * If the string is already longer than the desired length, return the string.\n * Else returns the string, with extra spaces on the end, such that it reaches `length` characters.\n *\n * @param length the desired length of the string to return\n * @param str the input string\n */\nexport function padString(length, str) {\n while (str.length < length)\n str += ' ';\n return str;\n}\nexport function kebobString(camelCase) {\n return camelCase\n .replace(/^([A-Z])/, function ($1) { return $1.toLowerCase(); }) // replace first char\n .replace(/([A-Z])/g, function ($1) { return '-' + $1.toLowerCase(); }); // replace rest\n}\nexport function functionToString(fn) {\n var fnStr = fnToString(fn);\n var namedFunctionMatch = fnStr.match(/^(function [^ ]+\\([^)]*\\))/);\n var toStr = namedFunctionMatch ? namedFunctionMatch[1] : fnStr;\n var fnName = fn['name'] || '';\n if (fnName && toStr.match(/function \\(/)) {\n return 'function ' + fnName + toStr.substr(9);\n }\n return toStr;\n}\nexport function fnToString(fn) {\n var _fn = isArray(fn) ? fn.slice(-1)[0] : fn;\n return (_fn && _fn.toString()) || 'undefined';\n}\nvar isRejection = Rejection.isRejectionPromise;\nvar hasToString = function (obj) {\n return isObject(obj) && !isArray(obj) && obj.constructor !== Object && isFunction(obj.toString);\n};\nvar stringifyPattern = pattern([\n [isUndefined, val('undefined')],\n [isNull, val('null')],\n [isPromise, val('[Promise]')],\n [isRejection, function (x) { return x._transitionRejection.toString(); }],\n [hasToString, function (x) { return x.toString(); }],\n [isInjectable, functionToString],\n [val(true), identity],\n]);\nexport function stringify(o) {\n var seen = [];\n function format(value) {\n if (isObject(value)) {\n if (seen.indexOf(value) !== -1)\n return '[circular ref]';\n seen.push(value);\n }\n return stringifyPattern(value);\n }\n if (isUndefined(o)) {\n // Workaround for IE & Edge Spec incompatibility where replacer function would not be called when JSON.stringify\n // is given `undefined` as value. To work around that, we simply detect `undefined` and bail out early by\n // manually stringifying it.\n return format(o);\n }\n return JSON.stringify(o, function (key, value) { return format(value); }).replace(/\\\\\"/g, '\"');\n}\n/** Returns a function that splits a string on a character or substring */\nexport var beforeAfterSubstr = function (char) { return function (str) {\n if (!str)\n return ['', ''];\n var idx = str.indexOf(char);\n if (idx === -1)\n return [str, ''];\n return [str.substr(0, idx), str.substr(idx + 1)];\n}; };\nexport var hostRegex = new RegExp('^(?:[a-z]+:)?//[^/]+/');\nexport var stripLastPathElement = function (str) { return str.replace(/\\/[^/]*$/, ''); };\nexport var splitHash = beforeAfterSubstr('#');\nexport var splitQuery = beforeAfterSubstr('?');\nexport var splitEqual = beforeAfterSubstr('=');\nexport var trimHashVal = function (str) { return (str ? str.replace(/^#/, '') : ''); };\n/**\n * Splits on a delimiter, but returns the delimiters in the array\n *\n * #### Example:\n * ```js\n * var splitOnSlashes = splitOnDelim('/');\n * splitOnSlashes(\"/foo\"); // [\"/\", \"foo\"]\n * splitOnSlashes(\"/foo/\"); // [\"/\", \"foo\", \"/\"]\n * ```\n */\nexport function splitOnDelim(delim) {\n var re = new RegExp('(' + delim + ')', 'g');\n return function (str) { return str.split(re).filter(identity); };\n}\n/**\n * Reduce fn that joins neighboring strings\n *\n * Given an array of strings, returns a new array\n * where all neighboring strings have been joined.\n *\n * #### Example:\n * ```js\n * let arr = [\"foo\", \"bar\", 1, \"baz\", \"\", \"qux\" ];\n * arr.reduce(joinNeighborsR, []) // [\"foobar\", 1, \"bazqux\" ]\n * ```\n */\nexport function joinNeighborsR(acc, x) {\n if (isString(tail(acc)) && isString(x))\n return acc.slice(0, -1).concat(tail(acc) + x);\n return pushR(acc, x);\n}\n//# sourceMappingURL=strings.js.map","/**\n * # Transition tracing (debug)\n *\n * Enable transition tracing to print transition information to the console,\n * in order to help debug your application.\n * Tracing logs detailed information about each Transition to your console.\n *\n * To enable tracing, import the [[Trace]] singleton and enable one or more categories.\n *\n * ### ES6\n * ```js\n * import {trace} from \"@uirouter/core\";\n * trace.enable(1, 5); // TRANSITION and VIEWCONFIG\n * ```\n *\n * ### CJS\n * ```js\n * let trace = require(\"@uirouter/core\").trace;\n * trace.enable(\"TRANSITION\", \"VIEWCONFIG\");\n * ```\n *\n * ### Globals\n * ```js\n * let trace = window[\"@uirouter/core\"].trace;\n * trace.enable(); // Trace everything (very verbose)\n * ```\n *\n * ### Angular 1:\n * ```js\n * app.run($trace => $trace.enable());\n * ```\n *\n * @publicapi @module trace\n */\n/* tslint:disable:no-console */\nimport { parse } from '../common/hof';\nimport { isFunction, isNumber } from '../common/predicates';\nimport { stringify, functionToString, maxLength, padString } from './strings';\n/** @hidden */\nfunction uiViewString(uiview) {\n if (!uiview)\n return 'ui-view (defunct)';\n var state = uiview.creationContext ? uiview.creationContext.name || '(root)' : '(none)';\n return \"[ui-view#\" + uiview.id + \" \" + uiview.$type + \":\" + uiview.fqn + \" (\" + uiview.name + \"@\" + state + \")]\";\n}\n/** @hidden */\nvar viewConfigString = function (viewConfig) {\n var view = viewConfig.viewDecl;\n var state = view.$context.name || '(root)';\n return \"[View#\" + viewConfig.$id + \" from '\" + state + \"' state]: target ui-view: '\" + view.$uiViewName + \"@\" + view.$uiViewContextAnchor + \"'\";\n};\n/** @hidden */\nfunction normalizedCat(input) {\n return isNumber(input) ? Category[input] : Category[Category[input]];\n}\n/** @hidden */\nvar consoleLog = Function.prototype.bind.call(console.log, console);\n/** @hidden */\nvar consoletable = isFunction(console.table) ? console.table.bind(console) : consoleLog.bind(console);\n/**\n * Trace categories Enum\n *\n * Enable or disable a category using [[Trace.enable]] or [[Trace.disable]]\n *\n * `trace.enable(Category.TRANSITION)`\n *\n * These can also be provided using a matching string, or position ordinal\n *\n * `trace.enable(\"TRANSITION\")`\n *\n * `trace.enable(1)`\n */\nvar Category;\n(function (Category) {\n Category[Category[\"RESOLVE\"] = 0] = \"RESOLVE\";\n Category[Category[\"TRANSITION\"] = 1] = \"TRANSITION\";\n Category[Category[\"HOOK\"] = 2] = \"HOOK\";\n Category[Category[\"UIVIEW\"] = 3] = \"UIVIEW\";\n Category[Category[\"VIEWCONFIG\"] = 4] = \"VIEWCONFIG\";\n})(Category || (Category = {}));\nexport { Category };\n/** @hidden */\nvar _tid = parse('$id');\n/** @hidden */\nvar _rid = parse('router.$id');\n/** @hidden */\nvar transLbl = function (trans) { return \"Transition #\" + _tid(trans) + \"-\" + _rid(trans); };\n/**\n * Prints UI-Router Transition trace information to the console.\n */\nvar Trace = /** @class */ (function () {\n /** @hidden */\n function Trace() {\n /** @hidden */\n this._enabled = {};\n this.approximateDigests = 0;\n }\n /** @hidden */\n Trace.prototype._set = function (enabled, categories) {\n var _this = this;\n if (!categories.length) {\n categories = Object.keys(Category)\n .map(function (k) { return parseInt(k, 10); })\n .filter(function (k) { return !isNaN(k); })\n .map(function (key) { return Category[key]; });\n }\n categories.map(normalizedCat).forEach(function (category) { return (_this._enabled[category] = enabled); });\n };\n Trace.prototype.enable = function () {\n var categories = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n categories[_i] = arguments[_i];\n }\n this._set(true, categories);\n };\n Trace.prototype.disable = function () {\n var categories = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n categories[_i] = arguments[_i];\n }\n this._set(false, categories);\n };\n /**\n * Retrieves the enabled stateus of a [[Category]]\n *\n * ```js\n * trace.enabled(\"VIEWCONFIG\"); // true or false\n * ```\n *\n * @returns boolean true if the category is enabled\n */\n Trace.prototype.enabled = function (category) {\n return !!this._enabled[normalizedCat(category)];\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceTransitionStart = function (trans) {\n if (!this.enabled(Category.TRANSITION))\n return;\n console.log(transLbl(trans) + \": Started -> \" + stringify(trans));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceTransitionIgnored = function (trans) {\n if (!this.enabled(Category.TRANSITION))\n return;\n console.log(transLbl(trans) + \": Ignored <> \" + stringify(trans));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceHookInvocation = function (step, trans, options) {\n if (!this.enabled(Category.HOOK))\n return;\n var event = parse('traceData.hookType')(options) || 'internal', context = parse('traceData.context.state.name')(options) || parse('traceData.context')(options) || 'unknown', name = functionToString(step.registeredHook.callback);\n console.log(transLbl(trans) + \": Hook -> \" + event + \" context: \" + context + \", \" + maxLength(200, name));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceHookResult = function (hookResult, trans, transitionOptions) {\n if (!this.enabled(Category.HOOK))\n return;\n console.log(transLbl(trans) + \": <- Hook returned: \" + maxLength(200, stringify(hookResult)));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceResolvePath = function (path, when, trans) {\n if (!this.enabled(Category.RESOLVE))\n return;\n console.log(transLbl(trans) + \": Resolving \" + path + \" (\" + when + \")\");\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceResolvableResolved = function (resolvable, trans) {\n if (!this.enabled(Category.RESOLVE))\n return;\n console.log(transLbl(trans) + \": <- Resolved \" + resolvable + \" to: \" + maxLength(200, stringify(resolvable.data)));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceError = function (reason, trans) {\n if (!this.enabled(Category.TRANSITION))\n return;\n console.log(transLbl(trans) + \": <- Rejected \" + stringify(trans) + \", reason: \" + reason);\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceSuccess = function (finalState, trans) {\n if (!this.enabled(Category.TRANSITION))\n return;\n console.log(transLbl(trans) + \": <- Success \" + stringify(trans) + \", final state: \" + finalState.name);\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceUIViewEvent = function (event, viewData, extra) {\n if (extra === void 0) { extra = ''; }\n if (!this.enabled(Category.UIVIEW))\n return;\n console.log(\"ui-view: \" + padString(30, event) + \" \" + uiViewString(viewData) + extra);\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceUIViewConfigUpdated = function (viewData, context) {\n if (!this.enabled(Category.UIVIEW))\n return;\n this.traceUIViewEvent('Updating', viewData, \" with ViewConfig from context='\" + context + \"'\");\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceUIViewFill = function (viewData, html) {\n if (!this.enabled(Category.UIVIEW))\n return;\n this.traceUIViewEvent('Fill', viewData, \" with: \" + maxLength(200, html));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceViewSync = function (pairs) {\n if (!this.enabled(Category.VIEWCONFIG))\n return;\n var uivheader = 'uiview component fqn';\n var cfgheader = 'view config state (view name)';\n var mapping = pairs\n .map(function (_a) {\n var _b;\n var uiView = _a.uiView, viewConfig = _a.viewConfig;\n var uiv = uiView && uiView.fqn;\n var cfg = viewConfig && viewConfig.viewDecl.$context.name + \": (\" + viewConfig.viewDecl.$name + \")\";\n return _b = {}, _b[uivheader] = uiv, _b[cfgheader] = cfg, _b;\n })\n .sort(function (a, b) { return (a[uivheader] || '').localeCompare(b[uivheader] || ''); });\n consoletable(mapping);\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceViewServiceEvent = function (event, viewConfig) {\n if (!this.enabled(Category.VIEWCONFIG))\n return;\n console.log(\"VIEWCONFIG: \" + event + \" \" + viewConfigString(viewConfig));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceViewServiceUIViewEvent = function (event, viewData) {\n if (!this.enabled(Category.VIEWCONFIG))\n return;\n console.log(\"VIEWCONFIG: \" + event + \" \" + uiViewString(viewData));\n };\n return Trace;\n}());\nexport { Trace };\n/**\n * The [[Trace]] singleton\n *\n * #### Example:\n * ```js\n * import {trace} from \"@uirouter/core\";\n * trace.enable(1, 5);\n * ```\n */\nvar trace = new Trace();\nexport { trace };\n//# sourceMappingURL=trace.js.map","/** @publicapi @module core */ /** */\nimport { StateParams } from './params/stateParams';\nimport { Queue } from './common/queue';\n/**\n * Global router state\n *\n * This is where we hold the global mutable state such as current state, current\n * params, current transition, etc.\n */\nvar UIRouterGlobals = /** @class */ (function () {\n function UIRouterGlobals() {\n /**\n * Current parameter values\n *\n * The parameter values from the latest successful transition\n */\n this.params = new StateParams();\n /** @internalapi */\n this.lastStartedTransitionId = -1;\n /** @internalapi */\n this.transitionHistory = new Queue([], 1);\n /** @internalapi */\n this.successfulTransitions = new Queue([], 1);\n }\n UIRouterGlobals.prototype.dispose = function () {\n this.transitionHistory.clear();\n this.successfulTransitions.clear();\n this.transition = null;\n };\n return UIRouterGlobals;\n}());\nexport { UIRouterGlobals };\n//# sourceMappingURL=globals.js.map","/** @internalapi @module hooks */ /** */\nimport { Transition } from '../transition/transition';\nimport { UIRouter } from '../router';\nimport { Resolvable } from '../resolve';\nimport { inArray, uniqR, unnestR, values } from '../common';\nfunction addCoreResolvables(trans) {\n trans.addResolvable(Resolvable.fromData(UIRouter, trans.router), '');\n trans.addResolvable(Resolvable.fromData(Transition, trans), '');\n trans.addResolvable(Resolvable.fromData('$transition$', trans), '');\n trans.addResolvable(Resolvable.fromData('$stateParams', trans.params()), '');\n trans.entering().forEach(function (state) {\n trans.addResolvable(Resolvable.fromData('$state$', state), state);\n });\n}\nexport var registerAddCoreResolvables = function (transitionService) {\n return transitionService.onCreate({}, addCoreResolvables);\n};\nvar TRANSITION_TOKENS = ['$transition$', Transition];\nvar isTransition = inArray(TRANSITION_TOKENS);\n// References to Transition in the treeChanges pathnodes makes all\n// previous Transitions reachable in memory, causing a memory leak\n// This function removes resolves for '$transition$' and `Transition` from the treeChanges.\n// Do not use this on current transitions, only on old ones.\nexport var treeChangesCleanup = function (trans) {\n var nodes = values(trans.treeChanges())\n .reduce(unnestR, [])\n .reduce(uniqR, []);\n // If the resolvable is a Transition, return a new resolvable with null data\n var replaceTransitionWithNull = function (r) {\n return isTransition(r.token) ? Resolvable.fromData(r.token, null) : r;\n };\n nodes.forEach(function (node) {\n node.resolvables = node.resolvables.map(replaceTransitionWithNull);\n });\n};\n//# sourceMappingURL=coreResolvables.js.map","/** @internalapi @module hooks */ /** */\nimport { trace } from '../common/trace';\nimport { Rejection } from '../transition/rejectFactory';\n/**\n * A [[TransitionHookFn]] that skips a transition if it should be ignored\n *\n * This hook is invoked at the end of the onBefore phase.\n *\n * If the transition should be ignored (because no parameter or states changed)\n * then the transition is ignored and not processed.\n */\nfunction ignoredHook(trans) {\n var ignoredReason = trans._ignoredReason();\n if (!ignoredReason)\n return;\n trace.traceTransitionIgnored(trans);\n var pending = trans.router.globals.transition;\n // The user clicked a link going back to the *current state* ('A')\n // However, there is also a pending transition in flight (to 'B')\n // Abort the transition to 'B' because the user now wants to be back at 'A'.\n if (ignoredReason === 'SameAsCurrent' && pending) {\n pending.abort();\n }\n return Rejection.ignored().toPromise();\n}\nexport var registerIgnoredTransitionHook = function (transitionService) {\n return transitionService.onBefore({}, ignoredHook, { priority: -9999 });\n};\n//# sourceMappingURL=ignoredTransition.js.map","/** @internalapi @module hooks */ /** */\n/**\n * A [[TransitionHookFn]] that rejects the Transition if it is invalid\n *\n * This hook is invoked at the end of the onBefore phase.\n * If the transition is invalid (for example, param values do not validate)\n * then the transition is rejected.\n */\nfunction invalidTransitionHook(trans) {\n if (!trans.valid()) {\n throw new Error(trans.error().toString());\n }\n}\nexport var registerInvalidTransitionHook = function (transitionService) {\n return transitionService.onBefore({}, invalidTransitionHook, { priority: -10000 });\n};\n//# sourceMappingURL=invalidTransition.js.map","import { services } from '../common/coreservices';\n/**\n * A [[TransitionHookFn]] that performs lazy loading\n *\n * When entering a state \"abc\" which has a `lazyLoad` function defined:\n * - Invoke the `lazyLoad` function (unless it is already in process)\n * - Flag the hook function as \"in process\"\n * - The function should return a promise (that resolves when lazy loading is complete)\n * - Wait for the promise to settle\n * - If the promise resolves to a [[LazyLoadResult]], then register those states\n * - Flag the hook function as \"not in process\"\n * - If the hook was successful\n * - Remove the `lazyLoad` function from the state declaration\n * - If all the hooks were successful\n * - Retry the transition (by returning a TargetState)\n *\n * ```\n * .state('abc', {\n * component: 'fooComponent',\n * lazyLoad: () => System.import('./fooComponent')\n * });\n * ```\n *\n * See [[StateDeclaration.lazyLoad]]\n */\nvar lazyLoadHook = function (transition) {\n var router = transition.router;\n function retryTransition() {\n if (transition.originalTransition().options().source !== 'url') {\n // The original transition was not triggered via url sync\n // The lazy state should be loaded now, so re-try the original transition\n var orig = transition.targetState();\n return router.stateService.target(orig.identifier(), orig.params(), orig.options());\n }\n // The original transition was triggered via url sync\n // Run the URL rules and find the best match\n var $url = router.urlService;\n var result = $url.match($url.parts());\n var rule = result && result.rule;\n // If the best match is a state, redirect the transition (instead\n // of calling sync() which supersedes the current transition)\n if (rule && rule.type === 'STATE') {\n var state = rule.state;\n var params = result.match;\n return router.stateService.target(state, params, transition.options());\n }\n // No matching state found, so let .sync() choose the best non-state match/otherwise\n router.urlService.sync();\n }\n var promises = transition\n .entering()\n .filter(function (state) { return !!state.$$state().lazyLoad; })\n .map(function (state) { return lazyLoadState(transition, state); });\n return services.$q.all(promises).then(retryTransition);\n};\nexport var registerLazyLoadHook = function (transitionService) {\n return transitionService.onBefore({ entering: function (state) { return !!state.lazyLoad; } }, lazyLoadHook);\n};\n/**\n * Invokes a state's lazy load function\n *\n * @param transition a Transition context\n * @param state the state to lazy load\n * @returns A promise for the lazy load result\n */\nexport function lazyLoadState(transition, state) {\n var lazyLoadFn = state.$$state().lazyLoad;\n // Store/get the lazy load promise on/from the hookfn so it doesn't get re-invoked\n var promise = lazyLoadFn['_promise'];\n if (!promise) {\n var success = function (result) {\n delete state.lazyLoad;\n delete state.$$state().lazyLoad;\n delete lazyLoadFn['_promise'];\n return result;\n };\n var error = function (err) {\n delete lazyLoadFn['_promise'];\n return services.$q.reject(err);\n };\n promise = lazyLoadFn['_promise'] = services.$q\n .when(lazyLoadFn(transition, state))\n .then(updateStateRegistry)\n .then(success, error);\n }\n /** Register any lazy loaded state definitions */\n function updateStateRegistry(result) {\n if (result && Array.isArray(result.states)) {\n result.states.forEach(function (_state) { return transition.router.stateRegistry.register(_state); });\n }\n return result;\n }\n return promise;\n}\n//# sourceMappingURL=lazyLoad.js.map","/**\n * A factory which creates an onEnter, onExit or onRetain transition hook function\n *\n * The returned function invokes the (for instance) state.onEnter hook when the\n * state is being entered.\n *\n * @hidden\n */\nfunction makeEnterExitRetainHook(hookName) {\n return function (transition, state) {\n var _state = state.$$state();\n var hookFn = _state[hookName];\n return hookFn(transition, state);\n };\n}\n/**\n * The [[TransitionStateHookFn]] for onExit\n *\n * When the state is being exited, the state's .onExit function is invoked.\n *\n * Registered using `transitionService.onExit({ exiting: (state) => !!state.onExit }, onExitHook);`\n *\n * See: [[IHookRegistry.onExit]]\n */\nvar onExitHook = makeEnterExitRetainHook('onExit');\nexport var registerOnExitHook = function (transitionService) {\n return transitionService.onExit({ exiting: function (state) { return !!state.onExit; } }, onExitHook);\n};\n/**\n * The [[TransitionStateHookFn]] for onRetain\n *\n * When the state was already entered, and is not being exited or re-entered, the state's .onRetain function is invoked.\n *\n * Registered using `transitionService.onRetain({ retained: (state) => !!state.onRetain }, onRetainHook);`\n *\n * See: [[IHookRegistry.onRetain]]\n */\nvar onRetainHook = makeEnterExitRetainHook('onRetain');\nexport var registerOnRetainHook = function (transitionService) {\n return transitionService.onRetain({ retained: function (state) { return !!state.onRetain; } }, onRetainHook);\n};\n/**\n * The [[TransitionStateHookFn]] for onEnter\n *\n * When the state is being entered, the state's .onEnter function is invoked.\n *\n * Registered using `transitionService.onEnter({ entering: (state) => !!state.onEnter }, onEnterHook);`\n *\n * See: [[IHookRegistry.onEnter]]\n */\nvar onEnterHook = makeEnterExitRetainHook('onEnter');\nexport var registerOnEnterHook = function (transitionService) {\n return transitionService.onEnter({ entering: function (state) { return !!state.onEnter; } }, onEnterHook);\n};\n//# sourceMappingURL=onEnterExitRetain.js.map","/** @internalapi @module hooks */ /** */\nimport { isString, isFunction } from '../common/predicates';\nimport { services } from '../common/coreservices';\nimport { TargetState } from '../state/targetState';\n/**\n * A [[TransitionHookFn]] that redirects to a different state or params\n *\n * Registered using `transitionService.onStart({ to: (state) => !!state.redirectTo }, redirectHook);`\n *\n * See [[StateDeclaration.redirectTo]]\n */\nvar redirectToHook = function (trans) {\n var redirect = trans.to().redirectTo;\n if (!redirect)\n return;\n var $state = trans.router.stateService;\n function handleResult(result) {\n if (!result)\n return;\n if (result instanceof TargetState)\n return result;\n if (isString(result))\n return $state.target(result, trans.params(), trans.options());\n if (result['state'] || result['params'])\n return $state.target(result['state'] || trans.to(), result['params'] || trans.params(), trans.options());\n }\n if (isFunction(redirect)) {\n return services.$q.when(redirect(trans)).then(handleResult);\n }\n return handleResult(redirect);\n};\nexport var registerRedirectToHook = function (transitionService) {\n return transitionService.onStart({ to: function (state) { return !!state.redirectTo; } }, redirectToHook);\n};\n//# sourceMappingURL=redirectTo.js.map","/** @internalapi @module hooks */ /** */\nimport { noop } from '../common/common';\nimport { ResolveContext } from '../resolve/resolveContext';\nimport { val } from '../common/hof';\nexport var RESOLVE_HOOK_PRIORITY = 1000;\n/**\n * A [[TransitionHookFn]] which resolves all EAGER Resolvables in the To Path\n *\n * Registered using `transitionService.onStart({}, eagerResolvePath, { priority: 1000 });`\n *\n * When a Transition starts, this hook resolves all the EAGER Resolvables, which the transition then waits for.\n *\n * See [[StateDeclaration.resolve]]\n */\nvar eagerResolvePath = function (trans) {\n return new ResolveContext(trans.treeChanges().to).resolvePath('EAGER', trans).then(noop);\n};\nexport var registerEagerResolvePath = function (transitionService) {\n return transitionService.onStart({}, eagerResolvePath, { priority: RESOLVE_HOOK_PRIORITY });\n};\n/**\n * A [[TransitionHookFn]] which resolves all LAZY Resolvables for the state (and all its ancestors) in the To Path\n *\n * Registered using `transitionService.onEnter({ entering: () => true }, lazyResolveState, { priority: 1000 });`\n *\n * When a State is being entered, this hook resolves all the Resolvables for this state, which the transition then waits for.\n *\n * See [[StateDeclaration.resolve]]\n */\nvar lazyResolveState = function (trans, state) {\n return new ResolveContext(trans.treeChanges().to)\n .subContext(state.$$state())\n .resolvePath('LAZY', trans)\n .then(noop);\n};\nexport var registerLazyResolveState = function (transitionService) {\n return transitionService.onEnter({ entering: val(true) }, lazyResolveState, { priority: RESOLVE_HOOK_PRIORITY });\n};\n/**\n * A [[TransitionHookFn]] which resolves any dynamically added (LAZY or EAGER) Resolvables.\n *\n * Registered using `transitionService.onFinish({}, eagerResolvePath, { priority: 1000 });`\n *\n * After all entering states have been entered, this hook resolves any remaining Resolvables.\n * These are typically dynamic resolves which were added by some Transition Hook using [[Transition.addResolvable]].\n *\n * See [[StateDeclaration.resolve]]\n */\nvar resolveRemaining = function (trans) {\n return new ResolveContext(trans.treeChanges().to).resolvePath('LAZY', trans).then(noop);\n};\nexport var registerResolveRemaining = function (transitionService) {\n return transitionService.onFinish({}, resolveRemaining, { priority: RESOLVE_HOOK_PRIORITY });\n};\n//# sourceMappingURL=resolve.js.map","import { copy } from '../common/common';\n/**\n * A [[TransitionHookFn]] which updates global UI-Router state\n *\n * Registered using `transitionService.onBefore({}, updateGlobalState);`\n *\n * Before a [[Transition]] starts, updates the global value of \"the current transition\" ([[Globals.transition]]).\n * After a successful [[Transition]], updates the global values of \"the current state\"\n * ([[Globals.current]] and [[Globals.$current]]) and \"the current param values\" ([[Globals.params]]).\n *\n * See also the deprecated properties:\n * [[StateService.transition]], [[StateService.current]], [[StateService.params]]\n */\nvar updateGlobalState = function (trans) {\n var globals = trans.router.globals;\n var transitionSuccessful = function () {\n globals.successfulTransitions.enqueue(trans);\n globals.$current = trans.$to();\n globals.current = globals.$current.self;\n copy(trans.params(), globals.params);\n };\n var clearCurrentTransition = function () {\n // Do not clear globals.transition if a different transition has started in the meantime\n if (globals.transition === trans)\n globals.transition = null;\n };\n trans.onSuccess({}, transitionSuccessful, { priority: 10000 });\n trans.promise.then(clearCurrentTransition, clearCurrentTransition);\n};\nexport var registerUpdateGlobalState = function (transitionService) {\n return transitionService.onCreate({}, updateGlobalState);\n};\n//# sourceMappingURL=updateGlobals.js.map","/**\n * A [[TransitionHookFn]] which updates the URL after a successful transition\n *\n * Registered using `transitionService.onSuccess({}, updateUrl);`\n */\nvar updateUrl = function (transition) {\n var options = transition.options();\n var $state = transition.router.stateService;\n var $urlRouter = transition.router.urlRouter;\n // Dont update the url in these situations:\n // The transition was triggered by a URL sync (options.source === 'url')\n // The user doesn't want the url to update (options.location === false)\n // The destination state, and all parents have no navigable url\n if (options.source !== 'url' && options.location && $state.$current.navigable) {\n var urlOptions = { replace: options.location === 'replace' };\n $urlRouter.push($state.$current.navigable.url, $state.params, urlOptions);\n }\n $urlRouter.update(true);\n};\nexport var registerUpdateUrl = function (transitionService) {\n return transitionService.onSuccess({}, updateUrl, { priority: 9999 });\n};\n//# sourceMappingURL=url.js.map","/** @internalapi @module hooks */ /** */\nimport { noop } from '../common/common';\nimport { services } from '../common/coreservices';\n/**\n * A [[TransitionHookFn]] which waits for the views to load\n *\n * Registered using `transitionService.onStart({}, loadEnteringViews);`\n *\n * Allows the views to do async work in [[ViewConfig.load]] before the transition continues.\n * In angular 1, this includes loading the templates.\n */\nvar loadEnteringViews = function (transition) {\n var $q = services.$q;\n var enteringViews = transition.views('entering');\n if (!enteringViews.length)\n return;\n return $q.all(enteringViews.map(function (view) { return $q.when(view.load()); })).then(noop);\n};\nexport var registerLoadEnteringViews = function (transitionService) {\n return transitionService.onFinish({}, loadEnteringViews);\n};\n/**\n * A [[TransitionHookFn]] which activates the new views when a transition is successful.\n *\n * Registered using `transitionService.onSuccess({}, activateViews);`\n *\n * After a transition is complete, this hook deactivates the old views from the previous state,\n * and activates the new views from the destination state.\n *\n * See [[ViewService]]\n */\nvar activateViews = function (transition) {\n var enteringViews = transition.views('entering');\n var exitingViews = transition.views('exiting');\n if (!enteringViews.length && !exitingViews.length)\n return;\n var $view = transition.router.viewService;\n exitingViews.forEach(function (vc) { return $view.deactivateViewConfig(vc); });\n enteringViews.forEach(function (vc) { return $view.activateViewConfig(vc); });\n $view.sync();\n};\nexport var registerActivateViews = function (transitionService) {\n return transitionService.onSuccess({}, activateViews);\n};\n//# sourceMappingURL=views.js.map","/** @publicapi @module common */ /** */\nexport * from './common/index';\nexport * from './params/index';\nexport * from './path/index';\nexport * from './resolve/index';\nexport * from './state/index';\nexport * from './transition/index';\nexport * from './url/index';\nexport * from './view/index';\nexport * from './globals';\nexport * from './router';\nexport * from './vanilla';\nexport * from './interface';\n//# sourceMappingURL=index.js.map","/**\n * # Core classes and interfaces\n *\n * The classes and interfaces that are core to ui-router and do not belong\n * to a more specific subsystem (such as resolve).\n *\n * @preferred @publicapi @module core\n */ /** */\n/** @internalapi */\nvar UIRouterPluginBase = /** @class */ (function () {\n function UIRouterPluginBase() {\n }\n UIRouterPluginBase.prototype.dispose = function (router) { };\n return UIRouterPluginBase;\n}());\nexport { UIRouterPluginBase };\n//# sourceMappingURL=interface.js.map","export * from './param';\nexport * from './paramTypes';\nexport * from './stateParams';\nexport * from './paramType';\n//# sourceMappingURL=index.js.map","/** @publicapi @module params */ /** */\nimport { extend, filter, map, allTrueR, find } from '../common/common';\nimport { prop } from '../common/hof';\nimport { isInjectable, isDefined, isString, isArray, isUndefined } from '../common/predicates';\nimport { services } from '../common/coreservices';\nimport { ParamType } from './paramType';\n/** @hidden */\nvar hasOwn = Object.prototype.hasOwnProperty;\n/** @hidden */\nvar isShorthand = function (cfg) {\n return ['value', 'type', 'squash', 'array', 'dynamic'].filter(hasOwn.bind(cfg || {})).length === 0;\n};\n/** @internalapi */\nvar DefType;\n(function (DefType) {\n DefType[DefType[\"PATH\"] = 0] = \"PATH\";\n DefType[DefType[\"SEARCH\"] = 1] = \"SEARCH\";\n DefType[DefType[\"CONFIG\"] = 2] = \"CONFIG\";\n})(DefType || (DefType = {}));\nexport { DefType };\n/** @internalapi */\nfunction getParamDeclaration(paramName, location, state) {\n var noReloadOnSearch = (state.reloadOnSearch === false && location === DefType.SEARCH) || undefined;\n var dynamic = find([state.dynamic, noReloadOnSearch], isDefined);\n var defaultConfig = isDefined(dynamic) ? { dynamic: dynamic } : {};\n var paramConfig = unwrapShorthand(state && state.params && state.params[paramName]);\n return extend(defaultConfig, paramConfig);\n}\n/** @hidden */\nfunction unwrapShorthand(cfg) {\n cfg = isShorthand(cfg) ? { value: cfg } : cfg;\n getStaticDefaultValue['__cacheable'] = true;\n function getStaticDefaultValue() {\n return cfg.value;\n }\n var $$fn = isInjectable(cfg.value) ? cfg.value : getStaticDefaultValue;\n return extend(cfg, { $$fn: $$fn });\n}\n/** @hidden */\nfunction getType(cfg, urlType, location, id, paramTypes) {\n if (cfg.type && urlType && urlType.name !== 'string')\n throw new Error(\"Param '\" + id + \"' has two type configurations.\");\n if (cfg.type && urlType && urlType.name === 'string' && paramTypes.type(cfg.type))\n return paramTypes.type(cfg.type);\n if (urlType)\n return urlType;\n if (!cfg.type) {\n var type = location === DefType.CONFIG\n ? 'any'\n : location === DefType.PATH\n ? 'path'\n : location === DefType.SEARCH\n ? 'query'\n : 'string';\n return paramTypes.type(type);\n }\n return cfg.type instanceof ParamType ? cfg.type : paramTypes.type(cfg.type);\n}\n/**\n * @internalapi\n * returns false, true, or the squash value to indicate the \"default parameter url squash policy\".\n */\nfunction getSquashPolicy(config, isOptional, defaultPolicy) {\n var squash = config.squash;\n if (!isOptional || squash === false)\n return false;\n if (!isDefined(squash) || squash == null)\n return defaultPolicy;\n if (squash === true || isString(squash))\n return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n}\n/** @internalapi */\nfunction getReplace(config, arrayMode, isOptional, squash) {\n var defaultPolicy = [\n { from: '', to: isOptional || arrayMode ? undefined : '' },\n { from: null, to: isOptional || arrayMode ? undefined : '' },\n ];\n var replace = isArray(config.replace) ? config.replace : [];\n if (isString(squash))\n replace.push({ from: squash, to: undefined });\n var configuredKeys = map(replace, prop('from'));\n return filter(defaultPolicy, function (item) { return configuredKeys.indexOf(item.from) === -1; }).concat(replace);\n}\n/** @internalapi */\nvar Param = /** @class */ (function () {\n function Param(id, type, location, urlConfig, state) {\n var config = getParamDeclaration(id, location, state);\n type = getType(config, type, location, id, urlConfig.paramTypes);\n var arrayMode = getArrayMode();\n type = arrayMode ? type.$asArray(arrayMode, location === DefType.SEARCH) : type;\n var isOptional = config.value !== undefined || location === DefType.SEARCH;\n var dynamic = isDefined(config.dynamic) ? !!config.dynamic : !!type.dynamic;\n var raw = isDefined(config.raw) ? !!config.raw : !!type.raw;\n var squash = getSquashPolicy(config, isOptional, urlConfig.defaultSquashPolicy());\n var replace = getReplace(config, arrayMode, isOptional, squash);\n var inherit = isDefined(config.inherit) ? !!config.inherit : !!type.inherit;\n // array config: param name (param[]) overrides default settings. explicit config overrides param name.\n function getArrayMode() {\n var arrayDefaults = { array: location === DefType.SEARCH ? 'auto' : false };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }\n extend(this, { id: id, type: type, location: location, isOptional: isOptional, dynamic: dynamic, raw: raw, squash: squash, replace: replace, inherit: inherit, array: arrayMode, config: config });\n }\n Param.values = function (params, values) {\n if (values === void 0) { values = {}; }\n var paramValues = {};\n for (var _i = 0, params_1 = params; _i < params_1.length; _i++) {\n var param = params_1[_i];\n paramValues[param.id] = param.value(values[param.id]);\n }\n return paramValues;\n };\n /**\n * Finds [[Param]] objects which have different param values\n *\n * Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects\n *\n * @param params: The list of Param objects to filter\n * @param values1: The first set of parameter values\n * @param values2: the second set of parameter values\n *\n * @returns any Param objects whose values were different between values1 and values2\n */\n Param.changed = function (params, values1, values2) {\n if (values1 === void 0) { values1 = {}; }\n if (values2 === void 0) { values2 = {}; }\n return params.filter(function (param) { return !param.type.equals(values1[param.id], values2[param.id]); });\n };\n /**\n * Checks if two param value objects are equal (for a set of [[Param]] objects)\n *\n * @param params The list of [[Param]] objects to check\n * @param values1 The first set of param values\n * @param values2 The second set of param values\n *\n * @returns true if the param values in values1 and values2 are equal\n */\n Param.equals = function (params, values1, values2) {\n if (values1 === void 0) { values1 = {}; }\n if (values2 === void 0) { values2 = {}; }\n return Param.changed(params, values1, values2).length === 0;\n };\n /** Returns true if a the parameter values are valid, according to the Param definitions */\n Param.validates = function (params, values) {\n if (values === void 0) { values = {}; }\n return params.map(function (param) { return param.validates(values[param.id]); }).reduce(allTrueR, true);\n };\n Param.prototype.isDefaultValue = function (value) {\n return this.isOptional && this.type.equals(this.value(), value);\n };\n /**\n * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the\n * default value, which may be the result of an injectable function.\n */\n Param.prototype.value = function (value) {\n var _this = this;\n /**\n * [Internal] Get the default value of a parameter, which may be an injectable function.\n */\n var getDefaultValue = function () {\n if (_this._defaultValueCache)\n return _this._defaultValueCache.defaultValue;\n if (!services.$injector)\n throw new Error('Injectable functions cannot be called at configuration time');\n var defaultValue = services.$injector.invoke(_this.config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !_this.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + _this.id + \"' is not an instance of ParamType (\" + _this.type.name + \")\");\n if (_this.config.$$fn['__cacheable']) {\n _this._defaultValueCache = { defaultValue: defaultValue };\n }\n return defaultValue;\n };\n var replaceSpecialValues = function (val) {\n for (var _i = 0, _a = _this.replace; _i < _a.length; _i++) {\n var tuple = _a[_i];\n if (tuple.from === val)\n return tuple.to;\n }\n return val;\n };\n value = replaceSpecialValues(value);\n return isUndefined(value) ? getDefaultValue() : this.type.$normalize(value);\n };\n Param.prototype.isSearch = function () {\n return this.location === DefType.SEARCH;\n };\n Param.prototype.validates = function (value) {\n // There was no parameter value, but the param is optional\n if ((isUndefined(value) || value === null) && this.isOptional)\n return true;\n // The value was not of the correct ParamType, and could not be decoded to the correct ParamType\n var normalized = this.type.$normalize(value);\n if (!this.type.is(normalized))\n return false;\n // The value was of the correct type, but when encoded, did not match the ParamType's regexp\n var encoded = this.type.encode(normalized);\n return !(isString(encoded) && !this.type.pattern.exec(encoded));\n };\n Param.prototype.toString = function () {\n return \"{Param:\" + this.id + \" \" + this.type + \" squash: '\" + this.squash + \"' optional: \" + this.isOptional + \"}\";\n };\n return Param;\n}());\nexport { Param };\n//# sourceMappingURL=param.js.map","/** @publicapi @module params */ /** */\nimport { extend, filter, map } from '../common/common';\nimport { isArray, isDefined } from '../common/predicates';\n/**\n * An internal class which implements [[ParamTypeDefinition]].\n *\n * A [[ParamTypeDefinition]] is a plain javascript object used to register custom parameter types.\n * When a param type definition is registered, an instance of this class is created internally.\n *\n * This class has naive implementations for all the [[ParamTypeDefinition]] methods.\n *\n * Used by [[UrlMatcher]] when matching or formatting URLs, or comparing and validating parameter values.\n *\n * #### Example:\n * ```js\n * var paramTypeDef = {\n * decode: function(val) { return parseInt(val, 10); },\n * encode: function(val) { return val && val.toString(); },\n * equals: function(a, b) { return this.is(a) && a === b; },\n * is: function(val) { return angular.isNumber(val) && isFinite(val) && val % 1 === 0; },\n * pattern: /\\d+/\n * }\n *\n * var paramType = new ParamType(paramTypeDef);\n * ```\n * @internalapi\n */\nvar ParamType = /** @class */ (function () {\n /**\n * @param def A configuration object which contains the custom type definition. The object's\n * properties will override the default methods and/or pattern in `ParamType`'s public interface.\n * @returns a new ParamType object\n */\n function ParamType(def) {\n /** @inheritdoc */\n this.pattern = /.*/;\n /** @inheritdoc */\n this.inherit = true;\n extend(this, def);\n }\n // consider these four methods to be \"abstract methods\" that should be overridden\n /** @inheritdoc */\n ParamType.prototype.is = function (val, key) {\n return true;\n };\n /** @inheritdoc */\n ParamType.prototype.encode = function (val, key) {\n return val;\n };\n /** @inheritdoc */\n ParamType.prototype.decode = function (val, key) {\n return val;\n };\n /** @inheritdoc */\n ParamType.prototype.equals = function (a, b) {\n // tslint:disable-next-line:triple-equals\n return a == b;\n };\n ParamType.prototype.$subPattern = function () {\n var sub = this.pattern.toString();\n return sub.substr(1, sub.length - 2);\n };\n ParamType.prototype.toString = function () {\n return \"{ParamType:\" + this.name + \"}\";\n };\n /** Given an encoded string, or a decoded object, returns a decoded object */\n ParamType.prototype.$normalize = function (val) {\n return this.is(val) ? val : this.decode(val);\n };\n /**\n * Wraps an existing custom ParamType as an array of ParamType, depending on 'mode'.\n * e.g.:\n * - urlmatcher pattern \"/path?{queryParam[]:int}\"\n * - url: \"/path?queryParam=1&queryParam=2\n * - $stateParams.queryParam will be [1, 2]\n * if `mode` is \"auto\", then\n * - url: \"/path?queryParam=1 will create $stateParams.queryParam: 1\n * - url: \"/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]\n */\n ParamType.prototype.$asArray = function (mode, isSearch) {\n if (!mode)\n return this;\n if (mode === 'auto' && !isSearch)\n throw new Error(\"'auto' array mode is for query parameters only\");\n return new ArrayType(this, mode);\n };\n return ParamType;\n}());\nexport { ParamType };\n/**\n * Wraps up a `ParamType` object to handle array values.\n * @internalapi\n */\nfunction ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return isArray(val) ? val : isDefined(val) ? [val] : [];\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === 'auto' ? val[0] : val;\n default:\n return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return allTruthyMode === true ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n raw: type.raw,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode,\n });\n}\n//# sourceMappingURL=paramType.js.map","/** @publicapi @module params */ /** */\nimport { fromJson, toJson, identity, equals, inherit, map, extend, pick } from '../common/common';\nimport { isDefined, isNullOrUndefined } from '../common/predicates';\nimport { is } from '../common/hof';\nimport { services } from '../common/coreservices';\nimport { ParamType } from './paramType';\n/**\n * A registry for parameter types.\n *\n * This registry manages the built-in (and custom) parameter types.\n *\n * The built-in parameter types are:\n *\n * - [[string]]\n * - [[path]]\n * - [[query]]\n * - [[hash]]\n * - [[int]]\n * - [[bool]]\n * - [[date]]\n * - [[json]]\n * - [[any]]\n *\n * To register custom parameter types, use [[UrlConfig.type]], i.e.,\n *\n * ```js\n * router.urlService.config.type(customType)\n * ```\n */\nvar ParamTypes = /** @class */ (function () {\n /** @internalapi */\n function ParamTypes() {\n /** @hidden */\n this.enqueue = true;\n /** @hidden */\n this.typeQueue = [];\n /** @internalapi */\n this.defaultTypes = pick(ParamTypes.prototype, [\n 'hash',\n 'string',\n 'query',\n 'path',\n 'int',\n 'bool',\n 'date',\n 'json',\n 'any',\n ]);\n // Register default types. Store them in the prototype of this.types.\n var makeType = function (definition, name) { return new ParamType(extend({ name: name }, definition)); };\n this.types = inherit(map(this.defaultTypes, makeType), {});\n }\n /** @internalapi */\n ParamTypes.prototype.dispose = function () {\n this.types = {};\n };\n /**\n * Registers a parameter type\n *\n * End users should call [[UrlMatcherFactory.type]], which delegates to this method.\n */\n ParamTypes.prototype.type = function (name, definition, definitionFn) {\n if (!isDefined(definition))\n return this.types[name];\n if (this.types.hasOwnProperty(name))\n throw new Error(\"A type named '\" + name + \"' has already been defined.\");\n this.types[name] = new ParamType(extend({ name: name }, definition));\n if (definitionFn) {\n this.typeQueue.push({ name: name, def: definitionFn });\n if (!this.enqueue)\n this._flushTypeQueue();\n }\n return this;\n };\n /** @internalapi */\n ParamTypes.prototype._flushTypeQueue = function () {\n while (this.typeQueue.length) {\n var type = this.typeQueue.shift();\n if (type.pattern)\n throw new Error(\"You cannot override a type's .pattern at runtime.\");\n extend(this.types[type.name], services.$injector.invoke(type.def));\n }\n };\n return ParamTypes;\n}());\nexport { ParamTypes };\n/** @hidden */\nfunction initDefaultTypes() {\n var makeDefaultType = function (def) {\n var valToString = function (val) { return (val != null ? val.toString() : val); };\n var defaultTypeBase = {\n encode: valToString,\n decode: valToString,\n is: is(String),\n pattern: /.*/,\n // tslint:disable-next-line:triple-equals\n equals: function (a, b) { return a == b; },\n };\n return extend({}, defaultTypeBase, def);\n };\n // Default Parameter Type Definitions\n extend(ParamTypes.prototype, {\n string: makeDefaultType({}),\n path: makeDefaultType({\n pattern: /[^/]*/,\n }),\n query: makeDefaultType({}),\n hash: makeDefaultType({\n inherit: false,\n }),\n int: makeDefaultType({\n decode: function (val) { return parseInt(val, 10); },\n is: function (val) {\n return !isNullOrUndefined(val) && this.decode(val.toString()) === val;\n },\n pattern: /-?\\d+/,\n }),\n bool: makeDefaultType({\n encode: function (val) { return (val && 1) || 0; },\n decode: function (val) { return parseInt(val, 10) !== 0; },\n is: is(Boolean),\n pattern: /0|1/,\n }),\n date: makeDefaultType({\n encode: function (val) {\n return !this.is(val)\n ? undefined\n : [val.getFullYear(), ('0' + (val.getMonth() + 1)).slice(-2), ('0' + val.getDate()).slice(-2)].join('-');\n },\n decode: function (val) {\n if (this.is(val))\n return val;\n var match = this.capture.exec(val);\n return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\n },\n is: function (val) { return val instanceof Date && !isNaN(val.valueOf()); },\n equals: function (l, r) {\n return ['getFullYear', 'getMonth', 'getDate'].reduce(function (acc, fn) { return acc && l[fn]() === r[fn](); }, true);\n },\n pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,\n capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/,\n }),\n json: makeDefaultType({\n encode: toJson,\n decode: fromJson,\n is: is(Object),\n equals: equals,\n pattern: /[^/]*/,\n }),\n // does not encode/decode\n any: makeDefaultType({\n encode: identity,\n decode: identity,\n is: function () { return true; },\n equals: equals,\n }),\n });\n}\ninitDefaultTypes();\n//# sourceMappingURL=paramTypes.js.map","/** @publicapi @module params */ /** */\nimport { extend, ancestors } from '../common/common';\n/** @internalapi */\nvar StateParams = /** @class */ (function () {\n function StateParams(params) {\n if (params === void 0) { params = {}; }\n extend(this, params);\n }\n /**\n * Merges a set of parameters with all parameters inherited between the common parents of the\n * current state and a given destination state.\n *\n * @param {Object} newParams The set of parameters which will be composited with inherited params.\n * @param {Object} $current Internal definition of object representing the current state.\n * @param {Object} $to Internal definition of object representing state to transition to.\n */\n StateParams.prototype.$inherit = function (newParams, $current, $to) {\n var parentParams;\n var parents = ancestors($current, $to), inherited = {}, inheritList = [];\n for (var i in parents) {\n if (!parents[i] || !parents[i].params)\n continue;\n parentParams = Object.keys(parents[i].params);\n if (!parentParams.length)\n continue;\n for (var j in parentParams) {\n if (inheritList.indexOf(parentParams[j]) >= 0)\n continue;\n inheritList.push(parentParams[j]);\n inherited[parentParams[j]] = this[parentParams[j]];\n }\n }\n return extend({}, inherited, newParams);\n };\n return StateParams;\n}());\nexport { StateParams };\n//# sourceMappingURL=stateParams.js.map","/** @internalapi @module path */ /** */\nexport * from './pathNode';\nexport * from './pathUtils';\n//# sourceMappingURL=index.js.map","/** @internalapi @module path */ /** */\nimport { extend, applyPairs, find } from '../common/common';\nimport { propEq } from '../common/hof';\nimport { Param } from '../params/param';\n/**\n * A node in a [[TreeChanges]] path\n *\n * For a [[TreeChanges]] path, this class holds the stateful information for a single node in the path.\n * Each PathNode corresponds to a state being entered, exited, or retained.\n * The stateful information includes parameter values and resolve data.\n */\nvar PathNode = /** @class */ (function () {\n function PathNode(stateOrNode) {\n if (stateOrNode instanceof PathNode) {\n var node = stateOrNode;\n this.state = node.state;\n this.paramSchema = node.paramSchema.slice();\n this.paramValues = extend({}, node.paramValues);\n this.resolvables = node.resolvables.slice();\n this.views = node.views && node.views.slice();\n }\n else {\n var state = stateOrNode;\n this.state = state;\n this.paramSchema = state.parameters({ inherit: false });\n this.paramValues = {};\n this.resolvables = state.resolvables.map(function (res) { return res.clone(); });\n }\n }\n PathNode.prototype.clone = function () {\n return new PathNode(this);\n };\n /** Sets [[paramValues]] for the node, from the values of an object hash */\n PathNode.prototype.applyRawParams = function (params) {\n var getParamVal = function (paramDef) { return [paramDef.id, paramDef.value(params[paramDef.id])]; };\n this.paramValues = this.paramSchema.reduce(function (memo, pDef) { return applyPairs(memo, getParamVal(pDef)); }, {});\n return this;\n };\n /** Gets a specific [[Param]] metadata that belongs to the node */\n PathNode.prototype.parameter = function (name) {\n return find(this.paramSchema, propEq('id', name));\n };\n /**\n * @returns true if the state and parameter values for another PathNode are\n * equal to the state and param values for this PathNode\n */\n PathNode.prototype.equals = function (node, paramsFn) {\n var diff = this.diff(node, paramsFn);\n return diff && diff.length === 0;\n };\n /**\n * Finds Params with different parameter values on another PathNode.\n *\n * Given another node (of the same state), finds the parameter values which differ.\n * Returns the [[Param]] (schema objects) whose parameter values differ.\n *\n * Given another node for a different state, returns `false`\n *\n * @param node The node to compare to\n * @param paramsFn A function that returns which parameters should be compared.\n * @returns The [[Param]]s which differ, or null if the two nodes are for different states\n */\n PathNode.prototype.diff = function (node, paramsFn) {\n if (this.state !== node.state)\n return false;\n var params = paramsFn ? paramsFn(this) : this.paramSchema;\n return Param.changed(params, this.paramValues, node.paramValues);\n };\n /**\n * Returns a clone of the PathNode\n * @deprecated use instance method `node.clone()`\n */\n PathNode.clone = function (node) { return node.clone(); };\n return PathNode;\n}());\nexport { PathNode };\n//# sourceMappingURL=pathNode.js.map","/** @internalapi @module path */ /** */\nimport { extend, find, pick, omit, tail, mergeR, values, unnestR, inArray, arrayTuples, } from '../common/common';\nimport { prop, propEq } from '../common/hof';\nimport { TargetState } from '../state/targetState';\nimport { PathNode } from './pathNode';\n/**\n * This class contains functions which convert TargetStates, Nodes and paths from one type to another.\n */\nvar PathUtils = /** @class */ (function () {\n function PathUtils() {\n }\n /** Given a PathNode[], create an TargetState */\n PathUtils.makeTargetState = function (registry, path) {\n var state = tail(path).state;\n return new TargetState(registry, state, path.map(prop('paramValues')).reduce(mergeR, {}), {});\n };\n PathUtils.buildPath = function (targetState) {\n var toParams = targetState.params();\n return targetState.$state().path.map(function (state) { return new PathNode(state).applyRawParams(toParams); });\n };\n /** Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[] */\n PathUtils.buildToPath = function (fromPath, targetState) {\n var toPath = PathUtils.buildPath(targetState);\n if (targetState.options().inherit) {\n return PathUtils.inheritParams(fromPath, toPath, Object.keys(targetState.params()));\n }\n return toPath;\n };\n /**\n * Creates ViewConfig objects and adds to nodes.\n *\n * On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state\n */\n PathUtils.applyViewConfigs = function ($view, path, states) {\n // Only apply the viewConfigs to the nodes for the given states\n path\n .filter(function (node) { return inArray(states, node.state); })\n .forEach(function (node) {\n var viewDecls = values(node.state.views || {});\n var subPath = PathUtils.subPath(path, function (n) { return n === node; });\n var viewConfigs = viewDecls.map(function (view) { return $view.createViewConfig(subPath, view); });\n node.views = viewConfigs.reduce(unnestR, []);\n });\n };\n /**\n * Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath\n *\n * For a parameter in a node to be inherited from the from path:\n * - The toPath's node must have a matching node in the fromPath (by state).\n * - The parameter name must not be found in the toKeys parameter array.\n *\n * Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some\n * caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams,\n * it is not inherited from the fromPath.\n */\n PathUtils.inheritParams = function (fromPath, toPath, toKeys) {\n if (toKeys === void 0) { toKeys = []; }\n function nodeParamVals(path, state) {\n var node = find(path, propEq('state', state));\n return extend({}, node && node.paramValues);\n }\n var noInherit = fromPath\n .map(function (node) { return node.paramSchema; })\n .reduce(unnestR, [])\n .filter(function (param) { return !param.inherit; })\n .map(prop('id'));\n /**\n * Given an [[PathNode]] \"toNode\", return a new [[PathNode]] with param values inherited from the\n * matching node in fromPath. Only inherit keys that aren't found in \"toKeys\" from the node in \"fromPath\"\"\n */\n function makeInheritedParamsNode(toNode) {\n // All param values for the node (may include default key/vals, when key was not found in toParams)\n var toParamVals = extend({}, toNode && toNode.paramValues);\n // limited to only those keys found in toParams\n var incomingParamVals = pick(toParamVals, toKeys);\n toParamVals = omit(toParamVals, toKeys);\n var fromParamVals = omit(nodeParamVals(fromPath, toNode.state) || {}, noInherit);\n // extend toParamVals with any fromParamVals, then override any of those those with incomingParamVals\n var ownParamVals = extend(toParamVals, fromParamVals, incomingParamVals);\n return new PathNode(toNode.state).applyRawParams(ownParamVals);\n }\n // The param keys specified by the incoming toParams\n return toPath.map(makeInheritedParamsNode);\n };\n /**\n * Computes the tree changes (entering, exiting) between a fromPath and toPath.\n */\n PathUtils.treeChanges = function (fromPath, toPath, reloadState) {\n var max = Math.min(fromPath.length, toPath.length);\n var keep = 0;\n var nodesMatch = function (node1, node2) { return node1.equals(node2, PathUtils.nonDynamicParams); };\n while (keep < max && fromPath[keep].state !== reloadState && nodesMatch(fromPath[keep], toPath[keep])) {\n keep++;\n }\n /** Given a retained node, return a new node which uses the to node's param values */\n function applyToParams(retainedNode, idx) {\n var cloned = retainedNode.clone();\n cloned.paramValues = toPath[idx].paramValues;\n return cloned;\n }\n var from, retained, exiting, entering, to;\n from = fromPath;\n retained = from.slice(0, keep);\n exiting = from.slice(keep);\n // Create a new retained path (with shallow copies of nodes) which have the params of the toPath mapped\n var retainedWithToParams = retained.map(applyToParams);\n entering = toPath.slice(keep);\n to = retainedWithToParams.concat(entering);\n return { from: from, to: to, retained: retained, retainedWithToParams: retainedWithToParams, exiting: exiting, entering: entering };\n };\n /**\n * Returns a new path which is: the subpath of the first path which matches the second path.\n *\n * The new path starts from root and contains any nodes that match the nodes in the second path.\n * It stops before the first non-matching node.\n *\n * Nodes are compared using their state property and their parameter values.\n * If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes.\n *\n * @param pathA the first path\n * @param pathB the second path\n * @param paramsFn a function which returns the parameters to consider when comparing\n *\n * @returns an array of PathNodes from the first path which match the nodes in the second path\n */\n PathUtils.matching = function (pathA, pathB, paramsFn) {\n var done = false;\n var tuples = arrayTuples(pathA, pathB);\n return tuples.reduce(function (matching, _a) {\n var nodeA = _a[0], nodeB = _a[1];\n done = done || !nodeA.equals(nodeB, paramsFn);\n return done ? matching : matching.concat(nodeA);\n }, []);\n };\n /**\n * Returns true if two paths are identical.\n *\n * @param pathA\n * @param pathB\n * @param paramsFn a function which returns the parameters to consider when comparing\n * @returns true if the the states and parameter values for both paths are identical\n */\n PathUtils.equals = function (pathA, pathB, paramsFn) {\n return pathA.length === pathB.length && PathUtils.matching(pathA, pathB, paramsFn).length === pathA.length;\n };\n /**\n * Return a subpath of a path, which stops at the first matching node\n *\n * Given an array of nodes, returns a subset of the array starting from the first node,\n * stopping when the first node matches the predicate.\n *\n * @param path a path of [[PathNode]]s\n * @param predicate a [[Predicate]] fn that matches [[PathNode]]s\n * @returns a subpath up to the matching node, or undefined if no match is found\n */\n PathUtils.subPath = function (path, predicate) {\n var node = find(path, predicate);\n var elementIdx = path.indexOf(node);\n return elementIdx === -1 ? undefined : path.slice(0, elementIdx + 1);\n };\n PathUtils.nonDynamicParams = function (node) {\n return node.state.parameters({ inherit: false }).filter(function (param) { return !param.dynamic; });\n };\n /** Gets the raw parameter values from a path */\n PathUtils.paramValues = function (path) { return path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {}); };\n return PathUtils;\n}());\nexport { PathUtils };\n//# sourceMappingURL=pathUtils.js.map","/** @publicapi @module resolve */ /** */\nexport * from './interface';\nexport * from './resolvable';\nexport * from './resolveContext';\n//# sourceMappingURL=index.js.map","/** @internalapi */\nexport var resolvePolicies = {\n when: {\n LAZY: 'LAZY',\n EAGER: 'EAGER',\n },\n async: {\n WAIT: 'WAIT',\n NOWAIT: 'NOWAIT',\n RXWAIT: 'RXWAIT',\n },\n};\n//# sourceMappingURL=interface.js.map","/** @publicapi @module resolve */ /** */\nimport { extend, identity } from '../common/common';\nimport { services } from '../common/coreservices';\nimport { trace } from '../common/trace';\nimport { stringify } from '../common/strings';\nimport { isFunction, isObject } from '../common/predicates';\nimport { isNullOrUndefined } from '../common/predicates';\n// TODO: explicitly make this user configurable\nexport var defaultResolvePolicy = {\n when: 'LAZY',\n async: 'WAIT',\n};\n/**\n * The basic building block for the resolve system.\n *\n * Resolvables encapsulate a state's resolve's resolveFn, the resolveFn's declared dependencies, the wrapped (.promise),\n * and the unwrapped-when-complete (.data) result of the resolveFn.\n *\n * Resolvable.get() either retrieves the Resolvable's existing promise, or else invokes resolve() (which invokes the\n * resolveFn) and returns the resulting promise.\n *\n * Resolvable.get() and Resolvable.resolve() both execute within a context path, which is passed as the first\n * parameter to those fns.\n */\nvar Resolvable = /** @class */ (function () {\n function Resolvable(arg1, resolveFn, deps, policy, data) {\n this.resolved = false;\n this.promise = undefined;\n if (arg1 instanceof Resolvable) {\n extend(this, arg1);\n }\n else if (isFunction(resolveFn)) {\n if (isNullOrUndefined(arg1))\n throw new Error('new Resolvable(): token argument is required');\n if (!isFunction(resolveFn))\n throw new Error('new Resolvable(): resolveFn argument must be a function');\n this.token = arg1;\n this.policy = policy;\n this.resolveFn = resolveFn;\n this.deps = deps || [];\n this.data = data;\n this.resolved = data !== undefined;\n this.promise = this.resolved ? services.$q.when(this.data) : undefined;\n }\n else if (isObject(arg1) && arg1.token && (arg1.hasOwnProperty('resolveFn') || arg1.hasOwnProperty('data'))) {\n var literal = arg1;\n return new Resolvable(literal.token, literal.resolveFn, literal.deps, literal.policy, literal.data);\n }\n }\n Resolvable.prototype.getPolicy = function (state) {\n var thisPolicy = this.policy || {};\n var statePolicy = (state && state.resolvePolicy) || {};\n return {\n when: thisPolicy.when || statePolicy.when || defaultResolvePolicy.when,\n async: thisPolicy.async || statePolicy.async || defaultResolvePolicy.async,\n };\n };\n /**\n * Asynchronously resolve this Resolvable's data\n *\n * Given a ResolveContext that this Resolvable is found in:\n * Wait for this Resolvable's dependencies, then invoke this Resolvable's function\n * and update the Resolvable's state\n */\n Resolvable.prototype.resolve = function (resolveContext, trans) {\n var _this = this;\n var $q = services.$q;\n // Gets all dependencies from ResolveContext and wait for them to be resolved\n var getResolvableDependencies = function () {\n return $q.all(resolveContext.getDependencies(_this).map(function (resolvable) { return resolvable.get(resolveContext, trans); }));\n };\n // Invokes the resolve function passing the resolved dependencies as arguments\n var invokeResolveFn = function (resolvedDeps) { return _this.resolveFn.apply(null, resolvedDeps); };\n // If the resolve policy is RXWAIT, wait for the observable to emit something. otherwise pass through.\n var node = resolveContext.findNode(this);\n var state = node && node.state;\n var asyncPolicy = this.getPolicy(state).async;\n var customAsyncPolicy = isFunction(asyncPolicy) ? asyncPolicy : identity;\n // After the final value has been resolved, update the state of the Resolvable\n var applyResolvedValue = function (resolvedValue) {\n _this.data = resolvedValue;\n _this.resolved = true;\n _this.resolveFn = null;\n trace.traceResolvableResolved(_this, trans);\n return _this.data;\n };\n // Sets the promise property first, then getsResolvableDependencies in the context of the promise chain. Always waits one tick.\n return (this.promise = $q\n .when()\n .then(getResolvableDependencies)\n .then(invokeResolveFn)\n .then(customAsyncPolicy)\n .then(applyResolvedValue));\n };\n /**\n * Gets a promise for this Resolvable's data.\n *\n * Fetches the data and returns a promise.\n * Returns the existing promise if it has already been fetched once.\n */\n Resolvable.prototype.get = function (resolveContext, trans) {\n return this.promise || this.resolve(resolveContext, trans);\n };\n Resolvable.prototype.toString = function () {\n return \"Resolvable(token: \" + stringify(this.token) + \", requires: [\" + this.deps.map(stringify) + \"])\";\n };\n Resolvable.prototype.clone = function () {\n return new Resolvable(this);\n };\n Resolvable.fromData = function (token, data) { return new Resolvable(token, function () { return data; }, null, null, data); };\n return Resolvable;\n}());\nexport { Resolvable };\n//# sourceMappingURL=resolvable.js.map","/** @publicapi @module resolve */ /** */\nimport { find, tail, uniqR, unnestR, inArray } from '../common/common';\nimport { propEq, not } from '../common/hof';\nimport { trace } from '../common/trace';\nimport { services } from '../common/coreservices';\nimport { resolvePolicies } from './interface';\nimport { Resolvable } from './resolvable';\nimport { PathUtils } from '../path/pathUtils';\nimport { stringify } from '../common/strings';\nimport { isUndefined } from '../common';\nvar whens = resolvePolicies.when;\nvar ALL_WHENS = [whens.EAGER, whens.LAZY];\nvar EAGER_WHENS = [whens.EAGER];\n// tslint:disable-next-line:no-inferrable-types\nexport var NATIVE_INJECTOR_TOKEN = 'Native Injector';\n/**\n * Encapsulates Dependency Injection for a path of nodes\n *\n * UI-Router states are organized as a tree.\n * A nested state has a path of ancestors to the root of the tree.\n * When a state is being activated, each element in the path is wrapped as a [[PathNode]].\n * A `PathNode` is a stateful object that holds things like parameters and resolvables for the state being activated.\n *\n * The ResolveContext closes over the [[PathNode]]s, and provides DI for the last node in the path.\n */\nvar ResolveContext = /** @class */ (function () {\n function ResolveContext(_path) {\n this._path = _path;\n }\n /** Gets all the tokens found in the resolve context, de-duplicated */\n ResolveContext.prototype.getTokens = function () {\n return this._path.reduce(function (acc, node) { return acc.concat(node.resolvables.map(function (r) { return r.token; })); }, []).reduce(uniqR, []);\n };\n /**\n * Gets the Resolvable that matches the token\n *\n * Gets the last Resolvable that matches the token in this context, or undefined.\n * Throws an error if it doesn't exist in the ResolveContext\n */\n ResolveContext.prototype.getResolvable = function (token) {\n var matching = this._path\n .map(function (node) { return node.resolvables; })\n .reduce(unnestR, [])\n .filter(function (r) { return r.token === token; });\n return tail(matching);\n };\n /** Returns the [[ResolvePolicy]] for the given [[Resolvable]] */\n ResolveContext.prototype.getPolicy = function (resolvable) {\n var node = this.findNode(resolvable);\n return resolvable.getPolicy(node.state);\n };\n /**\n * Returns a ResolveContext that includes a portion of this one\n *\n * Given a state, this method creates a new ResolveContext from this one.\n * The new context starts at the first node (root) and stops at the node for the `state` parameter.\n *\n * #### Why\n *\n * When a transition is created, the nodes in the \"To Path\" are injected from a ResolveContext.\n * A ResolveContext closes over a path of [[PathNode]]s and processes the resolvables.\n * The \"To State\" can inject values from its own resolvables, as well as those from all its ancestor state's (node's).\n * This method is used to create a narrower context when injecting ancestor nodes.\n *\n * @example\n * `let ABCD = new ResolveContext([A, B, C, D]);`\n *\n * Given a path `[A, B, C, D]`, where `A`, `B`, `C` and `D` are nodes for states `a`, `b`, `c`, `d`:\n * When injecting `D`, `D` should have access to all resolvables from `A`, `B`, `C`, `D`.\n * However, `B` should only be able to access resolvables from `A`, `B`.\n *\n * When resolving for the `B` node, first take the full \"To Path\" Context `[A,B,C,D]` and limit to the subpath `[A,B]`.\n * `let AB = ABCD.subcontext(a)`\n */\n ResolveContext.prototype.subContext = function (state) {\n return new ResolveContext(PathUtils.subPath(this._path, function (node) { return node.state === state; }));\n };\n /**\n * Adds Resolvables to the node that matches the state\n *\n * This adds a [[Resolvable]] (generally one created on the fly; not declared on a [[StateDeclaration.resolve]] block).\n * The resolvable is added to the node matching the `state` parameter.\n *\n * These new resolvables are not automatically fetched.\n * The calling code should either fetch them, fetch something that depends on them,\n * or rely on [[resolvePath]] being called when some state is being entered.\n *\n * Note: each resolvable's [[ResolvePolicy]] is merged with the state's policy, and the global default.\n *\n * @param newResolvables the new Resolvables\n * @param state Used to find the node to put the resolvable on\n */\n ResolveContext.prototype.addResolvables = function (newResolvables, state) {\n var node = find(this._path, propEq('state', state));\n var keys = newResolvables.map(function (r) { return r.token; });\n node.resolvables = node.resolvables.filter(function (r) { return keys.indexOf(r.token) === -1; }).concat(newResolvables);\n };\n /**\n * Returns a promise for an array of resolved path Element promises\n *\n * @param when\n * @param trans\n * @returns {Promise|any}\n */\n ResolveContext.prototype.resolvePath = function (when, trans) {\n var _this = this;\n if (when === void 0) { when = 'LAZY'; }\n // This option determines which 'when' policy Resolvables we are about to fetch.\n var whenOption = inArray(ALL_WHENS, when) ? when : 'LAZY';\n // If the caller specified EAGER, only the EAGER Resolvables are fetched.\n // if the caller specified LAZY, both EAGER and LAZY Resolvables are fetched.`\n var matchedWhens = whenOption === resolvePolicies.when.EAGER ? EAGER_WHENS : ALL_WHENS;\n // get the subpath to the state argument, if provided\n trace.traceResolvePath(this._path, when, trans);\n var matchesPolicy = function (acceptedVals, whenOrAsync) { return function (resolvable) {\n return inArray(acceptedVals, _this.getPolicy(resolvable)[whenOrAsync]);\n }; };\n // Trigger all the (matching) Resolvables in the path\n // Reduce all the \"WAIT\" Resolvables into an array\n var promises = this._path.reduce(function (acc, node) {\n var nodeResolvables = node.resolvables.filter(matchesPolicy(matchedWhens, 'when'));\n var nowait = nodeResolvables.filter(matchesPolicy(['NOWAIT'], 'async'));\n var wait = nodeResolvables.filter(not(matchesPolicy(['NOWAIT'], 'async')));\n // For the matching Resolvables, start their async fetch process.\n var subContext = _this.subContext(node.state);\n var getResult = function (r) {\n return r\n .get(subContext, trans)\n // Return a tuple that includes the Resolvable's token\n .then(function (value) { return ({ token: r.token, value: value }); });\n };\n nowait.forEach(getResult);\n return acc.concat(wait.map(getResult));\n }, []);\n // Wait for all the \"WAIT\" resolvables\n return services.$q.all(promises);\n };\n ResolveContext.prototype.injector = function () {\n return this._injector || (this._injector = new UIInjectorImpl(this));\n };\n ResolveContext.prototype.findNode = function (resolvable) {\n return find(this._path, function (node) { return inArray(node.resolvables, resolvable); });\n };\n /**\n * Gets the async dependencies of a Resolvable\n *\n * Given a Resolvable, returns its dependencies as a Resolvable[]\n */\n ResolveContext.prototype.getDependencies = function (resolvable) {\n var _this = this;\n var node = this.findNode(resolvable);\n // Find which other resolvables are \"visible\" to the `resolvable` argument\n // subpath stopping at resolvable's node, or the whole path (if the resolvable isn't in the path)\n var subPath = PathUtils.subPath(this._path, function (x) { return x === node; }) || this._path;\n var availableResolvables = subPath\n .reduce(function (acc, _node) { return acc.concat(_node.resolvables); }, []) // all of subpath's resolvables\n .filter(function (res) { return res !== resolvable; }); // filter out the `resolvable` argument\n var getDependency = function (token) {\n var matching = availableResolvables.filter(function (r) { return r.token === token; });\n if (matching.length)\n return tail(matching);\n var fromInjector = _this.injector().getNative(token);\n if (isUndefined(fromInjector)) {\n throw new Error('Could not find Dependency Injection token: ' + stringify(token));\n }\n return new Resolvable(token, function () { return fromInjector; }, [], fromInjector);\n };\n return resolvable.deps.map(getDependency);\n };\n return ResolveContext;\n}());\nexport { ResolveContext };\n/** @internalapi */\nvar UIInjectorImpl = /** @class */ (function () {\n function UIInjectorImpl(context) {\n this.context = context;\n this.native = this.get(NATIVE_INJECTOR_TOKEN) || services.$injector;\n }\n UIInjectorImpl.prototype.get = function (token) {\n var resolvable = this.context.getResolvable(token);\n if (resolvable) {\n if (this.context.getPolicy(resolvable).async === 'NOWAIT') {\n return resolvable.get(this.context);\n }\n if (!resolvable.resolved) {\n throw new Error('Resolvable async .get() not complete:' + stringify(resolvable.token));\n }\n return resolvable.data;\n }\n return this.getNative(token);\n };\n UIInjectorImpl.prototype.getAsync = function (token) {\n var resolvable = this.context.getResolvable(token);\n if (resolvable)\n return resolvable.get(this.context);\n return services.$q.when(this.native.get(token));\n };\n UIInjectorImpl.prototype.getNative = function (token) {\n return this.native && this.native.get(token);\n };\n return UIInjectorImpl;\n}());\n//# sourceMappingURL=resolveContext.js.map","/** @publicapi @module core */ /** */\nimport { UrlMatcherFactory } from './url/urlMatcherFactory';\nimport { UrlRouter } from './url/urlRouter';\nimport { TransitionService } from './transition/transitionService';\nimport { ViewService } from './view/view';\nimport { StateRegistry } from './state/stateRegistry';\nimport { StateService } from './state/stateService';\nimport { UIRouterGlobals } from './globals';\nimport { values, removeFrom } from './common/common';\nimport { isFunction } from './common/predicates';\nimport { UrlService } from './url/urlService';\nimport { trace } from './common/trace';\nimport { makeStub } from './common';\n/** @hidden */\nvar _routerInstance = 0;\n/** @hidden */\nvar locSvcFns = ['url', 'path', 'search', 'hash', 'onChange'];\n/** @hidden */\nvar locCfgFns = ['port', 'protocol', 'host', 'baseHref', 'html5Mode', 'hashPrefix'];\n/** @hidden */\nvar locationServiceStub = makeStub('LocationServices', locSvcFns);\n/** @hidden */\nvar locationConfigStub = makeStub('LocationConfig', locCfgFns);\n/**\n * The master class used to instantiate an instance of UI-Router.\n *\n * UI-Router (for each specific framework) will create an instance of this class during bootstrap.\n * This class instantiates and wires the UI-Router services together.\n *\n * After a new instance of the UIRouter class is created, it should be configured for your app.\n * For instance, app states should be registered with the [[UIRouter.stateRegistry]].\n *\n * ---\n *\n * Normally the framework code will bootstrap UI-Router.\n * If you are bootstrapping UIRouter manually, tell it to monitor the URL by calling\n * [[UrlService.listen]] then [[UrlService.sync]].\n */\nvar UIRouter = /** @class */ (function () {\n /**\n * Creates a new `UIRouter` object\n *\n * @param locationService a [[LocationServices]] implementation\n * @param locationConfig a [[LocationConfig]] implementation\n * @internalapi\n */\n function UIRouter(locationService, locationConfig) {\n if (locationService === void 0) { locationService = locationServiceStub; }\n if (locationConfig === void 0) { locationConfig = locationConfigStub; }\n this.locationService = locationService;\n this.locationConfig = locationConfig;\n /** @hidden */ this.$id = _routerInstance++;\n /** @hidden */ this._disposed = false;\n /** @hidden */ this._disposables = [];\n /** Provides trace information to the console */\n this.trace = trace;\n /** Provides services related to ui-view synchronization */\n this.viewService = new ViewService(this);\n /** Global router state */\n this.globals = new UIRouterGlobals();\n /** Provides services related to Transitions */\n this.transitionService = new TransitionService(this);\n /**\n * Deprecated for public use. Use [[urlService]] instead.\n * @deprecated Use [[urlService]] instead\n */\n this.urlMatcherFactory = new UrlMatcherFactory(this);\n /**\n * Deprecated for public use. Use [[urlService]] instead.\n * @deprecated Use [[urlService]] instead\n */\n this.urlRouter = new UrlRouter(this);\n /** Provides services related to the URL */\n this.urlService = new UrlService(this);\n /** Provides a registry for states, and related registration services */\n this.stateRegistry = new StateRegistry(this);\n /** Provides services related to states */\n this.stateService = new StateService(this);\n /** @hidden plugin instances are registered here */\n this._plugins = {};\n this.viewService._pluginapi._rootViewContext(this.stateRegistry.root());\n this.globals.$current = this.stateRegistry.root();\n this.globals.current = this.globals.$current.self;\n this.disposable(this.globals);\n this.disposable(this.stateService);\n this.disposable(this.stateRegistry);\n this.disposable(this.transitionService);\n this.disposable(this.urlService);\n this.disposable(locationService);\n this.disposable(locationConfig);\n }\n /** Registers an object to be notified when the router is disposed */\n UIRouter.prototype.disposable = function (disposable) {\n this._disposables.push(disposable);\n };\n /**\n * Disposes this router instance\n *\n * When called, clears resources retained by the router by calling `dispose(this)` on all\n * registered [[disposable]] objects.\n *\n * Or, if a `disposable` object is provided, calls `dispose(this)` on that object only.\n *\n * @param disposable (optional) the disposable to dispose\n */\n UIRouter.prototype.dispose = function (disposable) {\n var _this = this;\n if (disposable && isFunction(disposable.dispose)) {\n disposable.dispose(this);\n return undefined;\n }\n this._disposed = true;\n this._disposables.slice().forEach(function (d) {\n try {\n typeof d.dispose === 'function' && d.dispose(_this);\n removeFrom(_this._disposables, d);\n }\n catch (ignored) { }\n });\n };\n /**\n * Adds a plugin to UI-Router\n *\n * This method adds a UI-Router Plugin.\n * A plugin can enhance or change UI-Router behavior using any public API.\n *\n * #### Example:\n * ```js\n * import { MyCoolPlugin } from \"ui-router-cool-plugin\";\n *\n * var plugin = router.addPlugin(MyCoolPlugin);\n * ```\n *\n * ### Plugin authoring\n *\n * A plugin is simply a class (or constructor function) which accepts a [[UIRouter]] instance and (optionally) an options object.\n *\n * The plugin can implement its functionality using any of the public APIs of [[UIRouter]].\n * For example, it may configure router options or add a Transition Hook.\n *\n * The plugin can then be published as a separate module.\n *\n * #### Example:\n * ```js\n * export class MyAuthPlugin implements UIRouterPlugin {\n * constructor(router: UIRouter, options: any) {\n * this.name = \"MyAuthPlugin\";\n * let $transitions = router.transitionService;\n * let $state = router.stateService;\n *\n * let authCriteria = {\n * to: (state) => state.data && state.data.requiresAuth\n * };\n *\n * function authHook(transition: Transition) {\n * let authService = transition.injector().get('AuthService');\n * if (!authService.isAuthenticated()) {\n * return $state.target('login');\n * }\n * }\n *\n * $transitions.onStart(authCriteria, authHook);\n * }\n * }\n * ```\n *\n * @param plugin one of:\n * - a plugin class which implements [[UIRouterPlugin]]\n * - a constructor function for a [[UIRouterPlugin]] which accepts a [[UIRouter]] instance\n * - a factory function which accepts a [[UIRouter]] instance and returns a [[UIRouterPlugin]] instance\n * @param options options to pass to the plugin class/factory\n * @returns the registered plugin instance\n */\n UIRouter.prototype.plugin = function (plugin, options) {\n if (options === void 0) { options = {}; }\n var pluginInstance = new plugin(this, options);\n if (!pluginInstance.name)\n throw new Error('Required property `name` missing on plugin: ' + pluginInstance);\n this._disposables.push(pluginInstance);\n return (this._plugins[pluginInstance.name] = pluginInstance);\n };\n UIRouter.prototype.getPlugin = function (pluginName) {\n return pluginName ? this._plugins[pluginName] : values(this._plugins);\n };\n return UIRouter;\n}());\nexport { UIRouter };\n//# sourceMappingURL=router.js.map","export * from './stateBuilder';\nexport * from './stateObject';\nexport * from './stateMatcher';\nexport * from './stateQueueManager';\nexport * from './stateRegistry';\nexport * from './stateService';\nexport * from './targetState';\n//# sourceMappingURL=index.js.map","/** @publicapi @module state */ /** */\nimport { applyPairs, extend, identity, inherit, mapObj, noop, omit, tail, values, copy } from '../common/common';\nimport { isArray, isDefined, isFunction, isString } from '../common/predicates';\nimport { stringify } from '../common/strings';\nimport { is, pattern, pipe, prop, val } from '../common/hof';\nimport { Resolvable } from '../resolve/resolvable';\nimport { services } from '../common/coreservices';\nvar parseUrl = function (url) {\n if (!isString(url))\n return false;\n var root = url.charAt(0) === '^';\n return { val: root ? url.substring(1) : url, root: root };\n};\nfunction nameBuilder(state) {\n return state.name;\n}\nfunction selfBuilder(state) {\n state.self.$$state = function () { return state; };\n return state.self;\n}\nfunction dataBuilder(state) {\n if (state.parent && state.parent.data) {\n state.data = state.self.data = inherit(state.parent.data, state.data);\n }\n return state.data;\n}\nvar getUrlBuilder = function ($urlMatcherFactoryProvider, root) {\n return function urlBuilder(stateObject) {\n var stateDec = stateObject.self;\n // For future states, i.e., states whose name ends with `.**`,\n // match anything that starts with the url prefix\n if (stateDec && stateDec.url && stateDec.name && stateDec.name.match(/\\.\\*\\*$/)) {\n var newStateDec = {};\n copy(stateDec, newStateDec);\n newStateDec.url += '{remainder:any}'; // match any path (.*)\n stateDec = newStateDec;\n }\n var parent = stateObject.parent;\n var parsed = parseUrl(stateDec.url);\n var url = !parsed ? stateDec.url : $urlMatcherFactoryProvider.compile(parsed.val, { state: stateDec });\n if (!url)\n return null;\n if (!$urlMatcherFactoryProvider.isMatcher(url))\n throw new Error(\"Invalid url '\" + url + \"' in state '\" + stateObject + \"'\");\n return parsed && parsed.root ? url : ((parent && parent.navigable) || root()).url.append(url);\n };\n};\nvar getNavigableBuilder = function (isRoot) {\n return function navigableBuilder(state) {\n return !isRoot(state) && state.url ? state : state.parent ? state.parent.navigable : null;\n };\n};\nvar getParamsBuilder = function (paramFactory) {\n return function paramsBuilder(state) {\n var makeConfigParam = function (config, id) { return paramFactory.fromConfig(id, null, state.self); };\n var urlParams = (state.url && state.url.parameters({ inherit: false })) || [];\n var nonUrlParams = values(mapObj(omit(state.params || {}, urlParams.map(prop('id'))), makeConfigParam));\n return urlParams\n .concat(nonUrlParams)\n .map(function (p) { return [p.id, p]; })\n .reduce(applyPairs, {});\n };\n};\nfunction pathBuilder(state) {\n return state.parent ? state.parent.path.concat(state) : /*root*/ [state];\n}\nfunction includesBuilder(state) {\n var includes = state.parent ? extend({}, state.parent.includes) : {};\n includes[state.name] = true;\n return includes;\n}\n/**\n * This is a [[StateBuilder.builder]] function for the `resolve:` block on a [[StateDeclaration]].\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * validates the `resolve` property and converts it to a [[Resolvable]] array.\n *\n * resolve: input value can be:\n *\n * {\n * // analyzed but not injected\n * myFooResolve: function() { return \"myFooData\"; },\n *\n * // function.toString() parsed, \"DependencyName\" dep as string (not min-safe)\n * myBarResolve: function(DependencyName) { return DependencyName.fetchSomethingAsPromise() },\n *\n * // Array split; \"DependencyName\" dep as string\n * myBazResolve: [ \"DependencyName\", function(dep) { return dep.fetchSomethingAsPromise() },\n *\n * // Array split; DependencyType dep as token (compared using ===)\n * myQuxResolve: [ DependencyType, function(dep) { return dep.fetchSometingAsPromise() },\n *\n * // val.$inject used as deps\n * // where:\n * // corgeResolve.$inject = [\"DependencyName\"];\n * // function corgeResolve(dep) { dep.fetchSometingAsPromise() }\n * // then \"DependencyName\" dep as string\n * myCorgeResolve: corgeResolve,\n *\n * // inject service by name\n * // When a string is found, desugar creating a resolve that injects the named service\n * myGraultResolve: \"SomeService\"\n * }\n *\n * or:\n *\n * [\n * new Resolvable(\"myFooResolve\", function() { return \"myFooData\" }),\n * new Resolvable(\"myBarResolve\", function(dep) { return dep.fetchSomethingAsPromise() }, [ \"DependencyName\" ]),\n * { provide: \"myBazResolve\", useFactory: function(dep) { dep.fetchSomethingAsPromise() }, deps: [ \"DependencyName\" ] }\n * ]\n */\nexport function resolvablesBuilder(state) {\n /** convert resolve: {} and resolvePolicy: {} objects to an array of tuples */\n var objects2Tuples = function (resolveObj, resolvePolicies) {\n return Object.keys(resolveObj || {}).map(function (token) { return ({\n token: token,\n val: resolveObj[token],\n deps: undefined,\n policy: resolvePolicies[token],\n }); });\n };\n /** fetch DI annotations from a function or ng1-style array */\n var annotate = function (fn) {\n var $injector = services.$injector;\n // ng1 doesn't have an $injector until runtime.\n // If the $injector doesn't exist, use \"deferred\" literal as a\n // marker indicating they should be annotated when runtime starts\n return fn['$inject'] || ($injector && $injector.annotate(fn, $injector.strictDi)) || 'deferred';\n };\n /** true if the object has both `token` and `resolveFn`, and is probably a [[ResolveLiteral]] */\n var isResolveLiteral = function (obj) { return !!(obj.token && obj.resolveFn); };\n /** true if the object looks like a provide literal, or a ng2 Provider */\n var isLikeNg2Provider = function (obj) {\n return !!((obj.provide || obj.token) && (obj.useValue || obj.useFactory || obj.useExisting || obj.useClass));\n };\n /** true if the object looks like a tuple from obj2Tuples */\n var isTupleFromObj = function (obj) {\n return !!(obj && obj.val && (isString(obj.val) || isArray(obj.val) || isFunction(obj.val)));\n };\n /** extracts the token from a Provider or provide literal */\n var getToken = function (p) { return p.provide || p.token; };\n // prettier-ignore: Given a literal resolve or provider object, returns a Resolvable\n var literal2Resolvable = pattern([\n [prop('resolveFn'), function (p) { return new Resolvable(getToken(p), p.resolveFn, p.deps, p.policy); }],\n [prop('useFactory'), function (p) { return new Resolvable(getToken(p), p.useFactory, p.deps || p.dependencies, p.policy); }],\n [prop('useClass'), function (p) { return new Resolvable(getToken(p), function () { return new p.useClass(); }, [], p.policy); }],\n [prop('useValue'), function (p) { return new Resolvable(getToken(p), function () { return p.useValue; }, [], p.policy, p.useValue); }],\n [prop('useExisting'), function (p) { return new Resolvable(getToken(p), identity, [p.useExisting], p.policy); }],\n ]);\n // prettier-ignore\n var tuple2Resolvable = pattern([\n [pipe(prop('val'), isString), function (tuple) { return new Resolvable(tuple.token, identity, [tuple.val], tuple.policy); }],\n [pipe(prop('val'), isArray), function (tuple) { return new Resolvable(tuple.token, tail(tuple.val), tuple.val.slice(0, -1), tuple.policy); }],\n [pipe(prop('val'), isFunction), function (tuple) { return new Resolvable(tuple.token, tuple.val, annotate(tuple.val), tuple.policy); }],\n ]);\n // prettier-ignore\n var item2Resolvable = pattern([\n [is(Resolvable), function (r) { return r; }],\n [isResolveLiteral, literal2Resolvable],\n [isLikeNg2Provider, literal2Resolvable],\n [isTupleFromObj, tuple2Resolvable],\n [val(true), function (obj) { throw new Error('Invalid resolve value: ' + stringify(obj)); },],\n ]);\n // If resolveBlock is already an array, use it as-is.\n // Otherwise, assume it's an object and convert to an Array of tuples\n var decl = state.resolve;\n var items = isArray(decl) ? decl : objects2Tuples(decl, state.resolvePolicy || {});\n return items.map(item2Resolvable);\n}\n/**\n * @internalapi A internal global service\n *\n * StateBuilder is a factory for the internal [[StateObject]] objects.\n *\n * When you register a state with the [[StateRegistry]], you register a plain old javascript object which\n * conforms to the [[StateDeclaration]] interface. This factory takes that object and builds the corresponding\n * [[StateObject]] object, which has an API and is used internally.\n *\n * Custom properties or API may be added to the internal [[StateObject]] object by registering a decorator function\n * using the [[builder]] method.\n */\nvar StateBuilder = /** @class */ (function () {\n function StateBuilder(matcher, urlMatcherFactory) {\n this.matcher = matcher;\n var self = this;\n var root = function () { return matcher.find(''); };\n var isRoot = function (state) { return state.name === ''; };\n function parentBuilder(state) {\n if (isRoot(state))\n return null;\n return matcher.find(self.parentName(state)) || root();\n }\n this.builders = {\n name: [nameBuilder],\n self: [selfBuilder],\n parent: [parentBuilder],\n data: [dataBuilder],\n // Build a URLMatcher if necessary, either via a relative or absolute URL\n url: [getUrlBuilder(urlMatcherFactory, root)],\n // Keep track of the closest ancestor state that has a URL (i.e. is navigable)\n navigable: [getNavigableBuilder(isRoot)],\n params: [getParamsBuilder(urlMatcherFactory.paramFactory)],\n // Each framework-specific ui-router implementation should define its own `views` builder\n // e.g., src/ng1/statebuilders/views.ts\n views: [],\n // Keep a full path from the root down to this state as this is needed for state activation.\n path: [pathBuilder],\n // Speed up $state.includes() as it's used a lot\n includes: [includesBuilder],\n resolvables: [resolvablesBuilder],\n };\n }\n /**\n * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).\n * More than one BuilderFunction can be registered for a given property.\n *\n * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects.\n *\n * @param name The name of the State property being registered for.\n * @param fn The BuilderFunction which will be used to build the State property\n * @returns a function which deregisters the BuilderFunction\n */\n StateBuilder.prototype.builder = function (name, fn) {\n var builders = this.builders;\n var array = builders[name] || [];\n // Backwards compat: if only one builder exists, return it, else return whole arary.\n if (isString(name) && !isDefined(fn))\n return array.length > 1 ? array : array[0];\n if (!isString(name) || !isFunction(fn))\n return;\n builders[name] = array;\n builders[name].push(fn);\n return function () { return builders[name].splice(builders[name].indexOf(fn, 1)) && null; };\n };\n /**\n * Builds all of the properties on an essentially blank State object, returning a State object which has all its\n * properties and API built.\n *\n * @param state an uninitialized State object\n * @returns the built State object\n */\n StateBuilder.prototype.build = function (state) {\n var _a = this, matcher = _a.matcher, builders = _a.builders;\n var parent = this.parentName(state);\n if (parent && !matcher.find(parent, undefined, false)) {\n return null;\n }\n for (var key in builders) {\n if (!builders.hasOwnProperty(key))\n continue;\n var chain = builders[key].reduce(function (parentFn, step) { return function (_state) { return step(_state, parentFn); }; }, noop);\n state[key] = chain(state);\n }\n return state;\n };\n StateBuilder.prototype.parentName = function (state) {\n // name = 'foo.bar.baz.**'\n var name = state.name || '';\n // segments = ['foo', 'bar', 'baz', '.**']\n var segments = name.split('.');\n // segments = ['foo', 'bar', 'baz']\n var lastSegment = segments.pop();\n // segments = ['foo', 'bar'] (ignore .** segment for future states)\n if (lastSegment === '**')\n segments.pop();\n if (segments.length) {\n if (state.parent) {\n throw new Error(\"States that specify the 'parent:' property should not have a '.' in their name (\" + name + \")\");\n }\n // 'foo.bar'\n return segments.join('.');\n }\n if (!state.parent)\n return '';\n return isString(state.parent) ? state.parent : state.parent.name;\n };\n StateBuilder.prototype.name = function (state) {\n var name = state.name;\n if (name.indexOf('.') !== -1 || !state.parent)\n return name;\n var parentName = isString(state.parent) ? state.parent : state.parent.name;\n return parentName ? parentName + '.' + name : name;\n };\n return StateBuilder;\n}());\nexport { StateBuilder };\n//# sourceMappingURL=stateBuilder.js.map","/** @publicapi @module state */ /** */\nimport { isString } from '../common/predicates';\nimport { values } from '../common/common';\nvar StateMatcher = /** @class */ (function () {\n function StateMatcher(_states) {\n this._states = _states;\n }\n StateMatcher.prototype.isRelative = function (stateName) {\n stateName = stateName || '';\n return stateName.indexOf('.') === 0 || stateName.indexOf('^') === 0;\n };\n StateMatcher.prototype.find = function (stateOrName, base, matchGlob) {\n if (matchGlob === void 0) { matchGlob = true; }\n if (!stateOrName && stateOrName !== '')\n return undefined;\n var isStr = isString(stateOrName);\n var name = isStr ? stateOrName : stateOrName.name;\n if (this.isRelative(name))\n name = this.resolvePath(name, base);\n var state = this._states[name];\n if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {\n return state;\n }\n else if (isStr && matchGlob) {\n var _states = values(this._states);\n var matches = _states.filter(function (_state) { return _state.__stateObjectCache.nameGlob && _state.__stateObjectCache.nameGlob.matches(name); });\n if (matches.length > 1) {\n // tslint:disable-next-line:no-console\n console.log(\"stateMatcher.find: Found multiple matches for \" + name + \" using glob: \", matches.map(function (match) { return match.name; }));\n }\n return matches[0];\n }\n return undefined;\n };\n StateMatcher.prototype.resolvePath = function (name, base) {\n if (!base)\n throw new Error(\"No reference point given for path '\" + name + \"'\");\n var baseState = this.find(base);\n var splitName = name.split('.');\n var pathLength = splitName.length;\n var i = 0, current = baseState;\n for (; i < pathLength; i++) {\n if (splitName[i] === '' && i === 0) {\n current = baseState;\n continue;\n }\n if (splitName[i] === '^') {\n if (!current.parent)\n throw new Error(\"Path '\" + name + \"' not valid for state '\" + baseState.name + \"'\");\n current = current.parent;\n continue;\n }\n break;\n }\n var relName = splitName.slice(i).join('.');\n return current.name + (current.name && relName ? '.' : '') + relName;\n };\n return StateMatcher;\n}());\nexport { StateMatcher };\n//# sourceMappingURL=stateMatcher.js.map","import { defaults, values, find, inherit } from '../common/common';\nimport { propEq } from '../common/hof';\nimport { Glob } from '../common/glob';\nimport { isObject, isFunction } from '../common/predicates';\n/**\n * Internal representation of a UI-Router state.\n *\n * Instances of this class are created when a [[StateDeclaration]] is registered with the [[StateRegistry]].\n *\n * A registered [[StateDeclaration]] is augmented with a getter ([[StateDeclaration.$$state]]) which returns the corresponding [[StateObject]] object.\n *\n * This class prototypally inherits from the corresponding [[StateDeclaration]].\n * Each of its own properties (i.e., `hasOwnProperty`) are built using builders from the [[StateBuilder]].\n */\nvar StateObject = /** @class */ (function () {\n /** @deprecated use State.create() */\n function StateObject(config) {\n return StateObject.create(config || {});\n }\n /**\n * Create a state object to put the private/internal implementation details onto.\n * The object's prototype chain looks like:\n * (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...)\n *\n * @param stateDecl the user-supplied State Declaration\n * @returns {StateObject} an internal State object\n */\n StateObject.create = function (stateDecl) {\n stateDecl = StateObject.isStateClass(stateDecl) ? new stateDecl() : stateDecl;\n var state = inherit(inherit(stateDecl, StateObject.prototype));\n stateDecl.$$state = function () { return state; };\n state.self = stateDecl;\n state.__stateObjectCache = {\n nameGlob: Glob.fromString(state.name),\n };\n return state;\n };\n /**\n * Returns true if the provided parameter is the same state.\n *\n * Compares the identity of the state against the passed value, which is either an object\n * reference to the actual `State` instance, the original definition object passed to\n * `$stateProvider.state()`, or the fully-qualified name.\n *\n * @param ref Can be one of (a) a `State` instance, (b) an object that was passed\n * into `$stateProvider.state()`, (c) the fully-qualified name of a state as a string.\n * @returns Returns `true` if `ref` matches the current `State` instance.\n */\n StateObject.prototype.is = function (ref) {\n return this === ref || this.self === ref || this.fqn() === ref;\n };\n /**\n * @deprecated this does not properly handle dot notation\n * @returns Returns a dot-separated name of the state.\n */\n StateObject.prototype.fqn = function () {\n if (!this.parent || !(this.parent instanceof this.constructor))\n return this.name;\n var name = this.parent.fqn();\n return name ? name + '.' + this.name : this.name;\n };\n /**\n * Returns the root node of this state's tree.\n *\n * @returns The root of this state's tree.\n */\n StateObject.prototype.root = function () {\n return (this.parent && this.parent.root()) || this;\n };\n /**\n * Gets the state's `Param` objects\n *\n * Gets the list of [[Param]] objects owned by the state.\n * If `opts.inherit` is true, it also includes the ancestor states' [[Param]] objects.\n * If `opts.matchingKeys` exists, returns only `Param`s whose `id` is a key on the `matchingKeys` object\n *\n * @param opts options\n */\n StateObject.prototype.parameters = function (opts) {\n opts = defaults(opts, { inherit: true, matchingKeys: null });\n var inherited = (opts.inherit && this.parent && this.parent.parameters()) || [];\n return inherited\n .concat(values(this.params))\n .filter(function (param) { return !opts.matchingKeys || opts.matchingKeys.hasOwnProperty(param.id); });\n };\n /**\n * Returns a single [[Param]] that is owned by the state\n *\n * If `opts.inherit` is true, it also searches the ancestor states` [[Param]]s.\n * @param id the name of the [[Param]] to return\n * @param opts options\n */\n StateObject.prototype.parameter = function (id, opts) {\n if (opts === void 0) { opts = {}; }\n return ((this.url && this.url.parameter(id, opts)) ||\n find(values(this.params), propEq('id', id)) ||\n (opts.inherit && this.parent && this.parent.parameter(id)));\n };\n StateObject.prototype.toString = function () {\n return this.fqn();\n };\n /** Predicate which returns true if the object is an class with @State() decorator */\n StateObject.isStateClass = function (stateDecl) {\n return isFunction(stateDecl) && stateDecl['__uiRouterState'] === true;\n };\n /** Predicate which returns true if the object is an internal [[StateObject]] object */\n StateObject.isState = function (obj) { return isObject(obj['__stateObjectCache']); };\n return StateObject;\n}());\nexport { StateObject };\n//# sourceMappingURL=stateObject.js.map","/** @publicapi @module state */ /** */\nimport { inArray, isString, prop } from '../common';\nimport { StateObject } from './stateObject';\n/** @internalapi */\nvar StateQueueManager = /** @class */ (function () {\n function StateQueueManager(router, states, builder, listeners) {\n this.router = router;\n this.states = states;\n this.builder = builder;\n this.listeners = listeners;\n this.queue = [];\n }\n /** @internalapi */\n StateQueueManager.prototype.dispose = function () {\n this.queue = [];\n };\n StateQueueManager.prototype.register = function (stateDecl) {\n var queue = this.queue;\n var state = StateObject.create(stateDecl);\n var name = state.name;\n if (!isString(name))\n throw new Error('State must have a valid name');\n if (this.states.hasOwnProperty(name) || inArray(queue.map(prop('name')), name))\n throw new Error(\"State '\" + name + \"' is already defined\");\n queue.push(state);\n this.flush();\n return state;\n };\n StateQueueManager.prototype.flush = function () {\n var _this = this;\n var _a = this, queue = _a.queue, states = _a.states, builder = _a.builder;\n var registered = [], // states that got registered\n orphans = [], // states that don't yet have a parent registered\n previousQueueLength = {}; // keep track of how long the queue when an orphan was first encountered\n var getState = function (name) { return _this.states.hasOwnProperty(name) && _this.states[name]; };\n var notifyListeners = function () {\n if (registered.length) {\n _this.listeners.forEach(function (listener) { return listener('registered', registered.map(function (s) { return s.self; })); });\n }\n };\n while (queue.length > 0) {\n var state = queue.shift();\n var name_1 = state.name;\n var result = builder.build(state);\n var orphanIdx = orphans.indexOf(state);\n if (result) {\n var existingState = getState(name_1);\n if (existingState && existingState.name === name_1) {\n throw new Error(\"State '\" + name_1 + \"' is already defined\");\n }\n var existingFutureState = getState(name_1 + '.**');\n if (existingFutureState) {\n // Remove future state of the same name\n this.router.stateRegistry.deregister(existingFutureState);\n }\n states[name_1] = state;\n this.attachRoute(state);\n if (orphanIdx >= 0)\n orphans.splice(orphanIdx, 1);\n registered.push(state);\n continue;\n }\n var prev = previousQueueLength[name_1];\n previousQueueLength[name_1] = queue.length;\n if (orphanIdx >= 0 && prev === queue.length) {\n // Wait until two consecutive iterations where no additional states were dequeued successfully.\n // throw new Error(`Cannot register orphaned state '${name}'`);\n queue.push(state);\n notifyListeners();\n return states;\n }\n else if (orphanIdx < 0) {\n orphans.push(state);\n }\n queue.push(state);\n }\n notifyListeners();\n return states;\n };\n StateQueueManager.prototype.attachRoute = function (state) {\n if (state.abstract || !state.url)\n return;\n var rulesApi = this.router.urlService.rules;\n rulesApi.rule(rulesApi.urlRuleFactory.create(state));\n };\n return StateQueueManager;\n}());\nexport { StateQueueManager };\n//# sourceMappingURL=stateQueueManager.js.map","/** @publicapi @module state */ /** */\nimport { StateMatcher } from './stateMatcher';\nimport { StateBuilder } from './stateBuilder';\nimport { StateQueueManager } from './stateQueueManager';\nimport { removeFrom } from '../common/common';\nimport { propEq } from '../common/hof';\nvar StateRegistry = /** @class */ (function () {\n /** @internalapi */\n function StateRegistry(router) {\n this.router = router;\n this.states = {};\n this.listeners = [];\n this.matcher = new StateMatcher(this.states);\n this.builder = new StateBuilder(this.matcher, router.urlMatcherFactory);\n this.stateQueue = new StateQueueManager(router, this.states, this.builder, this.listeners);\n this._registerRoot();\n }\n /** @internalapi */\n StateRegistry.prototype._registerRoot = function () {\n var rootStateDef = {\n name: '',\n url: '^',\n views: null,\n params: {\n '#': { value: null, type: 'hash', dynamic: true },\n },\n abstract: true,\n };\n var _root = (this._root = this.stateQueue.register(rootStateDef));\n _root.navigable = null;\n };\n /** @internalapi */\n StateRegistry.prototype.dispose = function () {\n var _this = this;\n this.stateQueue.dispose();\n this.listeners = [];\n this.get().forEach(function (state) { return _this.get(state) && _this.deregister(state); });\n };\n /**\n * Listen for a State Registry events\n *\n * Adds a callback that is invoked when states are registered or deregistered with the StateRegistry.\n *\n * #### Example:\n * ```js\n * let allStates = registry.get();\n *\n * // Later, invoke deregisterFn() to remove the listener\n * let deregisterFn = registry.onStatesChanged((event, states) => {\n * switch(event) {\n * case: 'registered':\n * states.forEach(state => allStates.push(state));\n * break;\n * case: 'deregistered':\n * states.forEach(state => {\n * let idx = allStates.indexOf(state);\n * if (idx !== -1) allStates.splice(idx, 1);\n * });\n * break;\n * }\n * });\n * ```\n *\n * @param listener a callback function invoked when the registered states changes.\n * The function receives two parameters, `event` and `state`.\n * See [[StateRegistryListener]]\n * @return a function that deregisters the listener\n */\n StateRegistry.prototype.onStatesChanged = function (listener) {\n this.listeners.push(listener);\n return function deregisterListener() {\n removeFrom(this.listeners)(listener);\n }.bind(this);\n };\n /**\n * Gets the implicit root state\n *\n * Gets the root of the state tree.\n * The root state is implicitly created by UI-Router.\n * Note: this returns the internal [[StateObject]] representation, not a [[StateDeclaration]]\n *\n * @return the root [[StateObject]]\n */\n StateRegistry.prototype.root = function () {\n return this._root;\n };\n /**\n * Adds a state to the registry\n *\n * Registers a [[StateDeclaration]] or queues it for registration.\n *\n * Note: a state will be queued if the state's parent isn't yet registered.\n *\n * @param stateDefinition the definition of the state to register.\n * @returns the internal [[StateObject]] object.\n * If the state was successfully registered, then the object is fully built (See: [[StateBuilder]]).\n * If the state was only queued, then the object is not fully built.\n */\n StateRegistry.prototype.register = function (stateDefinition) {\n return this.stateQueue.register(stateDefinition);\n };\n /** @hidden */\n StateRegistry.prototype._deregisterTree = function (state) {\n var _this = this;\n var all = this.get().map(function (s) { return s.$$state(); });\n var getChildren = function (states) {\n var _children = all.filter(function (s) { return states.indexOf(s.parent) !== -1; });\n return _children.length === 0 ? _children : _children.concat(getChildren(_children));\n };\n var children = getChildren([state]);\n var deregistered = [state].concat(children).reverse();\n deregistered.forEach(function (_state) {\n var rulesApi = _this.router.urlService.rules;\n // Remove URL rule\n rulesApi\n .rules()\n .filter(propEq('state', _state))\n .forEach(function (rule) { return rulesApi.removeRule(rule); });\n // Remove state from registry\n delete _this.states[_state.name];\n });\n return deregistered;\n };\n /**\n * Removes a state from the registry\n *\n * This removes a state from the registry.\n * If the state has children, they are are also removed from the registry.\n *\n * @param stateOrName the state's name or object representation\n * @returns {StateObject[]} a list of removed states\n */\n StateRegistry.prototype.deregister = function (stateOrName) {\n var _state = this.get(stateOrName);\n if (!_state)\n throw new Error(\"Can't deregister state; not found: \" + stateOrName);\n var deregisteredStates = this._deregisterTree(_state.$$state());\n this.listeners.forEach(function (listener) { return listener('deregistered', deregisteredStates.map(function (s) { return s.self; })); });\n return deregisteredStates;\n };\n StateRegistry.prototype.get = function (stateOrName, base) {\n var _this = this;\n if (arguments.length === 0)\n return Object.keys(this.states).map(function (name) { return _this.states[name].self; });\n var found = this.matcher.find(stateOrName, base);\n return (found && found.self) || null;\n };\n StateRegistry.prototype.decorator = function (name, func) {\n return this.builder.builder(name, func);\n };\n return StateRegistry;\n}());\nexport { StateRegistry };\n//# sourceMappingURL=stateRegistry.js.map","/** @publicapi @module state */ /** */\nimport { createProxyFunctions, defaults, extend, inArray, noop, removeFrom, silenceUncaughtInPromise, silentRejection, } from '../common/common';\nimport { isDefined, isObject, isString } from '../common/predicates';\nimport { Queue } from '../common/queue';\nimport { services } from '../common/coreservices';\nimport { PathUtils } from '../path/pathUtils';\nimport { PathNode } from '../path/pathNode';\nimport { defaultTransOpts } from '../transition/transitionService';\nimport { Rejection, RejectType } from '../transition/rejectFactory';\nimport { TargetState } from './targetState';\nimport { Param } from '../params/param';\nimport { Glob } from '../common/glob';\nimport { ResolveContext } from '../resolve/resolveContext';\nimport { lazyLoadState } from '../hooks/lazyLoad';\nimport { not, val } from '../common/hof';\n/**\n * Provides state related service functions\n *\n * This class provides services related to ui-router states.\n * An instance of this class is located on the global [[UIRouter]] object.\n */\nvar StateService = /** @class */ (function () {\n /** @internalapi */\n function StateService(/** @hidden */ router) {\n this.router = router;\n /** @internalapi */\n this.invalidCallbacks = [];\n /** @hidden */\n this._defaultErrorHandler = function $defaultErrorHandler($error$) {\n if ($error$ instanceof Error && $error$.stack) {\n console.error($error$);\n console.error($error$.stack);\n }\n else if ($error$ instanceof Rejection) {\n console.error($error$.toString());\n if ($error$.detail && $error$.detail.stack)\n console.error($error$.detail.stack);\n }\n else {\n console.error($error$);\n }\n };\n var getters = ['current', '$current', 'params', 'transition'];\n var boundFns = Object.keys(StateService.prototype).filter(not(inArray(getters)));\n createProxyFunctions(val(StateService.prototype), this, val(this), boundFns);\n }\n Object.defineProperty(StateService.prototype, \"transition\", {\n /**\n * The [[Transition]] currently in progress (or null)\n *\n * This is a passthrough through to [[UIRouterGlobals.transition]]\n */\n get: function () {\n return this.router.globals.transition;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"params\", {\n /**\n * The latest successful state parameters\n *\n * This is a passthrough through to [[UIRouterGlobals.params]]\n */\n get: function () {\n return this.router.globals.params;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"current\", {\n /**\n * The current [[StateDeclaration]]\n *\n * This is a passthrough through to [[UIRouterGlobals.current]]\n */\n get: function () {\n return this.router.globals.current;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"$current\", {\n /**\n * The current [[StateObject]]\n *\n * This is a passthrough through to [[UIRouterGlobals.$current]]\n */\n get: function () {\n return this.router.globals.$current;\n },\n enumerable: true,\n configurable: true\n });\n /** @internalapi */\n StateService.prototype.dispose = function () {\n this.defaultErrorHandler(noop);\n this.invalidCallbacks = [];\n };\n /**\n * Handler for when [[transitionTo]] is called with an invalid state.\n *\n * Invokes the [[onInvalid]] callbacks, in natural order.\n * Each callback's return value is checked in sequence until one of them returns an instance of TargetState.\n * The results of the callbacks are wrapped in $q.when(), so the callbacks may return promises.\n *\n * If a callback returns an TargetState, then it is used as arguments to $state.transitionTo() and the result returned.\n *\n * @internalapi\n */\n StateService.prototype._handleInvalidTargetState = function (fromPath, toState) {\n var _this = this;\n var fromState = PathUtils.makeTargetState(this.router.stateRegistry, fromPath);\n var globals = this.router.globals;\n var latestThing = function () { return globals.transitionHistory.peekTail(); };\n var latest = latestThing();\n var callbackQueue = new Queue(this.invalidCallbacks.slice());\n var injector = new ResolveContext(fromPath).injector();\n var checkForRedirect = function (result) {\n if (!(result instanceof TargetState)) {\n return;\n }\n var target = result;\n // Recreate the TargetState, in case the state is now defined.\n target = _this.target(target.identifier(), target.params(), target.options());\n if (!target.valid()) {\n return Rejection.invalid(target.error()).toPromise();\n }\n if (latestThing() !== latest) {\n return Rejection.superseded().toPromise();\n }\n return _this.transitionTo(target.identifier(), target.params(), target.options());\n };\n function invokeNextCallback() {\n var nextCallback = callbackQueue.dequeue();\n if (nextCallback === undefined)\n return Rejection.invalid(toState.error()).toPromise();\n var callbackResult = services.$q.when(nextCallback(toState, fromState, injector));\n return callbackResult.then(checkForRedirect).then(function (result) { return result || invokeNextCallback(); });\n }\n return invokeNextCallback();\n };\n /**\n * Registers an Invalid State handler\n *\n * Registers a [[OnInvalidCallback]] function to be invoked when [[StateService.transitionTo]]\n * has been called with an invalid state reference parameter\n *\n * Example:\n * ```js\n * stateService.onInvalid(function(to, from, injector) {\n * if (to.name() === 'foo') {\n * let lazyLoader = injector.get('LazyLoadService');\n * return lazyLoader.load('foo')\n * .then(() => stateService.target('foo'));\n * }\n * });\n * ```\n *\n * @param {function} callback invoked when the toState is invalid\n * This function receives the (invalid) toState, the fromState, and an injector.\n * The function may optionally return a [[TargetState]] or a Promise for a TargetState.\n * If one is returned, it is treated as a redirect.\n *\n * @returns a function which deregisters the callback\n */\n StateService.prototype.onInvalid = function (callback) {\n this.invalidCallbacks.push(callback);\n return function deregisterListener() {\n removeFrom(this.invalidCallbacks)(callback);\n }.bind(this);\n };\n /**\n * Reloads the current state\n *\n * A method that force reloads the current state, or a partial state hierarchy.\n * All resolves are re-resolved, and components reinstantiated.\n *\n * #### Example:\n * ```js\n * let app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * $state.reload();\n * }\n * });\n * ```\n *\n * Note: `reload()` is just an alias for:\n *\n * ```js\n * $state.transitionTo($state.current, $state.params, {\n * reload: true, inherit: false\n * });\n * ```\n *\n * @param reloadState A state name or a state object.\n * If present, this state and all its children will be reloaded, but ancestors will not reload.\n *\n * #### Example:\n * ```js\n * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item'\n * //and current state is 'contacts.detail.item'\n * let app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * //will reload 'contact.detail' and nested 'contact.detail.item' states\n * $state.reload('contact.detail');\n * }\n * });\n * ```\n *\n * @returns A promise representing the state of the new transition. See [[StateService.go]]\n */\n StateService.prototype.reload = function (reloadState) {\n return this.transitionTo(this.current, this.params, {\n reload: isDefined(reloadState) ? reloadState : true,\n inherit: false,\n notify: false,\n });\n };\n /**\n * Transition to a different state and/or parameters\n *\n * Convenience method for transitioning to a new state.\n *\n * `$state.go` calls `$state.transitionTo` internally but automatically sets options to\n * `{ location: true, inherit: true, relative: router.globals.$current, notify: true }`.\n * This allows you to use either an absolute or relative `to` argument (because of `relative: router.globals.$current`).\n * It also allows you to specify * only the parameters you'd like to update, while letting unspecified parameters\n * inherit from the current parameter values (because of `inherit: true`).\n *\n * #### Example:\n * ```js\n * let app = angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.changeState = function () {\n * $state.go('contact.detail');\n * };\n * });\n * ```\n *\n * @param to Absolute state name, state object, or relative state path (relative to current state).\n *\n * Some examples:\n *\n * - `$state.go('contact.detail')` - will go to the `contact.detail` state\n * - `$state.go('^')` - will go to the parent state\n * - `$state.go('^.sibling')` - if current state is `home.child`, will go to the `home.sibling` state\n * - `$state.go('.child.grandchild')` - if current state is home, will go to the `home.child.grandchild` state\n *\n * @param params A map of the parameters that will be sent to the state, will populate $stateParams.\n *\n * Any parameters that are not specified will be inherited from current parameter values (because of `inherit: true`).\n * This allows, for example, going to a sibling state that shares parameters defined by a parent state.\n *\n * @param options Transition options\n *\n * @returns {promise} A promise representing the state of the new transition.\n */\n StateService.prototype.go = function (to, params, options) {\n var defautGoOpts = { relative: this.$current, inherit: true };\n var transOpts = defaults(options, defautGoOpts, defaultTransOpts);\n return this.transitionTo(to, params, transOpts);\n };\n /**\n * Creates a [[TargetState]]\n *\n * This is a factory method for creating a TargetState\n *\n * This may be returned from a Transition Hook to redirect a transition, for example.\n */\n StateService.prototype.target = function (identifier, params, options) {\n if (options === void 0) { options = {}; }\n // If we're reloading, find the state object to reload from\n if (isObject(options.reload) && !options.reload.name)\n throw new Error('Invalid reload state object');\n var reg = this.router.stateRegistry;\n options.reloadState =\n options.reload === true ? reg.root() : reg.matcher.find(options.reload, options.relative);\n if (options.reload && !options.reloadState)\n throw new Error(\"No such reload state '\" + (isString(options.reload) ? options.reload : options.reload.name) + \"'\");\n return new TargetState(this.router.stateRegistry, identifier, params, options);\n };\n StateService.prototype.getCurrentPath = function () {\n var _this = this;\n var globals = this.router.globals;\n var latestSuccess = globals.successfulTransitions.peekTail();\n var rootPath = function () { return [new PathNode(_this.router.stateRegistry.root())]; };\n return latestSuccess ? latestSuccess.treeChanges().to : rootPath();\n };\n /**\n * Low-level method for transitioning to a new state.\n *\n * The [[go]] method (which uses `transitionTo` internally) is recommended in most situations.\n *\n * #### Example:\n * ```js\n * let app = angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.changeState = function () {\n * $state.transitionTo('contact.detail');\n * };\n * });\n * ```\n *\n * @param to State name or state object.\n * @param toParams A map of the parameters that will be sent to the state,\n * will populate $stateParams.\n * @param options Transition options\n *\n * @returns A promise representing the state of the new transition. See [[go]]\n */\n StateService.prototype.transitionTo = function (to, toParams, options) {\n var _this = this;\n if (toParams === void 0) { toParams = {}; }\n if (options === void 0) { options = {}; }\n var router = this.router;\n var globals = router.globals;\n options = defaults(options, defaultTransOpts);\n var getCurrent = function () { return globals.transition; };\n options = extend(options, { current: getCurrent });\n var ref = this.target(to, toParams, options);\n var currentPath = this.getCurrentPath();\n if (!ref.exists())\n return this._handleInvalidTargetState(currentPath, ref);\n if (!ref.valid())\n return silentRejection(ref.error());\n /**\n * Special handling for Ignored, Aborted, and Redirected transitions\n *\n * The semantics for the transition.run() promise and the StateService.transitionTo()\n * promise differ. For instance, the run() promise may be rejected because it was\n * IGNORED, but the transitionTo() promise is resolved because from the user perspective\n * no error occurred. Likewise, the transition.run() promise may be rejected because of\n * a Redirect, but the transitionTo() promise is chained to the new Transition's promise.\n */\n var rejectedTransitionHandler = function (trans) { return function (error) {\n if (error instanceof Rejection) {\n var isLatest = router.globals.lastStartedTransitionId <= trans.$id;\n if (error.type === RejectType.IGNORED) {\n isLatest && router.urlRouter.update();\n // Consider ignored `Transition.run()` as a successful `transitionTo`\n return services.$q.when(globals.current);\n }\n var detail = error.detail;\n if (error.type === RejectType.SUPERSEDED && error.redirected && detail instanceof TargetState) {\n // If `Transition.run()` was redirected, allow the `transitionTo()` promise to resolve successfully\n // by returning the promise for the new (redirect) `Transition.run()`.\n var redirect = trans.redirect(detail);\n return redirect.run().catch(rejectedTransitionHandler(redirect));\n }\n if (error.type === RejectType.ABORTED) {\n isLatest && router.urlRouter.update();\n return services.$q.reject(error);\n }\n }\n var errorHandler = _this.defaultErrorHandler();\n errorHandler(error);\n return services.$q.reject(error);\n }; };\n var transition = this.router.transitionService.create(currentPath, ref);\n var transitionToPromise = transition.run().catch(rejectedTransitionHandler(transition));\n silenceUncaughtInPromise(transitionToPromise); // issue #2676\n // Return a promise for the transition, which also has the transition object on it.\n return extend(transitionToPromise, { transition: transition });\n };\n /**\n * Checks if the current state *is* the provided state\n *\n * Similar to [[includes]] but only checks for the full state name.\n * If params is supplied then it will be tested for strict equality against the current\n * active params object, so all params must match with none missing and no extras.\n *\n * #### Example:\n * ```js\n * $state.$current.name = 'contacts.details.item';\n *\n * // absolute name\n * $state.is('contact.details.item'); // returns true\n * $state.is(contactDetailItemStateObject); // returns true\n * ```\n *\n * // relative name (. and ^), typically from a template\n * // E.g. from the 'contacts.details' template\n * ```html\n *
            Item
            \n * ```\n *\n * @param stateOrName The state name (absolute or relative) or state object you'd like to check.\n * @param params A param object, e.g. `{sectionId: section.id}`, that you'd like\n * to test against the current active state.\n * @param options An options object. The options are:\n * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will\n * test relative to `options.relative` state (or name).\n *\n * @returns Returns true if it is the state.\n */\n StateService.prototype.is = function (stateOrName, params, options) {\n options = defaults(options, { relative: this.$current });\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);\n if (!isDefined(state))\n return undefined;\n if (this.$current !== state)\n return false;\n if (!params)\n return true;\n var schema = state.parameters({ inherit: true, matchingKeys: params });\n return Param.equals(schema, Param.values(schema, params), this.params);\n };\n /**\n * Checks if the current state *includes* the provided state\n *\n * A method to determine if the current active state is equal to or is the child of the\n * state stateName. If any params are passed then they will be tested for a match as well.\n * Not all the parameters need to be passed, just the ones you'd like to test for equality.\n *\n * #### Example when `$state.$current.name === 'contacts.details.item'`\n * ```js\n * // Using partial names\n * $state.includes(\"contacts\"); // returns true\n * $state.includes(\"contacts.details\"); // returns true\n * $state.includes(\"contacts.details.item\"); // returns true\n * $state.includes(\"contacts.list\"); // returns false\n * $state.includes(\"about\"); // returns false\n * ```\n *\n * #### Glob Examples when `* $state.$current.name === 'contacts.details.item.url'`:\n * ```js\n * $state.includes(\"*.details.*.*\"); // returns true\n * $state.includes(\"*.details.**\"); // returns true\n * $state.includes(\"**.item.**\"); // returns true\n * $state.includes(\"*.details.item.url\"); // returns true\n * $state.includes(\"*.details.*.url\"); // returns true\n * $state.includes(\"*.details.*\"); // returns false\n * $state.includes(\"item.**\"); // returns false\n * ```\n *\n * @param stateOrName A partial name, relative name, glob pattern,\n * or state object to be searched for within the current state name.\n * @param params A param object, e.g. `{sectionId: section.id}`,\n * that you'd like to test against the current active state.\n * @param options An options object. The options are:\n * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will\n * test relative to `options.relative` state (or name).\n *\n * @returns {boolean} Returns true if it does include the state\n */\n StateService.prototype.includes = function (stateOrName, params, options) {\n options = defaults(options, { relative: this.$current });\n var glob = isString(stateOrName) && Glob.fromString(stateOrName);\n if (glob) {\n if (!glob.matches(this.$current.name))\n return false;\n stateOrName = this.$current.name;\n }\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative), include = this.$current.includes;\n if (!isDefined(state))\n return undefined;\n if (!isDefined(include[state.name]))\n return false;\n if (!params)\n return true;\n var schema = state.parameters({ inherit: true, matchingKeys: params });\n return Param.equals(schema, Param.values(schema, params), this.params);\n };\n /**\n * Generates a URL for a state and parameters\n *\n * Returns the url for the given state populated with the given params.\n *\n * #### Example:\n * ```js\n * expect($state.href(\"about.person\", { person: \"bob\" })).toEqual(\"/about/bob\");\n * ```\n *\n * @param stateOrName The state name or state object you'd like to generate a url from.\n * @param params An object of parameter values to fill the state's required parameters.\n * @param options Options object. The options are:\n *\n * @returns {string} compiled state url\n */\n StateService.prototype.href = function (stateOrName, params, options) {\n var defaultHrefOpts = {\n lossy: true,\n inherit: true,\n absolute: false,\n relative: this.$current,\n };\n options = defaults(options, defaultHrefOpts);\n params = params || {};\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);\n if (!isDefined(state))\n return null;\n if (options.inherit)\n params = this.params.$inherit(params, this.$current, state);\n var nav = state && options.lossy ? state.navigable : state;\n if (!nav || nav.url === undefined || nav.url === null) {\n return null;\n }\n return this.router.urlRouter.href(nav.url, params, { absolute: options.absolute });\n };\n /**\n * Sets or gets the default [[transitionTo]] error handler.\n *\n * The error handler is called when a [[Transition]] is rejected or when any error occurred during the Transition.\n * This includes errors caused by resolves and transition hooks.\n *\n * Note:\n * This handler does not receive certain Transition rejections.\n * Redirected and Ignored Transitions are not considered to be errors by [[StateService.transitionTo]].\n *\n * The built-in default error handler logs the error to the console.\n *\n * You can provide your own custom handler.\n *\n * #### Example:\n * ```js\n * stateService.defaultErrorHandler(function() {\n * // Do not log transitionTo errors\n * });\n * ```\n *\n * @param handler a global error handler function\n * @returns the current global error handler\n */\n StateService.prototype.defaultErrorHandler = function (handler) {\n return (this._defaultErrorHandler = handler || this._defaultErrorHandler);\n };\n StateService.prototype.get = function (stateOrName, base) {\n var reg = this.router.stateRegistry;\n if (arguments.length === 0)\n return reg.get();\n return reg.get(stateOrName, base || this.$current);\n };\n /**\n * Lazy loads a state\n *\n * Explicitly runs a state's [[StateDeclaration.lazyLoad]] function.\n *\n * @param stateOrName the state that should be lazy loaded\n * @param transition the optional Transition context to use (if the lazyLoad function requires an injector, etc)\n * Note: If no transition is provided, a noop transition is created using the from the current state to the current state.\n * This noop transition is not actually run.\n *\n * @returns a promise to lazy load\n */\n StateService.prototype.lazyLoad = function (stateOrName, transition) {\n var state = this.get(stateOrName);\n if (!state || !state.lazyLoad)\n throw new Error('Can not lazy load ' + stateOrName);\n var currentPath = this.getCurrentPath();\n var target = PathUtils.makeTargetState(this.router.stateRegistry, currentPath);\n transition = transition || this.router.transitionService.create(currentPath, target);\n return lazyLoadState(transition, state);\n };\n return StateService;\n}());\nexport { StateService };\n//# sourceMappingURL=stateService.js.map","/** @publicapi @module state */ /** */\nimport { isString } from '../common/predicates';\nimport { stringify } from '../common/strings';\nimport { extend } from '../common';\n/**\n * Encapsulate the target (destination) state/params/options of a [[Transition]].\n *\n * This class is frequently used to redirect a transition to a new destination.\n *\n * See:\n *\n * - [[HookResult]]\n * - [[TransitionHookFn]]\n * - [[TransitionService.onStart]]\n *\n * To create a `TargetState`, use [[StateService.target]].\n *\n * ---\n *\n * This class wraps:\n *\n * 1) an identifier for a state\n * 2) a set of parameters\n * 3) and transition options\n * 4) the registered state object (the [[StateDeclaration]])\n *\n * Many UI-Router APIs such as [[StateService.go]] take a [[StateOrName]] argument which can\n * either be a *state object* (a [[StateDeclaration]] or [[StateObject]]) or a *state name* (a string).\n * The `TargetState` class normalizes those options.\n *\n * A `TargetState` may be valid (the state being targeted exists in the registry)\n * or invalid (the state being targeted is not registered).\n */\nvar TargetState = /** @class */ (function () {\n /**\n * The TargetState constructor\n *\n * Note: Do not construct a `TargetState` manually.\n * To create a `TargetState`, use the [[StateService.target]] factory method.\n *\n * @param _stateRegistry The StateRegistry to use to look up the _definition\n * @param _identifier An identifier for a state.\n * Either a fully-qualified state name, or the object used to define the state.\n * @param _params Parameters for the target state\n * @param _options Transition options.\n *\n * @internalapi\n */\n function TargetState(_stateRegistry, _identifier, _params, _options) {\n this._stateRegistry = _stateRegistry;\n this._identifier = _identifier;\n this._identifier = _identifier;\n this._params = extend({}, _params || {});\n this._options = extend({}, _options || {});\n this._definition = _stateRegistry.matcher.find(_identifier, this._options.relative);\n }\n /** The name of the state this object targets */\n TargetState.prototype.name = function () {\n return (this._definition && this._definition.name) || this._identifier;\n };\n /** The identifier used when creating this TargetState */\n TargetState.prototype.identifier = function () {\n return this._identifier;\n };\n /** The target parameter values */\n TargetState.prototype.params = function () {\n return this._params;\n };\n /** The internal state object (if it was found) */\n TargetState.prototype.$state = function () {\n return this._definition;\n };\n /** The internal state declaration (if it was found) */\n TargetState.prototype.state = function () {\n return this._definition && this._definition.self;\n };\n /** The target options */\n TargetState.prototype.options = function () {\n return this._options;\n };\n /** True if the target state was found */\n TargetState.prototype.exists = function () {\n return !!(this._definition && this._definition.self);\n };\n /** True if the object is valid */\n TargetState.prototype.valid = function () {\n return !this.error();\n };\n /** If the object is invalid, returns the reason why */\n TargetState.prototype.error = function () {\n var base = this.options().relative;\n if (!this._definition && !!base) {\n var stateName = base.name ? base.name : base;\n return \"Could not resolve '\" + this.name() + \"' from state '\" + stateName + \"'\";\n }\n if (!this._definition)\n return \"No such state '\" + this.name() + \"'\";\n if (!this._definition.self)\n return \"State '\" + this.name() + \"' has an invalid definition\";\n };\n TargetState.prototype.toString = function () {\n return \"'\" + this.name() + \"'\" + stringify(this.params());\n };\n /**\n * Returns a copy of this TargetState which targets a different state.\n * The new TargetState has the same parameter values and transition options.\n *\n * @param state The new state that should be targeted\n */\n TargetState.prototype.withState = function (state) {\n return new TargetState(this._stateRegistry, state, this._params, this._options);\n };\n /**\n * Returns a copy of this TargetState, using the specified parameter values.\n *\n * @param params the new parameter values to use\n * @param replace When false (default) the new parameter values will be merged with the current values.\n * When true the parameter values will be used instead of the current values.\n */\n TargetState.prototype.withParams = function (params, replace) {\n if (replace === void 0) { replace = false; }\n var newParams = replace ? params : extend({}, this._params, params);\n return new TargetState(this._stateRegistry, this._identifier, newParams, this._options);\n };\n /**\n * Returns a copy of this TargetState, using the specified Transition Options.\n *\n * @param options the new options to use\n * @param replace When false (default) the new options will be merged with the current options.\n * When true the options will be used instead of the current options.\n */\n TargetState.prototype.withOptions = function (options, replace) {\n if (replace === void 0) { replace = false; }\n var newOpts = replace ? options : extend({}, this._options, options);\n return new TargetState(this._stateRegistry, this._identifier, this._params, newOpts);\n };\n /** Returns true if the object has a state property that might be a state or state name */\n TargetState.isDef = function (obj) { return obj && obj.state && (isString(obj.state) || isString(obj.state.name)); };\n return TargetState;\n}());\nexport { TargetState };\n//# sourceMappingURL=targetState.js.map","/** @publicapi @module transition */ /** */\nimport { extend, assertPredicate, unnestR, identity } from '../common/common';\nimport { isArray } from '../common/predicates';\nimport { TransitionHookPhase, TransitionHookScope, } from './interface';\nimport { TransitionHook } from './transitionHook';\n/**\n * This class returns applicable TransitionHooks for a specific Transition instance.\n *\n * Hooks ([[RegisteredHook]]) may be registered globally, e.g., $transitions.onEnter(...), or locally, e.g.\n * myTransition.onEnter(...). The HookBuilder finds matching RegisteredHooks (where the match criteria is\n * determined by the type of hook)\n *\n * The HookBuilder also converts RegisteredHooks objects to TransitionHook objects, which are used to run a Transition.\n *\n * The HookBuilder constructor is given the $transitions service and a Transition instance. Thus, a HookBuilder\n * instance may only be used for one specific Transition object. (side note: the _treeChanges accessor is private\n * in the Transition class, so we must also provide the Transition's _treeChanges)\n *\n */\nvar HookBuilder = /** @class */ (function () {\n function HookBuilder(transition) {\n this.transition = transition;\n }\n HookBuilder.prototype.buildHooksForPhase = function (phase) {\n var _this = this;\n var $transitions = this.transition.router.transitionService;\n return $transitions._pluginapi\n ._getEvents(phase)\n .map(function (type) { return _this.buildHooks(type); })\n .reduce(unnestR, [])\n .filter(identity);\n };\n /**\n * Returns an array of newly built TransitionHook objects.\n *\n * - Finds all RegisteredHooks registered for the given `hookType` which matched the transition's [[TreeChanges]].\n * - Finds [[PathNode]] (or `PathNode[]`) to use as the TransitionHook context(s)\n * - For each of the [[PathNode]]s, creates a TransitionHook\n *\n * @param hookType the type of the hook registration function, e.g., 'onEnter', 'onFinish'.\n */\n HookBuilder.prototype.buildHooks = function (hookType) {\n var transition = this.transition;\n var treeChanges = transition.treeChanges();\n // Find all the matching registered hooks for a given hook type\n var matchingHooks = this.getMatchingHooks(hookType, treeChanges, transition);\n if (!matchingHooks)\n return [];\n var baseHookOptions = {\n transition: transition,\n current: transition.options().current,\n };\n var makeTransitionHooks = function (hook) {\n // Fetch the Nodes that caused this hook to match.\n var matches = hook.matches(treeChanges, transition);\n // Select the PathNode[] that will be used as TransitionHook context objects\n var matchingNodes = matches[hookType.criteriaMatchPath.name];\n // Return an array of HookTuples\n return matchingNodes.map(function (node) {\n var _options = extend({\n bind: hook.bind,\n traceData: { hookType: hookType.name, context: node },\n }, baseHookOptions);\n var state = hookType.criteriaMatchPath.scope === TransitionHookScope.STATE ? node.state.self : null;\n var transitionHook = new TransitionHook(transition, state, hook, _options);\n return { hook: hook, node: node, transitionHook: transitionHook };\n });\n };\n return matchingHooks\n .map(makeTransitionHooks)\n .reduce(unnestR, [])\n .sort(tupleSort(hookType.reverseSort))\n .map(function (tuple) { return tuple.transitionHook; });\n };\n /**\n * Finds all RegisteredHooks from:\n * - The Transition object instance hook registry\n * - The TransitionService ($transitions) global hook registry\n *\n * which matched:\n * - the eventType\n * - the matchCriteria (to, from, exiting, retained, entering)\n *\n * @returns an array of matched [[RegisteredHook]]s\n */\n HookBuilder.prototype.getMatchingHooks = function (hookType, treeChanges, transition) {\n var isCreate = hookType.hookPhase === TransitionHookPhase.CREATE;\n // Instance and Global hook registries\n var $transitions = this.transition.router.transitionService;\n var registries = isCreate ? [$transitions] : [this.transition, $transitions];\n return registries\n .map(function (reg) { return reg.getHooks(hookType.name); }) // Get named hooks from registries\n .filter(assertPredicate(isArray, \"broken event named: \" + hookType.name)) // Sanity check\n .reduce(unnestR, []) // Un-nest RegisteredHook[][] to RegisteredHook[] array\n .filter(function (hook) { return hook.matches(treeChanges, transition); }); // Only those satisfying matchCriteria\n };\n return HookBuilder;\n}());\nexport { HookBuilder };\n/**\n * A factory for a sort function for HookTuples.\n *\n * The sort function first compares the PathNode depth (how deep in the state tree a node is), then compares\n * the EventHook priority.\n *\n * @param reverseDepthSort a boolean, when true, reverses the sort order for the node depth\n * @returns a tuple sort function\n */\nfunction tupleSort(reverseDepthSort) {\n if (reverseDepthSort === void 0) { reverseDepthSort = false; }\n return function nodeDepthThenPriority(l, r) {\n var factor = reverseDepthSort ? -1 : 1;\n var depthDelta = (l.node.state.path.length - r.node.state.path.length) * factor;\n return depthDelta !== 0 ? depthDelta : r.hook.priority - l.hook.priority;\n };\n}\n//# sourceMappingURL=hookBuilder.js.map","/** @publicapi @module transition */ /** */\nimport { isString, isFunction, Glob, extend, removeFrom, tail, values, identity, mapObj } from '../common';\nimport { // has or is using\nTransitionHookScope, } from './interface';\n/**\n * Determines if the given state matches the matchCriteria\n *\n * @hidden\n *\n * @param state a State Object to test against\n * @param criterion\n * - If a string, matchState uses the string as a glob-matcher against the state name\n * - If an array (of strings), matchState uses each string in the array as a glob-matchers against the state name\n * and returns a positive match if any of the globs match.\n * - If a function, matchState calls the function with the state and returns true if the function's result is truthy.\n * @returns {boolean}\n */\nexport function matchState(state, criterion, transition) {\n var toMatch = isString(criterion) ? [criterion] : criterion;\n function matchGlobs(_state) {\n var globStrings = toMatch;\n for (var i = 0; i < globStrings.length; i++) {\n var glob = new Glob(globStrings[i]);\n if ((glob && glob.matches(_state.name)) || (!glob && globStrings[i] === _state.name)) {\n return true;\n }\n }\n return false;\n }\n var matchFn = (isFunction(toMatch) ? toMatch : matchGlobs);\n return !!matchFn(state, transition);\n}\n/**\n * @internalapi\n * The registration data for a registered transition hook\n */\nvar RegisteredHook = /** @class */ (function () {\n function RegisteredHook(tranSvc, eventType, callback, matchCriteria, removeHookFromRegistry, options) {\n if (options === void 0) { options = {}; }\n this.tranSvc = tranSvc;\n this.eventType = eventType;\n this.callback = callback;\n this.matchCriteria = matchCriteria;\n this.removeHookFromRegistry = removeHookFromRegistry;\n this.invokeCount = 0;\n this._deregistered = false;\n this.priority = options.priority || 0;\n this.bind = options.bind || null;\n this.invokeLimit = options.invokeLimit;\n }\n /**\n * Gets the matching [[PathNode]]s\n *\n * Given an array of [[PathNode]]s, and a [[HookMatchCriterion]], returns an array containing\n * the [[PathNode]]s that the criteria matches, or `null` if there were no matching nodes.\n *\n * Returning `null` is significant to distinguish between the default\n * \"match-all criterion value\" of `true` compared to a `() => true` function,\n * when the nodes is an empty array.\n *\n * This is useful to allow a transition match criteria of `entering: true`\n * to still match a transition, even when `entering === []`. Contrast that\n * with `entering: (state) => true` which only matches when a state is actually\n * being entered.\n */\n RegisteredHook.prototype._matchingNodes = function (nodes, criterion, transition) {\n if (criterion === true)\n return nodes;\n var matching = nodes.filter(function (node) { return matchState(node.state, criterion, transition); });\n return matching.length ? matching : null;\n };\n /**\n * Gets the default match criteria (all `true`)\n *\n * Returns an object which has all the criteria match paths as keys and `true` as values, i.e.:\n *\n * ```js\n * {\n * to: true,\n * from: true,\n * entering: true,\n * exiting: true,\n * retained: true,\n * }\n */\n RegisteredHook.prototype._getDefaultMatchCriteria = function () {\n return mapObj(this.tranSvc._pluginapi._getPathTypes(), function () { return true; });\n };\n /**\n * Gets matching nodes as [[IMatchingNodes]]\n *\n * Create a IMatchingNodes object from the TransitionHookTypes that is roughly equivalent to:\n *\n * ```js\n * let matches: IMatchingNodes = {\n * to: _matchingNodes([tail(treeChanges.to)], mc.to),\n * from: _matchingNodes([tail(treeChanges.from)], mc.from),\n * exiting: _matchingNodes(treeChanges.exiting, mc.exiting),\n * retained: _matchingNodes(treeChanges.retained, mc.retained),\n * entering: _matchingNodes(treeChanges.entering, mc.entering),\n * };\n * ```\n */\n RegisteredHook.prototype._getMatchingNodes = function (treeChanges, transition) {\n var _this = this;\n var criteria = extend(this._getDefaultMatchCriteria(), this.matchCriteria);\n var paths = values(this.tranSvc._pluginapi._getPathTypes());\n return paths.reduce(function (mn, pathtype) {\n // STATE scope criteria matches against every node in the path.\n // TRANSITION scope criteria matches against only the last node in the path\n var isStateHook = pathtype.scope === TransitionHookScope.STATE;\n var path = treeChanges[pathtype.name] || [];\n var nodes = isStateHook ? path : [tail(path)];\n mn[pathtype.name] = _this._matchingNodes(nodes, criteria[pathtype.name], transition);\n return mn;\n }, {});\n };\n /**\n * Determines if this hook's [[matchCriteria]] match the given [[TreeChanges]]\n *\n * @returns an IMatchingNodes object, or null. If an IMatchingNodes object is returned, its values\n * are the matching [[PathNode]]s for each [[HookMatchCriterion]] (to, from, exiting, retained, entering)\n */\n RegisteredHook.prototype.matches = function (treeChanges, transition) {\n var matches = this._getMatchingNodes(treeChanges, transition);\n // Check if all the criteria matched the TreeChanges object\n var allMatched = values(matches).every(identity);\n return allMatched ? matches : null;\n };\n RegisteredHook.prototype.deregister = function () {\n this.removeHookFromRegistry(this);\n this._deregistered = true;\n };\n return RegisteredHook;\n}());\nexport { RegisteredHook };\n/** @hidden Return a registration function of the requested type. */\nexport function makeEvent(registry, transitionService, eventType) {\n // Create the object which holds the registered transition hooks.\n var _registeredHooks = (registry._registeredHooks = registry._registeredHooks || {});\n var hooks = (_registeredHooks[eventType.name] = []);\n var removeHookFn = removeFrom(hooks);\n // Create hook registration function on the IHookRegistry for the event\n registry[eventType.name] = hookRegistrationFn;\n function hookRegistrationFn(matchObject, callback, options) {\n if (options === void 0) { options = {}; }\n var registeredHook = new RegisteredHook(transitionService, eventType, callback, matchObject, removeHookFn, options);\n hooks.push(registeredHook);\n return registeredHook.deregister.bind(registeredHook);\n }\n return hookRegistrationFn;\n}\n//# sourceMappingURL=hookRegistry.js.map","/**\n * # Transition subsystem\n *\n * This module contains APIs related to a Transition.\n *\n * See:\n * - [[TransitionService]]\n * - [[Transition]]\n * - [[HookFn]], [[TransitionHookFn]], [[TransitionStateHookFn]], [[HookMatchCriteria]], [[HookResult]]\n *\n * @preferred @publicapi @module transition\n */ /** */\nexport * from './interface';\nexport * from './hookBuilder';\nexport * from './hookRegistry';\nexport * from './rejectFactory';\nexport * from './transition';\nexport * from './transitionHook';\nexport * from './transitionEventType';\nexport * from './transitionService';\n//# sourceMappingURL=index.js.map","var TransitionHookPhase;\n(function (TransitionHookPhase) {\n TransitionHookPhase[TransitionHookPhase[\"CREATE\"] = 0] = \"CREATE\";\n TransitionHookPhase[TransitionHookPhase[\"BEFORE\"] = 1] = \"BEFORE\";\n TransitionHookPhase[TransitionHookPhase[\"RUN\"] = 2] = \"RUN\";\n TransitionHookPhase[TransitionHookPhase[\"SUCCESS\"] = 3] = \"SUCCESS\";\n TransitionHookPhase[TransitionHookPhase[\"ERROR\"] = 4] = \"ERROR\";\n})(TransitionHookPhase || (TransitionHookPhase = {}));\nvar TransitionHookScope;\n(function (TransitionHookScope) {\n TransitionHookScope[TransitionHookScope[\"TRANSITION\"] = 0] = \"TRANSITION\";\n TransitionHookScope[TransitionHookScope[\"STATE\"] = 1] = \"STATE\";\n})(TransitionHookScope || (TransitionHookScope = {}));\nexport { TransitionHookPhase, TransitionHookScope };\n//# sourceMappingURL=interface.js.map","/** @publicapi @module transition */ /** */\n'use strict';\nimport { extend, silentRejection } from '../common/common';\nimport { stringify } from '../common/strings';\nimport { is } from '../common/hof';\nvar RejectType;\n(function (RejectType) {\n /**\n * A new transition superseded this one.\n *\n * While this transition was running, a new transition started.\n * This transition is cancelled because it was superseded by new transition.\n */\n RejectType[RejectType[\"SUPERSEDED\"] = 2] = \"SUPERSEDED\";\n /**\n * The transition was aborted\n *\n * The transition was aborted by a hook which returned `false`\n */\n RejectType[RejectType[\"ABORTED\"] = 3] = \"ABORTED\";\n /**\n * The transition was invalid\n *\n * The transition was never started because it was invalid\n */\n RejectType[RejectType[\"INVALID\"] = 4] = \"INVALID\";\n /**\n * The transition was ignored\n *\n * The transition was ignored because it would have no effect.\n *\n * Either:\n *\n * - The transition is targeting the current state and parameter values\n * - The transition is targeting the same state and parameter values as the currently running transition.\n */\n RejectType[RejectType[\"IGNORED\"] = 5] = \"IGNORED\";\n /**\n * The transition errored.\n *\n * This generally means a hook threw an error or returned a rejected promise\n */\n RejectType[RejectType[\"ERROR\"] = 6] = \"ERROR\";\n})(RejectType || (RejectType = {}));\nexport { RejectType };\n/** @hidden */\nvar id = 0;\nvar Rejection = /** @class */ (function () {\n function Rejection(type, message, detail) {\n /** @hidden */\n this.$id = id++;\n this.type = type;\n this.message = message;\n this.detail = detail;\n }\n /** Returns true if the obj is a rejected promise created from the `asPromise` factory */\n Rejection.isRejectionPromise = function (obj) {\n return obj && typeof obj.then === 'function' && is(Rejection)(obj._transitionRejection);\n };\n /** Returns a Rejection due to transition superseded */\n Rejection.superseded = function (detail, options) {\n var message = 'The transition has been superseded by a different transition';\n var rejection = new Rejection(RejectType.SUPERSEDED, message, detail);\n if (options && options.redirected) {\n rejection.redirected = true;\n }\n return rejection;\n };\n /** Returns a Rejection due to redirected transition */\n Rejection.redirected = function (detail) {\n return Rejection.superseded(detail, { redirected: true });\n };\n /** Returns a Rejection due to invalid transition */\n Rejection.invalid = function (detail) {\n var message = 'This transition is invalid';\n return new Rejection(RejectType.INVALID, message, detail);\n };\n /** Returns a Rejection due to ignored transition */\n Rejection.ignored = function (detail) {\n var message = 'The transition was ignored';\n return new Rejection(RejectType.IGNORED, message, detail);\n };\n /** Returns a Rejection due to aborted transition */\n Rejection.aborted = function (detail) {\n var message = 'The transition has been aborted';\n return new Rejection(RejectType.ABORTED, message, detail);\n };\n /** Returns a Rejection due to aborted transition */\n Rejection.errored = function (detail) {\n var message = 'The transition errored';\n return new Rejection(RejectType.ERROR, message, detail);\n };\n /**\n * Returns a Rejection\n *\n * Normalizes a value as a Rejection.\n * If the value is already a Rejection, returns it.\n * Otherwise, wraps and returns the value as a Rejection (Rejection type: ERROR).\n *\n * @returns `detail` if it is already a `Rejection`, else returns an ERROR Rejection.\n */\n Rejection.normalize = function (detail) {\n return is(Rejection)(detail) ? detail : Rejection.errored(detail);\n };\n Rejection.prototype.toString = function () {\n var detailString = function (d) { return (d && d.toString !== Object.prototype.toString ? d.toString() : stringify(d)); };\n var detail = detailString(this.detail);\n var _a = this, $id = _a.$id, type = _a.type, message = _a.message;\n return \"Transition Rejection($id: \" + $id + \" type: \" + type + \", message: \" + message + \", detail: \" + detail + \")\";\n };\n Rejection.prototype.toPromise = function () {\n return extend(silentRejection(this), { _transitionRejection: this });\n };\n return Rejection;\n}());\nexport { Rejection };\n//# sourceMappingURL=rejectFactory.js.map","/** @publicapi @module transition */ /** */\nimport { trace } from '../common/trace';\nimport { services } from '../common/coreservices';\nimport { stringify } from '../common/strings';\nimport { map, find, extend, mergeR, tail, omit, arrayTuples, unnestR, identity, anyTrueR } from '../common/common';\nimport { isObject, isUndefined } from '../common/predicates';\nimport { prop, propEq, val, not, is } from '../common/hof';\nimport { TransitionHookPhase, } from './interface'; // has or is using\nimport { TransitionHook } from './transitionHook';\nimport { matchState, makeEvent } from './hookRegistry';\nimport { HookBuilder } from './hookBuilder';\nimport { PathUtils } from '../path/pathUtils';\nimport { Param } from '../params/param';\nimport { Resolvable } from '../resolve/resolvable';\nimport { ResolveContext } from '../resolve/resolveContext';\nimport { Rejection } from './rejectFactory';\nimport { flattenR, uniqR } from '../common';\n/** @hidden */\nvar stateSelf = prop('self');\n/**\n * Represents a transition between two states.\n *\n * When navigating to a state, we are transitioning **from** the current state **to** the new state.\n *\n * This object contains all contextual information about the to/from states, parameters, resolves.\n * It has information about all states being entered and exited as a result of the transition.\n */\nvar Transition = /** @class */ (function () {\n /**\n * Creates a new Transition object.\n *\n * If the target state is not valid, an error is thrown.\n *\n * @internalapi\n *\n * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`\n * encapsulates the \"from state\".\n * @param targetState The target state and parameters being transitioned to (also, the transition options)\n * @param router The [[UIRouter]] instance\n */\n function Transition(fromPath, targetState, router) {\n var _this = this;\n /** @hidden */\n this._deferred = services.$q.defer();\n /**\n * This promise is resolved or rejected based on the outcome of the Transition.\n *\n * When the transition is successful, the promise is resolved\n * When the transition is unsuccessful, the promise is rejected with the [[Rejection]] or javascript error\n */\n this.promise = this._deferred.promise;\n /** @hidden Holds the hook registration functions such as those passed to Transition.onStart() */\n this._registeredHooks = {};\n /** @hidden */\n this._hookBuilder = new HookBuilder(this);\n /** Checks if this transition is currently active/running. */\n this.isActive = function () { return _this.router.globals.transition === _this; };\n this.router = router;\n this._targetState = targetState;\n if (!targetState.valid()) {\n throw new Error(targetState.error());\n }\n // current() is assumed to come from targetState.options, but provide a naive implementation otherwise.\n this._options = extend({ current: val(this) }, targetState.options());\n this.$id = router.transitionService._transitionCount++;\n var toPath = PathUtils.buildToPath(fromPath, targetState);\n this._treeChanges = PathUtils.treeChanges(fromPath, toPath, this._options.reloadState);\n this.createTransitionHookRegFns();\n var onCreateHooks = this._hookBuilder.buildHooksForPhase(TransitionHookPhase.CREATE);\n TransitionHook.invokeHooks(onCreateHooks, function () { return null; });\n this.applyViewConfigs(router);\n }\n /** @hidden */\n Transition.prototype.onBefore = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onStart = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onExit = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onRetain = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onEnter = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onFinish = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onSuccess = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onError = function (criteria, callback, options) {\n return;\n };\n /** @hidden\n * Creates the transition-level hook registration functions\n * (which can then be used to register hooks)\n */\n Transition.prototype.createTransitionHookRegFns = function () {\n var _this = this;\n this.router.transitionService._pluginapi\n ._getEvents()\n .filter(function (type) { return type.hookPhase !== TransitionHookPhase.CREATE; })\n .forEach(function (type) { return makeEvent(_this, _this.router.transitionService, type); });\n };\n /** @internalapi */\n Transition.prototype.getHooks = function (hookName) {\n return this._registeredHooks[hookName];\n };\n Transition.prototype.applyViewConfigs = function (router) {\n var enteringStates = this._treeChanges.entering.map(function (node) { return node.state; });\n PathUtils.applyViewConfigs(router.transitionService.$view, this._treeChanges.to, enteringStates);\n };\n /**\n * @internalapi\n *\n * @returns the internal from [State] object\n */\n Transition.prototype.$from = function () {\n return tail(this._treeChanges.from).state;\n };\n /**\n * @internalapi\n *\n * @returns the internal to [State] object\n */\n Transition.prototype.$to = function () {\n return tail(this._treeChanges.to).state;\n };\n /**\n * Returns the \"from state\"\n *\n * Returns the state that the transition is coming *from*.\n *\n * @returns The state declaration object for the Transition's (\"from state\").\n */\n Transition.prototype.from = function () {\n return this.$from().self;\n };\n /**\n * Returns the \"to state\"\n *\n * Returns the state that the transition is going *to*.\n *\n * @returns The state declaration object for the Transition's target state (\"to state\").\n */\n Transition.prototype.to = function () {\n return this.$to().self;\n };\n /**\n * Gets the Target State\n *\n * A transition's [[TargetState]] encapsulates the [[to]] state, the [[params]], and the [[options]] as a single object.\n *\n * @returns the [[TargetState]] of this Transition\n */\n Transition.prototype.targetState = function () {\n return this._targetState;\n };\n /**\n * Determines whether two transitions are equivalent.\n * @deprecated\n */\n Transition.prototype.is = function (compare) {\n if (compare instanceof Transition) {\n // TODO: Also compare parameters\n return this.is({ to: compare.$to().name, from: compare.$from().name });\n }\n return !((compare.to && !matchState(this.$to(), compare.to, this)) ||\n (compare.from && !matchState(this.$from(), compare.from, this)));\n };\n Transition.prototype.params = function (pathname) {\n if (pathname === void 0) { pathname = 'to'; }\n return Object.freeze(this._treeChanges[pathname].map(prop('paramValues')).reduce(mergeR, {}));\n };\n Transition.prototype.paramsChanged = function () {\n var fromParams = this.params('from');\n var toParams = this.params('to');\n // All the parameters declared on both the \"to\" and \"from\" paths\n var allParamDescriptors = []\n .concat(this._treeChanges.to)\n .concat(this._treeChanges.from)\n .map(function (pathNode) { return pathNode.paramSchema; })\n .reduce(flattenR, [])\n .reduce(uniqR, []);\n var changedParamDescriptors = Param.changed(allParamDescriptors, fromParams, toParams);\n return changedParamDescriptors.reduce(function (changedValues, descriptor) {\n changedValues[descriptor.id] = toParams[descriptor.id];\n return changedValues;\n }, {});\n };\n /**\n * Creates a [[UIInjector]] Dependency Injector\n *\n * Returns a Dependency Injector for the Transition's target state (to state).\n * The injector provides resolve values which the target state has access to.\n *\n * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2).\n *\n * #### Example:\n * ```js\n * .onEnter({ entering: 'myState' }, trans => {\n * var myResolveValue = trans.injector().get('myResolve');\n * // Inject a global service from the global/native injector (if it exists)\n * var MyService = trans.injector().get('MyService');\n * })\n * ```\n *\n * In some cases (such as `onBefore`), you may need access to some resolve data but it has not yet been fetched.\n * You can use [[UIInjector.getAsync]] to get a promise for the data.\n * #### Example:\n * ```js\n * .onBefore({}, trans => {\n * return trans.injector().getAsync('myResolve').then(myResolveValue =>\n * return myResolveValue !== 'ABORT';\n * });\n * });\n * ```\n *\n * If a `state` is provided, the injector that is returned will be limited to resolve values that the provided state has access to.\n * This can be useful if both a parent state `foo` and a child state `foo.bar` have both defined a resolve such as `data`.\n * #### Example:\n * ```js\n * .onEnter({ to: 'foo.bar' }, trans => {\n * // returns result of `foo` state's `myResolve` resolve\n * // even though `foo.bar` also has a `myResolve` resolve\n * var fooData = trans.injector('foo').get('myResolve');\n * });\n * ```\n *\n * If you need resolve data from the exiting states, pass `'from'` as `pathName`.\n * The resolve data from the `from` path will be returned.\n * #### Example:\n * ```js\n * .onExit({ exiting: 'foo.bar' }, trans => {\n * // Gets the resolve value of `myResolve` from the state being exited\n * var fooData = trans.injector(null, 'from').get('myResolve');\n * });\n * ```\n *\n *\n * @param state Limits the resolves provided to only the resolves the provided state has access to.\n * @param pathName Default: `'to'`: Chooses the path for which to create the injector. Use this to access resolves for `exiting` states.\n *\n * @returns a [[UIInjector]]\n */\n Transition.prototype.injector = function (state, pathName) {\n if (pathName === void 0) { pathName = 'to'; }\n var path = this._treeChanges[pathName];\n if (state)\n path = PathUtils.subPath(path, function (node) { return node.state === state || node.state.name === state; });\n return new ResolveContext(path).injector();\n };\n /**\n * Gets all available resolve tokens (keys)\n *\n * This method can be used in conjunction with [[injector]] to inspect the resolve values\n * available to the Transition.\n *\n * This returns all the tokens defined on [[StateDeclaration.resolve]] blocks, for the states\n * in the Transition's [[TreeChanges.to]] path.\n *\n * #### Example:\n * This example logs all resolve values\n * ```js\n * let tokens = trans.getResolveTokens();\n * tokens.forEach(token => console.log(token + \" = \" + trans.injector().get(token)));\n * ```\n *\n * #### Example:\n * This example creates promises for each resolve value.\n * This triggers fetches of resolves (if any have not yet been fetched).\n * When all promises have all settled, it logs the resolve values.\n * ```js\n * let tokens = trans.getResolveTokens();\n * let promise = tokens.map(token => trans.injector().getAsync(token));\n * Promise.all(promises).then(values => console.log(\"Resolved values: \" + values));\n * ```\n *\n * Note: Angular 1 users whould use `$q.all()`\n *\n * @param pathname resolve context's path name (e.g., `to` or `from`)\n *\n * @returns an array of resolve tokens (keys)\n */\n Transition.prototype.getResolveTokens = function (pathname) {\n if (pathname === void 0) { pathname = 'to'; }\n return new ResolveContext(this._treeChanges[pathname]).getTokens();\n };\n /**\n * Dynamically adds a new [[Resolvable]] (i.e., [[StateDeclaration.resolve]]) to this transition.\n *\n * Allows a transition hook to dynamically add a Resolvable to this Transition.\n *\n * Use the [[Transition.injector]] to retrieve the resolved data in subsequent hooks ([[UIInjector.get]]).\n *\n * If a `state` argument is provided, the Resolvable is processed when that state is being entered.\n * If no `state` is provided then the root state is used.\n * If the given `state` has already been entered, the Resolvable is processed when any child state is entered.\n * If no child states will be entered, the Resolvable is processed during the `onFinish` phase of the Transition.\n *\n * The `state` argument also scopes the resolved data.\n * The resolved data is available from the injector for that `state` and any children states.\n *\n * #### Example:\n * ```js\n * transitionService.onBefore({}, transition => {\n * transition.addResolvable({\n * token: 'myResolve',\n * deps: ['MyService'],\n * resolveFn: myService => myService.getData()\n * });\n * });\n * ```\n *\n * @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]])\n * @param state the state in the \"to path\" which should receive the new resolve (otherwise, the root state)\n */\n Transition.prototype.addResolvable = function (resolvable, state) {\n if (state === void 0) { state = ''; }\n resolvable = is(Resolvable)(resolvable) ? resolvable : new Resolvable(resolvable);\n var stateName = typeof state === 'string' ? state : state.name;\n var topath = this._treeChanges.to;\n var targetNode = find(topath, function (node) { return node.state.name === stateName; });\n var resolveContext = new ResolveContext(topath);\n resolveContext.addResolvables([resolvable], targetNode.state);\n };\n /**\n * Gets the transition from which this transition was redirected.\n *\n * If the current transition is a redirect, this method returns the transition that was redirected.\n *\n * #### Example:\n * ```js\n * let transitionA = $state.go('A').transition\n * transitionA.onStart({}, () => $state.target('B'));\n * $transitions.onSuccess({ to: 'B' }, (trans) => {\n * trans.to().name === 'B'; // true\n * trans.redirectedFrom() === transitionA; // true\n * });\n * ```\n *\n * @returns The previous Transition, or null if this Transition is not the result of a redirection\n */\n Transition.prototype.redirectedFrom = function () {\n return this._options.redirectedFrom || null;\n };\n /**\n * Gets the original transition in a redirect chain\n *\n * A transition might belong to a long chain of multiple redirects.\n * This method walks the [[redirectedFrom]] chain back to the original (first) transition in the chain.\n *\n * #### Example:\n * ```js\n * // states\n * registry.register({ name: 'A', redirectTo: 'B' });\n * registry.register({ name: 'B', redirectTo: 'C' });\n * registry.register({ name: 'C', redirectTo: 'D' });\n * registry.register({ name: 'D' });\n *\n * let transitionA = $state.go('A').transition\n *\n * $transitions.onSuccess({ to: 'D' }, (trans) => {\n * trans.to().name === 'D'; // true\n * trans.redirectedFrom().to().name === 'C'; // true\n * trans.originalTransition() === transitionA; // true\n * trans.originalTransition().to().name === 'A'; // true\n * });\n * ```\n *\n * @returns The original Transition that started a redirect chain\n */\n Transition.prototype.originalTransition = function () {\n var rf = this.redirectedFrom();\n return (rf && rf.originalTransition()) || this;\n };\n /**\n * Get the transition options\n *\n * @returns the options for this Transition.\n */\n Transition.prototype.options = function () {\n return this._options;\n };\n /**\n * Gets the states being entered.\n *\n * @returns an array of states that will be entered during this transition.\n */\n Transition.prototype.entering = function () {\n return map(this._treeChanges.entering, prop('state')).map(stateSelf);\n };\n /**\n * Gets the states being exited.\n *\n * @returns an array of states that will be exited during this transition.\n */\n Transition.prototype.exiting = function () {\n return map(this._treeChanges.exiting, prop('state'))\n .map(stateSelf)\n .reverse();\n };\n /**\n * Gets the states being retained.\n *\n * @returns an array of states that are already entered from a previous Transition, that will not be\n * exited during this Transition\n */\n Transition.prototype.retained = function () {\n return map(this._treeChanges.retained, prop('state')).map(stateSelf);\n };\n /**\n * Get the [[ViewConfig]]s associated with this Transition\n *\n * Each state can define one or more views (template/controller), which are encapsulated as `ViewConfig` objects.\n * This method fetches the `ViewConfigs` for a given path in the Transition (e.g., \"to\" or \"entering\").\n *\n * @param pathname the name of the path to fetch views for:\n * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)\n * @param state If provided, only returns the `ViewConfig`s for a single state in the path\n *\n * @returns a list of ViewConfig objects for the given path.\n */\n Transition.prototype.views = function (pathname, state) {\n if (pathname === void 0) { pathname = 'entering'; }\n var path = this._treeChanges[pathname];\n path = !state ? path : path.filter(propEq('state', state));\n return path\n .map(prop('views'))\n .filter(identity)\n .reduce(unnestR, []);\n };\n Transition.prototype.treeChanges = function (pathname) {\n return pathname ? this._treeChanges[pathname] : this._treeChanges;\n };\n /**\n * Creates a new transition that is a redirection of the current one.\n *\n * This transition can be returned from a [[TransitionService]] hook to\n * redirect a transition to a new state and/or set of parameters.\n *\n * @internalapi\n *\n * @returns Returns a new [[Transition]] instance.\n */\n Transition.prototype.redirect = function (targetState) {\n var redirects = 1, trans = this;\n // tslint:disable-next-line:no-conditional-assignment\n while ((trans = trans.redirectedFrom()) != null) {\n if (++redirects > 20)\n throw new Error(\"Too many consecutive Transition redirects (20+)\");\n }\n var redirectOpts = { redirectedFrom: this, source: 'redirect' };\n // If the original transition was caused by URL sync, then use { location: 'replace' }\n // on the new transition (unless the target state explicitly specifies location: false).\n // This causes the original url to be replaced with the url for the redirect target\n // so the original url disappears from the browser history.\n if (this.options().source === 'url' && targetState.options().location !== false) {\n redirectOpts.location = 'replace';\n }\n var newOptions = extend({}, this.options(), targetState.options(), redirectOpts);\n targetState = targetState.withOptions(newOptions, true);\n var newTransition = this.router.transitionService.create(this._treeChanges.from, targetState);\n var originalEnteringNodes = this._treeChanges.entering;\n var redirectEnteringNodes = newTransition._treeChanges.entering;\n // --- Re-use resolve data from original transition ---\n // When redirecting from a parent state to a child state where the parent parameter values haven't changed\n // (because of the redirect), the resolves fetched by the original transition are still valid in the\n // redirected transition.\n //\n // This allows you to define a redirect on a parent state which depends on an async resolve value.\n // You can wait for the resolve, then redirect to a child state based on the result.\n // The redirected transition does not have to re-fetch the resolve.\n // ---------------------------------------------------------\n var nodeIsReloading = function (reloadState) { return function (node) {\n return reloadState && node.state.includes[reloadState.name];\n }; };\n // Find any \"entering\" nodes in the redirect path that match the original path and aren't being reloaded\n var matchingEnteringNodes = PathUtils.matching(redirectEnteringNodes, originalEnteringNodes, PathUtils.nonDynamicParams).filter(not(nodeIsReloading(targetState.options().reloadState)));\n // Use the existing (possibly pre-resolved) resolvables for the matching entering nodes.\n matchingEnteringNodes.forEach(function (node, idx) {\n node.resolvables = originalEnteringNodes[idx].resolvables;\n });\n return newTransition;\n };\n /** @hidden If a transition doesn't exit/enter any states, returns any [[Param]] whose value changed */\n Transition.prototype._changedParams = function () {\n var tc = this._treeChanges;\n /** Return undefined if it's not a \"dynamic\" transition, for the following reasons */\n // If user explicitly wants a reload\n if (this._options.reload)\n return undefined;\n // If any states are exiting or entering\n if (tc.exiting.length || tc.entering.length)\n return undefined;\n // If to/from path lengths differ\n if (tc.to.length !== tc.from.length)\n return undefined;\n // If the to/from paths are different\n var pathsDiffer = arrayTuples(tc.to, tc.from)\n .map(function (tuple) { return tuple[0].state !== tuple[1].state; })\n .reduce(anyTrueR, false);\n if (pathsDiffer)\n return undefined;\n // Find any parameter values that differ\n var nodeSchemas = tc.to.map(function (node) { return node.paramSchema; });\n var _a = [tc.to, tc.from].map(function (path) { return path.map(function (x) { return x.paramValues; }); }), toValues = _a[0], fromValues = _a[1];\n var tuples = arrayTuples(nodeSchemas, toValues, fromValues);\n return tuples.map(function (_a) {\n var schema = _a[0], toVals = _a[1], fromVals = _a[2];\n return Param.changed(schema, toVals, fromVals);\n }).reduce(unnestR, []);\n };\n /**\n * Returns true if the transition is dynamic.\n *\n * A transition is dynamic if no states are entered nor exited, but at least one dynamic parameter has changed.\n *\n * @returns true if the Transition is dynamic\n */\n Transition.prototype.dynamic = function () {\n var changes = this._changedParams();\n return !changes ? false : changes.map(function (x) { return x.dynamic; }).reduce(anyTrueR, false);\n };\n /**\n * Returns true if the transition is ignored.\n *\n * A transition is ignored if no states are entered nor exited, and no parameter values have changed.\n *\n * @returns true if the Transition is ignored.\n */\n Transition.prototype.ignored = function () {\n return !!this._ignoredReason();\n };\n /** @hidden */\n Transition.prototype._ignoredReason = function () {\n var pending = this.router.globals.transition;\n var reloadState = this._options.reloadState;\n var same = function (pathA, pathB) {\n if (pathA.length !== pathB.length)\n return false;\n var matching = PathUtils.matching(pathA, pathB);\n return pathA.length === matching.filter(function (node) { return !reloadState || !node.state.includes[reloadState.name]; }).length;\n };\n var newTC = this.treeChanges();\n var pendTC = pending && pending.treeChanges();\n if (pendTC && same(pendTC.to, newTC.to) && same(pendTC.exiting, newTC.exiting))\n return 'SameAsPending';\n if (newTC.exiting.length === 0 && newTC.entering.length === 0 && same(newTC.from, newTC.to))\n return 'SameAsCurrent';\n };\n /**\n * Runs the transition\n *\n * This method is generally called from the [[StateService.transitionTo]]\n *\n * @internalapi\n *\n * @returns a promise for a successful transition.\n */\n Transition.prototype.run = function () {\n var _this = this;\n var runAllHooks = TransitionHook.runAllHooks;\n // Gets transition hooks array for the given phase\n var getHooksFor = function (phase) { return _this._hookBuilder.buildHooksForPhase(phase); };\n // When the chain is complete, then resolve or reject the deferred\n var transitionSuccess = function () {\n trace.traceSuccess(_this.$to(), _this);\n _this.success = true;\n _this._deferred.resolve(_this.to());\n runAllHooks(getHooksFor(TransitionHookPhase.SUCCESS));\n };\n var transitionError = function (reason) {\n trace.traceError(reason, _this);\n _this.success = false;\n _this._deferred.reject(reason);\n _this._error = reason;\n runAllHooks(getHooksFor(TransitionHookPhase.ERROR));\n };\n var runTransition = function () {\n // Wait to build the RUN hook chain until the BEFORE hooks are done\n // This allows a BEFORE hook to dynamically add additional RUN hooks via the Transition object.\n var allRunHooks = getHooksFor(TransitionHookPhase.RUN);\n var done = function () { return services.$q.when(undefined); };\n return TransitionHook.invokeHooks(allRunHooks, done);\n };\n var startTransition = function () {\n var globals = _this.router.globals;\n globals.lastStartedTransitionId = _this.$id;\n globals.transition = _this;\n globals.transitionHistory.enqueue(_this);\n trace.traceTransitionStart(_this);\n return services.$q.when(undefined);\n };\n var allBeforeHooks = getHooksFor(TransitionHookPhase.BEFORE);\n TransitionHook.invokeHooks(allBeforeHooks, startTransition)\n .then(runTransition)\n .then(transitionSuccess, transitionError);\n return this.promise;\n };\n /**\n * Checks if the Transition is valid\n *\n * @returns true if the Transition is valid\n */\n Transition.prototype.valid = function () {\n return !this.error() || this.success !== undefined;\n };\n /**\n * Aborts this transition\n *\n * Imperative API to abort a Transition.\n * This only applies to Transitions that are not yet complete.\n */\n Transition.prototype.abort = function () {\n // Do not set flag if the transition is already complete\n if (isUndefined(this.success)) {\n this._aborted = true;\n }\n };\n /**\n * The Transition error reason.\n *\n * If the transition is invalid (and could not be run), returns the reason the transition is invalid.\n * If the transition was valid and ran, but was not successful, returns the reason the transition failed.\n *\n * @returns a transition rejection explaining why the transition is invalid, or the reason the transition failed.\n */\n Transition.prototype.error = function () {\n var state = this.$to();\n if (state.self.abstract) {\n return Rejection.invalid(\"Cannot transition to abstract state '\" + state.name + \"'\");\n }\n var paramDefs = state.parameters();\n var values = this.params();\n var invalidParams = paramDefs.filter(function (param) { return !param.validates(values[param.id]); });\n if (invalidParams.length) {\n var invalidValues = invalidParams.map(function (param) { return \"[\" + param.id + \":\" + stringify(values[param.id]) + \"]\"; }).join(', ');\n var detail = \"The following parameter values are not valid for state '\" + state.name + \"': \" + invalidValues;\n return Rejection.invalid(detail);\n }\n if (this.success === false)\n return this._error;\n };\n /**\n * A string representation of the Transition\n *\n * @returns A string representation of the Transition\n */\n Transition.prototype.toString = function () {\n var fromStateOrName = this.from();\n var toStateOrName = this.to();\n var avoidEmptyHash = function (params) {\n return params['#'] !== null && params['#'] !== undefined ? params : omit(params, ['#']);\n };\n // (X) means the to state is invalid.\n var id = this.$id, from = isObject(fromStateOrName) ? fromStateOrName.name : fromStateOrName, fromParams = stringify(avoidEmptyHash(this._treeChanges.from.map(prop('paramValues')).reduce(mergeR, {}))), toValid = this.valid() ? '' : '(X) ', to = isObject(toStateOrName) ? toStateOrName.name : toStateOrName, toParams = stringify(avoidEmptyHash(this.params()));\n return \"Transition#\" + id + \"( '\" + from + \"'\" + fromParams + \" -> \" + toValid + \"'\" + to + \"'\" + toParams + \" )\";\n };\n /** @hidden */\n Transition.diToken = Transition;\n return Transition;\n}());\nexport { Transition };\n//# sourceMappingURL=transition.js.map","import { TransitionHook } from './transitionHook';\n/**\n * This class defines a type of hook, such as `onBefore` or `onEnter`.\n * Plugins can define custom hook types, such as sticky states does for `onInactive`.\n *\n * @interalapi\n */\nvar TransitionEventType = /** @class */ (function () {\n /* tslint:disable:no-inferrable-types */\n function TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {\n if (reverseSort === void 0) { reverseSort = false; }\n if (getResultHandler === void 0) { getResultHandler = TransitionHook.HANDLE_RESULT; }\n if (getErrorHandler === void 0) { getErrorHandler = TransitionHook.REJECT_ERROR; }\n if (synchronous === void 0) { synchronous = false; }\n this.name = name;\n this.hookPhase = hookPhase;\n this.hookOrder = hookOrder;\n this.criteriaMatchPath = criteriaMatchPath;\n this.reverseSort = reverseSort;\n this.getResultHandler = getResultHandler;\n this.getErrorHandler = getErrorHandler;\n this.synchronous = synchronous;\n }\n return TransitionEventType;\n}());\nexport { TransitionEventType };\n//# sourceMappingURL=transitionEventType.js.map","/** @publicapi @module transition */ /** */\nimport { TransitionHookPhase } from './interface';\nimport { defaults, noop, silentRejection } from '../common/common';\nimport { fnToString, maxLength } from '../common/strings';\nimport { isPromise } from '../common/predicates';\nimport { is, parse } from '../common/hof';\nimport { trace } from '../common/trace';\nimport { services } from '../common/coreservices';\nimport { Rejection } from './rejectFactory';\nimport { TargetState } from '../state/targetState';\nvar defaultOptions = {\n current: noop,\n transition: null,\n traceData: {},\n bind: null,\n};\n/** @hidden */\nvar TransitionHook = /** @class */ (function () {\n function TransitionHook(transition, stateContext, registeredHook, options) {\n var _this = this;\n this.transition = transition;\n this.stateContext = stateContext;\n this.registeredHook = registeredHook;\n this.options = options;\n this.isSuperseded = function () { return _this.type.hookPhase === TransitionHookPhase.RUN && !_this.options.transition.isActive(); };\n this.options = defaults(options, defaultOptions);\n this.type = registeredHook.eventType;\n }\n /**\n * Chains together an array of TransitionHooks.\n *\n * Given a list of [[TransitionHook]] objects, chains them together.\n * Each hook is invoked after the previous one completes.\n *\n * #### Example:\n * ```js\n * var hooks: TransitionHook[] = getHooks();\n * let promise: Promise = TransitionHook.chain(hooks);\n *\n * promise.then(handleSuccess, handleError);\n * ```\n *\n * @param hooks the list of hooks to chain together\n * @param waitFor if provided, the chain is `.then()`'ed off this promise\n * @returns a `Promise` for sequentially invoking the hooks (in order)\n */\n TransitionHook.chain = function (hooks, waitFor) {\n // Chain the next hook off the previous\n var createHookChainR = function (prev, nextHook) { return prev.then(function () { return nextHook.invokeHook(); }); };\n return hooks.reduce(createHookChainR, waitFor || services.$q.when());\n };\n /**\n * Invokes all the provided TransitionHooks, in order.\n * Each hook's return value is checked.\n * If any hook returns a promise, then the rest of the hooks are chained off that promise, and the promise is returned.\n * If no hook returns a promise, then all hooks are processed synchronously.\n *\n * @param hooks the list of TransitionHooks to invoke\n * @param doneCallback a callback that is invoked after all the hooks have successfully completed\n *\n * @returns a promise for the async result, or the result of the callback\n */\n TransitionHook.invokeHooks = function (hooks, doneCallback) {\n for (var idx = 0; idx < hooks.length; idx++) {\n var hookResult = hooks[idx].invokeHook();\n if (isPromise(hookResult)) {\n var remainingHooks = hooks.slice(idx + 1);\n return TransitionHook.chain(remainingHooks, hookResult).then(doneCallback);\n }\n }\n return doneCallback();\n };\n /**\n * Run all TransitionHooks, ignoring their return value.\n */\n TransitionHook.runAllHooks = function (hooks) {\n hooks.forEach(function (hook) { return hook.invokeHook(); });\n };\n TransitionHook.prototype.logError = function (err) {\n this.transition.router.stateService.defaultErrorHandler()(err);\n };\n TransitionHook.prototype.invokeHook = function () {\n var _this = this;\n var hook = this.registeredHook;\n if (hook._deregistered)\n return;\n var notCurrent = this.getNotCurrentRejection();\n if (notCurrent)\n return notCurrent;\n var options = this.options;\n trace.traceHookInvocation(this, this.transition, options);\n var invokeCallback = function () { return hook.callback.call(options.bind, _this.transition, _this.stateContext); };\n var normalizeErr = function (err) { return Rejection.normalize(err).toPromise(); };\n var handleError = function (err) { return hook.eventType.getErrorHandler(_this)(err); };\n var handleResult = function (result) { return hook.eventType.getResultHandler(_this)(result); };\n try {\n var result = invokeCallback();\n if (!this.type.synchronous && isPromise(result)) {\n return result.catch(normalizeErr).then(handleResult, handleError);\n }\n else {\n return handleResult(result);\n }\n }\n catch (err) {\n // If callback throws (synchronously)\n return handleError(Rejection.normalize(err));\n }\n finally {\n if (hook.invokeLimit && ++hook.invokeCount >= hook.invokeLimit) {\n hook.deregister();\n }\n }\n };\n /**\n * This method handles the return value of a Transition Hook.\n *\n * A hook can return false (cancel), a TargetState (redirect),\n * or a promise (which may later resolve to false or a redirect)\n *\n * This also handles \"transition superseded\" -- when a new transition\n * was started while the hook was still running\n */\n TransitionHook.prototype.handleHookResult = function (result) {\n var _this = this;\n var notCurrent = this.getNotCurrentRejection();\n if (notCurrent)\n return notCurrent;\n // Hook returned a promise\n if (isPromise(result)) {\n // Wait for the promise, then reprocess with the resulting value\n return result.then(function (val) { return _this.handleHookResult(val); });\n }\n trace.traceHookResult(result, this.transition, this.options);\n // Hook returned false\n if (result === false) {\n // Abort this Transition\n return Rejection.aborted('Hook aborted transition').toPromise();\n }\n var isTargetState = is(TargetState);\n // hook returned a TargetState\n if (isTargetState(result)) {\n // Halt the current Transition and redirect (a new Transition) to the TargetState.\n return Rejection.redirected(result).toPromise();\n }\n };\n /**\n * Return a Rejection promise if the transition is no longer current due\n * to a stopped router (disposed), or a new transition has started and superseded this one.\n */\n TransitionHook.prototype.getNotCurrentRejection = function () {\n var router = this.transition.router;\n // The router is stopped\n if (router._disposed) {\n return Rejection.aborted(\"UIRouter instance #\" + router.$id + \" has been stopped (disposed)\").toPromise();\n }\n if (this.transition._aborted) {\n return Rejection.aborted().toPromise();\n }\n // This transition is no longer current.\n // Another transition started while this hook was still running.\n if (this.isSuperseded()) {\n // Abort this transition\n return Rejection.superseded(this.options.current()).toPromise();\n }\n };\n TransitionHook.prototype.toString = function () {\n var _a = this, options = _a.options, registeredHook = _a.registeredHook;\n var event = parse('traceData.hookType')(options) || 'internal', context = parse('traceData.context.state.name')(options) || parse('traceData.context')(options) || 'unknown', name = fnToString(registeredHook.callback);\n return event + \" context: \" + context + \", \" + maxLength(200, name);\n };\n /**\n * These GetResultHandler(s) are used by [[invokeHook]] below\n * Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])\n */\n TransitionHook.HANDLE_RESULT = function (hook) { return function (result) {\n return hook.handleHookResult(result);\n }; };\n /**\n * If the result is a promise rejection, log it.\n * Otherwise, ignore the result.\n */\n TransitionHook.LOG_REJECTED_RESULT = function (hook) { return function (result) {\n isPromise(result) && result.catch(function (err) { return hook.logError(Rejection.normalize(err)); });\n return undefined;\n }; };\n /**\n * These GetErrorHandler(s) are used by [[invokeHook]] below\n * Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])\n */\n TransitionHook.LOG_ERROR = function (hook) { return function (error) { return hook.logError(error); }; };\n TransitionHook.REJECT_ERROR = function (hook) { return function (error) { return silentRejection(error); }; };\n TransitionHook.THROW_ERROR = function (hook) { return function (error) {\n throw error;\n }; };\n return TransitionHook;\n}());\nexport { TransitionHook };\n//# sourceMappingURL=transitionHook.js.map","/** @publicapi @module transition */ /** */\nimport { TransitionHookScope, TransitionHookPhase, } from './interface';\nimport { Transition } from './transition';\nimport { makeEvent } from './hookRegistry';\nimport { registerAddCoreResolvables, treeChangesCleanup } from '../hooks/coreResolvables';\nimport { registerRedirectToHook } from '../hooks/redirectTo';\nimport { registerOnExitHook, registerOnRetainHook, registerOnEnterHook } from '../hooks/onEnterExitRetain';\nimport { registerEagerResolvePath, registerLazyResolveState, registerResolveRemaining } from '../hooks/resolve';\nimport { registerLoadEnteringViews, registerActivateViews } from '../hooks/views';\nimport { registerUpdateGlobalState } from '../hooks/updateGlobals';\nimport { registerUpdateUrl } from '../hooks/url';\nimport { registerLazyLoadHook } from '../hooks/lazyLoad';\nimport { TransitionEventType } from './transitionEventType';\nimport { TransitionHook } from './transitionHook';\nimport { isDefined } from '../common/predicates';\nimport { removeFrom, values, createProxyFunctions } from '../common/common';\nimport { val } from '../common/hof';\nimport { registerIgnoredTransitionHook } from '../hooks/ignoredTransition';\nimport { registerInvalidTransitionHook } from '../hooks/invalidTransition';\n/**\n * The default [[Transition]] options.\n *\n * Include this object when applying custom defaults:\n * let reloadOpts = { reload: true, notify: true }\n * let options = defaults(theirOpts, customDefaults, defaultOptions);\n */\nexport var defaultTransOpts = {\n location: true,\n relative: null,\n inherit: false,\n notify: true,\n reload: false,\n custom: {},\n current: function () { return null; },\n source: 'unknown',\n};\n/**\n * This class provides services related to Transitions.\n *\n * - Most importantly, it allows global Transition Hooks to be registered.\n * - It allows the default transition error handler to be set.\n * - It also has a factory function for creating new [[Transition]] objects, (used internally by the [[StateService]]).\n *\n * At bootstrap, [[UIRouter]] creates a single instance (singleton) of this class.\n */\nvar TransitionService = /** @class */ (function () {\n /** @hidden */\n function TransitionService(_router) {\n /** @hidden */\n this._transitionCount = 0;\n /** @hidden The transition hook types, such as `onEnter`, `onStart`, etc */\n this._eventTypes = [];\n /** @hidden The registered transition hooks */\n this._registeredHooks = {};\n /** @hidden The paths on a criteria object */\n this._criteriaPaths = {};\n this._router = _router;\n this.$view = _router.viewService;\n this._deregisterHookFns = {};\n this._pluginapi = (createProxyFunctions(val(this), {}, val(this), [\n '_definePathType',\n '_defineEvent',\n '_getPathTypes',\n '_getEvents',\n 'getHooks',\n ]));\n this._defineCorePaths();\n this._defineCoreEvents();\n this._registerCoreTransitionHooks();\n _router.globals.successfulTransitions.onEvict(treeChangesCleanup);\n }\n /**\n * Registers a [[TransitionHookFn]], called *while a transition is being constructed*.\n *\n * Registers a transition lifecycle hook, which is invoked during transition construction.\n *\n * This low level hook should only be used by plugins.\n * This can be a useful time for plugins to add resolves or mutate the transition as needed.\n * The Sticky States plugin uses this hook to modify the treechanges.\n *\n * ### Lifecycle\n *\n * `onCreate` hooks are invoked *while a transition is being constructed*.\n *\n * ### Return value\n *\n * The hook's return value is ignored\n *\n * @internalapi\n * @param criteria defines which Transitions the Hook should be invoked for.\n * @param callback the hook function which will be invoked.\n * @param options the registration options\n * @returns a function which deregisters the hook.\n */\n TransitionService.prototype.onCreate = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onBefore = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onStart = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onExit = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onRetain = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onEnter = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onFinish = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onSuccess = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onError = function (criteria, callback, options) {\n return;\n };\n /**\n * dispose\n * @internalapi\n */\n TransitionService.prototype.dispose = function (router) {\n values(this._registeredHooks).forEach(function (hooksArray) {\n return hooksArray.forEach(function (hook) {\n hook._deregistered = true;\n removeFrom(hooksArray, hook);\n });\n });\n };\n /**\n * Creates a new [[Transition]] object\n *\n * This is a factory function for creating new Transition objects.\n * It is used internally by the [[StateService]] and should generally not be called by application code.\n *\n * @param fromPath the path to the current state (the from state)\n * @param targetState the target state (destination)\n * @returns a Transition\n */\n TransitionService.prototype.create = function (fromPath, targetState) {\n return new Transition(fromPath, targetState, this._router);\n };\n /** @hidden */\n TransitionService.prototype._defineCoreEvents = function () {\n var Phase = TransitionHookPhase;\n var TH = TransitionHook;\n var paths = this._criteriaPaths;\n var NORMAL_SORT = false, REVERSE_SORT = true;\n var SYNCHRONOUS = true;\n this._defineEvent('onCreate', Phase.CREATE, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.THROW_ERROR, SYNCHRONOUS);\n this._defineEvent('onBefore', Phase.BEFORE, 0, paths.to);\n this._defineEvent('onStart', Phase.RUN, 0, paths.to);\n this._defineEvent('onExit', Phase.RUN, 100, paths.exiting, REVERSE_SORT);\n this._defineEvent('onRetain', Phase.RUN, 200, paths.retained);\n this._defineEvent('onEnter', Phase.RUN, 300, paths.entering);\n this._defineEvent('onFinish', Phase.RUN, 400, paths.to);\n this._defineEvent('onSuccess', Phase.SUCCESS, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS);\n this._defineEvent('onError', Phase.ERROR, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS);\n };\n /** @hidden */\n TransitionService.prototype._defineCorePaths = function () {\n var STATE = TransitionHookScope.STATE, TRANSITION = TransitionHookScope.TRANSITION;\n this._definePathType('to', TRANSITION);\n this._definePathType('from', TRANSITION);\n this._definePathType('exiting', STATE);\n this._definePathType('retained', STATE);\n this._definePathType('entering', STATE);\n };\n /** @hidden */\n TransitionService.prototype._defineEvent = function (name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {\n if (reverseSort === void 0) { reverseSort = false; }\n if (getResultHandler === void 0) { getResultHandler = TransitionHook.HANDLE_RESULT; }\n if (getErrorHandler === void 0) { getErrorHandler = TransitionHook.REJECT_ERROR; }\n if (synchronous === void 0) { synchronous = false; }\n var eventType = new TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous);\n this._eventTypes.push(eventType);\n makeEvent(this, this, eventType);\n };\n /** @hidden */\n // tslint:disable-next-line\n TransitionService.prototype._getEvents = function (phase) {\n var transitionHookTypes = isDefined(phase)\n ? this._eventTypes.filter(function (type) { return type.hookPhase === phase; })\n : this._eventTypes.slice();\n return transitionHookTypes.sort(function (l, r) {\n var cmpByPhase = l.hookPhase - r.hookPhase;\n return cmpByPhase === 0 ? l.hookOrder - r.hookOrder : cmpByPhase;\n });\n };\n /**\n * Adds a Path to be used as a criterion against a TreeChanges path\n *\n * For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path.\n * It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)`\n * Each state in the exiting path is checked against the criteria and returned as part of the match.\n *\n * Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path.\n * It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)`\n * Only the tail of the `to` path is checked against the criteria and returned as part of the match.\n *\n * @hidden\n */\n TransitionService.prototype._definePathType = function (name, hookScope) {\n this._criteriaPaths[name] = { name: name, scope: hookScope };\n };\n /** * @hidden */\n // tslint:disable-next-line\n TransitionService.prototype._getPathTypes = function () {\n return this._criteriaPaths;\n };\n /** @hidden */\n TransitionService.prototype.getHooks = function (hookName) {\n return this._registeredHooks[hookName];\n };\n /** @hidden */\n TransitionService.prototype._registerCoreTransitionHooks = function () {\n var fns = this._deregisterHookFns;\n fns.addCoreResolves = registerAddCoreResolvables(this);\n fns.ignored = registerIgnoredTransitionHook(this);\n fns.invalid = registerInvalidTransitionHook(this);\n // Wire up redirectTo hook\n fns.redirectTo = registerRedirectToHook(this);\n // Wire up onExit/Retain/Enter state hooks\n fns.onExit = registerOnExitHook(this);\n fns.onRetain = registerOnRetainHook(this);\n fns.onEnter = registerOnEnterHook(this);\n // Wire up Resolve hooks\n fns.eagerResolve = registerEagerResolvePath(this);\n fns.lazyResolve = registerLazyResolveState(this);\n fns.resolveAll = registerResolveRemaining(this);\n // Wire up the View management hooks\n fns.loadViews = registerLoadEnteringViews(this);\n fns.activateViews = registerActivateViews(this);\n // Updates global state after a transition\n fns.updateGlobals = registerUpdateGlobalState(this);\n // After globals.current is updated at priority: 10000\n fns.updateUrl = registerUpdateUrl(this);\n // Lazy load state trees\n fns.lazyLoad = registerLazyLoadHook(this);\n };\n return TransitionService;\n}());\nexport { TransitionService };\n//# sourceMappingURL=transitionService.js.map","export * from './urlMatcher';\nexport * from './urlMatcherFactory';\nexport * from './urlRouter';\nexport * from './urlRule';\nexport * from './urlService';\nexport { UrlRules } from './urlRules';\nexport { UrlConfig } from './urlConfig';\n//# sourceMappingURL=index.js.map","import { ParamTypes } from '../params';\nimport { isDefined, isString } from '../common';\n/**\n * An API to customize the URL behavior and retrieve URL configuration\n *\n * This API is used to customize the behavior of the URL.\n * This includes optional trailing slashes ([[strictMode]]), case sensitivity ([[caseInsensitive]]),\n * and custom parameter encoding (custom [[type]]).\n *\n * It also has information about the location (url) configuration such as [[port]] and [[baseHref]].\n * This information can be used to build absolute URLs, such as\n * `https://example.com:443/basepath/state/substate?param1=a#hashvalue`;\n *\n * This API is a property of [[UrlService]] as [[UrlService.config]].\n */\nvar UrlConfig = /** @class */ (function () {\n /** @hidden */ function UrlConfig(/** @hidden */ router) {\n var _this = this;\n this.router = router;\n /** @hidden */ this.paramTypes = new ParamTypes();\n /** @hidden */ this._isCaseInsensitive = false;\n /** @hidden */ this._isStrictMode = true;\n /** @hidden */ this._defaultSquashPolicy = false;\n /** @internalapi */ this.dispose = function () { return _this.paramTypes.dispose(); };\n // Delegate these calls to the current LocationConfig implementation\n /**\n * Gets the base Href, e.g., `http://localhost/approot/`\n *\n * @return the application's base href\n */\n this.baseHref = function () { return _this.router.locationConfig.baseHref(); };\n /**\n * Gets or sets the hashPrefix\n *\n * This only applies when not running in [[html5Mode]] (pushstate mode)\n *\n * If the current url is `http://localhost/app#!/uirouter/path/#anchor`, it returns `!` which is the prefix for the \"hashbang\" portion.\n *\n * @return the hash prefix\n */\n this.hashPrefix = function (newprefix) { return _this.router.locationConfig.hashPrefix(newprefix); };\n /**\n * Gets the host, e.g., `localhost`\n *\n * @return the protocol\n */\n this.host = function () { return _this.router.locationConfig.host(); };\n /**\n * Returns true when running in pushstate mode\n *\n * @return true when running in html5 mode (pushstate mode).\n */\n this.html5Mode = function () { return _this.router.locationConfig.html5Mode(); };\n /**\n * Gets the port, e.g., `80`\n *\n * @return the port number\n */\n this.port = function () { return _this.router.locationConfig.port(); };\n /**\n * Gets the protocol, e.g., `http`\n *\n * @return the protocol\n */\n this.protocol = function () { return _this.router.locationConfig.protocol(); };\n }\n /**\n * Defines whether URL matching should be case sensitive (the default behavior), or not.\n *\n * #### Example:\n * ```js\n * // Allow case insensitive url matches\n * urlService.config.caseInsensitive(true);\n * ```\n *\n * @param value `false` to match URL in a case sensitive manner; otherwise `true`;\n * @returns the current value of caseInsensitive\n */\n UrlConfig.prototype.caseInsensitive = function (value) {\n return (this._isCaseInsensitive = isDefined(value) ? value : this._isCaseInsensitive);\n };\n /**\n * Sets the default behavior when generating or matching URLs with default parameter values.\n *\n * #### Example:\n * ```js\n * // Remove default parameter values from the url\n * urlService.config.defaultSquashPolicy(true);\n * ```\n *\n * @param value A string that defines the default parameter URL squashing behavior.\n * - `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL\n * - `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the\n * parameter is surrounded by slashes, squash (remove) one slash from the URL\n * - any other string, e.g. \"~\": When generating an href with a default parameter value, squash (remove)\n * the parameter value from the URL and replace it with this string.\n * @returns the current value of defaultSquashPolicy\n */\n UrlConfig.prototype.defaultSquashPolicy = function (value) {\n if (isDefined(value) && value !== true && value !== false && !isString(value))\n throw new Error(\"Invalid squash policy: \" + value + \". Valid policies: false, true, arbitrary-string\");\n return (this._defaultSquashPolicy = isDefined(value) ? value : this._defaultSquashPolicy);\n };\n /**\n * Defines whether URLs should match trailing slashes, or not (the default behavior).\n *\n * #### Example:\n * ```js\n * // Allow optional trailing slashes\n * urlService.config.strictMode(false);\n * ```\n *\n * @param value `false` to match trailing slashes in URLs, otherwise `true`.\n * @returns the current value of strictMode\n */\n UrlConfig.prototype.strictMode = function (value) {\n return (this._isStrictMode = isDefined(value) ? value : this._isStrictMode);\n };\n /**\n * Creates and registers a custom [[ParamType]] object\n *\n * A custom parameter type can be used to generate URLs with typed parameters or custom encoding/decoding.\n *\n * #### Note: Register custom types *before using them* in a state definition.\n *\n * #### Example:\n * ```js\n * // Encode object parameter as JSON string\n * urlService.config.type('myjson', {\n * encode: (obj) => JSON.stringify(obj),\n * decode: (str) => JSON.parse(str),\n * is: (val) => typeof(val) === 'object',\n * pattern: /[^/]+/,\n * equals: (a, b) => _.isEqual(a, b),\n * });\n * ```\n *\n * See [[ParamTypeDefinition]] for more examples\n *\n * @param name The type name.\n * @param definition The type definition. See [[ParamTypeDefinition]] for information on the values accepted.\n * @param definitionFn A function that is injected before the app runtime starts.\n * The result of this function should be a [[ParamTypeDefinition]].\n * The result is merged into the existing `definition`.\n * See [[ParamType]] for information on the values accepted.\n *\n * @returns if only the `name` parameter was specified: the currently registered [[ParamType]] object, or undefined\n */\n UrlConfig.prototype.type = function (name, definition, definitionFn) {\n var type = this.paramTypes.type(name, definition, definitionFn);\n return !isDefined(definition) ? type : this;\n };\n return UrlConfig;\n}());\nexport { UrlConfig };\n//# sourceMappingURL=urlConfig.js.map","/** @publicapi @module url */ /** */\nimport { map, inherit, identity, unnest, tail, find, allTrueR, unnestR, arrayTuples } from '../common/common';\nimport { prop, propEq } from '../common/hof';\nimport { isArray, isString, isDefined } from '../common/predicates';\nimport { Param, DefType } from '../params/param';\nimport { joinNeighborsR, splitOnDelim } from '../common/strings';\nimport { defaults } from '../common';\n/** @hidden */\nfunction quoteRegExp(str, param) {\n var surroundPattern = ['', ''], result = str.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, '\\\\$&');\n if (!param)\n return result;\n switch (param.squash) {\n case false:\n surroundPattern = ['(', ')' + (param.isOptional ? '?' : '')];\n break;\n case true:\n result = result.replace(/\\/$/, '');\n surroundPattern = ['(?:/(', ')|/)?'];\n break;\n default:\n surroundPattern = [\"(\" + param.squash + \"|\", ')?'];\n break;\n }\n return result + surroundPattern[0] + param.type.pattern.source + surroundPattern[1];\n}\n/** @hidden */\nvar memoizeTo = function (obj, _prop, fn) { return (obj[_prop] = obj[_prop] || fn()); };\n/** @hidden */\nvar splitOnSlash = splitOnDelim('/');\n/** @hidden */\nvar defaultConfig = {\n state: { params: {} },\n strict: true,\n caseInsensitive: true,\n};\n/**\n * Matches URLs against patterns.\n *\n * Matches URLs against patterns and extracts named parameters from the path or the search\n * part of the URL.\n *\n * A URL pattern consists of a path pattern, optionally followed by '?' and a list of search (query)\n * parameters. Multiple search parameter names are separated by '&'. Search parameters\n * do not influence whether or not a URL is matched, but their values are passed through into\n * the matched parameters returned by [[UrlMatcher.exec]].\n *\n * - *Path parameters* are defined using curly brace placeholders (`/somepath/{param}`)\n * or colon placeholders (`/somePath/:param`).\n *\n * - *A parameter RegExp* may be defined for a param after a colon\n * (`/somePath/{param:[a-zA-Z0-9]+}`) in a curly brace placeholder.\n * The regexp must match for the url to be matched.\n * Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.\n *\n * Note: a RegExp parameter will encode its value using either [[ParamTypes.path]] or [[ParamTypes.query]].\n *\n * - *Custom parameter types* may also be specified after a colon (`/somePath/{param:int}`) in curly brace parameters.\n * See [[UrlMatcherFactory.type]] for more information.\n *\n * - *Catch-all parameters* are defined using an asterisk placeholder (`/somepath/*catchallparam`).\n * A catch-all * parameter value will contain the remainder of the URL.\n *\n * ---\n *\n * Parameter names may contain only word characters (latin letters, digits, and underscore) and\n * must be unique within the pattern (across both path and search parameters).\n * A path parameter matches any number of characters other than '/'. For catch-all\n * placeholders the path parameter matches any number of characters.\n *\n * Examples:\n *\n * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for\n * trailing slashes, and patterns have to match the entire path, not just a prefix.\n * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or\n * '/user/bob/details'. The second path segment will be captured as the parameter 'id'.\n * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.\n * * `'/user/{id:[^/]*}'` - Same as the previous example.\n * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id\n * parameter consists of 1 to 8 hex digits.\n * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the\n * path into the parameter 'path'.\n * * `'/files/*path'` - ditto.\n * * `'/calendar/{start:date}'` - Matches \"/calendar/2014-11-12\" (because the pattern defined\n * in the built-in `date` ParamType matches `2014-11-12`) and provides a Date object in $stateParams.start\n *\n */\nvar UrlMatcher = /** @class */ (function () {\n /**\n * @param pattern The pattern to compile into a matcher.\n * @param paramTypes The [[ParamTypes]] registry\n * @param paramFactory A [[ParamFactory]] object\n * @param config A [[UrlMatcherCompileConfig]] configuration object\n */\n function UrlMatcher(pattern, paramTypes, paramFactory, config) {\n var _this = this;\n /** @hidden */\n this._cache = { path: [this] };\n /** @hidden */\n this._children = [];\n /** @hidden */\n this._params = [];\n /** @hidden */\n this._segments = [];\n /** @hidden */\n this._compiled = [];\n this.config = config = defaults(config, defaultConfig);\n this.pattern = pattern;\n // Find all placeholders and create a compiled pattern, using either classic or curly syntax:\n // '*' name\n // ':' name\n // '{' name '}'\n // '{' name ':' regexp '}'\n // The regular expression is somewhat complicated due to the need to allow curly braces\n // inside the regular expression. The placeholder regexp breaks down as follows:\n // ([:*])([\\w\\[\\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case)\n // \\{([\\w\\[\\]]+)(?:\\:\\s*( ... ))?\\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case\n // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either\n // [^{}\\\\]+ - anything other than curly braces or backslash\n // \\\\. - a backslash escape\n // \\{(?:[^{}\\\\]+|\\\\.)*\\} - a matched set of curly braces containing other atoms\n var placeholder = /([:*])([\\w\\[\\]]+)|\\{([\\w\\[\\]]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g;\n var searchPlaceholder = /([:]?)([\\w\\[\\].-]+)|\\{([\\w\\[\\].-]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g;\n var patterns = [];\n var last = 0;\n var matchArray;\n var checkParamErrors = function (id) {\n if (!UrlMatcher.nameValidator.test(id))\n throw new Error(\"Invalid parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n if (find(_this._params, propEq('id', id)))\n throw new Error(\"Duplicate parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n };\n // Split into static segments separated by path parameter placeholders.\n // The number of segments is always 1 more than the number of parameters.\n var matchDetails = function (m, isSearch) {\n // IE[78] returns '' for unmatched groups instead of null\n var id = m[2] || m[3];\n var regexp = isSearch ? m[4] : m[4] || (m[1] === '*' ? '[\\\\s\\\\S]*' : null);\n var makeRegexpType = function (str) {\n return inherit(paramTypes.type(isSearch ? 'query' : 'path'), {\n pattern: new RegExp(str, _this.config.caseInsensitive ? 'i' : undefined),\n });\n };\n return {\n id: id,\n regexp: regexp,\n segment: pattern.substring(last, m.index),\n type: !regexp ? null : paramTypes.type(regexp) || makeRegexpType(regexp),\n };\n };\n var details;\n var segment;\n // tslint:disable-next-line:no-conditional-assignment\n while ((matchArray = placeholder.exec(pattern))) {\n details = matchDetails(matchArray, false);\n if (details.segment.indexOf('?') >= 0)\n break; // we're into the search part\n checkParamErrors(details.id);\n this._params.push(paramFactory.fromPath(details.id, details.type, config.state));\n this._segments.push(details.segment);\n patterns.push([details.segment, tail(this._params)]);\n last = placeholder.lastIndex;\n }\n segment = pattern.substring(last);\n // Find any search parameter names and remove them from the last segment\n var i = segment.indexOf('?');\n if (i >= 0) {\n var search = segment.substring(i);\n segment = segment.substring(0, i);\n if (search.length > 0) {\n last = 0;\n // tslint:disable-next-line:no-conditional-assignment\n while ((matchArray = searchPlaceholder.exec(search))) {\n details = matchDetails(matchArray, true);\n checkParamErrors(details.id);\n this._params.push(paramFactory.fromSearch(details.id, details.type, config.state));\n last = placeholder.lastIndex;\n // check if ?&\n }\n }\n }\n this._segments.push(segment);\n this._compiled = patterns.map(function (_pattern) { return quoteRegExp.apply(null, _pattern); }).concat(quoteRegExp(segment));\n }\n /** @hidden */\n UrlMatcher.encodeDashes = function (str) {\n // Replace dashes with encoded \"\\-\"\n return encodeURIComponent(str).replace(/-/g, function (c) {\n return \"%5C%\" + c\n .charCodeAt(0)\n .toString(16)\n .toUpperCase();\n });\n };\n /** @hidden Given a matcher, return an array with the matcher's path segments and path params, in order */\n UrlMatcher.pathSegmentsAndParams = function (matcher) {\n var staticSegments = matcher._segments;\n var pathParams = matcher._params.filter(function (p) { return p.location === DefType.PATH; });\n return arrayTuples(staticSegments, pathParams.concat(undefined))\n .reduce(unnestR, [])\n .filter(function (x) { return x !== '' && isDefined(x); });\n };\n /** @hidden Given a matcher, return an array with the matcher's query params */\n UrlMatcher.queryParams = function (matcher) {\n return matcher._params.filter(function (p) { return p.location === DefType.SEARCH; });\n };\n /**\n * Compare two UrlMatchers\n *\n * This comparison function converts a UrlMatcher into static and dynamic path segments.\n * Each static path segment is a static string between a path separator (slash character).\n * Each dynamic segment is a path parameter.\n *\n * The comparison function sorts static segments before dynamic ones.\n */\n UrlMatcher.compare = function (a, b) {\n /**\n * Turn a UrlMatcher and all its parent matchers into an array\n * of slash literals '/', string literals, and Param objects\n *\n * This example matcher matches strings like \"/foo/:param/tail\":\n * var matcher = $umf.compile(\"/foo\").append($umf.compile(\"/:param\")).append($umf.compile(\"/\")).append($umf.compile(\"tail\"));\n * var result = segments(matcher); // [ '/', 'foo', '/', Param, '/', 'tail' ]\n *\n * Caches the result as `matcher._cache.segments`\n */\n var segments = function (matcher) {\n return (matcher._cache.segments =\n matcher._cache.segments ||\n matcher._cache.path\n .map(UrlMatcher.pathSegmentsAndParams)\n .reduce(unnestR, [])\n .reduce(joinNeighborsR, [])\n .map(function (x) { return (isString(x) ? splitOnSlash(x) : x); })\n .reduce(unnestR, []));\n };\n /**\n * Gets the sort weight for each segment of a UrlMatcher\n *\n * Caches the result as `matcher._cache.weights`\n */\n var weights = function (matcher) {\n return (matcher._cache.weights =\n matcher._cache.weights ||\n segments(matcher).map(function (segment) {\n // Sort slashes first, then static strings, the Params\n if (segment === '/')\n return 1;\n if (isString(segment))\n return 2;\n if (segment instanceof Param)\n return 3;\n }));\n };\n /**\n * Pads shorter array in-place (mutates)\n */\n var padArrays = function (l, r, padVal) {\n var len = Math.max(l.length, r.length);\n while (l.length < len)\n l.push(padVal);\n while (r.length < len)\n r.push(padVal);\n };\n var weightsA = weights(a), weightsB = weights(b);\n padArrays(weightsA, weightsB, 0);\n var _pairs = arrayTuples(weightsA, weightsB);\n var cmp, i;\n for (i = 0; i < _pairs.length; i++) {\n cmp = _pairs[i][0] - _pairs[i][1];\n if (cmp !== 0)\n return cmp;\n }\n return 0;\n };\n /**\n * Creates a new concatenated UrlMatcher\n *\n * Builds a new UrlMatcher by appending another UrlMatcher to this one.\n *\n * @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`.\n */\n UrlMatcher.prototype.append = function (url) {\n this._children.push(url);\n url._cache = {\n path: this._cache.path.concat(url),\n parent: this,\n pattern: null,\n };\n return url;\n };\n /** @hidden */\n UrlMatcher.prototype.isRoot = function () {\n return this._cache.path[0] === this;\n };\n /** Returns the input pattern string */\n UrlMatcher.prototype.toString = function () {\n return this.pattern;\n };\n /**\n * Tests the specified url/path against this matcher.\n *\n * Tests if the given url matches this matcher's pattern, and returns an object containing the captured\n * parameter values. Returns null if the path does not match.\n *\n * The returned object contains the values\n * of any search parameters that are mentioned in the pattern, but their value may be null if\n * they are not present in `search`. This means that search parameters are always treated\n * as optional.\n *\n * #### Example:\n * ```js\n * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {\n * x: '1', q: 'hello'\n * });\n * // returns { id: 'bob', q: 'hello', r: null }\n * ```\n *\n * @param path The URL path to match, e.g. `$location.path()`.\n * @param search URL search parameters, e.g. `$location.search()`.\n * @param hash URL hash e.g. `$location.hash()`.\n * @param options\n *\n * @returns The captured parameter values.\n */\n UrlMatcher.prototype.exec = function (path, search, hash, options) {\n var _this = this;\n if (search === void 0) { search = {}; }\n if (options === void 0) { options = {}; }\n var match = memoizeTo(this._cache, 'pattern', function () {\n return new RegExp([\n '^',\n unnest(_this._cache.path.map(prop('_compiled'))).join(''),\n _this.config.strict === false ? '/?' : '',\n '$',\n ].join(''), _this.config.caseInsensitive ? 'i' : undefined);\n }).exec(path);\n if (!match)\n return null;\n // options = defaults(options, { isolate: false });\n var allParams = this.parameters(), pathParams = allParams.filter(function (param) { return !param.isSearch(); }), searchParams = allParams.filter(function (param) { return param.isSearch(); }), nPathSegments = this._cache.path.map(function (urlm) { return urlm._segments.length - 1; }).reduce(function (a, x) { return a + x; }), values = {};\n if (nPathSegments !== match.length - 1)\n throw new Error(\"Unbalanced capture group in route '\" + this.pattern + \"'\");\n function decodePathArray(paramVal) {\n var reverseString = function (str) {\n return str\n .split('')\n .reverse()\n .join('');\n };\n var unquoteDashes = function (str) { return str.replace(/\\\\-/g, '-'); };\n var split = reverseString(paramVal).split(/-(?!\\\\)/);\n var allReversed = map(split, reverseString);\n return map(allReversed, unquoteDashes).reverse();\n }\n for (var i = 0; i < nPathSegments; i++) {\n var param = pathParams[i];\n var value = match[i + 1];\n // if the param value matches a pre-replace pair, replace the value before decoding.\n for (var j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === value)\n value = param.replace[j].to;\n }\n if (value && param.array === true)\n value = decodePathArray(value);\n if (isDefined(value))\n value = param.type.decode(value);\n values[param.id] = param.value(value);\n }\n searchParams.forEach(function (param) {\n var value = search[param.id];\n for (var j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === value)\n value = param.replace[j].to;\n }\n if (isDefined(value))\n value = param.type.decode(value);\n values[param.id] = param.value(value);\n });\n if (hash)\n values['#'] = hash;\n return values;\n };\n /**\n * @hidden\n * Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance.\n *\n * @returns {Array.} An array of [[Param]] objects. Must be treated as read-only. If the\n * pattern has no parameters, an empty array is returned.\n */\n UrlMatcher.prototype.parameters = function (opts) {\n if (opts === void 0) { opts = {}; }\n if (opts.inherit === false)\n return this._params;\n return unnest(this._cache.path.map(function (matcher) { return matcher._params; }));\n };\n /**\n * @hidden\n * Returns a single parameter from this UrlMatcher by id\n *\n * @param id\n * @param opts\n * @returns {T|Param|any|boolean|UrlMatcher|null}\n */\n UrlMatcher.prototype.parameter = function (id, opts) {\n var _this = this;\n if (opts === void 0) { opts = {}; }\n var findParam = function () {\n for (var _i = 0, _a = _this._params; _i < _a.length; _i++) {\n var param = _a[_i];\n if (param.id === id)\n return param;\n }\n };\n var parent = this._cache.parent;\n return findParam() || (opts.inherit !== false && parent && parent.parameter(id, opts)) || null;\n };\n /**\n * Validates the input parameter values against this UrlMatcher\n *\n * Checks an object hash of parameters to validate their correctness according to the parameter\n * types of this `UrlMatcher`.\n *\n * @param params The object hash of parameters to validate.\n * @returns Returns `true` if `params` validates, otherwise `false`.\n */\n UrlMatcher.prototype.validates = function (params) {\n var validParamVal = function (param, val) { return !param || param.validates(val); };\n params = params || {};\n // I'm not sure why this checks only the param keys passed in, and not all the params known to the matcher\n var paramSchema = this.parameters().filter(function (paramDef) { return params.hasOwnProperty(paramDef.id); });\n return paramSchema.map(function (paramDef) { return validParamVal(paramDef, params[paramDef.id]); }).reduce(allTrueR, true);\n };\n /**\n * Given a set of parameter values, creates a URL from this UrlMatcher.\n *\n * Creates a URL that matches this pattern by substituting the specified values\n * for the path and search parameters.\n *\n * #### Example:\n * ```js\n * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });\n * // returns '/user/bob?q=yes'\n * ```\n *\n * @param values the values to substitute for the parameters in this pattern.\n * @returns the formatted URL (path and optionally search part).\n */\n UrlMatcher.prototype.format = function (values) {\n if (values === void 0) { values = {}; }\n // Build the full path of UrlMatchers (including all parent UrlMatchers)\n var urlMatchers = this._cache.path;\n // Extract all the static segments and Params (processed as ParamDetails)\n // into an ordered array\n var pathSegmentsAndParams = urlMatchers\n .map(UrlMatcher.pathSegmentsAndParams)\n .reduce(unnestR, [])\n .map(function (x) { return (isString(x) ? x : getDetails(x)); });\n // Extract the query params into a separate array\n var queryParams = urlMatchers\n .map(UrlMatcher.queryParams)\n .reduce(unnestR, [])\n .map(getDetails);\n var isInvalid = function (param) { return param.isValid === false; };\n if (pathSegmentsAndParams.concat(queryParams).filter(isInvalid).length) {\n return null;\n }\n /**\n * Given a Param, applies the parameter value, then returns detailed information about it\n */\n function getDetails(param) {\n // Normalize to typed value\n var value = param.value(values[param.id]);\n var isValid = param.validates(value);\n var isDefaultValue = param.isDefaultValue(value);\n // Check if we're in squash mode for the parameter\n var squash = isDefaultValue ? param.squash : false;\n // Allow the Parameter's Type to encode the value\n var encoded = param.type.encode(value);\n return { param: param, value: value, isValid: isValid, isDefaultValue: isDefaultValue, squash: squash, encoded: encoded };\n }\n // Build up the path-portion from the list of static segments and parameters\n var pathString = pathSegmentsAndParams.reduce(function (acc, x) {\n // The element is a static segment (a raw string); just append it\n if (isString(x))\n return acc + x;\n // Otherwise, it's a ParamDetails.\n var squash = x.squash, encoded = x.encoded, param = x.param;\n // If squash is === true, try to remove a slash from the path\n if (squash === true)\n return acc.match(/\\/$/) ? acc.slice(0, -1) : acc;\n // If squash is a string, use the string for the param value\n if (isString(squash))\n return acc + squash;\n if (squash !== false)\n return acc; // ?\n if (encoded == null)\n return acc;\n // If this parameter value is an array, encode the value using encodeDashes\n if (isArray(encoded))\n return acc + map(encoded, UrlMatcher.encodeDashes).join('-');\n // If the parameter type is \"raw\", then do not encodeURIComponent\n if (param.raw)\n return acc + encoded;\n // Encode the value\n return acc + encodeURIComponent(encoded);\n }, '');\n // Build the query string by applying parameter values (array or regular)\n // then mapping to key=value, then flattening and joining using \"&\"\n var queryString = queryParams\n .map(function (paramDetails) {\n var param = paramDetails.param, squash = paramDetails.squash, encoded = paramDetails.encoded, isDefaultValue = paramDetails.isDefaultValue;\n if (encoded == null || (isDefaultValue && squash !== false))\n return;\n if (!isArray(encoded))\n encoded = [encoded];\n if (encoded.length === 0)\n return;\n if (!param.raw)\n encoded = map(encoded, encodeURIComponent);\n return encoded.map(function (val) { return param.id + \"=\" + val; });\n })\n .filter(identity)\n .reduce(unnestR, [])\n .join('&');\n // Concat the pathstring with the queryString (if exists) and the hashString (if exists)\n return pathString + (queryString ? \"?\" + queryString : '') + (values['#'] ? '#' + values['#'] : '');\n };\n /** @hidden */\n UrlMatcher.nameValidator = /^\\w+([-.]+\\w+)*(?:\\[\\])?$/;\n return UrlMatcher;\n}());\nexport { UrlMatcher };\n//# sourceMappingURL=urlMatcher.js.map","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n/** @publicapi @module url */ /** */\nimport { extend, forEach, isDefined, isFunction, isObject } from '../common';\nimport { UrlMatcher } from './urlMatcher';\nimport { DefType, Param } from '../params';\n/** @internalapi */\nvar ParamFactory = /** @class */ (function () {\n function ParamFactory(router) {\n this.router = router;\n }\n ParamFactory.prototype.fromConfig = function (id, type, state) {\n return new Param(id, type, DefType.CONFIG, this.router.urlService.config, state);\n };\n ParamFactory.prototype.fromPath = function (id, type, state) {\n return new Param(id, type, DefType.PATH, this.router.urlService.config, state);\n };\n ParamFactory.prototype.fromSearch = function (id, type, state) {\n return new Param(id, type, DefType.SEARCH, this.router.urlService.config, state);\n };\n return ParamFactory;\n}());\nexport { ParamFactory };\n/**\n * Factory for [[UrlMatcher]] instances.\n *\n * The factory is available to ng1 services as\n * `$urlMatcherFactory` or ng1 providers as `$urlMatcherFactoryProvider`.\n *\n * @internalapi\n */\nvar UrlMatcherFactory = /** @class */ (function () {\n // TODO: move implementations to UrlConfig (urlService.config)\n function UrlMatcherFactory(/** @hidden */ router) {\n var _this = this;\n this.router = router;\n /** @internalapi Creates a new [[Param]] for a given location (DefType) */\n this.paramFactory = new ParamFactory(this.router);\n /** @deprecated use [[UrlConfig.caseInsensitive]] */\n this.caseInsensitive = function (value) { return _this.router.urlService.config.caseInsensitive(value); };\n /** @deprecated use [[UrlConfig.defaultSquashPolicy]] */\n this.defaultSquashPolicy = function (value) { return _this.router.urlService.config.defaultSquashPolicy(value); };\n /** @deprecated use [[UrlConfig.strictMode]] */\n this.strictMode = function (value) { return _this.router.urlService.config.strictMode(value); };\n /** @deprecated use [[UrlConfig.type]] */\n this.type = function (name, definition, definitionFn) {\n return _this.router.urlService.config.type(name, definition, definitionFn) || _this;\n };\n extend(this, { UrlMatcher: UrlMatcher, Param: Param });\n }\n /**\n * Creates a [[UrlMatcher]] for the specified pattern.\n *\n * @param pattern The URL pattern.\n * @param config The config object hash.\n * @returns The UrlMatcher.\n */\n UrlMatcherFactory.prototype.compile = function (pattern, config) {\n var urlConfig = this.router.urlService.config;\n // backward-compatible support for config.params -> config.state.params\n var params = config && !config.state && config.params;\n config = params ? __assign({ state: { params: params } }, config) : config;\n var globalConfig = { strict: urlConfig._isStrictMode, caseInsensitive: urlConfig._isCaseInsensitive };\n return new UrlMatcher(pattern, urlConfig.paramTypes, this.paramFactory, extend(globalConfig, config));\n };\n /**\n * Returns true if the specified object is a [[UrlMatcher]], or false otherwise.\n *\n * @param object The object to perform the type check against.\n * @returns `true` if the object matches the `UrlMatcher` interface, by\n * implementing all the same methods.\n */\n UrlMatcherFactory.prototype.isMatcher = function (object) {\n // TODO: typeof?\n if (!isObject(object))\n return false;\n var result = true;\n forEach(UrlMatcher.prototype, function (val, name) {\n if (isFunction(val))\n result = result && (isDefined(object[name]) && isFunction(object[name]));\n });\n return result;\n };\n /** @hidden */\n UrlMatcherFactory.prototype.$get = function () {\n var urlConfig = this.router.urlService.config;\n urlConfig.paramTypes.enqueue = false;\n urlConfig.paramTypes._flushTypeQueue();\n return this;\n };\n return UrlMatcherFactory;\n}());\nexport { UrlMatcherFactory };\n//# sourceMappingURL=urlMatcherFactory.js.map","/** @publicapi @module url */ /** */\nimport { stripLastPathElement } from '../common';\nimport { UrlRuleFactory } from './urlRule';\n/** @hidden */\nfunction appendBasePath(url, isHtml5, absolute, baseHref) {\n if (baseHref === '/')\n return url;\n if (isHtml5)\n return stripLastPathElement(baseHref) + url;\n if (absolute)\n return baseHref.slice(1) + url;\n return url;\n}\n/**\n * Updates URL and responds to URL changes\n *\n * ### Deprecation warning:\n * This class is now considered to be an internal API\n * Use the [[UrlService]] instead.\n * For configuring URL rules, use the [[UrlRules]] which can be found as [[UrlService.rules]].\n *\n * @internalapi\n */\nvar UrlRouter = /** @class */ (function () {\n /** @hidden */\n function UrlRouter(/** @hidden */ router) {\n var _this = this;\n this.router = router;\n // Delegate these calls to [[UrlService]]\n /** @deprecated use [[UrlService.sync]]*/\n this.sync = function (evt) { return _this.router.urlService.sync(evt); };\n /** @deprecated use [[UrlService.listen]]*/\n this.listen = function (enabled) { return _this.router.urlService.listen(enabled); };\n /** @deprecated use [[UrlService.deferIntercept]]*/\n this.deferIntercept = function (defer) { return _this.router.urlService.deferIntercept(defer); };\n /** @deprecated use [[UrlService.match]]*/\n this.match = function (urlParts) { return _this.router.urlService.match(urlParts); };\n // Delegate these calls to [[UrlRules]]\n /** @deprecated use [[UrlRules.initial]]*/\n this.initial = function (handler) {\n return _this.router.urlService.rules.initial(handler);\n };\n /** @deprecated use [[UrlRules.otherwise]]*/\n this.otherwise = function (handler) {\n return _this.router.urlService.rules.otherwise(handler);\n };\n /** @deprecated use [[UrlRules.removeRule]]*/\n this.removeRule = function (rule) { return _this.router.urlService.rules.removeRule(rule); };\n /** @deprecated use [[UrlRules.rule]]*/\n this.rule = function (rule) { return _this.router.urlService.rules.rule(rule); };\n /** @deprecated use [[UrlRules.rules]]*/\n this.rules = function () { return _this.router.urlService.rules.rules(); };\n /** @deprecated use [[UrlRules.sort]]*/\n this.sort = function (compareFn) { return _this.router.urlService.rules.sort(compareFn); };\n /** @deprecated use [[UrlRules.when]]*/\n this.when = function (matcher, handler, options) { return _this.router.urlService.rules.when(matcher, handler, options); };\n this.urlRuleFactory = new UrlRuleFactory(router);\n }\n /**\n * Internal API.\n * @internalapi\n */\n UrlRouter.prototype.update = function (read) {\n var $url = this.router.locationService;\n if (read) {\n this.location = $url.url();\n return;\n }\n if ($url.url() === this.location)\n return;\n $url.url(this.location, true);\n };\n /**\n * Internal API.\n *\n * Pushes a new location to the browser history.\n *\n * @internalapi\n * @param urlMatcher\n * @param params\n * @param options\n */\n UrlRouter.prototype.push = function (urlMatcher, params, options) {\n var replace = options && !!options.replace;\n this.router.urlService.url(urlMatcher.format(params || {}), replace);\n };\n /**\n * Builds and returns a URL with interpolated parameters\n *\n * #### Example:\n * ```js\n * matcher = $umf.compile(\"/about/:person\");\n * params = { person: \"bob\" };\n * $bob = $urlRouter.href(matcher, params);\n * // $bob == \"/about/bob\";\n * ```\n *\n * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.\n * @param params An object of parameter values to fill the matcher's required parameters.\n * @param options Options object. The options are:\n *\n * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n *\n * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`\n */\n UrlRouter.prototype.href = function (urlMatcher, params, options) {\n var url = urlMatcher.format(params);\n if (url == null)\n return null;\n options = options || { absolute: false };\n var cfg = this.router.urlService.config;\n var isHtml5 = cfg.html5Mode();\n if (!isHtml5 && url !== null) {\n url = '#' + cfg.hashPrefix() + url;\n }\n url = appendBasePath(url, isHtml5, options.absolute, cfg.baseHref());\n if (!options.absolute || !url) {\n return url;\n }\n var slash = !isHtml5 && url ? '/' : '';\n var cfgPort = cfg.port();\n var port = (cfgPort === 80 || cfgPort === 443 ? '' : ':' + cfgPort);\n return [cfg.protocol(), '://', cfg.host(), port, slash, url].join('');\n };\n Object.defineProperty(UrlRouter.prototype, \"interceptDeferred\", {\n /** @deprecated use [[UrlService.interceptDeferred]]*/\n get: function () {\n return this.router.urlService.interceptDeferred;\n },\n enumerable: true,\n configurable: true\n });\n return UrlRouter;\n}());\nexport { UrlRouter };\n//# sourceMappingURL=urlRouter.js.map","/** @publicapi @module url */ /** */\nimport { UrlMatcher } from './urlMatcher';\nimport { isString, isDefined, isFunction } from '../common/predicates';\nimport { identity, extend } from '../common/common';\nimport { is, pattern } from '../common/hof';\nimport { StateObject } from '../state/stateObject';\n/**\n * Creates a [[UrlRule]]\n *\n * Creates a [[UrlRule]] from a:\n *\n * - `string`\n * - [[UrlMatcher]]\n * - `RegExp`\n * - [[StateObject]]\n * @internalapi\n */\nvar UrlRuleFactory = /** @class */ (function () {\n function UrlRuleFactory(router) {\n this.router = router;\n }\n UrlRuleFactory.prototype.compile = function (str) {\n return this.router.urlMatcherFactory.compile(str);\n };\n UrlRuleFactory.prototype.create = function (what, handler) {\n var _this = this;\n var isState = StateObject.isState;\n var makeRule = pattern([\n [isString, function (_what) { return makeRule(_this.compile(_what)); }],\n [is(UrlMatcher), function (_what) { return _this.fromUrlMatcher(_what, handler); }],\n [isState, function (_what) { return _this.fromState(_what, _this.router); }],\n [is(RegExp), function (_what) { return _this.fromRegExp(_what, handler); }],\n [isFunction, function (_what) { return new BaseUrlRule(_what, handler); }],\n ]);\n var rule = makeRule(what);\n if (!rule)\n throw new Error(\"invalid 'what' in when()\");\n return rule;\n };\n /**\n * A UrlRule which matches based on a UrlMatcher\n *\n * The `handler` may be either a `string`, a [[UrlRuleHandlerFn]] or another [[UrlMatcher]]\n *\n * ## Handler as a function\n *\n * If `handler` is a function, the function is invoked with:\n *\n * - matched parameter values ([[RawParams]] from [[UrlMatcher.exec]])\n * - url: the current Url ([[UrlParts]])\n * - router: the router object ([[UIRouter]])\n *\n * #### Example:\n * ```js\n * var urlMatcher = $umf.compile(\"/foo/:fooId/:barId\");\n * var rule = factory.fromUrlMatcher(urlMatcher, match => \"/home/\" + match.fooId + \"/\" + match.barId);\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\n * var result = rule.handler(match); // '/home/123/456'\n * ```\n *\n * ## Handler as UrlMatcher\n *\n * If `handler` is a UrlMatcher, the handler matcher is used to create the new url.\n * The `handler` UrlMatcher is formatted using the matched param from the first matcher.\n * The url is replaced with the result.\n *\n * #### Example:\n * ```js\n * var urlMatcher = $umf.compile(\"/foo/:fooId/:barId\");\n * var handler = $umf.compile(\"/home/:fooId/:barId\");\n * var rule = factory.fromUrlMatcher(urlMatcher, handler);\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\n * var result = rule.handler(match); // '/home/123/456'\n * ```\n */\n UrlRuleFactory.prototype.fromUrlMatcher = function (urlMatcher, handler) {\n var _handler = handler;\n if (isString(handler))\n handler = this.router.urlMatcherFactory.compile(handler);\n if (is(UrlMatcher)(handler))\n _handler = function (match) { return handler.format(match); };\n function matchUrlParamters(url) {\n var params = urlMatcher.exec(url.path, url.search, url.hash);\n return urlMatcher.validates(params) && params;\n }\n // Prioritize URLs, lowest to highest:\n // - Some optional URL parameters, but none matched\n // - No optional parameters in URL\n // - Some optional parameters, some matched\n // - Some optional parameters, all matched\n function matchPriority(params) {\n var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n if (!optional.length)\n return 0.000001;\n var matched = optional.filter(function (param) { return params[param.id]; });\n return matched.length / optional.length;\n }\n var details = { urlMatcher: urlMatcher, matchPriority: matchPriority, type: 'URLMATCHER' };\n return extend(new BaseUrlRule(matchUrlParamters, _handler), details);\n };\n /**\n * A UrlRule which matches a state by its url\n *\n * #### Example:\n * ```js\n * var rule = factory.fromState($state.get('foo'), router);\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\n * var result = rule.handler(match);\n * // Starts a transition to 'foo' with params: { fooId: '123', barId: '456' }\n * ```\n */\n UrlRuleFactory.prototype.fromState = function (state, router) {\n /**\n * Handles match by transitioning to matched state\n *\n * First checks if the router should start a new transition.\n * A new transition is not required if the current state's URL\n * and the new URL are already identical\n */\n var handler = function (match) {\n var $state = router.stateService;\n var globals = router.globals;\n if ($state.href(state, match) !== $state.href(globals.current, globals.params)) {\n $state.transitionTo(state, match, { inherit: true, source: 'url' });\n }\n };\n var details = { state: state, type: 'STATE' };\n return extend(this.fromUrlMatcher(state.url, handler), details);\n };\n /**\n * A UrlRule which matches based on a regular expression\n *\n * The `handler` may be either a [[UrlRuleHandlerFn]] or a string.\n *\n * ## Handler as a function\n *\n * If `handler` is a function, the function is invoked with:\n *\n * - regexp match array (from `regexp`)\n * - url: the current Url ([[UrlParts]])\n * - router: the router object ([[UIRouter]])\n *\n * #### Example:\n * ```js\n * var rule = factory.fromRegExp(/^\\/foo\\/(bar|baz)$/, match => \"/home/\" + match[1])\n * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]\n * var result = rule.handler(match); // '/home/bar'\n * ```\n *\n * ## Handler as string\n *\n * If `handler` is a string, the url is *replaced by the string* when the Rule is invoked.\n * The string is first interpolated using `string.replace()` style pattern.\n *\n * #### Example:\n * ```js\n * var rule = factory.fromRegExp(/^\\/foo\\/(bar|baz)$/, \"/home/$1\")\n * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]\n * var result = rule.handler(match); // '/home/bar'\n * ```\n */\n UrlRuleFactory.prototype.fromRegExp = function (regexp, handler) {\n if (regexp.global || regexp.sticky)\n throw new Error('Rule RegExp must not be global or sticky');\n /**\n * If handler is a string, the url will be replaced by the string.\n * If the string has any String.replace() style variables in it (like `$2`),\n * they will be replaced by the captures from [[match]]\n */\n var redirectUrlTo = function (match) {\n // Interpolates matched values into $1 $2, etc using a String.replace()-style pattern\n return handler.replace(/\\$(\\$|\\d{1,2})/, function (m, what) { return match[what === '$' ? 0 : Number(what)]; });\n };\n var _handler = isString(handler) ? redirectUrlTo : handler;\n var matchParamsFromRegexp = function (url) { return regexp.exec(url.path); };\n var details = { regexp: regexp, type: 'REGEXP' };\n return extend(new BaseUrlRule(matchParamsFromRegexp, _handler), details);\n };\n UrlRuleFactory.isUrlRule = function (obj) { return obj && ['type', 'match', 'handler'].every(function (key) { return isDefined(obj[key]); }); };\n return UrlRuleFactory;\n}());\nexport { UrlRuleFactory };\n/**\n * A base rule which calls `match`\n *\n * The value from the `match` function is passed through to the `handler`.\n * @internalapi\n */\nvar BaseUrlRule = /** @class */ (function () {\n function BaseUrlRule(match, handler) {\n var _this = this;\n this.match = match;\n this.type = 'RAW';\n this.matchPriority = function (match) { return 0 - _this.$id; };\n this.handler = handler || identity;\n }\n return BaseUrlRule;\n}());\nexport { BaseUrlRule };\n//# sourceMappingURL=urlRule.js.map","import { TargetState } from '../state';\nimport { UrlMatcher } from './urlMatcher';\nimport { is, isDefined, isFunction, isString, removeFrom, val } from '../common';\nimport { UrlRuleFactory } from './urlRule';\n/** @hidden */\nvar prioritySort = function (a, b) { return (b.priority || 0) - (a.priority || 0); };\n/** @hidden */\nvar typeSort = function (a, b) {\n var weights = { STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1 };\n return (weights[a.type] || 0) - (weights[b.type] || 0);\n};\n/** @hidden */\nvar urlMatcherSort = function (a, b) {\n return !a.urlMatcher || !b.urlMatcher ? 0 : UrlMatcher.compare(a.urlMatcher, b.urlMatcher);\n};\n/** @hidden */\nvar idSort = function (a, b) {\n // Identically sorted STATE and URLMATCHER best rule will be chosen by `matchPriority` after each rule matches the URL\n var useMatchPriority = { STATE: true, URLMATCHER: true };\n var equal = useMatchPriority[a.type] && useMatchPriority[b.type];\n return equal ? 0 : (a.$id || 0) - (b.$id || 0);\n};\n/**\n * Default rule priority sorting function.\n *\n * Sorts rules by:\n *\n * - Explicit priority (set rule priority using [[UrlRules.when]])\n * - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1)\n * - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule.\n * - Rule registration order (for rule types other than STATE and URLMATCHER)\n * - Equally sorted State and UrlMatcher rules will each match the URL.\n * Then, the *best* match is chosen based on how many parameter values were matched.\n *\n * @publicapi\n */\nvar defaultRuleSortFn;\ndefaultRuleSortFn = function (a, b) {\n var cmp = prioritySort(a, b);\n if (cmp !== 0)\n return cmp;\n cmp = typeSort(a, b);\n if (cmp !== 0)\n return cmp;\n cmp = urlMatcherSort(a, b);\n if (cmp !== 0)\n return cmp;\n return idSort(a, b);\n};\n/** @hidden */\nfunction getHandlerFn(handler) {\n if (!isFunction(handler) && !isString(handler) && !is(TargetState)(handler) && !TargetState.isDef(handler)) {\n throw new Error(\"'handler' must be a string, function, TargetState, or have a state: 'newtarget' property\");\n }\n return isFunction(handler) ? handler : val(handler);\n}\n/**\n * API for managing URL rules\n *\n * This API is used to create and manage URL rules.\n * URL rules are a mechanism to respond to specific URL patterns.\n *\n * The most commonly used methods are [[otherwise]] and [[when]].\n *\n * This API is a property of [[UrlService]] as [[UrlService.rules]]\n *\n * @publicapi\n */\nvar UrlRules = /** @class */ (function () {\n /** @hidden */\n function UrlRules(/** @hidden */ router) {\n this.router = router;\n /** @hidden */ this._sortFn = defaultRuleSortFn;\n /** @hidden */ this._rules = [];\n /** @hidden */ this._id = 0;\n this.urlRuleFactory = new UrlRuleFactory(router);\n }\n /** @hidden */\n UrlRules.prototype.dispose = function (router) {\n this._rules = [];\n delete this._otherwiseFn;\n };\n /**\n * Defines the initial state, path, or behavior to use when the app starts.\n *\n * This rule defines the initial/starting state for the application.\n *\n * This rule is triggered the first time the URL is checked (when the app initially loads).\n * The rule is triggered only when the url matches either `\"\"` or `\"/\"`.\n *\n * Note: The rule is intended to be used when the root of the application is directly linked to.\n * When the URL is *not* `\"\"` or `\"/\"` and doesn't match other rules, the [[otherwise]] rule is triggered.\n * This allows 404-like behavior when an unknown URL is deep-linked.\n *\n * #### Example:\n * Start app at `home` state.\n * ```js\n * .initial({ state: 'home' });\n * ```\n *\n * #### Example:\n * Start app at `/home` (by url)\n * ```js\n * .initial('/home');\n * ```\n *\n * #### Example:\n * When no other url rule matches, go to `home` state\n * ```js\n * .initial((matchValue, url, router) => {\n * console.log('initial state');\n * return { state: 'home' };\n * })\n * ```\n *\n * @param handler The initial state or url path, or a function which returns the state or url path (or performs custom logic).\n */\n UrlRules.prototype.initial = function (handler) {\n var handlerFn = getHandlerFn(handler);\n var matchFn = function (urlParts, router) {\n return router.globals.transitionHistory.size() === 0 && !!/^\\/?$/.exec(urlParts.path);\n };\n this.rule(this.urlRuleFactory.create(matchFn, handlerFn));\n };\n /**\n * Defines the state, url, or behavior to use when no other rule matches the URL.\n *\n * This rule is matched when *no other rule* matches.\n * It is generally used to handle unknown URLs (similar to \"404\" behavior, but on the client side).\n *\n * - If `handler` a string, it is treated as a url redirect\n *\n * #### Example:\n * When no other url rule matches, redirect to `/index`\n * ```js\n * .otherwise('/index');\n * ```\n *\n * - If `handler` is an object with a `state` property, the state is activated.\n *\n * #### Example:\n * When no other url rule matches, redirect to `home` and provide a `dashboard` parameter value.\n * ```js\n * .otherwise({ state: 'home', params: { dashboard: 'default' } });\n * ```\n *\n * - If `handler` is a function, the function receives the current url ([[UrlParts]]) and the [[UIRouter]] object.\n * The function can perform actions, and/or return a value.\n *\n * #### Example:\n * When no other url rule matches, manually trigger a transition to the `home` state\n * ```js\n * .otherwise((matchValue, urlParts, router) => {\n * router.stateService.go('home');\n * });\n * ```\n *\n * #### Example:\n * When no other url rule matches, go to `home` state\n * ```js\n * .otherwise((matchValue, urlParts, router) => {\n * return { state: 'home' };\n * });\n * ```\n *\n * @param handler The url path to redirect to, or a function which returns the url path (or performs custom logic).\n */\n UrlRules.prototype.otherwise = function (handler) {\n var handlerFn = getHandlerFn(handler);\n this._otherwiseFn = this.urlRuleFactory.create(val(true), handlerFn);\n this._sorted = false;\n };\n /**\n * Remove a rule previously registered\n *\n * @param rule the matcher rule that was previously registered using [[rule]]\n */\n UrlRules.prototype.removeRule = function (rule) {\n removeFrom(this._rules, rule);\n };\n /**\n * Manually adds a URL Rule.\n *\n * Usually, a url rule is added using [[StateDeclaration.url]] or [[when]].\n * This api can be used directly for more control (to register a [[BaseUrlRule]], for example).\n * Rules can be created using [[urlRuleFactory]], or created manually as simple objects.\n *\n * A rule should have a `match` function which returns truthy if the rule matched.\n * It should also have a `handler` function which is invoked if the rule is the best match.\n *\n * @return a function that deregisters the rule\n */\n UrlRules.prototype.rule = function (rule) {\n var _this = this;\n if (!UrlRuleFactory.isUrlRule(rule))\n throw new Error('invalid rule');\n rule.$id = this._id++;\n rule.priority = rule.priority || 0;\n this._rules.push(rule);\n this._sorted = false;\n return function () { return _this.removeRule(rule); };\n };\n /**\n * Gets all registered rules\n *\n * @returns an array of all the registered rules\n */\n UrlRules.prototype.rules = function () {\n this.ensureSorted();\n return this._rules.concat(this._otherwiseFn ? [this._otherwiseFn] : []);\n };\n /**\n * Defines URL Rule priorities\n *\n * More than one rule ([[UrlRule]]) might match a given URL.\n * This `compareFn` is used to sort the rules by priority.\n * Higher priority rules should sort earlier.\n *\n * The [[defaultRuleSortFn]] is used by default.\n *\n * You only need to call this function once.\n * The `compareFn` will be used to sort the rules as each is registered.\n *\n * If called without any parameter, it will re-sort the rules.\n *\n * ---\n *\n * Url rules may come from multiple sources: states's urls ([[StateDeclaration.url]]), [[when]], and [[rule]].\n * Each rule has a (user-provided) [[UrlRule.priority]], a [[UrlRule.type]], and a [[UrlRule.$id]]\n * The `$id` is is the order in which the rule was registered.\n *\n * The sort function should use these data, or data found on a specific type\n * of [[UrlRule]] (such as [[StateRule.state]]), to order the rules as desired.\n *\n * #### Example:\n * This compare function prioritizes rules by the order in which the rules were registered.\n * A rule registered earlier has higher priority.\n *\n * ```js\n * function compareFn(a, b) {\n * return a.$id - b.$id;\n * }\n * ```\n *\n * @param compareFn a function that compares to [[UrlRule]] objects.\n * The `compareFn` should abide by the `Array.sort` compare function rules.\n * Given two rules, `a` and `b`, return a negative number if `a` should be higher priority.\n * Return a positive number if `b` should be higher priority.\n * Return `0` if the rules are identical.\n *\n * See the [mozilla reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description)\n * for details.\n */\n UrlRules.prototype.sort = function (compareFn) {\n var sorted = this.stableSort(this._rules, (this._sortFn = compareFn || this._sortFn));\n // precompute _sortGroup values and apply to each rule\n var group = 0;\n for (var i = 0; i < sorted.length; i++) {\n sorted[i]._group = group;\n if (i < sorted.length - 1 && this._sortFn(sorted[i], sorted[i + 1]) !== 0) {\n group++;\n }\n }\n this._rules = sorted;\n this._sorted = true;\n };\n /** @hidden */\n UrlRules.prototype.ensureSorted = function () {\n this._sorted || this.sort();\n };\n /** @hidden */\n UrlRules.prototype.stableSort = function (arr, compareFn) {\n var arrOfWrapper = arr.map(function (elem, idx) { return ({ elem: elem, idx: idx }); });\n arrOfWrapper.sort(function (wrapperA, wrapperB) {\n var cmpDiff = compareFn(wrapperA.elem, wrapperB.elem);\n return cmpDiff === 0 ? wrapperA.idx - wrapperB.idx : cmpDiff;\n });\n return arrOfWrapper.map(function (wrapper) { return wrapper.elem; });\n };\n /**\n * Registers a `matcher` and `handler` for custom URLs handling.\n *\n * The `matcher` can be:\n *\n * - a [[UrlMatcher]]: See: [[UrlMatcherFactory.compile]]\n * - a `string`: The string is compiled to a [[UrlMatcher]]\n * - a `RegExp`: The regexp is used to match the url.\n *\n * The `handler` can be:\n *\n * - a string: The url is redirected to the value of the string.\n * - a function: The url is redirected to the return value of the function.\n *\n * ---\n *\n * When the `handler` is a `string` and the `matcher` is a `UrlMatcher` (or string), the redirect\n * string is interpolated with parameter values.\n *\n * #### Example:\n * When the URL is `/foo/123` the rule will redirect to `/bar/123`.\n * ```js\n * .when(\"/foo/:param1\", \"/bar/:param1\")\n * ```\n *\n * ---\n *\n * When the `handler` is a string and the `matcher` is a `RegExp`, the redirect string is\n * interpolated with capture groups from the RegExp.\n *\n * #### Example:\n * When the URL is `/foo/123` the rule will redirect to `/bar/123`.\n * ```js\n * .when(new RegExp(\"^/foo/(.*)$\"), \"/bar/$1\");\n * ```\n *\n * ---\n *\n * When the handler is a function, it receives the matched value, the current URL, and the `UIRouter` object (See [[UrlRuleHandlerFn]]).\n * The \"matched value\" differs based on the `matcher`.\n * For [[UrlMatcher]]s, it will be the matched state params.\n * For `RegExp`, it will be the match array from `regexp.exec()`.\n *\n * If the handler returns a string, the URL is redirected to the string.\n *\n * #### Example:\n * When the URL is `/foo/123` the rule will redirect to `/bar/123`.\n * ```js\n * .when(new RegExp(\"^/foo/(.*)$\"), match => \"/bar/\" + match[1]);\n * ```\n *\n * Note: the `handler` may also invoke arbitrary code, such as `$state.go()`\n *\n * @param matcher A pattern `string` to match, compiled as a [[UrlMatcher]], or a `RegExp`.\n * @param handler The path to redirect to, or a function that returns the path.\n * @param options `{ priority: number }`\n *\n * @return the registered [[UrlRule]]\n */\n UrlRules.prototype.when = function (matcher, handler, options) {\n var rule = this.urlRuleFactory.create(matcher, handler);\n if (isDefined(options && options.priority))\n rule.priority = options.priority;\n this.rule(rule);\n return rule;\n };\n return UrlRules;\n}());\nexport { UrlRules };\n//# sourceMappingURL=urlRules.js.map","import { extend, is, isString, pattern } from '../common';\nimport { UrlRules } from './urlRules';\nimport { UrlConfig } from './urlConfig';\nimport { TargetState } from '../state';\n/** API for URL management */\nvar UrlService = /** @class */ (function () {\n /** @hidden */\n function UrlService(/** @hidden */ router) {\n var _this = this;\n this.router = router;\n /** @hidden */ this.interceptDeferred = false;\n /**\n * The nested [[UrlRules]] API for managing URL rules and rewrites\n *\n * See: [[UrlRules]] for details\n */\n this.rules = new UrlRules(this.router);\n /**\n * The nested [[UrlConfig]] API to configure the URL and retrieve URL information\n *\n * See: [[UrlConfig]] for details\n */\n this.config = new UrlConfig(this.router);\n // Delegate these calls to the current LocationServices implementation\n /**\n * Gets the current url, or updates the url\n *\n * ### Getting the current URL\n *\n * When no arguments are passed, returns the current URL.\n * The URL is normalized using the internal [[path]]/[[search]]/[[hash]] values.\n *\n * For example, the URL may be stored in the hash ([[HashLocationServices]]) or\n * have a base HREF prepended ([[PushStateLocationServices]]).\n *\n * The raw URL in the browser might be:\n *\n * ```\n * http://mysite.com/somepath/index.html#/internal/path/123?param1=foo#anchor\n * ```\n *\n * or\n *\n * ```\n * http://mysite.com/basepath/internal/path/123?param1=foo#anchor\n * ```\n *\n * then this method returns:\n *\n * ```\n * /internal/path/123?param1=foo#anchor\n * ```\n *\n *\n * #### Example:\n * ```js\n * locationServices.url(); // \"/some/path?query=value#anchor\"\n * ```\n *\n * ### Updating the URL\n *\n * When `newurl` arguments is provided, changes the URL to reflect `newurl`\n *\n * #### Example:\n * ```js\n * locationServices.url(\"/some/path?query=value#anchor\", true);\n * ```\n *\n * @param newurl The new value for the URL.\n * This url should reflect only the new internal [[path]], [[search]], and [[hash]] values.\n * It should not include the protocol, site, port, or base path of an absolute HREF.\n * @param replace When true, replaces the current history entry (instead of appending it) with this new url\n * @param state The history's state object, i.e., pushState (if the LocationServices implementation supports it)\n *\n * @return the url (after potentially being processed)\n */\n this.url = function (newurl, replace, state) {\n return _this.router.locationService.url(newurl, replace, state);\n };\n /**\n * Gets the path part of the current url\n *\n * If the current URL is `/some/path?query=value#anchor`, this returns `/some/path`\n *\n * @return the path portion of the url\n */\n this.path = function () { return _this.router.locationService.path(); };\n /**\n * Gets the search part of the current url as an object\n *\n * If the current URL is `/some/path?query=value#anchor`, this returns `{ query: 'value' }`\n *\n * @return the search (query) portion of the url, as an object\n */\n this.search = function () { return _this.router.locationService.search(); };\n /**\n * Gets the hash part of the current url\n *\n * If the current URL is `/some/path?query=value#anchor`, this returns `anchor`\n *\n * @return the hash (anchor) portion of the url\n */\n this.hash = function () { return _this.router.locationService.hash(); };\n /**\n * @internalapi\n *\n * Registers a low level url change handler\n *\n * Note: Because this is a low level handler, it's not recommended for general use.\n *\n * #### Example:\n * ```js\n * let deregisterFn = locationServices.onChange((evt) => console.log(\"url change\", evt));\n * ```\n *\n * @param callback a function that will be called when the url is changing\n * @return a function that de-registers the callback\n */\n this.onChange = function (callback) { return _this.router.locationService.onChange(callback); };\n }\n /** @hidden */\n UrlService.prototype.dispose = function () {\n this.listen(false);\n this.rules.dispose();\n };\n /**\n * Gets the current URL parts\n *\n * This method returns the different parts of the current URL (the [[path]], [[search]], and [[hash]]) as a [[UrlParts]] object.\n */\n UrlService.prototype.parts = function () {\n return { path: this.path(), search: this.search(), hash: this.hash() };\n };\n /**\n * Activates the best rule for the current URL\n *\n * Checks the current URL for a matching [[UrlRule]], then invokes that rule's handler.\n * This method is called internally any time the URL has changed.\n *\n * This effectively activates the state (or redirect, etc) which matches the current URL.\n *\n * #### Example:\n * ```js\n * urlService.deferIntercept();\n *\n * fetch('/states.json').then(resp => resp.json()).then(data => {\n * data.forEach(state => $stateRegistry.register(state));\n * urlService.listen();\n * // Find the matching URL and invoke the handler.\n * urlService.sync();\n * });\n * ```\n */\n UrlService.prototype.sync = function (evt) {\n if (evt && evt.defaultPrevented)\n return;\n var _a = this.router, urlService = _a.urlService, stateService = _a.stateService;\n var url = { path: urlService.path(), search: urlService.search(), hash: urlService.hash() };\n var best = this.match(url);\n var applyResult = pattern([\n [isString, function (newurl) { return urlService.url(newurl, true); }],\n [TargetState.isDef, function (def) { return stateService.go(def.state, def.params, def.options); }],\n [is(TargetState), function (target) { return stateService.go(target.state(), target.params(), target.options()); }],\n ]);\n applyResult(best && best.rule.handler(best.match, url, this.router));\n };\n /**\n * Starts or stops listening for URL changes\n *\n * Call this sometime after calling [[deferIntercept]] to start monitoring the url.\n * This causes UI-Router to start listening for changes to the URL, if it wasn't already listening.\n *\n * If called with `false`, UI-Router will stop listening (call listen(true) to start listening again).\n *\n * #### Example:\n * ```js\n * urlService.deferIntercept();\n *\n * fetch('/states.json').then(resp => resp.json()).then(data => {\n * data.forEach(state => $stateRegistry.register(state));\n * // Start responding to URL changes\n * urlService.listen();\n * urlService.sync();\n * });\n * ```\n *\n * @param enabled `true` or `false` to start or stop listening to URL changes\n */\n UrlService.prototype.listen = function (enabled) {\n var _this = this;\n if (enabled === false) {\n this._stopListeningFn && this._stopListeningFn();\n delete this._stopListeningFn;\n }\n else {\n return (this._stopListeningFn = this._stopListeningFn || this.router.urlService.onChange(function (evt) { return _this.sync(evt); }));\n }\n };\n /**\n * Disables monitoring of the URL.\n *\n * Call this method before UI-Router has bootstrapped.\n * It will stop UI-Router from performing the initial url sync.\n *\n * This can be useful to perform some asynchronous initialization before the router starts.\n * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.\n *\n * #### Example:\n * ```js\n * // Prevent UI-Router from automatically intercepting URL changes when it starts;\n * urlService.deferIntercept();\n *\n * fetch('/states.json').then(resp => resp.json()).then(data => {\n * data.forEach(state => $stateRegistry.register(state));\n * urlService.listen();\n * urlService.sync();\n * });\n * ```\n *\n * @param defer Indicates whether to defer location change interception.\n * Passing no parameter is equivalent to `true`.\n */\n UrlService.prototype.deferIntercept = function (defer) {\n if (defer === undefined)\n defer = true;\n this.interceptDeferred = defer;\n };\n /**\n * Matches a URL\n *\n * Given a URL (as a [[UrlParts]] object), check all rules and determine the best matching rule.\n * Return the result as a [[MatchResult]].\n */\n UrlService.prototype.match = function (url) {\n var _this = this;\n url = extend({ path: '', search: {}, hash: '' }, url);\n var rules = this.rules.rules();\n // Checks a single rule. Returns { rule: rule, match: match, weight: weight } if it matched, or undefined\n var checkRule = function (rule) {\n var match = rule.match(url, _this.router);\n return match && { match: match, rule: rule, weight: rule.matchPriority(match) };\n };\n // The rules are pre-sorted.\n // - Find the first matching rule.\n // - Find any other matching rule that sorted *exactly the same*, according to `.sort()`.\n // - Choose the rule with the highest match weight.\n var best;\n for (var i = 0; i < rules.length; i++) {\n // Stop when there is a 'best' rule and the next rule sorts differently than it.\n if (best && best.rule._group !== rules[i]._group)\n break;\n var current = checkRule(rules[i]);\n // Pick the best MatchResult\n best = !best || (current && current.weight > best.weight) ? current : best;\n }\n return best;\n };\n return UrlService;\n}());\nexport { UrlService };\n//# sourceMappingURL=urlService.js.map","/** @internalapi @module vanilla */ /** */\nexport * from './vanilla/index';\n//# sourceMappingURL=vanilla.js.map","/** @internalapi @module vanilla */ /** */\nimport { deregAll, isDefined, removeFrom, root } from '../common';\nimport { buildUrl, getParams, parseUrl } from './utils';\n/** A base `LocationServices` */\nvar BaseLocationServices = /** @class */ (function () {\n function BaseLocationServices(router, fireAfterUpdate) {\n var _this = this;\n this.fireAfterUpdate = fireAfterUpdate;\n this._listeners = [];\n this._listener = function (evt) { return _this._listeners.forEach(function (cb) { return cb(evt); }); };\n this.hash = function () { return parseUrl(_this._get()).hash; };\n this.path = function () { return parseUrl(_this._get()).path; };\n this.search = function () { return getParams(parseUrl(_this._get()).search); };\n this._location = root.location;\n this._history = root.history;\n }\n BaseLocationServices.prototype.url = function (url, replace) {\n if (replace === void 0) { replace = true; }\n if (isDefined(url) && url !== this._get()) {\n this._set(null, null, url, replace);\n if (this.fireAfterUpdate) {\n this._listeners.forEach(function (cb) { return cb({ url: url }); });\n }\n }\n return buildUrl(this);\n };\n BaseLocationServices.prototype.onChange = function (cb) {\n var _this = this;\n this._listeners.push(cb);\n return function () { return removeFrom(_this._listeners, cb); };\n };\n BaseLocationServices.prototype.dispose = function (router) {\n deregAll(this._listeners);\n };\n return BaseLocationServices;\n}());\nexport { BaseLocationServices };\n//# sourceMappingURL=baseLocationService.js.map","/** @internalapi @module vanilla */\n/** */\nimport { isDefined, isUndefined } from '../common/predicates';\n/** A `LocationConfig` that delegates to the browser's `location` object */\nvar BrowserLocationConfig = /** @class */ (function () {\n function BrowserLocationConfig(router, _isHtml5) {\n if (_isHtml5 === void 0) { _isHtml5 = false; }\n this._isHtml5 = _isHtml5;\n this._baseHref = undefined;\n this._hashPrefix = '';\n }\n BrowserLocationConfig.prototype.port = function () {\n if (location.port) {\n return Number(location.port);\n }\n return this.protocol() === 'https' ? 443 : 80;\n };\n BrowserLocationConfig.prototype.protocol = function () {\n return location.protocol.replace(/:/g, '');\n };\n BrowserLocationConfig.prototype.host = function () {\n return location.hostname;\n };\n BrowserLocationConfig.prototype.html5Mode = function () {\n return this._isHtml5;\n };\n BrowserLocationConfig.prototype.hashPrefix = function (newprefix) {\n return isDefined(newprefix) ? (this._hashPrefix = newprefix) : this._hashPrefix;\n };\n BrowserLocationConfig.prototype.baseHref = function (href) {\n if (isDefined(href))\n this._baseHref = href;\n if (isUndefined(this._baseHref))\n this._baseHref = this.getBaseHref();\n return this._baseHref;\n };\n BrowserLocationConfig.prototype.getBaseHref = function () {\n var baseTag = document.getElementsByTagName('base')[0];\n if (baseTag && baseTag.href) {\n return baseTag.href.replace(/^([^/:]*:)?\\/\\/[^/]*/, '');\n }\n return this._isHtml5 ? '/' : location.pathname || '/';\n };\n BrowserLocationConfig.prototype.dispose = function () { };\n return BrowserLocationConfig;\n}());\nexport { BrowserLocationConfig };\n//# sourceMappingURL=browserLocationConfig.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/** @internalapi @module vanilla */ /** */\nimport { root, trimHashVal } from '../common';\nimport { BaseLocationServices } from './baseLocationService';\n/** A `LocationServices` that uses the browser hash \"#\" to get/set the current location */\nvar HashLocationService = /** @class */ (function (_super) {\n __extends(HashLocationService, _super);\n function HashLocationService(router) {\n var _this = _super.call(this, router, false) || this;\n root.addEventListener('hashchange', _this._listener, false);\n return _this;\n }\n HashLocationService.prototype._get = function () {\n return trimHashVal(this._location.hash);\n };\n HashLocationService.prototype._set = function (state, title, url, replace) {\n this._location.hash = url;\n };\n HashLocationService.prototype.dispose = function (router) {\n _super.prototype.dispose.call(this, router);\n root.removeEventListener('hashchange', this._listener);\n };\n return HashLocationService;\n}(BaseLocationServices));\nexport { HashLocationService };\n//# sourceMappingURL=hashLocationService.js.map","export * from './q';\nexport * from './injector';\nexport * from './baseLocationService';\nexport * from './hashLocationService';\nexport * from './memoryLocationService';\nexport * from './pushStateLocationService';\nexport * from './memoryLocationConfig';\nexport * from './browserLocationConfig';\nexport * from './utils';\nexport * from './plugins';\n//# sourceMappingURL=index.js.map","/** @internalapi @module vanilla */ /** */\nimport { extend, assertPredicate, isFunction, isArray, isInjectable, } from '../common/index';\n// globally available injectables\nvar globals = {};\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/gm;\nvar ARGUMENT_NAMES = /([^\\s,]+)/g;\n/**\n * A basic angular1-like injector api\n *\n * This object implements four methods similar to the\n * [angular 1 dependency injector](https://docs.angularjs.org/api/auto/service/$injector)\n *\n * UI-Router evolved from an angular 1 library to a framework agnostic library.\n * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection.\n *\n * This object provides a naive implementation of a globally scoped dependency injection system.\n * It supports the following DI approaches:\n *\n * ### Function parameter names\n *\n * A function's `.toString()` is called, and the parameter names are parsed.\n * This only works when the parameter names aren't \"mangled\" by a minifier such as UglifyJS.\n *\n * ```js\n * function injectedFunction(FooService, BarService) {\n * // FooService and BarService are injected\n * }\n * ```\n *\n * ### Function annotation\n *\n * A function may be annotated with an array of dependency names as the `$inject` property.\n *\n * ```js\n * injectedFunction.$inject = [ 'FooService', 'BarService' ];\n * function injectedFunction(fs, bs) {\n * // FooService and BarService are injected as fs and bs parameters\n * }\n * ```\n *\n * ### Array notation\n *\n * An array provides the names of the dependencies to inject (as strings).\n * The function is the last element of the array.\n *\n * ```js\n * [ 'FooService', 'BarService', function (fs, bs) {\n * // FooService and BarService are injected as fs and bs parameters\n * }]\n * ```\n *\n * @type {$InjectorLike}\n */\nexport var $injector = {\n /** Gets an object from DI based on a string token */\n get: function (name) { return globals[name]; },\n /** Returns true if an object named `name` exists in global DI */\n has: function (name) { return $injector.get(name) != null; },\n /**\n * Injects a function\n *\n * @param fn the function to inject\n * @param context the function's `this` binding\n * @param locals An object with additional DI tokens and values, such as `{ someToken: { foo: 1 } }`\n */\n invoke: function (fn, context, locals) {\n var all = extend({}, globals, locals || {});\n var params = $injector.annotate(fn);\n var ensureExist = assertPredicate(function (key) { return all.hasOwnProperty(key); }, function (key) { return \"DI can't find injectable: '\" + key + \"'\"; });\n var args = params.filter(ensureExist).map(function (x) { return all[x]; });\n if (isFunction(fn))\n return fn.apply(context, args);\n else\n return fn.slice(-1)[0].apply(context, args);\n },\n /**\n * Returns a function's dependencies\n *\n * Analyzes a function (or array) and returns an array of DI tokens that the function requires.\n * @return an array of `string`s\n */\n annotate: function (fn) {\n if (!isInjectable(fn))\n throw new Error(\"Not an injectable function: \" + fn);\n if (fn && fn.$inject)\n return fn.$inject;\n if (isArray(fn))\n return fn.slice(0, -1);\n var fnStr = fn.toString().replace(STRIP_COMMENTS, '');\n var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES);\n return result || [];\n },\n};\n//# sourceMappingURL=injector.js.map","import { isDefined } from '../common/predicates';\nimport { noop } from '../common/common';\n/** A `LocationConfig` mock that gets/sets all config from an in-memory object */\nvar MemoryLocationConfig = /** @class */ (function () {\n function MemoryLocationConfig() {\n var _this = this;\n this.dispose = noop;\n this._baseHref = '';\n this._port = 80;\n this._protocol = 'http';\n this._host = 'localhost';\n this._hashPrefix = '';\n this.port = function () { return _this._port; };\n this.protocol = function () { return _this._protocol; };\n this.host = function () { return _this._host; };\n this.baseHref = function () { return _this._baseHref; };\n this.html5Mode = function () { return false; };\n this.hashPrefix = function (newval) { return (isDefined(newval) ? (_this._hashPrefix = newval) : _this._hashPrefix); };\n }\n return MemoryLocationConfig;\n}());\nexport { MemoryLocationConfig };\n//# sourceMappingURL=memoryLocationConfig.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/** @internalapi @module vanilla */ /** */\nimport { BaseLocationServices } from './baseLocationService';\n/** A `LocationServices` that gets/sets the current location from an in-memory object */\nvar MemoryLocationService = /** @class */ (function (_super) {\n __extends(MemoryLocationService, _super);\n function MemoryLocationService(router) {\n return _super.call(this, router, true) || this;\n }\n MemoryLocationService.prototype._get = function () {\n return this._url;\n };\n MemoryLocationService.prototype._set = function (state, title, url, replace) {\n this._url = url;\n };\n return MemoryLocationService;\n}(BaseLocationServices));\nexport { MemoryLocationService };\n//# sourceMappingURL=memoryLocationService.js.map","/** @internalapi @module vanilla */ /** */\nimport { BrowserLocationConfig } from './browserLocationConfig';\nimport { HashLocationService } from './hashLocationService';\nimport { locationPluginFactory } from './utils';\nimport { PushStateLocationService } from './pushStateLocationService';\nimport { MemoryLocationService } from './memoryLocationService';\nimport { MemoryLocationConfig } from './memoryLocationConfig';\nimport { $injector } from './injector';\nimport { $q } from './q';\nimport { services } from '../common/coreservices';\nexport function servicesPlugin(router) {\n services.$injector = $injector;\n services.$q = $q;\n return { name: 'vanilla.services', $q: $q, $injector: $injector, dispose: function () { return null; } };\n}\n/** A `UIRouterPlugin` uses the browser hash to get/set the current location */\nexport var hashLocationPlugin = locationPluginFactory('vanilla.hashBangLocation', false, HashLocationService, BrowserLocationConfig);\n/** A `UIRouterPlugin` that gets/sets the current location using the browser's `location` and `history` apis */\nexport var pushStateLocationPlugin = locationPluginFactory('vanilla.pushStateLocation', true, PushStateLocationService, BrowserLocationConfig);\n/** A `UIRouterPlugin` that gets/sets the current location from an in-memory object */\nexport var memoryLocationPlugin = locationPluginFactory('vanilla.memoryLocation', false, MemoryLocationService, MemoryLocationConfig);\n//# sourceMappingURL=plugins.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { BaseLocationServices } from './baseLocationService';\nimport { root, splitHash, splitQuery, stripLastPathElement } from '../common';\n/**\n * A `LocationServices` that gets/sets the current location using the browser's `location` and `history` apis\n *\n * Uses `history.pushState` and `history.replaceState`\n */\nvar PushStateLocationService = /** @class */ (function (_super) {\n __extends(PushStateLocationService, _super);\n function PushStateLocationService(router) {\n var _this = _super.call(this, router, true) || this;\n _this._config = router.urlService.config;\n root.addEventListener('popstate', _this._listener, false);\n return _this;\n }\n /**\n * Gets the base prefix without:\n * - trailing slash\n * - trailing filename\n * - protocol and hostname\n *\n * If , this returns '/base'.\n * If , this returns '/foo/base'.\n * If , this returns '/base'.\n * If , this returns '/base'.\n * If , this returns ''.\n * If , this returns ''.\n * If , this returns ''.\n *\n * See: https://html.spec.whatwg.org/dev/semantics.html#the-base-element\n */\n PushStateLocationService.prototype._getBasePrefix = function () {\n return stripLastPathElement(this._config.baseHref());\n };\n PushStateLocationService.prototype._get = function () {\n var _a = this._location, pathname = _a.pathname, hash = _a.hash, search = _a.search;\n search = splitQuery(search)[1]; // strip ? if found\n hash = splitHash(hash)[1]; // strip # if found\n var basePrefix = this._getBasePrefix();\n var exactBaseHrefMatch = pathname === this._config.baseHref();\n var startsWithBase = pathname.substr(0, basePrefix.length) === basePrefix;\n pathname = exactBaseHrefMatch ? '/' : startsWithBase ? pathname.substring(basePrefix.length) : pathname;\n return pathname + (search ? '?' + search : '') + (hash ? '#' + hash : '');\n };\n PushStateLocationService.prototype._set = function (state, title, url, replace) {\n var basePrefix = this._getBasePrefix();\n var slash = url && url[0] !== '/' ? '/' : '';\n var fullUrl = url === '' || url === '/' ? this._config.baseHref() : basePrefix + slash + url;\n if (replace) {\n this._history.replaceState(state, title, fullUrl);\n }\n else {\n this._history.pushState(state, title, fullUrl);\n }\n };\n PushStateLocationService.prototype.dispose = function (router) {\n _super.prototype.dispose.call(this, router);\n root.removeEventListener('popstate', this._listener);\n };\n return PushStateLocationService;\n}(BaseLocationServices));\nexport { PushStateLocationService };\n//# sourceMappingURL=pushStateLocationService.js.map","/** @internalapi @module vanilla */ /** */\nimport { isArray, isObject } from '../common/index';\n/**\n * An angular1-like promise api\n *\n * This object implements four methods similar to the\n * [angular 1 promise api](https://docs.angularjs.org/api/ng/service/$q)\n *\n * UI-Router evolved from an angular 1 library to a framework agnostic library.\n * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection.\n *\n * This API provides native ES6 promise support wrapped as a $q-like API.\n * Internally, UI-Router uses this $q object to perform promise operations.\n * The `angular-ui-router` (ui-router for angular 1) uses the $q API provided by angular.\n *\n * $q-like promise api\n */\nexport var $q = {\n /** Normalizes a value as a promise */\n when: function (val) { return new Promise(function (resolve, reject) { return resolve(val); }); },\n /** Normalizes a value as a promise rejection */\n reject: function (val) {\n return new Promise(function (resolve, reject) {\n reject(val);\n });\n },\n /** @returns a deferred object, which has `resolve` and `reject` functions */\n defer: function () {\n var deferred = {};\n deferred.promise = new Promise(function (resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n });\n return deferred;\n },\n /** Like Promise.all(), but also supports object key/promise notation like $q */\n all: function (promises) {\n if (isArray(promises)) {\n return Promise.all(promises);\n }\n if (isObject(promises)) {\n // Convert promises map to promises array.\n // When each promise resolves, map it to a tuple { key: key, val: val }\n var chain = Object.keys(promises).map(function (key) { return promises[key].then(function (val) { return ({ key: key, val: val }); }); });\n // Then wait for all promises to resolve, and convert them back to an object\n return $q.all(chain).then(function (values) {\n return values.reduce(function (acc, tuple) {\n acc[tuple.key] = tuple.val;\n return acc;\n }, {});\n });\n }\n },\n};\n//# sourceMappingURL=q.js.map","/** @internalapi @module vanilla */ /** */\nimport { identity, unnestR, isArray, splitEqual, splitHash, splitQuery, } from '../common';\nexport var keyValsToObjectR = function (accum, _a) {\n var key = _a[0], val = _a[1];\n if (!accum.hasOwnProperty(key)) {\n accum[key] = val;\n }\n else if (isArray(accum[key])) {\n accum[key].push(val);\n }\n else {\n accum[key] = [accum[key], val];\n }\n return accum;\n};\nexport var getParams = function (queryString) {\n return queryString\n .split('&')\n .filter(identity)\n .map(splitEqual)\n .reduce(keyValsToObjectR, {});\n};\nexport function parseUrl(url) {\n var orEmptyString = function (x) { return x || ''; };\n var _a = splitHash(url).map(orEmptyString), beforehash = _a[0], hash = _a[1];\n var _b = splitQuery(beforehash).map(orEmptyString), path = _b[0], search = _b[1];\n return { path: path, search: search, hash: hash, url: url };\n}\nexport var buildUrl = function (loc) {\n var path = loc.path();\n var searchObject = loc.search();\n var hash = loc.hash();\n var search = Object.keys(searchObject)\n .map(function (key) {\n var param = searchObject[key];\n var vals = isArray(param) ? param : [param];\n return vals.map(function (val) { return key + '=' + val; });\n })\n .reduce(unnestR, [])\n .join('&');\n return path + (search ? '?' + search : '') + (hash ? '#' + hash : '');\n};\nexport function locationPluginFactory(name, isHtml5, serviceClass, configurationClass) {\n return function (uiRouter) {\n var service = (uiRouter.locationService = new serviceClass(uiRouter));\n var configuration = (uiRouter.locationConfig = new configurationClass(uiRouter, isHtml5));\n function dispose(router) {\n router.dispose(service);\n router.dispose(configuration);\n }\n return { name: name, service: service, configuration: configuration, dispose: dispose };\n };\n}\n//# sourceMappingURL=utils.js.map","export * from './view';\n//# sourceMappingURL=index.js.map","/** @publicapi @module view */ /** */\nimport { equals, applyPairs, removeFrom, inArray, find } from '../common/common';\nimport { curry, prop } from '../common/hof';\nimport { isString, isArray } from '../common/predicates';\nimport { trace } from '../common/trace';\n/**\n * The View service\n *\n * This service pairs existing `ui-view` components (which live in the DOM)\n * with view configs (from the state declaration objects: [[StateDeclaration.views]]).\n *\n * - After a successful Transition, the views from the newly entered states are activated via [[activateViewConfig]].\n * The views from exited states are deactivated via [[deactivateViewConfig]].\n * (See: the [[registerActivateViews]] Transition Hook)\n *\n * - As `ui-view` components pop in and out of existence, they register themselves using [[registerUIView]].\n *\n * - When the [[sync]] function is called, the registered `ui-view`(s) ([[ActiveUIView]])\n * are configured with the matching [[ViewConfig]](s)\n *\n */\nvar ViewService = /** @class */ (function () {\n /** @hidden */\n function ViewService(/** @hidden */ router) {\n var _this = this;\n this.router = router;\n /** @hidden */ this._uiViews = [];\n /** @hidden */ this._viewConfigs = [];\n /** @hidden */ this._viewConfigFactories = {};\n /** @hidden */ this._listeners = [];\n /** @internalapi */\n this._pluginapi = {\n _rootViewContext: this._rootViewContext.bind(this),\n _viewConfigFactory: this._viewConfigFactory.bind(this),\n _registeredUIView: function (id) { return find(_this._uiViews, function (view) { return _this.router.$id + \".\" + view.id === id; }); },\n _registeredUIViews: function () { return _this._uiViews; },\n _activeViewConfigs: function () { return _this._viewConfigs; },\n _onSync: function (listener) {\n _this._listeners.push(listener);\n return function () { return removeFrom(_this._listeners, listener); };\n },\n };\n }\n /**\n * Normalizes a view's name from a state.views configuration block.\n *\n * This should be used by a framework implementation to calculate the values for\n * [[_ViewDeclaration.$uiViewName]] and [[_ViewDeclaration.$uiViewContextAnchor]].\n *\n * @param context the context object (state declaration) that the view belongs to\n * @param rawViewName the name of the view, as declared in the [[StateDeclaration.views]]\n *\n * @returns the normalized uiViewName and uiViewContextAnchor that the view targets\n */\n ViewService.normalizeUIViewTarget = function (context, rawViewName) {\n if (rawViewName === void 0) { rawViewName = ''; }\n // TODO: Validate incoming view name with a regexp to allow:\n // ex: \"view.name@foo.bar\" , \"^.^.view.name\" , \"view.name@^.^\" , \"\" ,\n // \"@\" , \"$default@^\" , \"!$default.$default\" , \"!foo.bar\"\n var viewAtContext = rawViewName.split('@');\n var uiViewName = viewAtContext[0] || '$default'; // default to unnamed view\n var uiViewContextAnchor = isString(viewAtContext[1]) ? viewAtContext[1] : '^'; // default to parent context\n // Handle relative view-name sugar syntax.\n // Matches rawViewName \"^.^.^.foo.bar\" into array: [\"^.^.^.foo.bar\", \"^.^.^\", \"foo.bar\"],\n var relativeViewNameSugar = /^(\\^(?:\\.\\^)*)\\.(.*$)/.exec(uiViewName);\n if (relativeViewNameSugar) {\n // Clobbers existing contextAnchor (rawViewName validation will fix this)\n uiViewContextAnchor = relativeViewNameSugar[1]; // set anchor to \"^.^.^\"\n uiViewName = relativeViewNameSugar[2]; // set view-name to \"foo.bar\"\n }\n if (uiViewName.charAt(0) === '!') {\n uiViewName = uiViewName.substr(1);\n uiViewContextAnchor = ''; // target absolutely from root\n }\n // handle parent relative targeting \"^.^.^\"\n var relativeMatch = /^(\\^(?:\\.\\^)*)$/;\n if (relativeMatch.exec(uiViewContextAnchor)) {\n var anchorState = uiViewContextAnchor.split('.').reduce(function (anchor, x) { return anchor.parent; }, context);\n uiViewContextAnchor = anchorState.name;\n }\n else if (uiViewContextAnchor === '.') {\n uiViewContextAnchor = context.name;\n }\n return { uiViewName: uiViewName, uiViewContextAnchor: uiViewContextAnchor };\n };\n /** @hidden */\n ViewService.prototype._rootViewContext = function (context) {\n return (this._rootContext = context || this._rootContext);\n };\n /** @hidden */\n ViewService.prototype._viewConfigFactory = function (viewType, factory) {\n this._viewConfigFactories[viewType] = factory;\n };\n ViewService.prototype.createViewConfig = function (path, decl) {\n var cfgFactory = this._viewConfigFactories[decl.$type];\n if (!cfgFactory)\n throw new Error('ViewService: No view config factory registered for type ' + decl.$type);\n var cfgs = cfgFactory(path, decl);\n return isArray(cfgs) ? cfgs : [cfgs];\n };\n /**\n * Deactivates a ViewConfig.\n *\n * This function deactivates a `ViewConfig`.\n * After calling [[sync]], it will un-pair from any `ui-view` with which it is currently paired.\n *\n * @param viewConfig The ViewConfig view to deregister.\n */\n ViewService.prototype.deactivateViewConfig = function (viewConfig) {\n trace.traceViewServiceEvent('<- Removing', viewConfig);\n removeFrom(this._viewConfigs, viewConfig);\n };\n ViewService.prototype.activateViewConfig = function (viewConfig) {\n trace.traceViewServiceEvent('-> Registering', viewConfig);\n this._viewConfigs.push(viewConfig);\n };\n ViewService.prototype.sync = function () {\n var _this = this;\n var uiViewsByFqn = this._uiViews.map(function (uiv) { return [uiv.fqn, uiv]; }).reduce(applyPairs, {});\n // Return a weighted depth value for a uiView.\n // The depth is the nesting depth of ui-views (based on FQN; times 10,000)\n // plus the depth of the state that is populating the uiView\n function uiViewDepth(uiView) {\n var stateDepth = function (context) { return (context && context.parent ? stateDepth(context.parent) + 1 : 1); };\n return uiView.fqn.split('.').length * 10000 + stateDepth(uiView.creationContext);\n }\n // Return the ViewConfig's context's depth in the context tree.\n function viewConfigDepth(config) {\n var context = config.viewDecl.$context, count = 0;\n while (++count && context.parent)\n context = context.parent;\n return count;\n }\n // Given a depth function, returns a compare function which can return either ascending or descending order\n var depthCompare = curry(function (depthFn, posNeg, left, right) { return posNeg * (depthFn(left) - depthFn(right)); });\n var matchingConfigPair = function (uiView) {\n var matchingConfigs = _this._viewConfigs.filter(ViewService.matches(uiViewsByFqn, uiView));\n if (matchingConfigs.length > 1) {\n // This is OK. Child states can target a ui-view that the parent state also targets (the child wins)\n // Sort by depth and return the match from the deepest child\n // console.log(`Multiple matching view configs for ${uiView.fqn}`, matchingConfigs);\n matchingConfigs.sort(depthCompare(viewConfigDepth, -1)); // descending\n }\n return { uiView: uiView, viewConfig: matchingConfigs[0] };\n };\n var configureUIView = function (tuple) {\n // If a parent ui-view is reconfigured, it could destroy child ui-views.\n // Before configuring a child ui-view, make sure it's still in the active uiViews array.\n if (_this._uiViews.indexOf(tuple.uiView) !== -1)\n tuple.uiView.configUpdated(tuple.viewConfig);\n };\n // Sort views by FQN and state depth. Process uiviews nearest the root first.\n var uiViewTuples = this._uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair);\n var matchedViewConfigs = uiViewTuples.map(function (tuple) { return tuple.viewConfig; });\n var unmatchedConfigTuples = this._viewConfigs\n .filter(function (config) { return !inArray(matchedViewConfigs, config); })\n .map(function (viewConfig) { return ({ uiView: undefined, viewConfig: viewConfig }); });\n uiViewTuples.forEach(configureUIView);\n var allTuples = uiViewTuples.concat(unmatchedConfigTuples);\n this._listeners.forEach(function (cb) { return cb(allTuples); });\n trace.traceViewSync(allTuples);\n };\n /**\n * Registers a `ui-view` component\n *\n * When a `ui-view` component is created, it uses this method to register itself.\n * After registration the [[sync]] method is used to ensure all `ui-view` are configured with the proper [[ViewConfig]].\n *\n * Note: the `ui-view` component uses the `ViewConfig` to determine what view should be loaded inside the `ui-view`,\n * and what the view's state context is.\n *\n * Note: There is no corresponding `deregisterUIView`.\n * A `ui-view` should hang on to the return value of `registerUIView` and invoke it to deregister itself.\n *\n * @param uiView The metadata for a UIView\n * @return a de-registration function used when the view is destroyed.\n */\n ViewService.prototype.registerUIView = function (uiView) {\n trace.traceViewServiceUIViewEvent('-> Registering', uiView);\n var uiViews = this._uiViews;\n var fqnAndTypeMatches = function (uiv) { return uiv.fqn === uiView.fqn && uiv.$type === uiView.$type; };\n if (uiViews.filter(fqnAndTypeMatches).length)\n trace.traceViewServiceUIViewEvent('!!!! duplicate uiView named:', uiView);\n uiViews.push(uiView);\n this.sync();\n return function () {\n var idx = uiViews.indexOf(uiView);\n if (idx === -1) {\n trace.traceViewServiceUIViewEvent('Tried removing non-registered uiView', uiView);\n return;\n }\n trace.traceViewServiceUIViewEvent('<- Deregistering', uiView);\n removeFrom(uiViews)(uiView);\n };\n };\n /**\n * Returns the list of views currently available on the page, by fully-qualified name.\n *\n * @return {Array} Returns an array of fully-qualified view names.\n */\n ViewService.prototype.available = function () {\n return this._uiViews.map(prop('fqn'));\n };\n /**\n * Returns the list of views on the page containing loaded content.\n *\n * @return {Array} Returns an array of fully-qualified view names.\n */\n ViewService.prototype.active = function () {\n return this._uiViews.filter(prop('$config')).map(prop('name'));\n };\n /**\n * Given a ui-view and a ViewConfig, determines if they \"match\".\n *\n * A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in\n * the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of.\n *\n * A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or\n * can be a segmented ui-view path, describing a portion of a ui-view fqn.\n *\n * In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type\n *\n * If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if:\n * - the ui-view's name matches the ViewConfig's target name\n * - the ui-view's context matches the ViewConfig's anchor\n *\n * If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if:\n * - There exists a parent ui-view where:\n * - the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name\n * - the parent ui-view's context matches the ViewConfig's anchor\n * - And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn\n *\n * Example:\n *\n * DOM:\n * \n * \n * \n * \n * \n * \n * \n * \n *\n * uiViews: [\n * { fqn: \"$default\", creationContext: { name: \"\" } },\n * { fqn: \"$default.foo\", creationContext: { name: \"A\" } },\n * { fqn: \"$default.foo.$default\", creationContext: { name: \"A.B\" } }\n * { fqn: \"$default.foo.$default.bar\", creationContext: { name: \"A.B.C\" } }\n * ]\n *\n * These four view configs all match the ui-view with the fqn: \"$default.foo.$default.bar\":\n *\n * - ViewConfig1: { uiViewName: \"bar\", uiViewContextAnchor: \"A.B.C\" }\n * - ViewConfig2: { uiViewName: \"$default.bar\", uiViewContextAnchor: \"A.B\" }\n * - ViewConfig3: { uiViewName: \"foo.$default.bar\", uiViewContextAnchor: \"A\" }\n * - ViewConfig4: { uiViewName: \"$default.foo.$default.bar\", uiViewContextAnchor: \"\" }\n *\n * Using ViewConfig3 as an example, it matches the ui-view with fqn \"$default.foo.$default.bar\" because:\n * - The ViewConfig's segmented target name is: [ \"foo\", \"$default\", \"bar\" ]\n * - There exists a parent ui-view (which has fqn: \"$default.foo\") where:\n * - the parent ui-view's name \"foo\" matches the first segment \"foo\" of the ViewConfig's target name\n * - the parent ui-view's context \"A\" matches the ViewConfig's anchor context \"A\"\n * - And the remaining segments [ \"$default\", \"bar\" ].join(\".\"_ of the ViewConfig's target name match\n * the tail of the ui-view's fqn \"default.bar\"\n *\n * @internalapi\n */\n ViewService.matches = function (uiViewsByFqn, uiView) { return function (viewConfig) {\n // Don't supply an ng1 ui-view with an ng2 ViewConfig, etc\n if (uiView.$type !== viewConfig.viewDecl.$type)\n return false;\n // Split names apart from both viewConfig and uiView into segments\n var vc = viewConfig.viewDecl;\n var vcSegments = vc.$uiViewName.split('.');\n var uivSegments = uiView.fqn.split('.');\n // Check if the tails of the segment arrays match. ex, these arrays' tails match:\n // vc: [\"foo\", \"bar\"], uiv fqn: [\"$default\", \"foo\", \"bar\"]\n if (!equals(vcSegments, uivSegments.slice(0 - vcSegments.length)))\n return false;\n // Now check if the fqn ending at the first segment of the viewConfig matches the context:\n // [\"$default\", \"foo\"].join(\".\") == \"$default.foo\", does the ui-view $default.foo context match?\n var negOffset = 1 - vcSegments.length || undefined;\n var fqnToFirstSegment = uivSegments.slice(0, negOffset).join('.');\n var uiViewContext = uiViewsByFqn[fqnToFirstSegment].creationContext;\n return vc.$uiViewContextAnchor === (uiViewContext && uiViewContext.name);\n }; };\n return ViewService;\n}());\nexport { ViewService };\n//# sourceMappingURL=view.js.map","\"use strict\";!function(e,n){if(\"function\"==typeof define&&define.amd)define([\"angular\"],n);else if(\"undefined\"!=typeof exports)n(require(\"angular\"));else{var r={exports:{}};n(e.angular),e.index=r.exports}}(this,function(e){function n(e){return e&&e.__esModule?e:{\"default\":e}}function r(e,n){function r(r,a,i){function o(a){a.stopPropagation(),a.preventDefault();var o=a.dataTransfer,s=o&&o.files||null;if(!s)return n(i.filesDrop)(r,{$files:[],$event:a}),void d(a);var f=[].reduce.call(s,function(e,n){var r=t(n).then(function(e){return n.dataURL=e});return e.push(r),e},[]);e.all(f).then(function(){n(i.filesDrop)(r,{$files:s,$event:a}),d(a)})}function s(e){e.stopPropagation(),e.preventDefault(),a.addClass(\"filesDrop--dragover\")}function d(){a.removeClass(\"filesDrop--dragover\")}t=t.bind({$q:e}),a.addClass(\"filesDrop\"),a[0].addEventListener(\"dragleave\",d),a[0].addEventListener(\"dragover\",s),a[0].addEventListener(\"drop\",o),r.$on(\"$destroy\",function(){a[0].removeEventListener(\"dragleave\",d),a[0].removeEventListener(\"dragover\",s),a[0].removeEventListener(\"drop\",o)})}return{restrict:\"A\",scope:!1,link:r}}function t(e){return new this.$q(function(n,r){if(e instanceof File||e instanceof Blob){var t=new FileReader;t.onloadend=function(e){return n(e.target.result)},t.readAsDataURL(e)}else r(new Error(\"Expected image.readAsDataURL(arg1): arg1 to be File instance, but got \"+e))})}var a=n(e),i=a[\"default\"].module(\"angular-files-drop\",[]);i.directive(\"filesDrop\",[\"$q\",\"$parse\",r])});\n//# sourceMappingURL=index.js.map\n","/** @publicapi @module ng1 */ /** */\nimport * as ng_from_import from 'angular';\n/** @hidden */ var ng_from_global = angular;\n/** @hidden */ export var ng = ng_from_import && ng_from_import.module ? ng_from_import : ng_from_global;\n//# sourceMappingURL=angular.js.map","/**\n * # Angular 1 Directives\n *\n * These are the directives included in UI-Router for Angular 1.\n * These directives are used in templates to create viewports and link/navigate to states.\n *\n * @preferred @publicapi @module directives\n */ /** */\nimport { ng as angular } from '../angular';\nimport { extend, forEach, tail, isString, isObject, isArray, parse, noop, unnestR, identity, uniqR, inArray, removeFrom, } from '@uirouter/core';\n/** @hidden */\nfunction parseStateRef(ref) {\n var parsed;\n var paramsOnly = ref.match(/^\\s*({[^}]*})\\s*$/);\n if (paramsOnly)\n ref = '(' + paramsOnly[1] + ')';\n parsed = ref.replace(/\\n/g, ' ').match(/^\\s*([^(]*?)\\s*(\\((.*)\\))?\\s*$/);\n if (!parsed || parsed.length !== 4)\n throw new Error(\"Invalid state ref '\" + ref + \"'\");\n return { state: parsed[1] || null, paramExpr: parsed[3] || null };\n}\n/** @hidden */\nfunction stateContext(el) {\n var $uiView = el.parent().inheritedData('$uiView');\n var path = parse('$cfg.path')($uiView);\n return path ? tail(path).state.name : undefined;\n}\n/** @hidden */\nfunction processedDef($state, $element, def) {\n var uiState = def.uiState || $state.current.name;\n var uiStateOpts = extend(defaultOpts($element, $state), def.uiStateOpts || {});\n var href = $state.href(uiState, def.uiStateParams, uiStateOpts);\n return { uiState: uiState, uiStateParams: def.uiStateParams, uiStateOpts: uiStateOpts, href: href };\n}\n/** @hidden */\nfunction getTypeInfo(el) {\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';\n var isForm = el[0].nodeName === 'FORM';\n return {\n attr: isForm ? 'action' : isSvg ? 'xlink:href' : 'href',\n isAnchor: el.prop('tagName').toUpperCase() === 'A',\n clickable: !isForm,\n };\n}\n/** @hidden */\nfunction clickHook(el, $state, $timeout, type, getDef) {\n return function (e) {\n var button = e.which || e.button, target = getDef();\n if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) {\n // HACK: This is to allow ng-clicks to be processed before the transition is initiated:\n var transition_1 = $timeout(function () {\n if (!el.attr('disabled')) {\n $state.go(target.uiState, target.uiStateParams, target.uiStateOpts);\n }\n });\n e.preventDefault();\n // if the state has no URL, ignore one preventDefault from the directive.\n var ignorePreventDefaultCount_1 = type.isAnchor && !target.href ? 1 : 0;\n e.preventDefault = function () {\n if (ignorePreventDefaultCount_1-- <= 0)\n $timeout.cancel(transition_1);\n };\n }\n };\n}\n/** @hidden */\nfunction defaultOpts(el, $state) {\n return {\n relative: stateContext(el) || $state.$current,\n inherit: true,\n source: 'sref',\n };\n}\n/** @hidden */\nfunction bindEvents(element, scope, hookFn, uiStateOpts) {\n var events;\n if (uiStateOpts) {\n events = uiStateOpts.events;\n }\n if (!isArray(events)) {\n events = ['click'];\n }\n var on = element.on ? 'on' : 'bind';\n for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {\n var event_1 = events_1[_i];\n element[on](event_1, hookFn);\n }\n scope.$on('$destroy', function () {\n var off = element.off ? 'off' : 'unbind';\n for (var _i = 0, events_2 = events; _i < events_2.length; _i++) {\n var event_2 = events_2[_i];\n element[off](event_2, hookFn);\n }\n });\n}\n/**\n * `ui-sref`: A directive for linking to a state\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * ### Linked State\n * The attribute value of the `ui-sref` is the name of the state to link to.\n *\n * #### Example:\n * This will activate the `home` state when the link is clicked.\n * ```html\n * Home\n * ```\n *\n * ### Relative Links\n * You can also use relative state paths within `ui-sref`, just like a relative path passed to `$state.go()` ([[StateService.go]]).\n * You just need to be aware that the path is relative to the state that *created* the link.\n * This allows a state to create a relative `ui-sref` which always targets the same destination.\n *\n * #### Example:\n * Both these links are relative to the parent state, even when a child state is currently active.\n * ```html\n * child 1 state\n * child 2 state\n * ```\n *\n * This link activates the parent state.\n * ```html\n * Return\n * ```\n *\n * ### hrefs\n * If the linked state has a URL, the directive will automatically generate and\n * update the `href` attribute (using the [[StateService.href]] method).\n *\n * #### Example:\n * Assuming the `users` state has a url of `/users/`\n * ```html\n * Users\n * ```\n *\n * ### Parameter Values\n * In addition to the state name, a `ui-sref` can include parameter values which are applied when activating the state.\n * Param values can be provided in the `ui-sref` value after the state name, enclosed by parentheses.\n * The content inside the parentheses is an expression, evaluated to the parameter values.\n *\n * #### Example:\n * This example renders a list of links to users.\n * The state's `userId` parameter value comes from each user's `user.id` property.\n * ```html\n *
          • \n * {{ user.displayName }}\n *
          • \n * ```\n *\n * Note:\n * The parameter values expression is `$watch`ed for updates.\n *\n * ### Transition Options\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute.\n * Options are restricted to `location`, `inherit`, and `reload`.\n *\n * #### Example:\n * ```html\n * Home\n * ```\n *\n * ### Other DOM Events\n *\n * You can also customize which DOM events to respond to (instead of `click`) by\n * providing an `events` array in the `ui-sref-opts` attribute.\n *\n * #### Example:\n * ```html\n * \n * ```\n *\n * ### Highlighting the active link\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\n *\n * ### Examples\n * If you have the following template:\n *\n * ```html\n * Home\n * About\n * Next page\n *\n * \n * ```\n *\n * Then (assuming the current state is `contacts`) the rendered html including hrefs would be:\n *\n * ```html\n * Home\n * About\n * Next page\n *\n *
              \n *
            • \n * Joe\n *
            • \n *
            • \n * Alice\n *
            • \n *
            • \n * Bob\n *
            • \n *
            \n *\n * Home\n * ```\n *\n * ### Notes\n *\n * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses.\n * #### Example:\n * Sets the `lang` parameter to `en` and remains on the same state.\n *\n * ```html\n * English\n * ```\n *\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\n *\n * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).\n * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.\n */\nvar uiSrefDirective;\nuiSrefDirective = [\n '$uiRouter',\n '$timeout',\n function $StateRefDirective($uiRouter, $timeout) {\n var $state = $uiRouter.stateService;\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function (scope, element, attrs, uiSrefActive) {\n var type = getTypeInfo(element);\n var active = uiSrefActive[1] || uiSrefActive[0];\n var unlinkInfoFn = null;\n var hookFn;\n var rawDef = {};\n var getDef = function () { return processedDef($state, element, rawDef); };\n var ref = parseStateRef(attrs.uiSref);\n rawDef.uiState = ref.state;\n rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {};\n function update() {\n var def = getDef();\n if (unlinkInfoFn)\n unlinkInfoFn();\n if (active)\n unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\n if (def.href != null)\n attrs.$set(type.attr, def.href);\n }\n if (ref.paramExpr) {\n scope.$watch(ref.paramExpr, function (val) {\n rawDef.uiStateParams = extend({}, val);\n update();\n }, true);\n rawDef.uiStateParams = extend({}, scope.$eval(ref.paramExpr));\n }\n update();\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\n if (!type.clickable)\n return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n },\n };\n },\n];\n/**\n * `ui-state`: A fully dynamic directive for linking to a state\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * ### Linked State\n * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to.\n * **This is in contrast with `ui-sref`, which takes a state name as a string literal.**\n *\n * #### Example:\n * Create a list of links.\n * ```html\n *
          • \n * {{ link.displayName }}\n *
          • \n * ```\n *\n * ### Relative Links\n * If the expression evaluates to a relative path, it is processed like [[uiSref]].\n * You just need to be aware that the path is relative to the state that *created* the link.\n * This allows a state to create relative `ui-state` which always targets the same destination.\n *\n * ### hrefs\n * If the linked state has a URL, the directive will automatically generate and\n * update the `href` attribute (using the [[StateService.href]] method).\n *\n * ### Parameter Values\n * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state.\n * Param values should be provided using the `ui-state-params` attribute.\n * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression.\n *\n * #### Example:\n * This example renders a list of links with param values.\n * The state's `userId` parameter value comes from each user's `user.id` property.\n * ```html\n *
          • \n * {{ link.displayName }}\n *
          • \n * ```\n *\n * ### Transition Options\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute.\n * Options are restricted to `location`, `inherit`, and `reload`.\n * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression.\n *\n * #### Example:\n * ```html\n * Home\n * ```\n *\n * ### Other DOM Events\n *\n * You can also customize which DOM events to respond to (instead of `click`) by\n * providing an `events` array in the `ui-state-opts` attribute.\n *\n * #### Example:\n * ```html\n * \n * ```\n *\n * ### Highlighting the active link\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\n *\n * ### Notes\n *\n * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`.\n * However, it might be simpler to use [[uiSref]] parameter-only links.\n *\n * #### Example:\n * Sets the `lang` parameter to `en` and remains on the same state.\n *\n * ```html\n * English\n * ```\n *\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\n * ```\n */\nvar uiStateDirective;\nuiStateDirective = [\n '$uiRouter',\n '$timeout',\n function $StateRefDynamicDirective($uiRouter, $timeout) {\n var $state = $uiRouter.stateService;\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function (scope, element, attrs, uiSrefActive) {\n var type = getTypeInfo(element);\n var active = uiSrefActive[1] || uiSrefActive[0];\n var unlinkInfoFn = null;\n var hookFn;\n var rawDef = {};\n var getDef = function () { return processedDef($state, element, rawDef); };\n var inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts'];\n var watchDeregFns = inputAttrs.reduce(function (acc, attr) { return ((acc[attr] = noop), acc); }, {});\n function update() {\n var def = getDef();\n if (unlinkInfoFn)\n unlinkInfoFn();\n if (active)\n unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\n if (def.href != null)\n attrs.$set(type.attr, def.href);\n }\n inputAttrs.forEach(function (field) {\n rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null;\n attrs.$observe(field, function (expr) {\n watchDeregFns[field]();\n watchDeregFns[field] = scope.$watch(expr, function (newval) {\n rawDef[field] = newval;\n update();\n }, true);\n });\n });\n update();\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\n if (!type.clickable)\n return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n },\n };\n },\n];\n/**\n * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active\n *\n * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the\n * related directive's state is active (and remove them when it is inactive).\n *\n * The primary use-case is to highlight the active link in navigation menus,\n * distinguishing it from the inactive menu items.\n *\n * ### Linking to a `ui-sref` or `ui-state`\n * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element.\n * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**.\n *\n * ### Matching\n *\n * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**.\n * This is a \"fuzzy match\" which uses [[StateService.includes]].\n *\n * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active).\n * This is an \"exact match\" which uses [[StateService.is]].\n *\n * ### Parameter values\n * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.\n * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted.\n *\n * #### Example:\n * ```html\n *
          • \n * {{ user.lastName }}\n *
          • \n * ```\n *\n * ### Examples\n *\n * Given the following template:\n * #### Example:\n * ```html\n * \n * ```\n *\n * When the app state is `app.user` (or any child state),\n * and contains the state parameter \"user\" with value \"bilbobaggins\",\n * the resulting HTML will appear as (note the 'active' class):\n *\n * ```html\n * \n * ```\n *\n * ### Glob mode\n *\n * It is possible to pass `ui-sref-active` an expression that evaluates to an object.\n * The objects keys represent active class names and values represent the respective state names/globs.\n * `ui-sref-active` will match if the current active state **includes** any of\n * the specified state names/globs, even the abstract ones.\n *\n * #### Example:\n * Given the following template, with \"admin\" being an abstract state:\n * ```html\n *
            \n * Roles\n *
            \n * ```\n *\n * Arrays are also supported as values in the `ngClass`-like interface.\n * This allows multiple states to add `active` class.\n *\n * #### Example:\n * Given the following template, with \"admin.roles\" being the current state, the class will be added too:\n * ```html\n *
            \n * Roles\n *
            \n * ```\n *\n * When the current state is \"admin.roles\" the \"active\" class will be applied to both the `
            ` and `` elements.\n * It is important to note that the state names/globs passed to `ui-sref-active` override any state provided by a linked `ui-sref`.\n *\n * ### Notes:\n *\n * - The class name is interpolated **once** during the directives link time (any further changes to the\n * interpolated value are ignored).\n *\n * - Multiple classes may be specified in a space-separated format: `ui-sref-active='class1 class2 class3'`\n */\nvar uiSrefActiveDirective;\nuiSrefActiveDirective = [\n '$state',\n '$stateParams',\n '$interpolate',\n '$uiRouter',\n function $StateRefActiveDirective($state, $stateParams, $interpolate, $uiRouter) {\n return {\n restrict: 'A',\n controller: [\n '$scope',\n '$element',\n '$attrs',\n function ($scope, $element, $attrs) {\n var states = [];\n var activeEqClass;\n var uiSrefActive;\n // There probably isn't much point in $observing this\n // uiSrefActive and uiSrefActiveEq share the same directive object with some\n // slight difference in logic routing\n activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope);\n try {\n uiSrefActive = $scope.$eval($attrs.uiSrefActive);\n }\n catch (e) {\n // Do nothing. uiSrefActive is not a valid expression.\n // Fall back to using $interpolate below\n }\n uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope);\n setStatesFromDefinitionObject(uiSrefActive);\n // Allow uiSref to communicate with uiSrefActive[Equals]\n this.$$addStateInfo = function (newState, newParams) {\n // we already got an explicit state provided by ui-sref-active, so we\n // shadow the one that comes from ui-sref\n if (isObject(uiSrefActive) && states.length > 0) {\n return;\n }\n var deregister = addState(newState, newParams, uiSrefActive);\n update();\n return deregister;\n };\n function updateAfterTransition(trans) {\n trans.promise.then(update, noop);\n }\n $scope.$on('$destroy', setupEventListeners());\n if ($uiRouter.globals.transition) {\n updateAfterTransition($uiRouter.globals.transition);\n }\n function setupEventListeners() {\n var deregisterStatesChangedListener = $uiRouter.stateRegistry.onStatesChanged(handleStatesChanged);\n var deregisterOnStartListener = $uiRouter.transitionService.onStart({}, updateAfterTransition);\n var deregisterStateChangeSuccessListener = $scope.$on('$stateChangeSuccess', update);\n return function cleanUp() {\n deregisterStatesChangedListener();\n deregisterOnStartListener();\n deregisterStateChangeSuccessListener();\n };\n }\n function handleStatesChanged() {\n setStatesFromDefinitionObject(uiSrefActive);\n }\n function setStatesFromDefinitionObject(statesDefinition) {\n if (isObject(statesDefinition)) {\n states = [];\n forEach(statesDefinition, function (stateOrName, activeClass) {\n // Helper function to abstract adding state.\n var addStateForClass = function (stateOrName, activeClass) {\n var ref = parseStateRef(stateOrName);\n addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);\n };\n if (isString(stateOrName)) {\n // If state is string, just add it.\n addStateForClass(stateOrName, activeClass);\n }\n else if (isArray(stateOrName)) {\n // If state is an array, iterate over it and add each array item individually.\n forEach(stateOrName, function (stateOrName) {\n addStateForClass(stateOrName, activeClass);\n });\n }\n });\n }\n }\n function addState(stateName, stateParams, activeClass) {\n var state = $state.get(stateName, stateContext($element));\n var stateInfo = {\n state: state || { name: stateName },\n params: stateParams,\n activeClass: activeClass,\n };\n states.push(stateInfo);\n return function removeState() {\n removeFrom(states)(stateInfo);\n };\n }\n // Update route state\n function update() {\n var splitClasses = function (str) { return str.split(/\\s/).filter(identity); };\n var getClasses = function (stateList) {\n return stateList\n .map(function (x) { return x.activeClass; })\n .map(splitClasses)\n .reduce(unnestR, []);\n };\n var allClasses = getClasses(states)\n .concat(splitClasses(activeEqClass))\n .reduce(uniqR, []);\n var fuzzyClasses = getClasses(states.filter(function (x) { return $state.includes(x.state.name, x.params); }));\n var exactlyMatchesAny = !!states.filter(function (x) { return $state.is(x.state.name, x.params); }).length;\n var exactClasses = exactlyMatchesAny ? splitClasses(activeEqClass) : [];\n var addClasses = fuzzyClasses.concat(exactClasses).reduce(uniqR, []);\n var removeClasses = allClasses.filter(function (cls) { return !inArray(addClasses, cls); });\n $scope.$evalAsync(function () {\n addClasses.forEach(function (className) { return $element.addClass(className); });\n removeClasses.forEach(function (className) { return $element.removeClass(className); });\n });\n }\n update();\n },\n ],\n };\n },\n];\nangular\n .module('ui.router.state')\n .directive('uiSref', uiSrefDirective)\n .directive('uiSrefActive', uiSrefActiveDirective)\n .directive('uiSrefActiveEq', uiSrefActiveDirective)\n .directive('uiState', uiStateDirective);\n//# sourceMappingURL=stateDirectives.js.map","/** @publicapi @module directives */ /** */\nimport { extend, filter, isDefined, isFunction, isString, kebobString, noop, parse, ResolveContext, tail, trace, unnestR, } from '@uirouter/core';\nimport { ng as angular } from '../angular';\nimport { getLocals } from '../services';\nimport { Ng1ViewConfig } from '../statebuilders/views';\n/**\n * `ui-view`: A viewport directive which is filled in by a view from the active state.\n *\n * ### Attributes\n *\n * - `name`: (Optional) A view name.\n * The name should be unique amongst the other views in the same state.\n * You can have views of the same name that live in different states.\n * The ui-view can be targeted in a View using the name ([[Ng1StateDeclaration.views]]).\n *\n * - `autoscroll`: an expression. When it evaluates to true, the `ui-view` will be scrolled into view when it is activated.\n * Uses [[$uiViewScroll]] to do the scrolling.\n *\n * - `onload`: Expression to evaluate whenever the view updates.\n *\n * #### Example:\n * A view can be unnamed or named.\n * ```html\n * \n *
            \n *\n * \n *
            \n *\n * \n * \n * ```\n *\n * You can only have one unnamed view within any template (or root html). If you are only using a\n * single view and it is unnamed then you can populate it like so:\n *\n * ```html\n *
            \n * $stateProvider.state(\"home\", {\n * template: \"

            HELLO!

            \"\n * })\n * ```\n *\n * The above is a convenient shortcut equivalent to specifying your view explicitly with the\n * [[Ng1StateDeclaration.views]] config property, by name, in this case an empty name:\n *\n * ```js\n * $stateProvider.state(\"home\", {\n * views: {\n * \"\": {\n * template: \"

            HELLO!

            \"\n * }\n * }\n * })\n * ```\n *\n * But typically you'll only use the views property if you name your view or have more than one view\n * in the same template. There's not really a compelling reason to name a view if its the only one,\n * but you could if you wanted, like so:\n *\n * ```html\n *
            \n * ```\n *\n * ```js\n * $stateProvider.state(\"home\", {\n * views: {\n * \"main\": {\n * template: \"

            HELLO!

            \"\n * }\n * }\n * })\n * ```\n *\n * Really though, you'll use views to set up multiple views:\n *\n * ```html\n *
            \n *
            \n *
            \n * ```\n *\n * ```js\n * $stateProvider.state(\"home\", {\n * views: {\n * \"\": {\n * template: \"

            HELLO!

            \"\n * },\n * \"chart\": {\n * template: \"\"\n * },\n * \"data\": {\n * template: \"\"\n * }\n * }\n * })\n * ```\n *\n * #### Examples for `autoscroll`:\n * ```html\n * \n * \n *\n * \n * \n * \n * \n * ```\n *\n * Resolve data:\n *\n * The resolved data from the state's `resolve` block is placed on the scope as `$resolve` (this\n * can be customized using [[Ng1ViewDeclaration.resolveAs]]). This can be then accessed from the template.\n *\n * Note that when `controllerAs` is being used, `$resolve` is set on the controller instance *after* the\n * controller is instantiated. The `$onInit()` hook can be used to perform initialization code which\n * depends on `$resolve` data.\n *\n * #### Example:\n * ```js\n * $stateProvider.state('home', {\n * template: '',\n * resolve: {\n * user: function(UserService) { return UserService.fetchUser(); }\n * }\n * });\n * ```\n */\nexport var uiView;\nuiView = [\n '$view',\n '$animate',\n '$uiViewScroll',\n '$interpolate',\n '$q',\n function $ViewDirective($view, $animate, $uiViewScroll, $interpolate, $q) {\n function getRenderer(attrs, scope) {\n return {\n enter: function (element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n }\n else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function (element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n }\n else {\n $animate.leave(element, cb);\n }\n },\n };\n }\n function configsEqual(config1, config2) {\n return config1 === config2;\n }\n var rootData = {\n $cfg: { viewDecl: { $context: $view._pluginapi._rootViewContext() } },\n $uiView: {},\n };\n var directive = {\n count: 0,\n restrict: 'ECA',\n terminal: true,\n priority: 400,\n transclude: 'element',\n compile: function (tElement, tAttrs, $transclude) {\n return function (scope, $element, attrs) {\n var onloadExp = attrs['onload'] || '', autoScrollExp = attrs['autoscroll'], renderer = getRenderer(attrs, scope), inherited = $element.inheritedData('$uiView') || rootData, name = $interpolate(attrs['uiView'] || attrs['name'] || '')(scope) || '$default';\n var previousEl, currentEl, currentScope, viewConfig, unregister;\n var activeUIView = {\n $type: 'ng1',\n id: directive.count++,\n name: name,\n fqn: inherited.$uiView.fqn ? inherited.$uiView.fqn + '.' + name : name,\n config: null,\n configUpdated: configUpdatedCallback,\n get creationContext() {\n // The context in which this ui-view \"tag\" was created\n var fromParentTagConfig = parse('$cfg.viewDecl.$context')(inherited);\n // Allow \n // See https://github.com/angular-ui/ui-router/issues/3355\n var fromParentTag = parse('$uiView.creationContext')(inherited);\n return fromParentTagConfig || fromParentTag;\n },\n };\n trace.traceUIViewEvent('Linking', activeUIView);\n function configUpdatedCallback(config) {\n if (config && !(config instanceof Ng1ViewConfig))\n return;\n if (configsEqual(viewConfig, config))\n return;\n trace.traceUIViewConfigUpdated(activeUIView, config && config.viewDecl && config.viewDecl.$context);\n viewConfig = config;\n updateView(config);\n }\n $element.data('$uiView', { $uiView: activeUIView });\n updateView();\n unregister = $view.registerUIView(activeUIView);\n scope.$on('$destroy', function () {\n trace.traceUIViewEvent('Destroying/Unregistering', activeUIView);\n unregister();\n });\n function cleanupLastView() {\n if (previousEl) {\n trace.traceUIViewEvent('Removing (previous) el', previousEl.data('$uiView'));\n previousEl.remove();\n previousEl = null;\n }\n if (currentScope) {\n trace.traceUIViewEvent('Destroying scope', activeUIView);\n currentScope.$destroy();\n currentScope = null;\n }\n if (currentEl) {\n var _viewData_1 = currentEl.data('$uiViewAnim');\n trace.traceUIViewEvent('Animate out', _viewData_1);\n renderer.leave(currentEl, function () {\n _viewData_1.$$animLeave.resolve();\n previousEl = null;\n });\n previousEl = currentEl;\n currentEl = null;\n }\n }\n function updateView(config) {\n var newScope = scope.$new();\n var animEnter = $q.defer(), animLeave = $q.defer();\n var $uiViewData = {\n $cfg: config,\n $uiView: activeUIView,\n };\n var $uiViewAnim = {\n $animEnter: animEnter.promise,\n $animLeave: animLeave.promise,\n $$animLeave: animLeave,\n };\n /**\n * @ngdoc event\n * @name ui.router.state.directive:ui-view#$viewContentLoading\n * @eventOf ui.router.state.directive:ui-view\n * @eventType emits on ui-view directive scope\n * @description\n *\n * Fired once the view **begins loading**, *before* the DOM is rendered.\n *\n * @param {Object} event Event object.\n * @param {string} viewName Name of the view.\n */\n newScope.$emit('$viewContentLoading', name);\n var cloned = $transclude(newScope, function (clone) {\n clone.data('$uiViewAnim', $uiViewAnim);\n clone.data('$uiView', $uiViewData);\n renderer.enter(clone, $element, function onUIViewEnter() {\n animEnter.resolve();\n if (currentScope)\n currentScope.$emit('$viewContentAnimationEnded');\n if ((isDefined(autoScrollExp) && !autoScrollExp) || scope.$eval(autoScrollExp)) {\n $uiViewScroll(clone);\n }\n });\n cleanupLastView();\n });\n currentEl = cloned;\n currentScope = newScope;\n /**\n * @ngdoc event\n * @name ui.router.state.directive:ui-view#$viewContentLoaded\n * @eventOf ui.router.state.directive:ui-view\n * @eventType emits on ui-view directive scope\n * @description *\n * Fired once the view is **loaded**, *after* the DOM is rendered.\n *\n * @param {Object} event Event object.\n */\n currentScope.$emit('$viewContentLoaded', config || viewConfig);\n currentScope.$eval(onloadExp);\n }\n };\n },\n };\n return directive;\n },\n];\n$ViewDirectiveFill.$inject = ['$compile', '$controller', '$transitions', '$view', '$q', '$timeout'];\n/** @hidden */\nfunction $ViewDirectiveFill($compile, $controller, $transitions, $view, $q, $timeout) {\n var getControllerAs = parse('viewDecl.controllerAs');\n var getResolveAs = parse('viewDecl.resolveAs');\n return {\n restrict: 'ECA',\n priority: -400,\n compile: function (tElement) {\n var initial = tElement.html();\n tElement.empty();\n return function (scope, $element) {\n var data = $element.data('$uiView');\n if (!data) {\n $element.html(initial);\n $compile($element.contents())(scope);\n return;\n }\n var cfg = data.$cfg || { viewDecl: {}, getTemplate: noop };\n var resolveCtx = cfg.path && new ResolveContext(cfg.path);\n $element.html(cfg.getTemplate($element, resolveCtx) || initial);\n trace.traceUIViewFill(data.$uiView, $element.html());\n var link = $compile($element.contents());\n var controller = cfg.controller;\n var controllerAs = getControllerAs(cfg);\n var resolveAs = getResolveAs(cfg);\n var locals = resolveCtx && getLocals(resolveCtx);\n scope[resolveAs] = locals;\n if (controller) {\n var controllerInstance = ($controller(controller, extend({}, locals, { $scope: scope, $element: $element })));\n if (controllerAs) {\n scope[controllerAs] = controllerInstance;\n scope[controllerAs][resolveAs] = locals;\n }\n // TODO: Use $view service as a central point for registering component-level hooks\n // Then, when a component is created, tell the $view service, so it can invoke hooks\n // $view.componentLoaded(controllerInstance, { $scope: scope, $element: $element });\n // scope.$on('$destroy', () => $view.componentUnloaded(controllerInstance, { $scope: scope, $element: $element }));\n $element.data('$ngControllerController', controllerInstance);\n $element.children().data('$ngControllerController', controllerInstance);\n registerControllerCallbacks($q, $transitions, controllerInstance, scope, cfg);\n }\n // Wait for the component to appear in the DOM\n if (isString(cfg.component)) {\n var kebobName = kebobString(cfg.component);\n var tagRegexp_1 = new RegExp(\"^(x-|data-)?\" + kebobName + \"$\", 'i');\n var getComponentController = function () {\n var directiveEl = [].slice\n .call($element[0].children)\n .filter(function (el) { return el && el.tagName && tagRegexp_1.exec(el.tagName); });\n return directiveEl && angular.element(directiveEl).data(\"$\" + cfg.component + \"Controller\");\n };\n var deregisterWatch_1 = scope.$watch(getComponentController, function (ctrlInstance) {\n if (!ctrlInstance)\n return;\n registerControllerCallbacks($q, $transitions, ctrlInstance, scope, cfg);\n deregisterWatch_1();\n });\n }\n link(scope);\n };\n },\n };\n}\n/** @hidden */\nvar hasComponentImpl = typeof angular.module('ui.router')['component'] === 'function';\n/** @hidden incrementing id */\nvar _uiCanExitId = 0;\n/** @hidden TODO: move these callbacks to $view and/or `/hooks/components.ts` or something */\nfunction registerControllerCallbacks($q, $transitions, controllerInstance, $scope, cfg) {\n // Call $onInit() ASAP\n if (isFunction(controllerInstance.$onInit) && !((cfg.viewDecl.component || cfg.viewDecl.componentProvider) && hasComponentImpl)) {\n controllerInstance.$onInit();\n }\n var viewState = tail(cfg.path).state.self;\n var hookOptions = { bind: controllerInstance };\n // Add component-level hook for onUiParamsChanged\n if (isFunction(controllerInstance.uiOnParamsChanged)) {\n var resolveContext = new ResolveContext(cfg.path);\n var viewCreationTrans_1 = resolveContext.getResolvable('$transition$').data;\n // Fire callback on any successful transition\n var paramsUpdated = function ($transition$) {\n // Exit early if the $transition$ is the same as the view was created within.\n // Exit early if the $transition$ will exit the state the view is for.\n if ($transition$ === viewCreationTrans_1 || $transition$.exiting().indexOf(viewState) !== -1)\n return;\n var toParams = $transition$.params('to');\n var fromParams = $transition$.params('from');\n var getNodeSchema = function (node) { return node.paramSchema; };\n var toSchema = $transition$\n .treeChanges('to')\n .map(getNodeSchema)\n .reduce(unnestR, []);\n var fromSchema = $transition$\n .treeChanges('from')\n .map(getNodeSchema)\n .reduce(unnestR, []);\n // Find the to params that have different values than the from params\n var changedToParams = toSchema.filter(function (param) {\n var idx = fromSchema.indexOf(param);\n return idx === -1 || !fromSchema[idx].type.equals(toParams[param.id], fromParams[param.id]);\n });\n // Only trigger callback if a to param has changed or is new\n if (changedToParams.length) {\n var changedKeys_1 = changedToParams.map(function (x) { return x.id; });\n // Filter the params to only changed/new to params. `$transition$.params()` may be used to get all params.\n var newValues = filter(toParams, function (val, key) { return changedKeys_1.indexOf(key) !== -1; });\n controllerInstance.uiOnParamsChanged(newValues, $transition$);\n }\n };\n $scope.$on('$destroy', $transitions.onSuccess({}, paramsUpdated, hookOptions));\n }\n // Add component-level hook for uiCanExit\n if (isFunction(controllerInstance.uiCanExit)) {\n var id_1 = _uiCanExitId++;\n var cacheProp_1 = '_uiCanExitIds';\n // Returns true if a redirect transition already answered truthy\n var prevTruthyAnswer_1 = function (trans) {\n return !!trans && ((trans[cacheProp_1] && trans[cacheProp_1][id_1] === true) || prevTruthyAnswer_1(trans.redirectedFrom()));\n };\n // If a user answered yes, but the transition was later redirected, don't also ask for the new redirect transition\n var wrappedHook = function (trans) {\n var promise;\n var ids = (trans[cacheProp_1] = trans[cacheProp_1] || {});\n if (!prevTruthyAnswer_1(trans)) {\n promise = $q.when(controllerInstance.uiCanExit(trans));\n promise.then(function (val) { return (ids[id_1] = val !== false); });\n }\n return promise;\n };\n var criteria = { exiting: viewState.name };\n $scope.$on('$destroy', $transitions.onBefore(criteria, wrappedHook, hookOptions));\n }\n}\nangular.module('ui.router.state').directive('uiView', uiView);\nangular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);\n//# sourceMappingURL=viewDirective.js.map","export * from './services';\nexport * from './statebuilders/views';\nexport * from './stateProvider';\nexport * from './urlRouterProvider';\nimport './injectables';\nimport './directives/stateDirectives';\nimport './stateFilters';\nimport './directives/viewDirective';\nimport './viewScroll';\nexport default 'ui.router';\nimport * as core from '@uirouter/core';\nexport { core };\nexport * from '@uirouter/core';\n//# sourceMappingURL=index.js.map","/**\n * The current (or pending) State Parameters\n *\n * An injectable global **Service Object** which holds the state parameters for the latest **SUCCESSFUL** transition.\n *\n * The values are not updated until *after* a `Transition` successfully completes.\n *\n * **Also:** an injectable **Per-Transition Object** object which holds the pending state parameters for the pending `Transition` currently running.\n *\n * ### Deprecation warning:\n *\n * The value injected for `$stateParams` is different depending on where it is injected.\n *\n * - When injected into an angular service, the object injected is the global **Service Object** with the parameter values for the latest successful `Transition`.\n * - When injected into transition hooks, resolves, or view controllers, the object is the **Per-Transition Object** with the parameter values for the running `Transition`.\n *\n * Because of these confusing details, this service is deprecated.\n *\n * ### Instead of using the global `$stateParams` service object,\n * inject [[$uiRouterGlobals]] and use [[UIRouterGlobals.params]]\n *\n * ```js\n * MyService.$inject = ['$uiRouterGlobals'];\n * function MyService($uiRouterGlobals) {\n * return {\n * paramValues: function () {\n * return $uiRouterGlobals.params;\n * }\n * }\n * }\n * ```\n *\n * ### Instead of using the per-transition `$stateParams` object,\n * inject the current `Transition` (as [[$transition$]]) and use [[Transition.params]]\n *\n * ```js\n * MyController.$inject = ['$transition$'];\n * function MyController($transition$) {\n * var username = $transition$.params().username;\n * // .. do something with username\n * }\n * ```\n *\n * ---\n *\n * This object can be injected into other services.\n *\n * #### Deprecated Example:\n * ```js\n * SomeService.$inject = ['$http', '$stateParams'];\n * function SomeService($http, $stateParams) {\n * return {\n * getUser: function() {\n * return $http.get('/api/users/' + $stateParams.username);\n * }\n * }\n * };\n * angular.service('SomeService', SomeService);\n * ```\n * @deprecated\n */\nvar $stateParams;\n/**\n * Global UI-Router variables\n *\n * The router global state as a **Service Object** (injectable during runtime).\n *\n * This object contains globals such as the current state and current parameter values.\n */\nvar $uiRouterGlobals;\n/**\n * The UI-Router instance\n *\n * The [[UIRouter]] singleton (the router instance) as a **Service Object** (injectable during runtime).\n *\n * This object is the UI-Router singleton instance, created by angular dependency injection during application bootstrap.\n * It has references to the other UI-Router services\n *\n * #### Note: This object is also exposed as [[$uiRouterProvider]] for injection during angular config time.\n */\nvar $uiRouter;\n/**\n * The UI-Router instance\n *\n * The [[UIRouter]] singleton (the router instance) as a **Provider Object** (injectable during config phase).\n *\n * This object is the UI-Router singleton instance, created by angular dependency injection during application bootstrap.\n * It has references to the other UI-Router services\n *\n * #### Note: This object is also exposed as [[$uiRouter]] for injection during runtime.\n */\nvar $uiRouterProvider;\n/**\n * Transition debug/tracing\n *\n * The [[Trace]] singleton as a **Service Object** (injectable during runtime).\n *\n * Enables or disables Transition tracing which can help to debug issues.\n */\nvar $trace;\n/**\n * The Transition Service\n *\n * The [[TransitionService]] singleton as a **Service Object** (injectable during runtime).\n *\n * This angular service exposes the [[TransitionService]] singleton, which is primarily\n * used to register global transition hooks.\n *\n * #### Note: This object is also exposed as [[$transitionsProvider]] for injection during the config phase.\n */\nvar $transitions;\n/**\n * The Transition Service\n *\n * The [[TransitionService]] singleton as a **Provider Object** (injectable during config phase)\n *\n * This angular service exposes the [[TransitionService]] singleton, which is primarily\n * used to register global transition hooks.\n *\n * #### Note: This object is also exposed as [[$transitions]] for injection during runtime.\n */\nvar $transitionsProvider;\n/**\n * The current [[Transition]] object\n *\n * The current [[Transition]] object as a **Per-Transition Object** (injectable into Resolve, Hooks, Controllers)\n *\n * This object returns information about the current transition, including:\n *\n * - To/from states\n * - To/from parameters\n * - Transition options\n * - States being entered, exited, and retained\n * - Resolve data\n * - A Promise for the transition\n * - Any transition failure information\n * - An injector for both Service and Per-Transition Objects\n */\nvar $transition$;\n/**\n * The State Service\n *\n * The [[StateService]] singleton as a **Service Object** (injectable during runtime).\n *\n * This service used to manage and query information on registered states.\n * It exposes state related APIs including:\n *\n * - Start a [[Transition]]\n * - Imperatively lazy load states\n * - Check if a state is currently active\n * - Look up states by name\n * - Build URLs for a state+parameters\n * - Configure the global Transition error handler\n *\n * This angular service exposes the [[StateService]] singleton.\n */\nvar $state;\n/**\n * The State Registry\n *\n * The [[StateRegistry]] singleton as a **Service Object** (injectable during runtime).\n *\n * This service is used to register/deregister states.\n * It has state registration related APIs including:\n *\n * - Register/deregister states\n * - Listen for state registration/deregistration\n * - Get states by name\n * - Add state decorators (to customize the state creation process)\n *\n * #### Note: This object is also exposed as [[$stateRegistryProvider]] for injection during the config phase.\n */\nvar $stateRegistry;\n/**\n * The State Registry\n *\n * The [[StateRegistry]] singleton as a **Provider Object** (injectable during config time).\n *\n * This service is used to register/deregister states.\n * It has state registration related APIs including:\n *\n * - Register/deregister states\n * - Listen for state registration/deregistration\n * - Get states by name\n * - Add state decorators (to customize the state creation process)\n *\n * #### Note: This object is also exposed as [[$stateRegistry]] for injection during runtime.\n */\nvar $stateRegistryProvider;\n/**\n * The View Scroll provider\n *\n * The [[UIViewScrollProvider]] as a **Provider Object** (injectable during config time).\n *\n * This angular service exposes the [[UIViewScrollProvider]] singleton and is\n * used to disable UI-Router's scroll behavior.\n */\nvar $uiViewScrollProvider;\n/**\n * The View Scroll function\n *\n * The View Scroll function as a **Service Object** (injectable during runtime).\n *\n * This is a function that scrolls an element into view.\n * The element is scrolled after a `$timeout` so the DOM has time to refresh.\n *\n * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,\n * this can be enabled by calling [[UIViewScrollProvider.useAnchorScroll]].\n *\n * Note: this function is used by the [[directives.uiView]] when the `autoscroll` expression evaluates to true.\n */\nvar $uiViewScroll;\n/**\n * The StateProvider\n *\n * An angular1-only [[StateProvider]] as a **Provider Object** (injectable during config time).\n *\n * This angular service exposes the [[StateProvider]] singleton.\n *\n * The `StateProvider` is primarily used to register states or add custom state decorators.\n *\n * ##### Note: This provider is a ng1 vestige.\n * It is a passthrough to [[$stateRegistry]] and [[$state]].\n */\nvar $stateProvider;\n/**\n * The URL Service Provider\n *\n * The [[UrlService]] singleton as a **Provider Object** (injectable during the angular config phase).\n *\n * A service used to configure and interact with the URL.\n * It has URL related APIs including:\n *\n * - register custom Parameter types `UrlService.config.type` ([[UrlConfigApi.type]])\n * - add URL rules: `UrlService.rules.when` ([[UrlRulesApi.when]])\n * - configure behavior when no url matches: `UrlService.rules.otherwise` ([[UrlRulesApi.otherwise]])\n * - delay initial URL synchronization [[UrlService.deferIntercept]].\n * - get or set the current url: [[UrlService.url]]\n *\n * ##### Note: This service can also be injected during runtime as [[$urlService]].\n */\nvar $urlServiceProvider;\n/**\n * The URL Service\n *\n * The [[UrlService]] singleton as a **Service Object** (injectable during runtime).\n *\n * Note: This service can also be injected during the config phase as [[$urlServiceProvider]].\n *\n * Used to configure the URL.\n * It has URL related APIs including:\n *\n * - register custom Parameter types `UrlService.config.type` ([[UrlConfigApi.type]])\n * - add URL rules: `UrlService.rules.when` ([[UrlRulesApi.when]])\n * - configure behavior when no url matches: `UrlService.rules.otherwise` ([[UrlRulesApi.otherwise]])\n * - delay initial URL synchronization [[UrlService.deferIntercept]].\n * - get or set the current url: [[UrlService.url]]\n *\n * ##### Note: This service can also be injected during the config phase as [[$urlServiceProvider]].\n */\nvar $urlService;\n/**\n * The URL Router Provider\n *\n * ### Deprecation warning: This object is now considered internal. Use [[$urlServiceProvider]] instead.\n *\n * The [[UrlRouter]] singleton as a **Provider Object** (injectable during config time).\n *\n * #### Note: This object is also exposed as [[$urlRouter]] for injection during runtime.\n *\n * @deprecated\n */\nvar $urlRouterProvider;\n/**\n * The Url Router\n *\n * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead.\n *\n * The [[UrlRouter]] singleton as a **Service Object** (injectable during runtime).\n *\n * #### Note: This object is also exposed as [[$urlRouterProvider]] for injection during angular config time.\n *\n * @deprecated\n */\nvar $urlRouter;\n/**\n * The URL Matcher Factory\n *\n * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead.\n *\n * The [[UrlMatcherFactory]] singleton as a **Service Object** (injectable during runtime).\n *\n * This service is used to set url mapping options, define custom parameter types, and create [[UrlMatcher]] objects.\n *\n * #### Note: This object is also exposed as [[$urlMatcherFactoryProvider]] for injection during angular config time.\n *\n * @deprecated\n */\nvar $urlMatcherFactory;\n/**\n * The URL Matcher Factory\n *\n * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead.\n *\n * The [[UrlMatcherFactory]] singleton as a **Provider Object** (injectable during config time).\n *\n * This service is used to set url mapping options, define custom parameter types, and create [[UrlMatcher]] objects.\n *\n * #### Note: This object is also exposed as [[$urlMatcherFactory]] for injection during runtime.\n *\n * @deprecated\n */\nvar $urlMatcherFactoryProvider;\n//# sourceMappingURL=injectables.js.map","/** @publicapi @module ng1 */ /** */\nimport { isDefined } from '@uirouter/core';\nimport { val, createProxyFunctions, removeFrom, isObject } from '@uirouter/core';\n/**\n * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service\n * @internalapi\n */\nvar Ng1LocationServices = /** @class */ (function () {\n function Ng1LocationServices($locationProvider) {\n // .onChange() registry\n this._urlListeners = [];\n this.$locationProvider = $locationProvider;\n var _lp = val($locationProvider);\n createProxyFunctions(_lp, this, _lp, ['hashPrefix']);\n }\n /**\n * Applys ng1-specific path parameter encoding\n *\n * The Angular 1 `$location` service is a bit weird.\n * It doesn't allow slashes to be encoded/decoded bi-directionally.\n *\n * See the writeup at https://github.com/angular-ui/ui-router/issues/2598\n *\n * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F\n *\n * @param router\n */\n Ng1LocationServices.monkeyPatchPathParameterType = function (router) {\n var pathType = router.urlMatcherFactory.type('path');\n pathType.encode = function (x) {\n return x != null ? x.toString().replace(/(~|\\/)/g, function (m) { return ({ '~': '~~', '/': '~2F' }[m]); }) : x;\n };\n pathType.decode = function (x) {\n return x != null ? x.toString().replace(/(~~|~2F)/g, function (m) { return ({ '~~': '~', '~2F': '/' }[m]); }) : x;\n };\n };\n Ng1LocationServices.prototype.dispose = function () { };\n Ng1LocationServices.prototype.onChange = function (callback) {\n var _this = this;\n this._urlListeners.push(callback);\n return function () { return removeFrom(_this._urlListeners)(callback); };\n };\n Ng1LocationServices.prototype.html5Mode = function () {\n var html5Mode = this.$locationProvider.html5Mode();\n html5Mode = isObject(html5Mode) ? html5Mode.enabled : html5Mode;\n return html5Mode && this.$sniffer.history;\n };\n Ng1LocationServices.prototype.baseHref = function () {\n return this._baseHref || (this._baseHref = this.$browser.baseHref() || this.$window.location.pathname);\n };\n Ng1LocationServices.prototype.url = function (newUrl, replace, state) {\n if (replace === void 0) { replace = false; }\n if (isDefined(newUrl))\n this.$location.url(newUrl);\n if (replace)\n this.$location.replace();\n if (state)\n this.$location.state(state);\n return this.$location.url();\n };\n Ng1LocationServices.prototype._runtimeServices = function ($rootScope, $location, $sniffer, $browser, $window) {\n var _this = this;\n this.$location = $location;\n this.$sniffer = $sniffer;\n this.$browser = $browser;\n this.$window = $window;\n // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange\n $rootScope.$on('$locationChangeSuccess', function (evt) { return _this._urlListeners.forEach(function (fn) { return fn(evt); }); });\n var _loc = val($location);\n // Bind these LocationService functions to $location\n createProxyFunctions(_loc, this, _loc, ['replace', 'path', 'search', 'hash']);\n // Bind these LocationConfig functions to $location\n createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']);\n };\n return Ng1LocationServices;\n}());\nexport { Ng1LocationServices };\n//# sourceMappingURL=locationServices.js.map","/**\n * # Angular 1 types\n *\n * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc.\n * The customizations to the core types for Angular UI-Router are documented here.\n *\n * The optional [[$resolve]] service is also documented here.\n *\n * @preferred @publicapi @module ng1\n */ /** */\nimport { ng as angular } from './angular';\nimport { services, applyPairs, isString, trace, extend, UIRouter, unnestR, } from '@uirouter/core';\nimport { ng1ViewsBuilder, getNg1ViewConfigFactory } from './statebuilders/views';\nimport { TemplateFactory } from './templateFactory';\nimport { StateProvider } from './stateProvider';\nimport { getStateHookBuilder } from './statebuilders/onEnterExitRetain';\nimport { Ng1LocationServices } from './locationServices';\nimport { UrlRouterProvider } from './urlRouterProvider';\nangular.module('ui.router.angular1', []);\nvar mod_init = angular.module('ui.router.init', ['ng']);\nvar mod_util = angular.module('ui.router.util', ['ui.router.init']);\nvar mod_rtr = angular.module('ui.router.router', ['ui.router.util']);\nvar mod_state = angular.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']);\nvar mod_main = angular.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']);\nvar mod_cmpt = angular.module('ui.router.compat', ['ui.router']); // tslint:disable-line\nvar router = null;\n$uiRouterProvider.$inject = ['$locationProvider'];\n/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */\nfunction $uiRouterProvider($locationProvider) {\n // Create a new instance of the Router when the $uiRouterProvider is initialized\n router = this.router = new UIRouter();\n router.stateProvider = new StateProvider(router.stateRegistry, router.stateService);\n // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties\n router.stateRegistry.decorator('views', ng1ViewsBuilder);\n router.stateRegistry.decorator('onExit', getStateHookBuilder('onExit'));\n router.stateRegistry.decorator('onRetain', getStateHookBuilder('onRetain'));\n router.stateRegistry.decorator('onEnter', getStateHookBuilder('onEnter'));\n router.viewService._pluginapi._viewConfigFactory('ng1', getNg1ViewConfigFactory());\n var ng1LocationService = (router.locationService = router.locationConfig = new Ng1LocationServices($locationProvider));\n Ng1LocationServices.monkeyPatchPathParameterType(router);\n // backwards compat: also expose router instance as $uiRouterProvider.router\n router['router'] = router;\n router['$get'] = $get;\n $get.$inject = ['$location', '$browser', '$window', '$sniffer', '$rootScope', '$http', '$templateCache'];\n function $get($location, $browser, $window, $sniffer, $rootScope, $http, $templateCache) {\n ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser, $window);\n delete router['router'];\n delete router['$get'];\n return router;\n }\n return router;\n}\nvar getProviderFor = function (serviceName) { return [\n '$uiRouterProvider',\n function ($urp) {\n var service = $urp.router[serviceName];\n service['$get'] = function () { return service; };\n return service;\n },\n]; };\n// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime)\nrunBlock.$inject = ['$injector', '$q', '$uiRouter'];\nfunction runBlock($injector, $q, $uiRouter) {\n services.$injector = $injector;\n services.$q = $q;\n // https://github.com/angular-ui/ui-router/issues/3678\n if (!$injector.hasOwnProperty('strictDi')) {\n try {\n $injector.invoke(function (checkStrictDi) { });\n }\n catch (error) {\n $injector.strictDi = !!/strict mode/.exec(error && error.toString());\n }\n }\n // The $injector is now available.\n // Find any resolvables that had dependency annotation deferred\n $uiRouter.stateRegistry\n .get()\n .map(function (x) { return x.$$state().resolvables; })\n .reduce(unnestR, [])\n .filter(function (x) { return x.deps === 'deferred'; })\n .forEach(function (resolvable) { return (resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi)); });\n}\n// $urlRouter service and $urlRouterProvider\nvar getUrlRouterProvider = function (uiRouter) { return (uiRouter.urlRouterProvider = new UrlRouterProvider(uiRouter)); };\n// $state service and $stateProvider\n// $urlRouter service and $urlRouterProvider\nvar getStateProvider = function () { return extend(router.stateProvider, { $get: function () { return router.stateService; } }); };\nwatchDigests.$inject = ['$rootScope'];\nexport function watchDigests($rootScope) {\n $rootScope.$watch(function () {\n trace.approximateDigests++;\n });\n}\nmod_init.provider('$uiRouter', $uiRouterProvider);\nmod_rtr.provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);\nmod_util.provider('$urlService', getProviderFor('urlService'));\nmod_util.provider('$urlMatcherFactory', ['$uiRouterProvider', function () { return router.urlMatcherFactory; }]);\nmod_util.provider('$templateFactory', function () { return new TemplateFactory(); });\nmod_state.provider('$stateRegistry', getProviderFor('stateRegistry'));\nmod_state.provider('$uiRouterGlobals', getProviderFor('globals'));\nmod_state.provider('$transitions', getProviderFor('transitionService'));\nmod_state.provider('$state', ['$uiRouterProvider', getStateProvider]);\nmod_state.factory('$stateParams', ['$uiRouter', function ($uiRouter) { return $uiRouter.globals.params; }]);\nmod_main.factory('$view', function () { return router.viewService; });\nmod_main.service('$trace', function () { return trace; });\nmod_main.run(watchDigests);\nmod_util.run(['$urlMatcherFactory', function ($urlMatcherFactory) { }]);\nmod_state.run(['$state', function ($state) { }]);\nmod_rtr.run(['$urlRouter', function ($urlRouter) { }]);\nmod_init.run(runBlock);\n/** @hidden TODO: find a place to move this */\nexport var getLocals = function (ctx) {\n var tokens = ctx.getTokens().filter(isString);\n var tuples = tokens.map(function (key) {\n var resolvable = ctx.getResolvable(key);\n var waitPolicy = ctx.getPolicy(resolvable).async;\n return [key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data];\n });\n return tuples.reduce(applyPairs, {});\n};\n//# sourceMappingURL=services.js.map","/** @publicapi @module ng1 */ /** */\nimport { ng as angular } from './angular';\n/**\n * `isState` Filter: truthy if the current state is the parameter\n *\n * Translates to [[StateService.is]] `$state.is(\"stateName\")`.\n *\n * #### Example:\n * ```html\n *
            show if state is 'stateName'
            \n * ```\n */\n$IsStateFilter.$inject = ['$state'];\nfunction $IsStateFilter($state) {\n var isFilter = function (state, params, options) {\n return $state.is(state, params, options);\n };\n isFilter.$stateful = true;\n return isFilter;\n}\n/**\n * `includedByState` Filter: truthy if the current state includes the parameter\n *\n * Translates to [[StateService.includes]]` $state.is(\"fullOrPartialStateName\")`.\n *\n * #### Example:\n * ```html\n *
            show if state includes 'fullOrPartialStateName'
            \n * ```\n */\n$IncludedByStateFilter.$inject = ['$state'];\nfunction $IncludedByStateFilter($state) {\n var includesFilter = function (state, params, options) {\n return $state.includes(state, params, options);\n };\n includesFilter.$stateful = true;\n return includesFilter;\n}\nangular\n .module('ui.router.state')\n .filter('isState', $IsStateFilter)\n .filter('includedByState', $IncludedByStateFilter);\nexport { $IsStateFilter, $IncludedByStateFilter };\n//# sourceMappingURL=stateFilters.js.map","/** @publicapi @module ng1 */ /** */\nimport { val, isObject, createProxyFunctions, } from '@uirouter/core';\n/**\n * The Angular 1 `StateProvider`\n *\n * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely\n * on state.\n *\n * A state corresponds to a \"place\" in the application in terms of the overall UI and\n * navigation. A state describes (via the controller / template / view properties) what\n * the UI looks like and does at that place.\n *\n * States often have things in common, and the primary way of factoring out these\n * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\n * nested states.\n *\n * The `$stateProvider` provides interfaces to declare these states for your app.\n */\nvar StateProvider = /** @class */ (function () {\n function StateProvider(stateRegistry, stateService) {\n this.stateRegistry = stateRegistry;\n this.stateService = stateService;\n createProxyFunctions(val(StateProvider.prototype), this, val(this));\n }\n /**\n * Decorates states when they are registered\n *\n * Allows you to extend (carefully) or override (at your own peril) the\n * `stateBuilder` object used internally by [[StateRegistry]].\n * This can be used to add custom functionality to ui-router,\n * for example inferring templateUrl based on the state name.\n *\n * When passing only a name, it returns the current (original or decorated) builder\n * function that matches `name`.\n *\n * The builder functions that can be decorated are listed below. Though not all\n * necessarily have a good use case for decoration, that is up to you to decide.\n *\n * In addition, users can attach custom decorators, which will generate new\n * properties within the state's internal definition. There is currently no clear\n * use-case for this beyond accessing internal states (i.e. $state.$current),\n * however, expect this to become increasingly relevant as we introduce additional\n * meta-programming features.\n *\n * **Warning**: Decorators should not be interdependent because the order of\n * execution of the builder functions in non-deterministic. Builder functions\n * should only be dependent on the state definition object and super function.\n *\n *\n * Existing builder functions and current return values:\n *\n * - **parent** `{object}` - returns the parent state object.\n * - **data** `{object}` - returns state data, including any inherited data that is not\n * overridden by own values (if any).\n * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\n * or `null`.\n * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is\n * navigable).\n * - **params** `{object}` - returns an array of state params that are ensured to\n * be a super-set of parent's params.\n * - **views** `{object}` - returns a views object where each key is an absolute view\n * name (i.e. \"viewName@stateName\") and each value is the config object\n * (template, controller) for the view. Even when you don't use the views object\n * explicitly on a state config, one is still created for you internally.\n * So by decorating this builder function you have access to decorating template\n * and controller properties.\n * - **ownParams** `{object}` - returns an array of params that belong to the state,\n * not including any params defined by ancestor states.\n * - **path** `{string}` - returns the full path from the root down to this state.\n * Needed for state activation.\n * - **includes** `{object}` - returns an object that includes every state that\n * would pass a `$state.includes()` test.\n *\n * #### Example:\n * Override the internal 'views' builder with a function that takes the state\n * definition, and a reference to the internal function being overridden:\n * ```js\n * $stateProvider.decorator('views', function (state, parent) {\n * let result = {},\n * views = parent(state);\n *\n * angular.forEach(views, function (config, name) {\n * let autoName = (state.name + '.' + name).replace('.', '/');\n * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\n * result[name] = config;\n * });\n * return result;\n * });\n *\n * $stateProvider.state('home', {\n * views: {\n * 'contact.list': { controller: 'ListController' },\n * 'contact.item': { controller: 'ItemController' }\n * }\n * });\n * ```\n *\n *\n * ```js\n * // Auto-populates list and item views with /partials/home/contact/list.html,\n * // and /partials/home/contact/item.html, respectively.\n * $state.go('home');\n * ```\n *\n * @param {string} name The name of the builder function to decorate.\n * @param {object} func A function that is responsible for decorating the original\n * builder function. The function receives two parameters:\n *\n * - `{object}` - state - The state config object.\n * - `{object}` - super - The original builder function.\n *\n * @return {object} $stateProvider - $stateProvider instance\n */\n StateProvider.prototype.decorator = function (name, func) {\n return this.stateRegistry.decorator(name, func) || this;\n };\n StateProvider.prototype.state = function (name, definition) {\n if (isObject(name)) {\n definition = name;\n }\n else {\n definition.name = name;\n }\n this.stateRegistry.register(definition);\n return this;\n };\n /**\n * Registers an invalid state handler\n *\n * This is a passthrough to [[StateService.onInvalid]] for ng1.\n */\n StateProvider.prototype.onInvalid = function (callback) {\n return this.stateService.onInvalid(callback);\n };\n return StateProvider;\n}());\nexport { StateProvider };\n//# sourceMappingURL=stateProvider.js.map","/** @publicapi @module ng1 */ /** */\nimport { services, ResolveContext, extend, } from '@uirouter/core';\nimport { getLocals } from '../services';\n/**\n * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,\n * `onRetain` callback hooks on a [[Ng1StateDeclaration]].\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * ensures that those hooks are injectable for @uirouter/angularjs (ng1).\n *\n * @internalapi\n */\nexport var getStateHookBuilder = function (hookName) {\n return function stateHookBuilder(stateObject, parentFn) {\n var hook = stateObject[hookName];\n var pathname = hookName === 'onExit' ? 'from' : 'to';\n function decoratedNg1Hook(trans, state) {\n var resolveContext = new ResolveContext(trans.treeChanges(pathname));\n var subContext = resolveContext.subContext(state.$$state());\n var locals = extend(getLocals(subContext), { $state$: state, $transition$: trans });\n return services.$injector.invoke(hook, this, locals);\n }\n return hook ? decoratedNg1Hook : undefined;\n };\n};\n//# sourceMappingURL=onEnterExitRetain.js.map","import { pick, forEach, tail, extend, isArray, isInjectable, isDefined, isString, services, trace, ViewService, ResolveContext, Resolvable, } from '@uirouter/core';\n/** @internalapi */\nexport function getNg1ViewConfigFactory() {\n var templateFactory = null;\n return function (path, view) {\n templateFactory = templateFactory || services.$injector.get('$templateFactory');\n return [new Ng1ViewConfig(path, view, templateFactory)];\n };\n}\n/** @internalapi */\nvar hasAnyKey = function (keys, obj) { return keys.reduce(function (acc, key) { return acc || isDefined(obj[key]); }, false); };\n/**\n * This is a [[StateBuilder.builder]] function for angular1 `views`.\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * handles the `views` property with logic specific to @uirouter/angularjs (ng1).\n *\n * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object\n * and applies the state-level configuration to a view named `$default`.\n *\n * @internalapi\n */\nexport function ng1ViewsBuilder(state) {\n // Do not process root state\n if (!state.parent)\n return {};\n var tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'], ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'], compKeys = ['component', 'bindings', 'componentProvider'], nonCompKeys = tplKeys.concat(ctrlKeys), allViewKeys = compKeys.concat(nonCompKeys);\n // Do not allow a state to have both state-level props and also a `views: {}` property.\n // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state.\n // However, the `$default` approach should not be mixed with a separate `views: ` block.\n if (isDefined(state.views) && hasAnyKey(allViewKeys, state)) {\n throw new Error(\"State '\" + state.name + \"' has a 'views' object. \" +\n \"It cannot also have \\\"view properties\\\" at the state level. \" +\n \"Move the following properties into a view (in the 'views' object): \" +\n (\" \" + allViewKeys.filter(function (key) { return isDefined(state[key]); }).join(', ')));\n }\n var views = {}, viewsObject = state.views || { $default: pick(state, allViewKeys) };\n forEach(viewsObject, function (config, name) {\n // Account for views: { \"\": { template... } }\n name = name || '$default';\n // Account for views: { header: \"headerComponent\" }\n if (isString(config))\n config = { component: config };\n // Make a shallow copy of the config object\n config = extend({}, config);\n // Do not allow a view to mix props for component-style view with props for template/controller-style view\n if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {\n throw new Error(\"Cannot combine: \" + compKeys.join('|') + \" with: \" + nonCompKeys.join('|') + \" in stateview: '\" + name + \"@\" + state.name + \"'\");\n }\n config.resolveAs = config.resolveAs || '$resolve';\n config.$type = 'ng1';\n config.$context = state;\n config.$name = name;\n var normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name);\n config.$uiViewName = normalized.uiViewName;\n config.$uiViewContextAnchor = normalized.uiViewContextAnchor;\n views[name] = config;\n });\n return views;\n}\n/** @hidden */\nvar id = 0;\n/** @internalapi */\nvar Ng1ViewConfig = /** @class */ (function () {\n function Ng1ViewConfig(path, viewDecl, factory) {\n var _this = this;\n this.path = path;\n this.viewDecl = viewDecl;\n this.factory = factory;\n this.$id = id++;\n this.loaded = false;\n this.getTemplate = function (uiView, context) {\n return _this.component\n ? _this.factory.makeComponentTemplate(uiView, context, _this.component, _this.viewDecl.bindings)\n : _this.template;\n };\n }\n Ng1ViewConfig.prototype.load = function () {\n var _this = this;\n var $q = services.$q;\n var context = new ResolveContext(this.path);\n var params = this.path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {});\n var promises = {\n template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),\n controller: $q.when(this.getController(context)),\n };\n return $q.all(promises).then(function (results) {\n trace.traceViewServiceEvent('Loaded', _this);\n _this.controller = results.controller;\n extend(_this, results.template); // Either { template: \"tpl\" } or { component: \"cmpName\" }\n return _this;\n });\n };\n /**\n * Gets the controller for a view configuration.\n *\n * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller.\n */\n Ng1ViewConfig.prototype.getController = function (context) {\n var provider = this.viewDecl.controllerProvider;\n if (!isInjectable(provider))\n return this.viewDecl.controller;\n var deps = services.$injector.annotate(provider);\n var providerFn = isArray(provider) ? tail(provider) : provider;\n var resolvable = new Resolvable('', providerFn, deps);\n return resolvable.get(context);\n };\n return Ng1ViewConfig;\n}());\nexport { Ng1ViewConfig };\n//# sourceMappingURL=views.js.map","/** @publicapi @module view */ /** */\nimport { ng as angular } from './angular';\nimport { isArray, isDefined, isFunction, isObject, services, tail, kebobString, unnestR, Resolvable, } from '@uirouter/core';\n/**\n * Service which manages loading of templates from a ViewConfig.\n */\nvar TemplateFactory = /** @class */ (function () {\n function TemplateFactory() {\n var _this = this;\n /** @hidden */ this._useHttp = angular.version.minor < 3;\n /** @hidden */ this.$get = [\n '$http',\n '$templateCache',\n '$injector',\n function ($http, $templateCache, $injector) {\n _this.$templateRequest = $injector.has && $injector.has('$templateRequest') && $injector.get('$templateRequest');\n _this.$http = $http;\n _this.$templateCache = $templateCache;\n return _this;\n },\n ];\n }\n /** @hidden */\n TemplateFactory.prototype.useHttpService = function (value) {\n this._useHttp = value;\n };\n /**\n * Creates a template from a configuration object.\n *\n * @param config Configuration object for which to load a template.\n * The following properties are search in the specified order, and the first one\n * that is defined is used to create the template:\n *\n * @param params Parameters to pass to the template function.\n * @param context The resolve context associated with the template's view\n *\n * @return {string|object} The template html as a string, or a promise for\n * that string,or `null` if no template is configured.\n */\n TemplateFactory.prototype.fromConfig = function (config, params, context) {\n var defaultTemplate = '';\n var asTemplate = function (result) { return services.$q.when(result).then(function (str) { return ({ template: str }); }); };\n var asComponent = function (result) { return services.$q.when(result).then(function (str) { return ({ component: str }); }); };\n return isDefined(config.template)\n ? asTemplate(this.fromString(config.template, params))\n : isDefined(config.templateUrl)\n ? asTemplate(this.fromUrl(config.templateUrl, params))\n : isDefined(config.templateProvider)\n ? asTemplate(this.fromProvider(config.templateProvider, params, context))\n : isDefined(config.component)\n ? asComponent(config.component)\n : isDefined(config.componentProvider)\n ? asComponent(this.fromComponentProvider(config.componentProvider, params, context))\n : asTemplate(defaultTemplate);\n };\n /**\n * Creates a template from a string or a function returning a string.\n *\n * @param template html template as a string or function that returns an html template as a string.\n * @param params Parameters to pass to the template function.\n *\n * @return {string|object} The template html as a string, or a promise for that\n * string.\n */\n TemplateFactory.prototype.fromString = function (template, params) {\n return isFunction(template) ? template(params) : template;\n };\n /**\n * Loads a template from the a URL via `$http` and `$templateCache`.\n *\n * @param {string|Function} url url of the template to load, or a function\n * that returns a url.\n * @param {Object} params Parameters to pass to the url function.\n * @return {string|Promise.} The template html as a string, or a promise\n * for that string.\n */\n TemplateFactory.prototype.fromUrl = function (url, params) {\n if (isFunction(url))\n url = url(params);\n if (url == null)\n return null;\n if (this._useHttp) {\n return this.$http\n .get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } })\n .then(function (response) {\n return response.data;\n });\n }\n return this.$templateRequest(url);\n };\n /**\n * Creates a template by invoking an injectable provider function.\n *\n * @param provider Function to invoke via `locals`\n * @param {Function} injectFn a function used to invoke the template provider\n * @return {string|Promise.} The template html as a string, or a promise\n * for that string.\n */\n TemplateFactory.prototype.fromProvider = function (provider, params, context) {\n var deps = services.$injector.annotate(provider);\n var providerFn = isArray(provider) ? tail(provider) : provider;\n var resolvable = new Resolvable('', providerFn, deps);\n return resolvable.get(context);\n };\n /**\n * Creates a component's template by invoking an injectable provider function.\n *\n * @param provider Function to invoke via `locals`\n * @param {Function} injectFn a function used to invoke the template provider\n * @return {string} The template html as a string: \"\".\n */\n TemplateFactory.prototype.fromComponentProvider = function (provider, params, context) {\n var deps = services.$injector.annotate(provider);\n var providerFn = isArray(provider) ? tail(provider) : provider;\n var resolvable = new Resolvable('', providerFn, deps);\n return resolvable.get(context);\n };\n /**\n * Creates a template from a component's name\n *\n * This implements route-to-component.\n * It works by retrieving the component (directive) metadata from the injector.\n * It analyses the component's bindings, then constructs a template that instantiates the component.\n * The template wires input and output bindings to resolves or from the parent component.\n *\n * @param uiView {object} The parent ui-view (for binding outputs to callbacks)\n * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)\n * @param component {string} Component's name in camel case.\n * @param bindings An object defining the component's bindings: {foo: '<'}\n * @return {string} The template as a string: \"\".\n */\n TemplateFactory.prototype.makeComponentTemplate = function (uiView, context, component, bindings) {\n bindings = bindings || {};\n // Bind once prefix\n var prefix = angular.version.minor >= 3 ? '::' : '';\n // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-`\n var kebob = function (camelCase) {\n var kebobed = kebobString(camelCase);\n return /^(x|data)-/.exec(kebobed) ? \"x-\" + kebobed : kebobed;\n };\n var attributeTpl = function (input) {\n var name = input.name, type = input.type;\n var attrName = kebob(name);\n // If the ui-view has an attribute which matches a binding on the routed component\n // then pass that attribute through to the routed component template.\n // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:`\n if (uiView.attr(attrName) && !bindings[name])\n return attrName + \"='\" + uiView.attr(attrName) + \"'\";\n var resolveName = bindings[name] || name;\n // Pre-evaluate the expression for \"@\" bindings by enclosing in {{ }}\n // some-attr=\"{{ ::$resolve.someResolveName }}\"\n if (type === '@')\n return attrName + \"='{{\" + prefix + \"$resolve.\" + resolveName + \"}}'\";\n // Wire \"&\" callbacks to resolves that return a callback function\n // Get the result of the resolve (should be a function) and annotate it to get its arguments.\n // some-attr=\"$resolve.someResolveResultName(foo, bar)\"\n if (type === '&') {\n var res = context.getResolvable(resolveName);\n var fn = res && res.data;\n var args = (fn && services.$injector.annotate(fn)) || [];\n // account for array style injection, i.e., ['foo', function(foo) {}]\n var arrayIdxStr = isArray(fn) ? \"[\" + (fn.length - 1) + \"]\" : '';\n return attrName + \"='$resolve.\" + resolveName + arrayIdxStr + \"(\" + args.join(',') + \")'\";\n }\n // some-attr=\"::$resolve.someResolveName\"\n return attrName + \"='\" + prefix + \"$resolve.\" + resolveName + \"'\";\n };\n var attrs = getComponentBindings(component)\n .map(attributeTpl)\n .join(' ');\n var kebobName = kebob(component);\n return \"<\" + kebobName + \" \" + attrs + \">\";\n };\n return TemplateFactory;\n}());\nexport { TemplateFactory };\n// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&')\nfunction getComponentBindings(name) {\n var cmpDefs = services.$injector.get(name + 'Directive'); // could be multiple\n if (!cmpDefs || !cmpDefs.length)\n throw new Error(\"Unable to find component named '\" + name + \"'\");\n return cmpDefs.map(getBindings).reduce(unnestR, []);\n}\n// Given a directive definition, find its object input attributes\n// Use different properties, depending on the type of directive (component, bindToController, normal)\nvar getBindings = function (def) {\n if (isObject(def.bindToController))\n return scopeBindings(def.bindToController);\n return scopeBindings(def.scope);\n};\n// for ng 1.2 style, process the scope: { input: \"=foo\" }\n// for ng 1.3 through ng 1.5, process the component's bindToController: { input: \"=foo\" } object\nvar scopeBindings = function (bindingsObj) {\n return Object.keys(bindingsObj || {})\n // [ 'input', [ '=foo', '=', 'foo' ] ]\n .map(function (key) { return [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])]; })\n // skip malformed values\n .filter(function (tuple) { return isDefined(tuple) && isArray(tuple[1]); })\n // { name: ('foo' || 'input'), type: '=' }\n .map(function (tuple) { return ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] }); });\n};\n//# sourceMappingURL=templateFactory.js.map","/** @publicapi @module url */ /** */\nimport { BaseUrlRule, } from '@uirouter/core';\nimport { services, isString, isFunction, isArray, identity } from '@uirouter/core';\n/**\n * Manages rules for client-side URL\n *\n * ### Deprecation warning:\n * This class is now considered to be an internal API\n * Use the [[UrlService]] instead.\n * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].\n *\n * This class manages the router rules for what to do when the URL changes.\n *\n * This provider remains for backwards compatibility.\n *\n * @internalapi\n * @deprecated\n */\nvar UrlRouterProvider = /** @class */ (function () {\n /** @hidden */\n function UrlRouterProvider(/** @hidden */ router) {\n this.router = router;\n }\n UrlRouterProvider.injectableHandler = function (router, handler) {\n return function (match) { return services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params }); };\n };\n /** @hidden */\n UrlRouterProvider.prototype.$get = function () {\n var urlService = this.router.urlService;\n this.router.urlRouter.update(true);\n if (!urlService.interceptDeferred)\n urlService.listen();\n return this.router.urlRouter;\n };\n /**\n * Registers a url handler function.\n *\n * Registers a low level url handler (a `rule`).\n * A rule detects specific URL patterns and returns a redirect, or performs some action.\n *\n * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Here's an example of how you might allow case insensitive urls\n * $urlRouterProvider.rule(function ($injector, $location) {\n * var path = $location.path(),\n * normalized = path.toLowerCase();\n *\n * if (path !== normalized) {\n * return normalized;\n * }\n * });\n * });\n * ```\n *\n * @param ruleFn\n * Handler function that takes `$injector` and `$location` services as arguments.\n * You can use them to detect a url and return a different url as a string.\n *\n * @return [[UrlRouterProvider]] (`this`)\n */\n UrlRouterProvider.prototype.rule = function (ruleFn) {\n var _this = this;\n if (!isFunction(ruleFn))\n throw new Error(\"'rule' must be a function\");\n var match = function () { return ruleFn(services.$injector, _this.router.locationService); };\n var rule = new BaseUrlRule(match, identity);\n this.router.urlService.rules.rule(rule);\n return this;\n };\n /**\n * Defines the path or behavior to use when no url can be matched.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // if the path doesn't match any of the urls you configured\n * // otherwise will take care of routing the user to the\n * // specified url\n * $urlRouterProvider.otherwise('/index');\n *\n * // Example of using function rule as param\n * $urlRouterProvider.otherwise(function ($injector, $location) {\n * return '/a/valid/url';\n * });\n * });\n * ```\n *\n * @param rule\n * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.\n * The function version is passed two params: `$injector` and `$location` services, and should return a url string.\n *\n * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n */\n UrlRouterProvider.prototype.otherwise = function (rule) {\n var _this = this;\n var urlRules = this.router.urlService.rules;\n if (isString(rule)) {\n urlRules.otherwise(rule);\n }\n else if (isFunction(rule)) {\n urlRules.otherwise(function () { return rule(services.$injector, _this.router.locationService); });\n }\n else {\n throw new Error(\"'rule' must be a string or function\");\n }\n return this;\n };\n /**\n * Registers a handler for a given url matching.\n *\n * If the handler is a string, it is\n * treated as a redirect, and is interpolated according to the syntax of match\n * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\n *\n * If the handler is a function, it is injectable.\n * It gets invoked if `$location` matches.\n * You have the option of inject the match object as `$match`.\n *\n * The handler can return\n *\n * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\n * will continue trying to find another one that matches.\n * - **string** which is treated as a redirect and passed to `$location.url()`\n * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * $urlRouterProvider.when($state.url, function ($match, $stateParams) {\n * if ($state.$current.navigable !== state ||\n * !equalForKeys($match, $stateParams) {\n * $state.transitionTo(state, $match, false);\n * }\n * });\n * });\n * ```\n *\n * @param what A pattern string to match, compiled as a [[UrlMatcher]].\n * @param handler The path (or function that returns a path) that you want to redirect your user to.\n * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]\n *\n * Note: the handler may also invoke arbitrary code, such as `$state.go()`\n */\n UrlRouterProvider.prototype.when = function (what, handler) {\n if (isArray(handler) || isFunction(handler)) {\n handler = UrlRouterProvider.injectableHandler(this.router, handler);\n }\n this.router.urlService.rules.when(what, handler);\n return this;\n };\n /**\n * Disables monitoring of the URL.\n *\n * Call this method before UI-Router has bootstrapped.\n * It will stop UI-Router from performing the initial url sync.\n *\n * This can be useful to perform some asynchronous initialization before the router starts.\n * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Prevent $urlRouter from automatically intercepting URL changes;\n * $urlRouterProvider.deferIntercept();\n * })\n *\n * app.run(function (MyService, $urlRouter, $http) {\n * $http.get(\"/stuff\").then(function(resp) {\n * MyService.doStuff(resp.data);\n * $urlRouter.listen();\n * $urlRouter.sync();\n * });\n * });\n * ```\n *\n * @param defer Indicates whether to defer location change interception.\n * Passing no parameter is equivalent to `true`.\n */\n UrlRouterProvider.prototype.deferIntercept = function (defer) {\n this.router.urlService.deferIntercept(defer);\n };\n return UrlRouterProvider;\n}());\nexport { UrlRouterProvider };\n//# sourceMappingURL=urlRouterProvider.js.map","/** @publicapi @module ng1 */ /** */\nimport { ng as angular } from './angular';\n/** @hidden */\nfunction $ViewScrollProvider() {\n var useAnchorScroll = false;\n this.useAnchorScroll = function () {\n useAnchorScroll = true;\n };\n this.$get = [\n '$anchorScroll',\n '$timeout',\n function ($anchorScroll, $timeout) {\n if (useAnchorScroll) {\n return $anchorScroll;\n }\n return function ($element) {\n return $timeout(function () {\n $element[0].scrollIntoView();\n }, 0, false);\n };\n },\n ];\n}\nangular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n//# sourceMappingURL=viewScroll.js.map","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","module.exports = {\n \"100\": \"Continue\",\n \"101\": \"Switching Protocols\",\n \"102\": \"Processing\",\n \"200\": \"OK\",\n \"201\": \"Created\",\n \"202\": \"Accepted\",\n \"203\": \"Non-Authoritative Information\",\n \"204\": \"No Content\",\n \"205\": \"Reset Content\",\n \"206\": \"Partial Content\",\n \"207\": \"Multi-Status\",\n \"208\": \"Already Reported\",\n \"226\": \"IM Used\",\n \"300\": \"Multiple Choices\",\n \"301\": \"Moved Permanently\",\n \"302\": \"Found\",\n \"303\": \"See Other\",\n \"304\": \"Not Modified\",\n \"305\": \"Use Proxy\",\n \"307\": \"Temporary Redirect\",\n \"308\": \"Permanent Redirect\",\n \"400\": \"Bad Request\",\n \"401\": \"Unauthorized\",\n \"402\": \"Payment Required\",\n \"403\": \"Forbidden\",\n \"404\": \"Not Found\",\n \"405\": \"Method Not Allowed\",\n \"406\": \"Not Acceptable\",\n \"407\": \"Proxy Authentication Required\",\n \"408\": \"Request Timeout\",\n \"409\": \"Conflict\",\n \"410\": \"Gone\",\n \"411\": \"Length Required\",\n \"412\": \"Precondition Failed\",\n \"413\": \"Payload Too Large\",\n \"414\": \"URI Too Long\",\n \"415\": \"Unsupported Media Type\",\n \"416\": \"Range Not Satisfiable\",\n \"417\": \"Expectation Failed\",\n \"418\": \"I'm a teapot\",\n \"421\": \"Misdirected Request\",\n \"422\": \"Unprocessable Entity\",\n \"423\": \"Locked\",\n \"424\": \"Failed Dependency\",\n \"425\": \"Unordered Collection\",\n \"426\": \"Upgrade Required\",\n \"428\": \"Precondition Required\",\n \"429\": \"Too Many Requests\",\n \"431\": \"Request Header Fields Too Large\",\n \"451\": \"Unavailable For Legal Reasons\",\n \"500\": \"Internal Server Error\",\n \"501\": \"Not Implemented\",\n \"502\": \"Bad Gateway\",\n \"503\": \"Service Unavailable\",\n \"504\": \"Gateway Timeout\",\n \"505\": \"HTTP Version Not Supported\",\n \"506\": \"Variant Also Negotiates\",\n \"507\": \"Insufficient Storage\",\n \"508\": \"Loop Detected\",\n \"509\": \"Bandwidth Limit Exceeded\",\n \"510\": \"Not Extended\",\n \"511\": \"Network Authentication Required\"\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (dirtyObject.hasOwnProperty(property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import assign from '../assign/index.js';\nexport default function cloneObject(dirtyObject) {\n return assign({}, dirtyObject);\n}","import lightFormatters from '../lightFormatters/index.js';\nimport getUTCDayOfYear from '../../../_lib/getUTCDayOfYear/index.js';\nimport getUTCISOWeek from '../../../_lib/getUTCISOWeek/index.js';\nimport getUTCISOWeekYear from '../../../_lib/getUTCISOWeekYear/index.js';\nimport getUTCWeek from '../../../_lib/getUTCWeek/index.js';\nimport getUTCWeekYear from '../../../_lib/getUTCWeekYear/index.js';\nimport addLeadingZeros from '../../addLeadingZeros/index.js';\nvar dayPeriodEnum = {\n am: 'am',\n pm: 'pm',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n /*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\n};\nvar formatters = {\n // Era\n G: function (date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function (date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\n },\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function (date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function (date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function (date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function (date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case 'e':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n }\n\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function (date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function (date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function (date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function (date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return 'Z';\n }\n\n switch (token) {\n // Hours and optional minutes\n case 'X':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","import addLeadingZeros from '../../addLeadingZeros/index.js';\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nvar formatters = {\n // Year\n y: function (date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function (date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function (date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function (date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function (date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function (date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function (date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function (date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function (date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n}\n\nfunction timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n}\n\nfunction dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/);\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n}\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nexport default longFormatters;","var MILLISECONDS_IN_MINUTE = 60000;\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\n\nexport default function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}","import toDate from '../../toDate/index.js';\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCDayOfYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","import toDate from '../../toDate/index.js';\nimport startOfUTCISOWeek from '../startOfUTCISOWeek/index.js';\nimport startOfUTCISOWeekYear from '../startOfUTCISOWeekYear/index.js';\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeek(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import toDate from '../../toDate/index.js';\nimport startOfUTCISOWeek from '../startOfUTCISOWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeekYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import toDate from '../../toDate/index.js';\nimport startOfUTCWeek from '../startOfUTCWeek/index.js';\nimport startOfUTCWeekYear from '../startOfUTCWeekYear/index.js';\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeek(dirtyDate, options) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import toInteger from '../toInteger/index.js';\nimport toDate from '../../toDate/index.js';\nimport startOfUTCWeek from '../startOfUTCWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeekYear(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate, dirtyOptions);\n var year = date.getUTCFullYear();\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","var protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\nexport function throwProtectedError(token) {\n if (token === 'YYYY') {\n throw new RangeError('Use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr');\n } else if (token === 'YY') {\n throw new RangeError('Use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr');\n } else if (token === 'D') {\n throw new RangeError('Use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr');\n } else if (token === 'DD') {\n throw new RangeError('Use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr');\n }\n}","import toInteger from '../toInteger/index.js';\nimport toDate from '../../toDate/index.js'; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import toInteger from '../toInteger/index.js';\nimport toDate from '../../toDate/index.js'; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var day = toInteger(dirtyDay);\n\n if (day % 7 === 0) {\n day = day - 7;\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import toInteger from '../toInteger/index.js';\nimport toDate from '../../toDate/index.js';\nimport getUTCISOWeek from '../getUTCISOWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getUTCISOWeek(date) - isoWeek;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from '../toInteger/index.js';\nimport toDate from '../../toDate/index.js';\nimport getUTCWeek from '../getUTCWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getUTCWeek(date, options) - week;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toDate from '../../toDate/index.js'; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeek(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import getUTCISOWeekYear from '../getUTCISOWeekYear/index.js';\nimport startOfUTCISOWeek from '../startOfUTCISOWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toInteger from '../toInteger/index.js';\nimport toDate from '../../toDate/index.js'; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeek(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toInteger from '../toInteger/index.js';\nimport getUTCWeekYear from '../getUTCWeekYear/index.js';\nimport startOfUTCWeek from '../startOfUTCWeek/index.js'; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\n return date;\n}","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n\n var number = Number(dirtyNumber);\n\n if (isNaN(number)) {\n return number;\n }\n\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","import isWeekend from '../isWeekend/index.js';\nimport toDate from '../toDate/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name addBusinessDays\n * @category Day Helpers\n * @summary Add the specified number of business days (mon - fri) to the given date.\n *\n * @description\n * Add the specified number of business days (mon - fri) to the given date, ignoring weekends.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of business days to be added\n * @returns {Date} the new date with the business days added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 10 business days to 1 September 2014:\n * var result = addBusinessDays(new Date(2014, 8, 1), 10)\n * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)\n */\n\nexport default function addBusinessDays(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n if (isNaN(amount)) return new Date(NaN);\n var hours = date.getHours();\n var sign = amount < 0 ? -1 : 1;\n date.setDate(date.getDate() + toInteger(amount / 5) * 7);\n amount %= 5; // to get remaining days not part of a full week\n // only loops over remaining days or if day is a weekend, ensures a business day is returned\n\n while (amount || isWeekend(date)) {\n date.setDate(date.getDate() + sign);\n if (!isWeekend(date)) amount -= sign;\n }\n\n date.setHours(hours);\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added\n * @returns {Date} the new date with the days added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * var result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\n\nexport default function addDays(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n date.setDate(date.getDate() + amount);\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addMilliseconds from '../addMilliseconds/index.js';\nvar MILLISECONDS_IN_HOUR = 3600000;\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be added\n * @returns {Date} the new date with the hours added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * var result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\n\nexport default function addHours(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport getISOWeekYear from '../getISOWeekYear/index.js';\nimport setISOWeekYear from '../setISOWeekYear/index.js';\n/**\n * @name addISOWeekYears\n * @category ISO Week-Numbering Year Helpers\n * @summary Add the specified number of ISO week-numbering years to the given date.\n *\n * @description\n * Add the specified number of ISO week-numbering years to the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `addISOYears` to `addISOWeekYears`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of ISO week-numbering years to be added\n * @returns {Date} the new date with the ISO week-numbering years added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 ISO week-numbering years to 2 July 2010:\n * var result = addISOWeekYears(new Date(2010, 6, 2), 5)\n * //=> Fri Jun 26 2015 00:00:00\n */\n\nexport default function addISOWeekYears(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return setISOWeekYear(dirtyDate, getISOWeekYear(dirtyDate) + amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addMilliseconds from '../addMilliseconds/index.js';\nvar MILLISECONDS_IN_MINUTE = 60000;\n/**\n * @name addMinutes\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be added\n * @returns {Date} the new date with the minutes added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\n\nexport default function addMinutes(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\nimport getDaysInMonth from '../getDaysInMonth/index.js';\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added\n * @returns {Date} the new date with the months added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * var result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\n\nexport default function addMonths(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n var desiredMonth = date.getMonth() + amount;\n var dateWithDesiredMonth = new Date(0);\n dateWithDesiredMonth.setFullYear(date.getFullYear(), desiredMonth, 1);\n dateWithDesiredMonth.setHours(0, 0, 0, 0);\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth); // Set the last day of the new month\n // if the original date was the last day of the longer month\n\n date.setMonth(desiredMonth, Math.min(daysInMonth, date.getDate()));\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addMonths from '../addMonths/index.js';\n/**\n * @name addQuarters\n * @category Quarter Helpers\n * @summary Add the specified number of year quarters to the given date.\n *\n * @description\n * Add the specified number of year quarters to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of quarters to be added\n * @returns {Date} the new date with the quarters added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 1 quarter to 1 September 2014:\n * var result = addQuarters(new Date(2014, 8, 1), 1)\n * //=> Mon Dec 01 2014 00:00:00\n */\n\nexport default function addQuarters(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n var months = amount * 3;\n return addMonths(dirtyDate, months);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addMilliseconds from '../addMilliseconds/index.js';\n/**\n * @name addSeconds\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be added\n * @returns {Date} the new date with the seconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * var result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\n\nexport default function addSeconds(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * 1000);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addDays from '../addDays/index.js';\n/**\n * @name addWeeks\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of week to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of weeks to be added\n * @returns {Date} the new date with the weeks added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * var result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\n\nexport default function addWeeks(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n var days = amount * 7;\n return addDays(dirtyDate, days);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addMonths from '../addMonths/index.js';\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be added\n * @returns {Date} the new date with the years added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * var result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\n\nexport default function addYears(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, amount * 12);\n}","import toDate from '../toDate/index.js';\n/**\n * @name areIntervalsOverlapping\n * @category Interval Helpers\n * @summary Is the given time interval overlapping with another time interval?\n *\n * @description\n * Is the given time interval overlapping with another time interval?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `areRangesOverlapping` to `areIntervalsOverlapping`.\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\n *\n * ```\n * 2.1.3\n * time interval\n * part of the time axis limited by two instants\n * ```\n *\n * Also, this function now accepts an object with `start` and `end` properties\n * instead of two arguments as an interval.\n * This function now throws `RangeError` if the start of the interval is after its end\n * or if any date in the interval is `Invalid Date`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * areRangesOverlapping(\n * new Date(2014, 0, 10), new Date(2014, 0, 20),\n * new Date(2014, 0, 17), new Date(2014, 0, 21)\n * )\n *\n * // v2.0.0 onward\n *\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\n * )\n * ```\n *\n * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link docs/types/Interval}\n * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link docs/types/Interval}\n * @returns {Boolean} whether the time intervals are overlapping\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // For overlapping time intervals:\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\n * )\n * //=> true\n *\n * @example\n * // For non-overlapping time intervals:\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }\n * )\n * //=> false\n */\n\nexport default function areIntervalsOverlapping(dirtyIntervalLeft, dirtyIntervalRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var intervalLeft = dirtyIntervalLeft || {};\n var intervalRight = dirtyIntervalRight || {};\n var leftStartTime = toDate(intervalLeft.start).getTime();\n var leftEndTime = toDate(intervalLeft.end).getTime();\n var rightStartTime = toDate(intervalRight.start).getTime();\n var rightEndTime = toDate(intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {\n throw new RangeError('Invalid interval');\n }\n\n return leftStartTime < rightEndTime && rightStartTime < leftEndTime;\n}","import toDate from '../toDate/index.js';\n/**\n * @name closestIndexTo\n * @category Common Helpers\n * @summary Return an index of the closest date from the array comparing to the given date.\n *\n * @description\n * Return an index of the closest date from the array comparing to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now, `closestIndexTo` doesn't throw an exception\n * when the second argument is not an array, and returns Invalid Date instead.\n *\n * @param {Date|Number} dateToCompare - the date to compare with\n * @param {Date[]|Number[]} datesArray - the array to search\n * @returns {Number} an index of the date closest to the given date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Which date is closer to 6 September 2015?\n * var dateToCompare = new Date(2015, 8, 6)\n * var datesArray = [\n * new Date(2015, 0, 1),\n * new Date(2016, 0, 1),\n * new Date(2017, 0, 1)\n * ]\n * var result = closestIndexTo(dateToCompare, datesArray)\n * //=> 1\n */\n\nexport default function closestIndexTo(dirtyDateToCompare, dirtyDatesArray) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateToCompare = toDate(dirtyDateToCompare);\n\n if (isNaN(dateToCompare)) {\n return NaN;\n }\n\n var timeToCompare = dateToCompare.getTime();\n var datesArray; // `dirtyDatesArray` is undefined or null\n\n if (dirtyDatesArray == null) {\n datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\n } else if (typeof dirtyDatesArray.forEach === 'function') {\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array\n } else {\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\n }\n\n var result;\n var minDistance;\n datesArray.forEach(function (dirtyDate, index) {\n var currentDate = toDate(dirtyDate);\n\n if (isNaN(currentDate)) {\n result = NaN;\n minDistance = NaN;\n return;\n }\n\n var distance = Math.abs(timeToCompare - currentDate.getTime());\n\n if (result == null || distance < minDistance) {\n result = index;\n minDistance = distance;\n }\n });\n return result;\n}","import toDate from '../toDate/index.js';\n/**\n * @name closestTo\n * @category Common Helpers\n * @summary Return a date from the array closest to the given date.\n *\n * @description\n * Return a date from the array closest to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now, `closestTo` doesn't throw an exception\n * when the second argument is not an array, and returns Invalid Date instead.\n *\n * @param {Date|Number} dateToCompare - the date to compare with\n * @param {Date[]|Number[]} datesArray - the array to search\n * @returns {Date} the date from the array closest to the given date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030?\n * var dateToCompare = new Date(2015, 8, 6)\n * var result = closestTo(dateToCompare, [\n * new Date(2000, 0, 1),\n * new Date(2030, 0, 1)\n * ])\n * //=> Tue Jan 01 2030 00:00:00\n */\n\nexport default function closestTo(dirtyDateToCompare, dirtyDatesArray) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateToCompare = toDate(dirtyDateToCompare);\n\n if (isNaN(dateToCompare)) {\n return new Date(NaN);\n }\n\n var timeToCompare = dateToCompare.getTime();\n var datesArray; // `dirtyDatesArray` is undefined or null\n\n if (dirtyDatesArray == null) {\n datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\n } else if (typeof dirtyDatesArray.forEach === 'function') {\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array\n } else {\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\n }\n\n var result;\n var minDistance;\n datesArray.forEach(function (dirtyDate) {\n var currentDate = toDate(dirtyDate);\n\n if (isNaN(currentDate)) {\n result = new Date(NaN);\n minDistance = NaN;\n return;\n }\n\n var distance = Math.abs(timeToCompare - currentDate.getTime());\n\n if (result == null || distance < minDistance) {\n result = currentDate;\n minDistance = distance;\n }\n });\n return result;\n}","import toDate from '../toDate/index.js';\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * var result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * var result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\n\nexport default function compareAsc(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var diff = dateLeft.getTime() - dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}","import toDate from '../toDate/index.js';\n/**\n * @name compareDesc\n * @category Common Helpers\n * @summary Compare the two dates reverse chronologically and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return -1 if the first date is after the second,\n * 1 if the first date is before the second or 0 if dates are equal.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989 reverse chronologically:\n * var result = compareDesc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> 1\n *\n * @example\n * // Sort the array of dates in reverse chronological order:\n * var result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareDesc)\n * //=> [\n * // Sun Jul 02 1995 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Wed Feb 11 1987 00:00:00\n * // ]\n */\n\nexport default function compareDesc(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var diff = dateLeft.getTime() - dateRight.getTime();\n\n if (diff > 0) {\n return -1;\n } else if (diff < 0) {\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}","/**\n * Maximum allowed time.\n * @constant\n * @type {number}\n * @default\n */\nexport var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n/**\n * Minimum allowed time.\n * @constant\n * @type {number}\n * @default\n */\n\nexport var minTime = -maxTime;","import isValid from '../isValid/index.js';\nimport isWeekend from '../isWeekend/index.js';\nimport toDate from '../toDate/index.js';\nimport differenceInCalendarDays from '../differenceInCalendarDays/index.js';\nimport addDays from '../addDays/index.js';\nimport isSameDay from '../isSameDay/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name differenceInBusinessDays\n * @category Day Helpers\n * @summary Get the number of business days between the given dates.\n *\n * @description\n * Get the number of business day periods between the given dates.\n * Business days being days that arent in the weekend.\n * Like `differenceInCalendarDays`, the function removes the times from\n * the dates before calculating the difference.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of business days\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many business days are between\n * // 10 January 2014 and 20 July 2014?\n * var result = differenceInBusinessDays(\n * new Date(2014, 6, 20),\n * new Date(2014, 0, 10)\n * )\n * //=> 136\n */\n\nexport default function differenceInBusinessDays(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n if (!isValid(dateLeft) || !isValid(dateRight)) return new Date(NaN);\n var calendarDifference = differenceInCalendarDays(dateLeft, dateRight);\n var sign = calendarDifference < 0 ? -1 : 1;\n var weeks = toInteger(calendarDifference / 7);\n var result = weeks * 5;\n dateRight = addDays(dateRight, weeks * 7); // the loop below will run at most 6 times to account for the remaining days that don't makeup a full week\n\n while (!isSameDay(dateLeft, dateRight)) {\n // sign is used to account for both negative and positive differences\n result += isWeekend(dateRight) ? 0 : sign;\n dateRight = addDays(dateRight, sign);\n }\n\n return result === 0 ? 0 : result;\n}","import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\nimport startOfDay from '../startOfDay/index.js';\nvar MILLISECONDS_IN_DAY = 86400000;\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar days\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * var result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * var result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\n\nexport default function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var startOfDayLeft = startOfDay(dirtyDateLeft);\n var startOfDayRight = startOfDay(dirtyDateRight);\n var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);\n}","import getISOWeekYear from '../getISOWeekYear/index.js';\n/**\n * @name differenceInCalendarISOWeekYears\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of calendar ISO week-numbering years between the given dates.\n *\n * @description\n * Get the number of calendar ISO week-numbering years between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `differenceInCalendarISOYears` to `differenceInCalendarISOWeekYears`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar ISO week-numbering years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012?\n * var result = differenceInCalendarISOWeekYears(\n * new Date(2012, 0, 1),\n * new Date(2010, 0, 1)\n * )\n * //=> 2\n */\n\nexport default function differenceInCalendarISOWeekYears(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n return getISOWeekYear(dirtyDateLeft) - getISOWeekYear(dirtyDateRight);\n}","import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\nimport startOfISOWeek from '../startOfISOWeek/index.js';\nvar MILLISECONDS_IN_WEEK = 604800000;\n/**\n * @name differenceInCalendarISOWeeks\n * @category ISO Week Helpers\n * @summary Get the number of calendar ISO weeks between the given dates.\n *\n * @description\n * Get the number of calendar ISO weeks between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar ISO weeks\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?\n * var result = differenceInCalendarISOWeeks(\n * new Date(2014, 6, 21),\n * new Date(2014, 6, 6)\n * )\n * //=> 3\n */\n\nexport default function differenceInCalendarISOWeeks(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var startOfISOWeekLeft = startOfISOWeek(dirtyDateLeft);\n var startOfISOWeekRight = startOfISOWeek(dirtyDateRight);\n var timestampLeft = startOfISOWeekLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfISOWeekLeft);\n var timestampRight = startOfISOWeekRight.getTime() - getTimezoneOffsetInMilliseconds(startOfISOWeekRight); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK);\n}","import toDate from '../toDate/index.js';\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * var result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\n\nexport default function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\n var monthDiff = dateLeft.getMonth() - dateRight.getMonth();\n return yearDiff * 12 + monthDiff;\n}","import getQuarter from '../getQuarter/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name differenceInCalendarQuarters\n * @category Quarter Helpers\n * @summary Get the number of calendar quarters between the given dates.\n *\n * @description\n * Get the number of calendar quarters between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar quarters\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar quarters are between 31 December 2013 and 2 July 2014?\n * var result = differenceInCalendarQuarters(\n * new Date(2014, 6, 2),\n * new Date(2013, 11, 31)\n * )\n * //=> 3\n */\n\nexport default function differenceInCalendarQuarters(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\n var quarterDiff = getQuarter(dateLeft) - getQuarter(dateRight);\n return yearDiff * 4 + quarterDiff;\n}","import startOfWeek from '../startOfWeek/index.js';\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\nvar MILLISECONDS_IN_WEEK = 604800000;\n/**\n * @name differenceInCalendarWeeks\n * @category Week Helpers\n * @summary Get the number of calendar weeks between the given dates.\n *\n * @description\n * Get the number of calendar weeks between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Number} the number of calendar weeks\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // How many calendar weeks are between 5 July 2014 and 20 July 2014?\n * var result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5)\n * )\n * //=> 3\n *\n * @example\n * // If the week starts on Monday,\n * // how many calendar weeks are between 5 July 2014 and 20 July 2014?\n * var result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5),\n * { weekStartsOn: 1 }\n * )\n * //=> 2\n */\n\nexport default function differenceInCalendarWeeks(dirtyDateLeft, dirtyDateRight, dirtyOptions) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var startOfWeekLeft = startOfWeek(dirtyDateLeft, dirtyOptions);\n var startOfWeekRight = startOfWeek(dirtyDateRight, dirtyOptions);\n var timestampLeft = startOfWeekLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekLeft);\n var timestampRight = startOfWeekRight.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekRight); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK);\n}","import toDate from '../toDate/index.js';\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * var result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\n\nexport default function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() - dateRight.getFullYear();\n}","import toDate from '../toDate/index.js';\nimport differenceInCalendarDays from '../differenceInCalendarDays/index.js';\nimport compareAsc from '../compareAsc/index.js';\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full days\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * var result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n * // How many days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * var result = differenceInDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n */\n\nexport default function differenceInDays(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));\n dateLeft.setDate(dateLeft.getDate() - sign * difference); // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastDayNotFull = compareAsc(dateLeft, dateRight) === -sign;\n var result = sign * (difference - isLastDayNotFull); // Prevent negative zero\n\n return result === 0 ? 0 : result;\n}","import differenceInMilliseconds from '../differenceInMilliseconds/index.js';\nvar MILLISECONDS_IN_HOUR = 3600000;\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of hours\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * var result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\n\nexport default function differenceInHours(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_HOUR;\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\n}","import toDate from '../toDate/index.js';\nimport differenceInCalendarISOWeekYears from '../differenceInCalendarISOWeekYears/index.js';\nimport compareAsc from '../compareAsc/index.js';\nimport subISOWeekYears from '../subISOWeekYears/index.js';\n/**\n * @name differenceInISOWeekYears\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of full ISO week-numbering years between the given dates.\n *\n * @description\n * Get the number of full ISO week-numbering years between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `differenceInISOYears` to `differenceInISOWeekYears`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full ISO week-numbering years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?\n * var result = differenceInISOWeekYears(\n * new Date(2012, 0, 1),\n * new Date(2010, 0, 1)\n * )\n * //=> 1\n */\n\nexport default function differenceInISOWeekYears(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarISOWeekYears(dateLeft, dateRight));\n dateLeft = subISOWeekYears(dateLeft, sign * difference); // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1\n // if last calendar ISO year is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastISOWeekYearNotFull = compareAsc(dateLeft, dateRight) === -sign;\n var result = sign * (difference - isLastISOWeekYearNotFull); // Prevent negative zero\n\n return result === 0 ? 0 : result;\n}","import toDate from '../toDate/index.js';\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * var result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\n\nexport default function differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getTime() - dateRight.getTime();\n}","import differenceInMilliseconds from '../differenceInMilliseconds/index.js';\nvar MILLISECONDS_IN_MINUTE = 60000;\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the number of minutes between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of minutes\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * var result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n */\n\nexport default function differenceInMinutes(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_MINUTE;\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\n}","import toDate from '../toDate/index.js';\nimport differenceInCalendarMonths from '../differenceInCalendarMonths/index.js';\nimport compareAsc from '../compareAsc/index.js';\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * var result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\n\nexport default function differenceInMonths(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));\n dateLeft.setMonth(dateLeft.getMonth() - sign * difference); // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign;\n var result = sign * (difference - isLastMonthNotFull); // Prevent negative zero\n\n return result === 0 ? 0 : result;\n}","import differenceInMonths from '../differenceInMonths/index.js';\n/**\n * @name differenceInQuarters\n * @category Quarter Helpers\n * @summary Get the number of full quarters between the given dates.\n *\n * @description\n * Get the number of full quarters between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full quarters\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full quarters are between 31 December 2013 and 2 July 2014?\n * var result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31))\n * //=> 2\n */\n\nexport default function differenceInQuarters(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var diff = differenceInMonths(dirtyDateLeft, dirtyDateRight) / 3;\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\n}","import differenceInMilliseconds from '../differenceInMilliseconds/index.js';\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of seconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * var result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\n\nexport default function differenceInSeconds(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / 1000;\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\n}","import differenceInDays from '../differenceInDays/index.js';\n/**\n * @name differenceInWeeks\n * @category Week Helpers\n * @summary Get the number of full weeks between the given dates.\n *\n * @description\n * Get the number of full weeks between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full weeks\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full weeks are between 5 July 2014 and 20 July 2014?\n * var result = differenceInWeeks(new Date(2014, 6, 20), new Date(2014, 6, 5))\n * //=> 2\n */\n\nexport default function differenceInWeeks(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var diff = differenceInDays(dirtyDateLeft, dirtyDateRight) / 7;\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff);\n}","import toDate from '../toDate/index.js';\nimport differenceInCalendarYears from '../differenceInCalendarYears/index.js';\nimport compareAsc from '../compareAsc/index.js';\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * var result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\n\nexport default function differenceInYears(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight));\n dateLeft.setFullYear(dateLeft.getFullYear() - sign * difference); // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign;\n var result = sign * (difference - isLastYearNotFull); // Prevent negative zero\n\n return result === 0 ? 0 : result;\n}","import toDate from '../toDate/index.js';\n/**\n * @name eachDayOfInterval\n * @category Interval Helpers\n * @summary Return the array of dates within the specified time interval.\n *\n * @description\n * Return the array of dates within the specified time interval.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `eachDay` to `eachDayOfInterval`.\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\n *\n * ```\n * 2.1.3\n * time interval\n * part of the time axis limited by two instants\n * ```\n *\n * Also, this function now accepts an object with `start` and `end` properties\n * instead of two arguments as an interval.\n * This function now throws `RangeError` if the start of the interval is after its end\n * or if any date in the interval is `Invalid Date`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * eachDay(new Date(2014, 0, 10), new Date(2014, 0, 20))\n *\n * // v2.0.0 onward\n *\n * eachDayOfInterval(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }\n * )\n * ```\n *\n * @param {Interval} interval - the interval. See [Interval]{@link docs/types/Interval}\n * @param {Object} [options] - an object with options.\n * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1.\n * @returns {Date[]} the array with starts of days from the day of the interval start to the day of the interval end\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.step` must be a number greater than 1\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Each day between 6 October 2014 and 10 October 2014:\n * var result = eachDayOfInterval({\n * start: new Date(2014, 9, 6),\n * end: new Date(2014, 9, 10)\n * })\n * //=> [\n * // Mon Oct 06 2014 00:00:00,\n * // Tue Oct 07 2014 00:00:00,\n * // Wed Oct 08 2014 00:00:00,\n * // Thu Oct 09 2014 00:00:00,\n * // Fri Oct 10 2014 00:00:00\n * // ]\n */\n\nexport default function eachDayOfInterval(dirtyInterval, options) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var interval = dirtyInterval || {};\n var startDate = toDate(interval.start);\n var endDate = toDate(interval.end);\n var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startDate.getTime() <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var dates = [];\n var currentDate = startDate;\n currentDate.setHours(0, 0, 0, 0);\n var step = options && 'step' in options ? Number(options.step) : 1;\n if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1');\n\n while (currentDate.getTime() <= endTime) {\n dates.push(toDate(currentDate));\n currentDate.setDate(currentDate.getDate() + step);\n currentDate.setHours(0, 0, 0, 0);\n }\n\n return dates;\n}","import addWeeks from '../addWeeks/index.js';\nimport startOfWeek from '../startOfWeek/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name eachWeekOfInterval\n * @category Interval Helpers\n * @summary Return the array of weeks within the specified time interval.\n *\n * @description\n * Return the array of weeks within the specified time interval.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Interval} interval - the interval. See [Interval]{@link docs/types/Interval}\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date[]} the array with starts of weeks from the week of the interval start to the week of the interval end\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be 0, 1, ..., 6\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Each week within interval 6 October 2014 - 23 November 2014:\n * var result = eachWeekOfInterval({\n * start: new Date(2014, 9, 6),\n * end: new Date(2014, 10, 23)\n * })\n * //=> [\n * // Sun Oct 05 2014 00:00:00,\n * // Sun Oct 12 2014 00:00:00,\n * // Sun Oct 19 2014 00:00:00,\n * // Sun Oct 26 2014 00:00:00,\n * // Sun Nov 02 2014 00:00:00,\n * // Sun Nov 09 2014 00:00:00,\n * // Sun Nov 16 2014 00:00:00,\n * // Sun Nov 23 2014 00:00:00\n * // ]\n */\n\nexport default function eachWeekOfInterval(dirtyInterval, options) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var interval = dirtyInterval || {};\n var startDate = toDate(interval.start);\n var endDate = toDate(interval.end);\n var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startDate.getTime() <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var startDateWeek = startOfWeek(startDate, options);\n var endDateWeek = startOfWeek(endDate, options); // Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet\n\n startDateWeek.setHours(15);\n endDateWeek.setHours(15);\n endTime = endDateWeek.getTime();\n var weeks = [];\n var currentWeek = startDateWeek;\n\n while (currentWeek.getTime() <= endTime) {\n currentWeek.setHours(0);\n weeks.push(toDate(currentWeek));\n currentWeek = addWeeks(currentWeek, 1);\n currentWeek.setHours(15);\n }\n\n return weeks;\n}","import eachDayOfInterval from '../eachDayOfInterval/index.js';\nimport isSunday from '../isSunday/index.js';\nimport isWeekend from '../isWeekend/index.js';\n/**\n * @name eachWeekendOfInterval\n * @category Interval Helpers\n * @summary List all the Saturdays and Sundays in the given date interval.\n *\n * @description\n * Get all the Saturdays and Sundays in the given date interval.\n *\n * @param {Interval} interval - the given interval. See [Interval]{@link docs/types/Interval}\n * @returns {Date[]} an array containing all the Saturdays and Sundays\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Lists all Saturdays and Sundays in the given date interval\n * var result = eachWeekendOfInterval({\n * start: new Date(2018, 8, 17),\n * end: new Date(2018, 8, 30)\n * })\n * //=> [\n * // Sat Sep 22 2018 00:00:00,\n * // Sun Sep 23 2018 00:00:00,\n * // Sat Sep 29 2018 00:00:00,\n * // Sun Sep 30 2018 00:00:00\n * // ]\n */\n\nexport default function eachWeekendOfInterval(interval) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var dateInterval = eachDayOfInterval(interval);\n var weekends = [];\n var index = 0;\n\n while (index++ < dateInterval.length) {\n var date = dateInterval[index];\n\n if (isWeekend(date)) {\n weekends.push(date);\n if (isSunday(date)) index = index + 5;\n }\n }\n\n return weekends;\n}","import eachWeekendOfInterval from '../eachWeekendOfInterval/index.js';\nimport startOfMonth from '../startOfMonth/index.js';\nimport endOfMonth from '../endOfMonth/index.js';\n/**\n * @name eachWeekendOfMonth\n * @category Month Helpers\n * @summary List all the Saturdays and Sundays in the given month.\n *\n * @description\n * Get all the Saturdays and Sundays in the given month.\n *\n * @param {Date|Number} date - the given month\n * @returns {Date[]} an array containing all the Saturdays and Sundays\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} The passed date is invalid\n *\n * @example\n * // Lists all Saturdays and Sundays in the given month\n * var result = eachWeekendOfMonth(new Date(2022, 1, 1))\n * //=> [\n * // Sat Feb 05 2022 00:00:00,\n * // Sun Feb 06 2022 00:00:00,\n * // Sat Feb 12 2022 00:00:00,\n * // Sun Feb 13 2022 00:00:00,\n * // Sat Feb 19 2022 00:00:00,\n * // Sun Feb 20 2022 00:00:00,\n * // Sat Feb 26 2022 00:00:00,\n * // Sun Feb 27 2022 00:00:00\n * // ]\n */\n\nexport default function eachWeekendOfMonth(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 arguments required, but only ' + arguments.length + ' present');\n }\n\n var startDate = startOfMonth(dirtyDate);\n if (isNaN(startDate)) throw new RangeError('The passed date is invalid');\n var endDate = endOfMonth(dirtyDate);\n return eachWeekendOfInterval({\n start: startDate,\n end: endDate\n });\n}","import eachWeekendOfInterval from '../eachWeekendOfInterval/index.js';\nimport startOfYear from '../startOfYear/index.js';\nimport endOfYear from '../endOfYear/index.js';\n/**\n * @name eachWeekendOfYear\n * @category Year Helpers\n * @summary List all the Saturdays and Sundays in the year.\n *\n * @description\n * Get all the Saturdays and Sundays in the year.\n *\n * @param {Date|Number} date - the given year\n * @returns {Date[]} an array containing all the Saturdays and Sundays\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} The passed date is invalid\n *\n * @example\n * // Lists all Saturdays and Sundays in the year\n * var result = eachWeekendOfYear(new Date(2020, 1, 1))\n * //=> [\n * // Sat Jan 03 2020 00:00:00,\n * // Sun Jan 04 2020 00:00:00,\n * // ...\n * // Sun Dec 27 2020 00:00:00\n * // ]\n * ]\n */\n\nexport default function eachWeekendOfYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 arguments required, but only ' + arguments.length + ' present');\n }\n\n var startDate = startOfYear(dirtyDate);\n if (isNaN(startDate)) throw new RangeError('The passed date is invalid');\n var endDate = endOfYear(dirtyDate);\n return eachWeekendOfInterval({\n start: startDate,\n end: endDate\n });\n}","import toDate from '../toDate/index.js';\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * var result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\n\nexport default function endOfDay(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name endOfDecade\n * @category Decade Helpers\n * @summary Return the end of a decade for the given date.\n *\n * @description\n * Return the end of a decade for the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a decade\n * @param {Object} [options] - an object with options.\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // The end of a decade for 12 May 1984 00:00:00:\n * var result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00))\n * //=> Dec 31 1989 23:59:59.999\n */\n\nexport default function endOfDecade(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var decade = 9 + Math.floor(year / 10) * 10;\n date.setFullYear(decade, 11, 31);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name endOfHour\n * @category Hour Helpers\n * @summary Return the end of an hour for the given date.\n *\n * @description\n * Return the end of an hour for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of an hour\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of an hour for 2 September 2014 11:55:00:\n * var result = endOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:59:59.999\n */\n\nexport default function endOfHour(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n date.setMinutes(59, 59, 999);\n return date;\n}","import endOfWeek from '../endOfWeek/index.js';\n/**\n * @name endOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the end of an ISO week for the given date.\n *\n * @description\n * Return the end of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of an ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of an ISO week for 2 September 2014 11:55:00:\n * var result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 23:59:59.999\n */\n\nexport default function endOfISOWeek(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return endOfWeek(dirtyDate, {\n weekStartsOn: 1\n });\n}","import getISOWeekYear from '../getISOWeekYear/index.js';\nimport startOfISOWeek from '../startOfISOWeek/index.js';\n/**\n * @name endOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the end of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the end of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `endOfISOYear` to `endOfISOWeekYear`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of an ISO week-numbering year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of an ISO week-numbering year for 2 July 2005:\n * var result = endOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Sun Jan 01 2006 23:59:59.999\n */\n\nexport default function endOfISOWeekYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var year = getISOWeekYear(dirtyDate);\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n var date = startOfISOWeek(fourthOfJanuaryOfNextYear);\n date.setMilliseconds(date.getMilliseconds() - 1);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name endOfMinute\n * @category Minute Helpers\n * @summary Return the end of a minute for the given date.\n *\n * @description\n * Return the end of a minute for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a minute\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a minute for 1 December 2014 22:15:45.400:\n * var result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:59.999\n */\n\nexport default function endOfMinute(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n date.setSeconds(59, 999);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * var result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\n\nexport default function endOfMonth(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name endOfQuarter\n * @category Quarter Helpers\n * @summary Return the end of a year quarter for the given date.\n *\n * @description\n * Return the end of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a quarter\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a quarter for 2 September 2014 11:55:00:\n * var result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\n\nexport default function endOfQuarter(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var currentMonth = date.getMonth();\n var month = currentMonth - currentMonth % 3 + 3;\n date.setMonth(month, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name endOfSecond\n * @category Second Helpers\n * @summary Return the end of a second for the given date.\n *\n * @description\n * Return the end of a second for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a second\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a second for 1 December 2014 22:15:45.400:\n * var result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.999\n */\n\nexport default function endOfSecond(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n date.setMilliseconds(999);\n return date;\n}","import endOfDay from '../endOfDay/index.js';\n/**\n * @name endOfToday\n * @category Day Helpers\n * @summary Return the end of today.\n * @pure false\n *\n * @description\n * Return the end of today.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the end of today\n *\n * @example\n * // If today is 6 October 2014:\n * var result = endOfToday()\n * //=> Mon Oct 6 2014 23:59:59.999\n */\n\nexport default function endOfToday() {\n return endOfDay(Date.now());\n}","/**\n * @name endOfTomorrow\n * @category Day Helpers\n * @summary Return the end of tomorrow.\n * @pure false\n *\n * @description\n * Return the end of tomorrow.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the end of tomorrow\n *\n * @example\n * // If today is 6 October 2014:\n * var result = endOfTomorrow()\n * //=> Tue Oct 7 2014 23:59:59.999\n */\nexport default function endOfTomorrow() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth();\n var day = now.getDate();\n var date = new Date(0);\n date.setFullYear(year, month, day + 1);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from '../toDate/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name endOfWeek\n * @category Week Helpers\n * @summary Return the end of a week for the given date.\n *\n * @description\n * Return the end of a week for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the end of a week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // The end of a week for 2 September 2014 11:55:00:\n * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 23:59:59.999\n *\n * @example\n * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:\n * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 23:59:59.999\n */\n\nexport default function endOfWeek(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n date.setDate(date.getDate() + diff);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name endOfYear\n * @category Year Helpers\n * @summary Return the end of a year for the given date.\n *\n * @description\n * Return the end of a year for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a year for 2 September 2014 11:55:00:\n * var result = endOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Dec 31 2014 23:59:59.999\n */\n\nexport default function endOfYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n date.setFullYear(year + 1, 0, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","/**\n * @name endOfYesterday\n * @category Day Helpers\n * @summary Return the end of yesterday.\n * @pure false\n *\n * @description\n * Return the end of yesterday.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the end of yesterday\n *\n * @example\n * // If today is 6 October 2014:\n * var result = endOfYesterday()\n * //=> Sun Oct 5 2014 23:59:59.999\n */\nexport default function endOfYesterday() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth();\n var day = now.getDate();\n var date = new Date(0);\n date.setFullYear(year, month, day - 1);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import isValid from '../isValid/index.js';\nimport defaultLocale from '../locale/en-US/index.js';\nimport subMilliseconds from '../subMilliseconds/index.js';\nimport toDate from '../toDate/index.js';\nimport formatters from '../_lib/format/formatters/index.js';\nimport longFormatters from '../_lib/format/longFormatters/index.js';\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from '../_lib/protectedTokens/index.js';\nimport toInteger from '../_lib/toInteger/index.js'; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'(.*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Su | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Su | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Su | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Su | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | AM, PM | a..aaa | AM, PM | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 1, 2, ..., 11, 0 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 0001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 05/29/1453 | 7 |\n * | | PP | May 29, 1453 | 7 |\n * | | PPP | May 29th, 1453 | 7 |\n * | | PPPP | Sunday, May 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |\n * | | PPpp | May 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | May 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * var result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var formatStr = String(dirtyFormatStr);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, formatterOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring);\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","import compareAsc from '../compareAsc/index.js';\nimport differenceInMonths from '../differenceInMonths/index.js';\nimport differenceInSeconds from '../differenceInSeconds/index.js';\nimport defaultLocale from '../locale/en-US/index.js';\nimport toDate from '../toDate/index.js';\nimport cloneObject from '../_lib/cloneObject/index.js';\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\nvar MINUTES_IN_DAY = 1440;\nvar MINUTES_IN_ALMOST_TWO_DAYS = 2520;\nvar MINUTES_IN_MONTH = 43200;\nvar MINUTES_IN_TWO_MONTHS = 86400;\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `distanceInWords ` to `formatDistance`\n * to make its name consistent with `format` and `formatRelative`.\n *\n * - The order of arguments is swapped to make the function\n * consistent with `differenceIn...` functions.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWords(\n * new Date(1986, 3, 4, 10, 32, 0),\n * new Date(1986, 3, 4, 11, 32, 0),\n * { addSuffix: true }\n * ) //=> 'in about 1 hour'\n *\n * // v2.0.0 onward\n *\n * formatDistance(\n * new Date(1986, 3, 4, 11, 32, 0),\n * new Date(1986, 3, 4, 10, 32, 0),\n * { addSuffix: true }\n * ) //=> 'in about 1 hour'\n * ```\n *\n * @param {Date|Number} date - the date\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * var result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * var result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * var result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * var result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\n\nexport default function formatDistance(dirtyDate, dirtyBaseDate, dirtyOptions) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.formatDistance) {\n throw new RangeError('locale must contain formatDistance property');\n }\n\n var comparison = compareAsc(dirtyDate, dirtyBaseDate);\n\n if (isNaN(comparison)) {\n throw new RangeError('Invalid time value');\n }\n\n var localizeOptions = cloneObject(options);\n localizeOptions.addSuffix = Boolean(options.addSuffix);\n localizeOptions.comparison = comparison;\n var dateLeft;\n var dateRight;\n\n if (comparison > 0) {\n dateLeft = toDate(dirtyBaseDate);\n dateRight = toDate(dirtyDate);\n } else {\n dateLeft = toDate(dirtyDate);\n dateRight = toDate(dirtyBaseDate);\n }\n\n var seconds = differenceInSeconds(dateRight, dateLeft);\n var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000;\n var minutes = Math.round((seconds - offsetInSeconds) / 60);\n var months; // 0 up to 2 mins\n\n if (minutes < 2) {\n if (options.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance('lessThanXSeconds', 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance('lessThanXSeconds', 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance('lessThanXSeconds', 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance('halfAMinute', null, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n } else {\n return locale.formatDistance('xMinutes', 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n } else {\n return locale.formatDistance('xMinutes', minutes, localizeOptions);\n }\n } // 2 mins up to 0.75 hrs\n\n } else if (minutes < 45) {\n return locale.formatDistance('xMinutes', minutes, localizeOptions); // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance('aboutXHours', 1, localizeOptions); // 1.5 hrs up to 24 hrs\n } else if (minutes < MINUTES_IN_DAY) {\n var hours = Math.round(minutes / 60);\n return locale.formatDistance('aboutXHours', hours, localizeOptions); // 1 day up to 1.75 days\n } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {\n return locale.formatDistance('xDays', 1, localizeOptions); // 1.75 days up to 30 days\n } else if (minutes < MINUTES_IN_MONTH) {\n var days = Math.round(minutes / MINUTES_IN_DAY);\n return locale.formatDistance('xDays', days, localizeOptions); // 1 month up to 2 months\n } else if (minutes < MINUTES_IN_TWO_MONTHS) {\n months = Math.round(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('aboutXMonths', months, localizeOptions);\n }\n\n months = differenceInMonths(dateRight, dateLeft); // 2 months up to 12 months\n\n if (months < 12) {\n var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('xMonths', nearestMonth, localizeOptions); // 1 year up to max Date\n } else {\n var monthsSinceStartOfYear = months % 12;\n var years = Math.floor(months / 12); // N years up to 1 years 3 months\n\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance('aboutXYears', years, localizeOptions); // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance('overXYears', years, localizeOptions); // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance('almostXYears', years + 1, localizeOptions);\n }\n }\n}","import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\nimport compareAsc from '../compareAsc/index.js';\nimport toDate from '../toDate/index.js';\nimport differenceInSeconds from '../differenceInSeconds/index.js';\nimport cloneObject from '../_lib/cloneObject/index.js';\nimport defaultLocale from '../locale/en-US/index.js';\nvar MINUTES_IN_DAY = 1440;\nvar MINUTES_IN_MONTH = 43200;\nvar MINUTES_IN_YEAR = 525600;\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `distanceInWordsStrict` to `formatDistanceStrict`\n * to make its name consistent with `format` and `formatRelative`.\n *\n * - The order of arguments is swapped to make the function\n * consistent with `differenceIn...` functions.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsStrict(\n * new Date(2015, 0, 2),\n * new Date(2014, 6, 2)\n * ) //=> '6 months'\n *\n * // v2.0.0 onward\n *\n * formatDistanceStrict(\n * new Date(2014, 6, 2),\n * new Date(2015, 0, 2)\n * ) //=> '6 months'\n * ```\n *\n * - `partialMethod` option is renamed to `roundingMethod`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsStrict(\n * new Date(1986, 3, 4, 10, 32, 0),\n * new Date(1986, 3, 4, 10, 33, 1),\n * { partialMethod: 'ceil' }\n * ) //=> '2 minutes'\n *\n * // v2.0.0 onward\n *\n * formatDistanceStrict(\n * new Date(1986, 3, 4, 10, 33, 1),\n * new Date(1986, 3, 4, 10, 32, 0),\n * { roundingMethod: 'ceil' }\n * ) //=> '2 minutes'\n * ```\n *\n * - If `roundingMethod` is not specified, it now defaults to `round` instead of `floor`.\n *\n * - `unit` option now accepts one of the strings:\n * 'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y'\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsStrict(\n * new Date(1986, 3, 4, 10, 32, 0),\n * new Date(1986, 3, 4, 10, 33, 1),\n * { unit: 'm' }\n * )\n *\n * // v2.0.0 onward\n *\n * formatDistanceStrict(\n * new Date(1986, 3, 4, 10, 33, 1),\n * new Date(1986, 3, 4, 10, 32, 0),\n * { unit: 'minute' }\n * )\n * ```\n *\n * @param {Date|Number} date - the date\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit\n * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round'\n * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * var result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * var result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * var result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * var result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * var result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * var result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport default function formatDistanceStrict(dirtyDate, dirtyBaseDate, dirtyOptions) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.formatDistance) {\n throw new RangeError('locale must contain localize.formatDistance property');\n }\n\n var comparison = compareAsc(dirtyDate, dirtyBaseDate);\n\n if (isNaN(comparison)) {\n throw new RangeError('Invalid time value');\n }\n\n var localizeOptions = cloneObject(options);\n localizeOptions.addSuffix = Boolean(options.addSuffix);\n localizeOptions.comparison = comparison;\n var dateLeft;\n var dateRight;\n\n if (comparison > 0) {\n dateLeft = toDate(dirtyBaseDate);\n dateRight = toDate(dirtyDate);\n } else {\n dateLeft = toDate(dirtyDate);\n dateRight = toDate(dirtyBaseDate);\n }\n\n var roundingMethod = options.roundingMethod == null ? 'round' : String(options.roundingMethod);\n var roundingMethodFn;\n\n if (roundingMethod === 'floor') {\n roundingMethodFn = Math.floor;\n } else if (roundingMethod === 'ceil') {\n roundingMethodFn = Math.ceil;\n } else if (roundingMethod === 'round') {\n roundingMethodFn = Math.round;\n } else {\n throw new RangeError(\"roundingMethod must be 'floor', 'ceil' or 'round'\");\n }\n\n var seconds = differenceInSeconds(dateRight, dateLeft);\n var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000;\n var minutes = roundingMethodFn((seconds - offsetInSeconds) / 60);\n var unit;\n\n if (options.unit == null) {\n if (minutes < 1) {\n unit = 'second';\n } else if (minutes < 60) {\n unit = 'minute';\n } else if (minutes < MINUTES_IN_DAY) {\n unit = 'hour';\n } else if (minutes < MINUTES_IN_MONTH) {\n unit = 'day';\n } else if (minutes < MINUTES_IN_YEAR) {\n unit = 'month';\n } else {\n unit = 'year';\n }\n } else {\n unit = String(options.unit);\n } // 0 up to 60 seconds\n\n\n if (unit === 'second') {\n return locale.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins\n } else if (unit === 'minute') {\n return locale.formatDistance('xMinutes', minutes, localizeOptions); // 1 up to 24 hours\n } else if (unit === 'hour') {\n var hours = roundingMethodFn(minutes / 60);\n return locale.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days\n } else if (unit === 'day') {\n var days = roundingMethodFn(minutes / MINUTES_IN_DAY);\n return locale.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months\n } else if (unit === 'month') {\n var months = roundingMethodFn(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date\n } else if (unit === 'year') {\n var years = roundingMethodFn(minutes / MINUTES_IN_YEAR);\n return locale.formatDistance('xYears', years, localizeOptions);\n }\n\n throw new RangeError(\"unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\");\n}","import distanceInWords from '../formatDistance/index.js';\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `distanceInWordsToNow ` to `formatDistanceToNow`\n * to make its name consistent with `format` and `formatRelative`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsToNow(new Date(2014, 6, 2), { addSuffix: true })\n * //=> 'in 6 months'\n *\n * // v2.0.0 onward\n *\n * formatDistanceToNow(new Date(2014, 6, 2), { addSuffix: true })\n * //=> 'in 6 months'\n * ```\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result specifies if now is earlier or later than the passed date\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * var result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * var result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * var result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * var eoLocale = require('date-fns/locale/eo')\n * var result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\n\nexport default function formatDistanceToNow(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return distanceInWords(dirtyDate, Date.now(), dirtyOptions);\n}","import differenceInCalendarDays from '../differenceInCalendarDays/index.js';\nimport format from '../format/index.js';\nimport defaultLocale from '../locale/en-US/index.js';\nimport subMilliseconds from '../subMilliseconds/index.js';\nimport toDate from '../toDate/index.js';\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\n/**\n * @name formatRelative\n * @category Common Helpers\n * @summary Represent the date in words relative to the given base date.\n *\n * @description\n * Represent the date in words relative to the given base date.\n *\n * | Distance to the base date | Result |\n * |---------------------------|---------------------------|\n * | Previous 6 days | last Sunday at 04:30 AM |\n * | Last day | yesterday at 04:30 AM |\n * | Same day | today at 04:30 AM |\n * | Next day | tomorrow at 04:30 AM |\n * | Next 6 days | Sunday at 04:30 AM |\n * | Other | 12/31/2017 |\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to format\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {String} the date in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.locale` must contain `formatRelative` property\n */\n\nexport default function formatRelative(dirtyDate, dirtyBaseDate, dirtyOptions) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var baseDate = toDate(dirtyBaseDate);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n if (!locale.formatRelative) {\n throw new RangeError('locale must contain formatRelative property');\n }\n\n var diff = differenceInCalendarDays(date, baseDate);\n\n if (isNaN(diff)) {\n throw new RangeError('Invalid time value');\n }\n\n var token;\n\n if (diff < -6) {\n token = 'other';\n } else if (diff < -1) {\n token = 'lastWeek';\n } else if (diff < 0) {\n token = 'yesterday';\n } else if (diff < 1) {\n token = 'today';\n } else if (diff < 2) {\n token = 'tomorrow';\n } else if (diff < 7) {\n token = 'nextWeek';\n } else {\n token = 'other';\n }\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var utcBaseDate = subMilliseconds(baseDate, getTimezoneOffsetInMilliseconds(baseDate));\n var formatStr = locale.formatRelative(token, utcDate, utcBaseDate, options);\n return format(date, formatStr, options);\n}","import toDate from '../toDate/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name fromUnixTime\n * @category Timestamp Helpers\n * @summary Create a date from a Unix timestamp.\n *\n * @description\n * Create a date from a Unix timestamp.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Number} unixTime - the given Unix timestamp\n * @returns {Date} the date\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Create the date 29 February 2012 11:45:05:\n * var result = fromUnixTime(1330515905)\n * //=> Wed Feb 29 2012 11:45:05\n */\n\nexport default function fromUnixTime(dirtyUnixTime) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var unixTime = toInteger(dirtyUnixTime);\n return toDate(unixTime * 1000);\n}","import toDate from '../toDate/index.js';\n/**\n * @name getDate\n * @category Day Helpers\n * @summary Get the day of the month of the given date.\n *\n * @description\n * Get the day of the month of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the day of month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which day of the month is 29 February 2012?\n * var result = getDate(new Date(2012, 1, 29))\n * //=> 29\n */\n\nexport default function getDate(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var dayOfMonth = date.getDate();\n return dayOfMonth;\n}","import toDate from '../toDate/index.js';\n/**\n * @name getDay\n * @category Weekday Helpers\n * @summary Get the day of the week of the given date.\n *\n * @description\n * Get the day of the week of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the day of week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which day of the week is 29 February 2012?\n * var result = getDay(new Date(2012, 1, 29))\n * //=> 3\n */\n\nexport default function getDay(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n return day;\n}","import toDate from '../toDate/index.js';\nimport startOfYear from '../startOfYear/index.js';\nimport differenceInCalendarDays from '../differenceInCalendarDays/index.js';\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the day of year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * var result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\n\nexport default function getDayOfYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var diff = differenceInCalendarDays(date, startOfYear(date));\n var dayOfYear = diff + 1;\n return dayOfYear;\n}","import toDate from '../toDate/index.js';\n/**\n * @name getDaysInMonth\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of days in a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many days are in February 2000?\n * var result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\n\nexport default function getDaysInMonth(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var monthIndex = date.getMonth();\n var lastDayOfMonth = new Date(0);\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\n lastDayOfMonth.setHours(0, 0, 0, 0);\n return lastDayOfMonth.getDate();\n}","import toDate from '../toDate/index.js';\nimport isLeapYear from '../isLeapYear/index.js';\n/**\n * @name getDaysInYear\n * @category Year Helpers\n * @summary Get the number of days in a year of the given date.\n *\n * @description\n * Get the number of days in a year of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of days in a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many days are in 2012?\n * var result = getDaysInYear(new Date(2012, 0, 1))\n * //=> 366\n */\n\nexport default function getDaysInYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n\n if (isNaN(date)) {\n return NaN;\n }\n\n return isLeapYear(date) ? 366 : 365;\n}","import toDate from '../toDate/index.js';\n/**\n * @name getDecade\n * @category Decade Helpers\n * @summary Get the decade of the given date.\n *\n * @description\n * Get the decade of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the year of decade\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which decade belongs 27 November 1942?\n * var result = getDecade(new Date(1942, 10, 27))\n * //=> 1940\n */\n\nexport default function getDecade(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var decade = Math.floor(year / 10) * 10;\n return decade;\n}","import toDate from '../toDate/index.js';\n/**\n * @name getHours\n * @category Hour Helpers\n * @summary Get the hours of the given date.\n *\n * @description\n * Get the hours of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the hours\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the hours of 29 February 2012 11:45:00:\n * var result = getHours(new Date(2012, 1, 29, 11, 45))\n * //=> 11\n */\n\nexport default function getHours(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var hours = date.getHours();\n return hours;\n}","import toDate from '../toDate/index.js';\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the day of ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * var result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\n\nexport default function getISODay(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}","import toDate from '../toDate/index.js';\nimport startOfISOWeek from '../startOfISOWeek/index.js';\nimport startOfISOWeekYear from '../startOfISOWeekYear/index.js';\nvar MILLISECONDS_IN_WEEK = 604800000;\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * var result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\n\nexport default function getISOWeek(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var diff = startOfISOWeek(date).getTime() - startOfISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import toDate from '../toDate/index.js';\nimport startOfISOWeek from '../startOfISOWeek/index.js';\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `getISOYear` to `getISOWeekYear`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the ISO week-numbering year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * var result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\n\nexport default function getISOWeekYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import startOfISOWeekYear from '../startOfISOWeekYear/index.js';\nimport addWeeks from '../addWeeks/index.js';\nvar MILLISECONDS_IN_WEEK = 604800000;\n/**\n * @name getISOWeeksInYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of weeks in an ISO week-numbering year of the given date.\n *\n * @description\n * Get the number of weeks in an ISO week-numbering year of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of ISO weeks in a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many weeks are in ISO week-numbering year 2015?\n * var result = getISOWeeksInYear(new Date(2015, 1, 11))\n * //=> 53\n */\n\nexport default function getISOWeeksInYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var thisYear = startOfISOWeekYear(dirtyDate);\n var nextYear = startOfISOWeekYear(addWeeks(thisYear, 60));\n var diff = nextYear.valueOf() - thisYear.valueOf(); // Round the number of weeks to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK);\n}","import toDate from '../toDate/index.js';\n/**\n * @name getMilliseconds\n * @category Millisecond Helpers\n * @summary Get the milliseconds of the given date.\n *\n * @description\n * Get the milliseconds of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the milliseconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the milliseconds of 29 February 2012 11:45:05.123:\n * var result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 123\n */\n\nexport default function getMilliseconds(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var milliseconds = date.getMilliseconds();\n return milliseconds;\n}","import toDate from '../toDate/index.js';\n/**\n * @name getMinutes\n * @category Minute Helpers\n * @summary Get the minutes of the given date.\n *\n * @description\n * Get the minutes of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the minutes\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the minutes of 29 February 2012 11:45:05:\n * var result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))\n * //=> 45\n */\n\nexport default function getMinutes(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var minutes = date.getMinutes();\n return minutes;\n}","import toDate from '../toDate/index.js';\n/**\n * @name getMonth\n * @category Month Helpers\n * @summary Get the month of the given date.\n *\n * @description\n * Get the month of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which month is 29 February 2012?\n * var result = getMonth(new Date(2012, 1, 29))\n * //=> 1\n */\n\nexport default function getMonth(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n return month;\n}","import toDate from '../toDate/index.js';\nvar MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000;\n/**\n * @name getOverlappingDaysInIntervals\n * @category Interval Helpers\n * @summary Get the number of days that overlap in two time intervals\n *\n * @description\n * Get the number of days that overlap in two time intervals\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `getOverlappingDaysInRanges` to `getOverlappingDaysInIntervals`.\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\n *\n * ```\n * 2.1.3\n * time interval\n * part of the time axis limited by two instants\n * ```\n *\n * Also, this function now accepts an object with `start` and `end` properties\n * instead of two arguments as an interval.\n * This function now throws `RangeError` if the start of the interval is after its end\n * or if any date in the interval is `Invalid Date`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * getOverlappingDaysInRanges(\n * new Date(2014, 0, 10), new Date(2014, 0, 20),\n * new Date(2014, 0, 17), new Date(2014, 0, 21)\n * )\n *\n * // v2.0.0 onward\n *\n * getOverlappingDaysInIntervals(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\n * )\n * ```\n *\n * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link docs/Interval}\n * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link docs/Interval}\n * @returns {Number} the number of days that overlap in two time intervals\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // For overlapping time intervals adds 1 for each started overlapping day:\n * getOverlappingDaysInIntervals(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\n * )\n * //=> 3\n *\n * @example\n * // For non-overlapping time intervals returns 0:\n * getOverlappingDaysInIntervals(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }\n * )\n * //=> 0\n */\n\nexport default function getOverlappingDaysInIntervals(dirtyIntervalLeft, dirtyIntervalRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var intervalLeft = dirtyIntervalLeft || {};\n var intervalRight = dirtyIntervalRight || {};\n var leftStartTime = toDate(intervalLeft.start).getTime();\n var leftEndTime = toDate(intervalLeft.end).getTime();\n var rightStartTime = toDate(intervalRight.start).getTime();\n var rightEndTime = toDate(intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var isOverlapping = leftStartTime < rightEndTime && rightStartTime < leftEndTime;\n\n if (!isOverlapping) {\n return 0;\n }\n\n var overlapStartDate = rightStartTime < leftStartTime ? leftStartTime : rightStartTime;\n var overlapEndDate = rightEndTime > leftEndTime ? leftEndTime : rightEndTime;\n var differenceInMs = overlapEndDate - overlapStartDate;\n return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY);\n}","import toDate from '../toDate/index.js';\n/**\n * @name getQuarter\n * @category Quarter Helpers\n * @summary Get the year quarter of the given date.\n *\n * @description\n * Get the year quarter of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the quarter\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which quarter is 2 July 2014?\n * var result = getQuarter(new Date(2014, 6, 2))\n * //=> 3\n */\n\nexport default function getQuarter(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var quarter = Math.floor(date.getMonth() / 3) + 1;\n return quarter;\n}","import toDate from '../toDate/index.js';\n/**\n * @name getSeconds\n * @category Second Helpers\n * @summary Get the seconds of the given date.\n *\n * @description\n * Get the seconds of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the seconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the seconds of 29 February 2012 11:45:05.123:\n * var result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 5\n */\n\nexport default function getSeconds(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var seconds = date.getSeconds();\n return seconds;\n}","import toDate from '../toDate/index.js';\n/**\n * @name getTime\n * @category Timestamp Helpers\n * @summary Get the milliseconds timestamp of the given date.\n *\n * @description\n * Get the milliseconds timestamp of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the timestamp\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the timestamp of 29 February 2012 11:45:05.123:\n * var result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 1330515905123\n */\n\nexport default function getTime(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n return timestamp;\n}","import getTime from '../getTime/index.js';\n/**\n * @name getUnixTime\n * @category Timestamp Helpers\n * @summary Get the seconds timestamp of the given date.\n *\n * @description\n * Get the seconds timestamp of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the timestamp\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the timestamp of 29 February 2012 11:45:05 CET:\n * var result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5))\n * //=> 1330512305\n */\n\nexport default function getUnixTime(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return Math.floor(getTime(dirtyDate) / 1000);\n}","import startOfWeek from '../startOfWeek/index.js';\nimport startOfWeekYear from '../startOfWeekYear/index.js';\nimport toDate from '../toDate/index.js';\nvar MILLISECONDS_IN_WEEK = 604800000;\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @returns {Number} the week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * var result = getISOWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * var result = getISOWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport default function getWeek(dirtyDate, options) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var diff = startOfWeek(date, options).getTime() - startOfWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import getDate from '../getDate/index.js';\nimport getDay from '../getDay/index.js';\nimport startOfMonth from '../startOfMonth/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name getWeekOfMonth\n * @category Week Helpers\n * @summary Get the week of the month of the given date.\n *\n * @description\n * Get the week of the month of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Number} the week of month\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Which week of the month is 9 November 2017?\n * var result = getWeekOfMonth(new Date(2017, 10, 9))\n * //=> 2\n */\n\nexport default function getWeekOfMonth(date, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var currentDayOfMonth = getDate(date);\n\n if (isNaN(currentDayOfMonth)) {\n return currentDayOfMonth;\n }\n\n var startWeekDay = getDay(startOfMonth(date));\n var lastDayOfFirstWeek = 0;\n\n if (startWeekDay >= weekStartsOn) {\n lastDayOfFirstWeek = weekStartsOn + 7 - startWeekDay;\n } else {\n lastDayOfFirstWeek = weekStartsOn - startWeekDay;\n }\n\n var weekNumber = 1;\n\n if (currentDayOfMonth > lastDayOfFirstWeek) {\n var remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek;\n weekNumber = weekNumber + Math.ceil(remainingDaysAfterFirstWeek / 7);\n }\n\n return weekNumber;\n}","import startOfWeek from '../startOfWeek/index.js';\nimport toDate from '../toDate/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @returns {Number} the local week-numbering year\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * var result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * var result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * var result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\n\nexport default function getWeekYear(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n var startOfNextYear = startOfWeek(firstWeekOfNextYear, dirtyOptions);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n var startOfThisYear = startOfWeek(firstWeekOfThisYear, dirtyOptions);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import differenceInCalendarWeeks from '../differenceInCalendarWeeks/index.js';\nimport lastDayOfMonth from '../lastDayOfMonth/index.js';\nimport startOfMonth from '../startOfMonth/index.js';\n/**\n * @name getWeeksInMonth\n * @category Week Helpers\n * @summary Get the number of calendar weeks a month spans.\n *\n * @description\n * Get the number of calendar weeks the month in the given date spans.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Number} the number of calendar weeks\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // How many calendar weeks does February 2015 span?\n * var result = getWeeksInMonth(new Date(2015, 1, 8))\n * //=> 4\n *\n * @example\n * // If the week starts on Monday,\n * // how many calendar weeks does July 2017 span?\n * var result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 })\n * //=> 6\n */\n\nexport default function getWeeksInMonth(date, options) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return differenceInCalendarWeeks(lastDayOfMonth(date), startOfMonth(date), options) + 1;\n}","import toDate from '../toDate/index.js';\n/**\n * @name getYear\n * @category Year Helpers\n * @summary Get the year of the given date.\n *\n * @description\n * Get the year of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which year is 2 July 2014?\n * var result = getYear(new Date(2014, 6, 2))\n * //=> 2014\n */\n\nexport default function getYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n return year;\n}","// This file is generated automatically by `scripts/build/indices.js`. Please, don't change it.\nexport { default as addBusinessDays } from './addBusinessDays/index.js';\nexport { default as addDays } from './addDays/index.js';\nexport { default as addHours } from './addHours/index.js';\nexport { default as addISOWeekYears } from './addISOWeekYears/index.js';\nexport { default as addMilliseconds } from './addMilliseconds/index.js';\nexport { default as addMinutes } from './addMinutes/index.js';\nexport { default as addMonths } from './addMonths/index.js';\nexport { default as addQuarters } from './addQuarters/index.js';\nexport { default as addSeconds } from './addSeconds/index.js';\nexport { default as addWeeks } from './addWeeks/index.js';\nexport { default as addYears } from './addYears/index.js';\nexport { default as areIntervalsOverlapping } from './areIntervalsOverlapping/index.js';\nexport { default as closestIndexTo } from './closestIndexTo/index.js';\nexport { default as closestTo } from './closestTo/index.js';\nexport { default as compareAsc } from './compareAsc/index.js';\nexport { default as compareDesc } from './compareDesc/index.js';\nexport { default as differenceInBusinessDays } from './differenceInBusinessDays/index.js';\nexport { default as differenceInCalendarDays } from './differenceInCalendarDays/index.js';\nexport { default as differenceInCalendarISOWeekYears } from './differenceInCalendarISOWeekYears/index.js';\nexport { default as differenceInCalendarISOWeeks } from './differenceInCalendarISOWeeks/index.js';\nexport { default as differenceInCalendarMonths } from './differenceInCalendarMonths/index.js';\nexport { default as differenceInCalendarQuarters } from './differenceInCalendarQuarters/index.js';\nexport { default as differenceInCalendarWeeks } from './differenceInCalendarWeeks/index.js';\nexport { default as differenceInCalendarYears } from './differenceInCalendarYears/index.js';\nexport { default as differenceInDays } from './differenceInDays/index.js';\nexport { default as differenceInHours } from './differenceInHours/index.js';\nexport { default as differenceInISOWeekYears } from './differenceInISOWeekYears/index.js';\nexport { default as differenceInMilliseconds } from './differenceInMilliseconds/index.js';\nexport { default as differenceInMinutes } from './differenceInMinutes/index.js';\nexport { default as differenceInMonths } from './differenceInMonths/index.js';\nexport { default as differenceInQuarters } from './differenceInQuarters/index.js';\nexport { default as differenceInSeconds } from './differenceInSeconds/index.js';\nexport { default as differenceInWeeks } from './differenceInWeeks/index.js';\nexport { default as differenceInYears } from './differenceInYears/index.js';\nexport { default as eachDayOfInterval } from './eachDayOfInterval/index.js';\nexport { default as eachWeekOfInterval } from './eachWeekOfInterval/index.js';\nexport { default as eachWeekendOfInterval } from './eachWeekendOfInterval/index.js';\nexport { default as eachWeekendOfMonth } from './eachWeekendOfMonth/index.js';\nexport { default as eachWeekendOfYear } from './eachWeekendOfYear/index.js';\nexport { default as endOfDay } from './endOfDay/index.js';\nexport { default as endOfDecade } from './endOfDecade/index.js';\nexport { default as endOfHour } from './endOfHour/index.js';\nexport { default as endOfISOWeek } from './endOfISOWeek/index.js';\nexport { default as endOfISOWeekYear } from './endOfISOWeekYear/index.js';\nexport { default as endOfMinute } from './endOfMinute/index.js';\nexport { default as endOfMonth } from './endOfMonth/index.js';\nexport { default as endOfQuarter } from './endOfQuarter/index.js';\nexport { default as endOfSecond } from './endOfSecond/index.js';\nexport { default as endOfToday } from './endOfToday/index.js';\nexport { default as endOfTomorrow } from './endOfTomorrow/index.js';\nexport { default as endOfWeek } from './endOfWeek/index.js';\nexport { default as endOfYear } from './endOfYear/index.js';\nexport { default as endOfYesterday } from './endOfYesterday/index.js';\nexport { default as format } from './format/index.js';\nexport { default as formatDistance } from './formatDistance/index.js';\nexport { default as formatDistanceStrict } from './formatDistanceStrict/index.js';\nexport { default as formatDistanceToNow } from './formatDistanceToNow/index.js';\nexport { default as formatRelative } from './formatRelative/index.js';\nexport { default as fromUnixTime } from './fromUnixTime/index.js';\nexport { default as getDate } from './getDate/index.js';\nexport { default as getDay } from './getDay/index.js';\nexport { default as getDayOfYear } from './getDayOfYear/index.js';\nexport { default as getDaysInMonth } from './getDaysInMonth/index.js';\nexport { default as getDaysInYear } from './getDaysInYear/index.js';\nexport { default as getDecade } from './getDecade/index.js';\nexport { default as getHours } from './getHours/index.js';\nexport { default as getISODay } from './getISODay/index.js';\nexport { default as getISOWeek } from './getISOWeek/index.js';\nexport { default as getISOWeekYear } from './getISOWeekYear/index.js';\nexport { default as getISOWeeksInYear } from './getISOWeeksInYear/index.js';\nexport { default as getMilliseconds } from './getMilliseconds/index.js';\nexport { default as getMinutes } from './getMinutes/index.js';\nexport { default as getMonth } from './getMonth/index.js';\nexport { default as getOverlappingDaysInIntervals } from './getOverlappingDaysInIntervals/index.js';\nexport { default as getQuarter } from './getQuarter/index.js';\nexport { default as getSeconds } from './getSeconds/index.js';\nexport { default as getTime } from './getTime/index.js';\nexport { default as getUnixTime } from './getUnixTime/index.js';\nexport { default as getWeek } from './getWeek/index.js';\nexport { default as getWeekOfMonth } from './getWeekOfMonth/index.js';\nexport { default as getWeekYear } from './getWeekYear/index.js';\nexport { default as getWeeksInMonth } from './getWeeksInMonth/index.js';\nexport { default as getYear } from './getYear/index.js';\nexport { default as isAfter } from './isAfter/index.js';\nexport { default as isBefore } from './isBefore/index.js';\nexport { default as isDate } from './isDate/index.js';\nexport { default as isEqual } from './isEqual/index.js';\nexport { default as isFirstDayOfMonth } from './isFirstDayOfMonth/index.js';\nexport { default as isFriday } from './isFriday/index.js';\nexport { default as isFuture } from './isFuture/index.js';\nexport { default as isLastDayOfMonth } from './isLastDayOfMonth/index.js';\nexport { default as isLeapYear } from './isLeapYear/index.js';\nexport { default as isMonday } from './isMonday/index.js';\nexport { default as isPast } from './isPast/index.js';\nexport { default as isSameDay } from './isSameDay/index.js';\nexport { default as isSameHour } from './isSameHour/index.js';\nexport { default as isSameISOWeek } from './isSameISOWeek/index.js';\nexport { default as isSameISOWeekYear } from './isSameISOWeekYear/index.js';\nexport { default as isSameMinute } from './isSameMinute/index.js';\nexport { default as isSameMonth } from './isSameMonth/index.js';\nexport { default as isSameQuarter } from './isSameQuarter/index.js';\nexport { default as isSameSecond } from './isSameSecond/index.js';\nexport { default as isSameWeek } from './isSameWeek/index.js';\nexport { default as isSameYear } from './isSameYear/index.js';\nexport { default as isSaturday } from './isSaturday/index.js';\nexport { default as isSunday } from './isSunday/index.js';\nexport { default as isThisHour } from './isThisHour/index.js';\nexport { default as isThisISOWeek } from './isThisISOWeek/index.js';\nexport { default as isThisMinute } from './isThisMinute/index.js';\nexport { default as isThisMonth } from './isThisMonth/index.js';\nexport { default as isThisQuarter } from './isThisQuarter/index.js';\nexport { default as isThisSecond } from './isThisSecond/index.js';\nexport { default as isThisWeek } from './isThisWeek/index.js';\nexport { default as isThisYear } from './isThisYear/index.js';\nexport { default as isThursday } from './isThursday/index.js';\nexport { default as isToday } from './isToday/index.js';\nexport { default as isTomorrow } from './isTomorrow/index.js';\nexport { default as isTuesday } from './isTuesday/index.js';\nexport { default as isValid } from './isValid/index.js';\nexport { default as isWednesday } from './isWednesday/index.js';\nexport { default as isWeekend } from './isWeekend/index.js';\nexport { default as isWithinInterval } from './isWithinInterval/index.js';\nexport { default as isYesterday } from './isYesterday/index.js';\nexport { default as lastDayOfDecade } from './lastDayOfDecade/index.js';\nexport { default as lastDayOfISOWeek } from './lastDayOfISOWeek/index.js';\nexport { default as lastDayOfISOWeekYear } from './lastDayOfISOWeekYear/index.js';\nexport { default as lastDayOfMonth } from './lastDayOfMonth/index.js';\nexport { default as lastDayOfQuarter } from './lastDayOfQuarter/index.js';\nexport { default as lastDayOfWeek } from './lastDayOfWeek/index.js';\nexport { default as lastDayOfYear } from './lastDayOfYear/index.js';\nexport { default as lightFormat } from './lightFormat/index.js';\nexport { default as max } from './max/index.js';\nexport { default as min } from './min/index.js';\nexport { default as parse } from './parse/index.js';\nexport { default as parseISO } from './parseISO/index.js';\nexport { default as roundToNearestMinutes } from './roundToNearestMinutes/index.js';\nexport { default as setDate } from './setDate/index.js';\nexport { default as setDay } from './setDay/index.js';\nexport { default as setDayOfYear } from './setDayOfYear/index.js';\nexport { default as setHours } from './setHours/index.js';\nexport { default as setISODay } from './setISODay/index.js';\nexport { default as setISOWeek } from './setISOWeek/index.js';\nexport { default as setISOWeekYear } from './setISOWeekYear/index.js';\nexport { default as setMilliseconds } from './setMilliseconds/index.js';\nexport { default as setMinutes } from './setMinutes/index.js';\nexport { default as setMonth } from './setMonth/index.js';\nexport { default as setQuarter } from './setQuarter/index.js';\nexport { default as setSeconds } from './setSeconds/index.js';\nexport { default as setWeek } from './setWeek/index.js';\nexport { default as setWeekYear } from './setWeekYear/index.js';\nexport { default as setYear } from './setYear/index.js';\nexport { default as startOfDay } from './startOfDay/index.js';\nexport { default as startOfDecade } from './startOfDecade/index.js';\nexport { default as startOfHour } from './startOfHour/index.js';\nexport { default as startOfISOWeek } from './startOfISOWeek/index.js';\nexport { default as startOfISOWeekYear } from './startOfISOWeekYear/index.js';\nexport { default as startOfMinute } from './startOfMinute/index.js';\nexport { default as startOfMonth } from './startOfMonth/index.js';\nexport { default as startOfQuarter } from './startOfQuarter/index.js';\nexport { default as startOfSecond } from './startOfSecond/index.js';\nexport { default as startOfToday } from './startOfToday/index.js';\nexport { default as startOfTomorrow } from './startOfTomorrow/index.js';\nexport { default as startOfWeek } from './startOfWeek/index.js';\nexport { default as startOfWeekYear } from './startOfWeekYear/index.js';\nexport { default as startOfYear } from './startOfYear/index.js';\nexport { default as startOfYesterday } from './startOfYesterday/index.js';\nexport { default as subDays } from './subDays/index.js';\nexport { default as subHours } from './subHours/index.js';\nexport { default as subISOWeekYears } from './subISOWeekYears/index.js';\nexport { default as subMilliseconds } from './subMilliseconds/index.js';\nexport { default as subMinutes } from './subMinutes/index.js';\nexport { default as subMonths } from './subMonths/index.js';\nexport { default as subQuarters } from './subQuarters/index.js';\nexport { default as subSeconds } from './subSeconds/index.js';\nexport { default as subWeeks } from './subWeeks/index.js';\nexport { default as subYears } from './subYears/index.js';\nexport { default as toDate } from './toDate/index.js';\nexport * from './constants/index.js';","import toDate from '../toDate/index.js';\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date that should be after the other one to return true\n * @param {Date|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is after the second date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\n\nexport default function isAfter(dirtyDate, dirtyDateToCompare) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var dateToCompare = toDate(dirtyDateToCompare);\n return date.getTime() > dateToCompare.getTime();\n}","import toDate from '../toDate/index.js';\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date that should be before the other one to return true\n * @param {Date|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is before the second date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\n\nexport default function isBefore(dirtyDate, dirtyDateToCompare) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var dateToCompare = toDate(dirtyDateToCompare);\n return date.getTime() < dateToCompare.getTime();\n}","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\n *\n * @example\n * // For a valid date:\n * var result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * var result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * var result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * var result = isDate({})\n * //=> false\n */\nexport default function isDate(value) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}","import toDate from '../toDate/index.js';\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Boolean} the dates are equal\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * var result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\n\nexport default function isEqual(dirtyLeftDate, dirtyRightDate) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyLeftDate);\n var dateRight = toDate(dirtyRightDate);\n return dateLeft.getTime() === dateRight.getTime();\n}","import toDate from '../toDate/index.js';\n/**\n * @name isFirstDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the first day of a month?\n *\n * @description\n * Is the given date the first day of a month?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is the first day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 1 September 2014 the first day of a month?\n * var result = isFirstDayOfMonth(new Date(2014, 8, 1))\n * //=> true\n */\n\nexport default function isFirstDayOfMonth(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return toDate(dirtyDate).getDate() === 1;\n}","import toDate from '../toDate/index.js';\n/**\n * @name isFriday\n * @category Weekday Helpers\n * @summary Is the given date Friday?\n *\n * @description\n * Is the given date Friday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Friday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 26 September 2014 Friday?\n * var result = isFriday(new Date(2014, 8, 26))\n * //=> true\n */\n\nexport default function isFriday(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return toDate(dirtyDate).getDay() === 5;\n}","import toDate from '../toDate/index.js';\n/**\n * @name isFuture\n * @category Common Helpers\n * @summary Is the given date in the future?\n * @pure false\n *\n * @description\n * Is the given date in the future?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in the future\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 31 December 2014 in the future?\n * var result = isFuture(new Date(2014, 11, 31))\n * //=> true\n */\n\nexport default function isFuture(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return toDate(dirtyDate).getTime() > Date.now();\n}","import toDate from '../toDate/index.js';\nimport endOfDay from '../endOfDay/index.js';\nimport endOfMonth from '../endOfMonth/index.js';\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is the last day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * var result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\n\nexport default function isLastDayOfMonth(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n return endOfDay(date).getTime() === endOfMonth(date).getTime();\n}","import toDate from '../toDate/index.js';\n/**\n * @name isLeapYear\n * @category Year Helpers\n * @summary Is the given date in the leap year?\n *\n * @description\n * Is the given date in the leap year?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in the leap year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 1 September 2012 in the leap year?\n * var result = isLeapYear(new Date(2012, 8, 1))\n * //=> true\n */\n\nexport default function isLeapYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}","import toDate from '../toDate/index.js';\n/**\n * @name isMonday\n * @category Weekday Helpers\n * @summary Is the given date Monday?\n *\n * @description\n * Is the given date Monday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Monday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 22 September 2014 Monday?\n * var result = isMonday(new Date(2014, 8, 22))\n * //=> true\n */\n\nexport default function isMonday(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return toDate(dirtyDate).getDay() === 1;\n}","import toDate from '../toDate/index.js';\n/**\n * @name isPast\n * @category Common Helpers\n * @summary Is the given date in the past?\n * @pure false\n *\n * @description\n * Is the given date in the past?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in the past\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 2 July 2014 in the past?\n * var result = isPast(new Date(2014, 6, 2))\n * //=> true\n */\n\nexport default function isPast(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return toDate(dirtyDate).getTime() < Date.now();\n}","import startOfDay from '../startOfDay/index.js';\n/**\n * @name isSameDay\n * @category Day Helpers\n * @summary Are the given dates in the same day?\n *\n * @description\n * Are the given dates in the same day?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same day\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * var result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\n * //=> true\n */\n\nexport default function isSameDay(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeftStartOfDay = startOfDay(dirtyDateLeft);\n var dateRightStartOfDay = startOfDay(dirtyDateRight);\n return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();\n}","import startOfHour from '../startOfHour/index.js';\n/**\n * @name isSameHour\n * @category Hour Helpers\n * @summary Are the given dates in the same hour?\n *\n * @description\n * Are the given dates in the same hour?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same hour\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour?\n * var result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30))\n * //=> true\n */\n\nexport default function isSameHour(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeftStartOfHour = startOfHour(dirtyDateLeft);\n var dateRightStartOfHour = startOfHour(dirtyDateRight);\n return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime();\n}","import isSameWeek from '../isSameWeek/index.js';\n/**\n * @name isSameISOWeek\n * @category ISO Week Helpers\n * @summary Are the given dates in the same ISO week?\n *\n * @description\n * Are the given dates in the same ISO week?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same ISO week\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 1 September 2014 and 7 September 2014 in the same ISO week?\n * var result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7))\n * //=> true\n */\n\nexport default function isSameISOWeek(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n return isSameWeek(dirtyDateLeft, dirtyDateRight, {\n weekStartsOn: 1\n });\n}","import startOfISOWeekYear from '../startOfISOWeekYear/index.js';\n/**\n * @name isSameISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Are the given dates in the same ISO week-numbering year?\n *\n * @description\n * Are the given dates in the same ISO week-numbering year?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `isSameISOYear` to `isSameISOWeekYear`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same ISO week-numbering year\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year?\n * var result = isSameISOWeekYear(new Date(2003, 11, 29), new Date(2005, 0, 2))\n * //=> true\n */\n\nexport default function isSameISOWeekYear(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeftStartOfYear = startOfISOWeekYear(dirtyDateLeft);\n var dateRightStartOfYear = startOfISOWeekYear(dirtyDateRight);\n return dateLeftStartOfYear.getTime() === dateRightStartOfYear.getTime();\n}","import startOfMinute from '../startOfMinute/index.js';\n/**\n * @name isSameMinute\n * @category Minute Helpers\n * @summary Are the given dates in the same minute?\n *\n * @description\n * Are the given dates in the same minute?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same minute\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15\n * // in the same minute?\n * var result = isSameMinute(\n * new Date(2014, 8, 4, 6, 30),\n * new Date(2014, 8, 4, 6, 30, 15)\n * )\n * //=> true\n */\n\nexport default function isSameMinute(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeftStartOfMinute = startOfMinute(dirtyDateLeft);\n var dateRightStartOfMinute = startOfMinute(dirtyDateRight);\n return dateLeftStartOfMinute.getTime() === dateRightStartOfMinute.getTime();\n}","import toDate from '../toDate/index.js';\n/**\n * @name isSameMonth\n * @category Month Helpers\n * @summary Are the given dates in the same month?\n *\n * @description\n * Are the given dates in the same month?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same month\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * var result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\n\nexport default function isSameMonth(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth();\n}","import startOfQuarter from '../startOfQuarter/index.js';\n/**\n * @name isSameQuarter\n * @category Quarter Helpers\n * @summary Are the given dates in the same year quarter?\n *\n * @description\n * Are the given dates in the same year quarter?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same quarter\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 1 January 2014 and 8 March 2014 in the same quarter?\n * var result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8))\n * //=> true\n */\n\nexport default function isSameQuarter(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeftStartOfQuarter = startOfQuarter(dirtyDateLeft);\n var dateRightStartOfQuarter = startOfQuarter(dirtyDateRight);\n return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime();\n}","import startOfSecond from '../startOfSecond/index.js';\n/**\n * @name isSameSecond\n * @category Second Helpers\n * @summary Are the given dates in the same second?\n *\n * @description\n * Are the given dates in the same second?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same second\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500\n * // in the same second?\n * var result = isSameSecond(\n * new Date(2014, 8, 4, 6, 30, 15),\n * new Date(2014, 8, 4, 6, 30, 15, 500)\n * )\n * //=> true\n */\n\nexport default function isSameSecond(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeftStartOfSecond = startOfSecond(dirtyDateLeft);\n var dateRightStartOfSecond = startOfSecond(dirtyDateRight);\n return dateLeftStartOfSecond.getTime() === dateRightStartOfSecond.getTime();\n}","import startOfWeek from '../startOfWeek/index.js';\n/**\n * @name isSameWeek\n * @category Week Helpers\n * @summary Are the given dates in the same week?\n *\n * @description\n * Are the given dates in the same week?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Boolean} the dates are in the same week\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\n * weekStartsOn: 1\n * })\n * //=> false\n */\n\nexport default function isSameWeek(dirtyDateLeft, dirtyDateRight, dirtyOptions) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeftStartOfWeek = startOfWeek(dirtyDateLeft, dirtyOptions);\n var dateRightStartOfWeek = startOfWeek(dirtyDateRight, dirtyOptions);\n return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime();\n}","import toDate from '../toDate/index.js';\n/**\n * @name isSameYear\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same year\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * var result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\n\nexport default function isSameYear(dirtyDateLeft, dirtyDateRight) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear();\n}","import toDate from '../toDate/index.js';\n/**\n * @name isSaturday\n * @category Weekday Helpers\n * @summary Is the given date Saturday?\n *\n * @description\n * Is the given date Saturday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Saturday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 27 September 2014 Saturday?\n * var result = isSaturday(new Date(2014, 8, 27))\n * //=> true\n */\n\nexport default function isSaturday(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return toDate(dirtyDate).getDay() === 6;\n}","import toDate from '../toDate/index.js';\n/**\n * @name isSunday\n * @category Weekday Helpers\n * @summary Is the given date Sunday?\n *\n * @description\n * Is the given date Sunday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Sunday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 21 September 2014 Sunday?\n * var result = isSunday(new Date(2014, 8, 21))\n * //=> true\n */\n\nexport default function isSunday(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return toDate(dirtyDate).getDay() === 0;\n}","import isSameHour from '../isSameHour/index.js';\n/**\n * @name isThisHour\n * @category Hour Helpers\n * @summary Is the given date in the same hour as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same hour as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this hour\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:00:00 in this hour?\n * var result = isThisHour(new Date(2014, 8, 25, 18))\n * //=> true\n */\n\nexport default function isThisHour(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameHour(Date.now(), dirtyDate);\n}","import isSameISOWeek from '../isSameISOWeek/index.js';\n/**\n * @name isThisISOWeek\n * @category ISO Week Helpers\n * @summary Is the given date in the same ISO week as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same ISO week as the current date?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 25 September 2014, is 22 September 2014 in this ISO week?\n * var result = isThisISOWeek(new Date(2014, 8, 22))\n * //=> true\n */\n\nexport default function isThisISOWeek(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameISOWeek(dirtyDate, Date.now());\n}","import isSameMinute from '../isSameMinute/index.js';\n/**\n * @name isThisMinute\n * @category Minute Helpers\n * @summary Is the given date in the same minute as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same minute as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this minute\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:30:00 in this minute?\n * var result = isThisMinute(new Date(2014, 8, 25, 18, 30))\n * //=> true\n */\n\nexport default function isThisMinute(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameMinute(Date.now(), dirtyDate);\n}","import isSameMonth from '../isSameMonth/index.js';\n/**\n * @name isThisMonth\n * @category Month Helpers\n * @summary Is the given date in the same month as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same month as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 25 September 2014, is 15 September 2014 in this month?\n * var result = isThisMonth(new Date(2014, 8, 15))\n * //=> true\n */\n\nexport default function isThisMonth(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameMonth(Date.now(), dirtyDate);\n}","import isSameQuarter from '../isSameQuarter/index.js';\n/**\n * @name isThisQuarter\n * @category Quarter Helpers\n * @summary Is the given date in the same quarter as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same quarter as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this quarter\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 25 September 2014, is 2 July 2014 in this quarter?\n * var result = isThisQuarter(new Date(2014, 6, 2))\n * //=> true\n */\n\nexport default function isThisQuarter(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameQuarter(Date.now(), dirtyDate);\n}","import isSameSecond from '../isSameSecond/index.js';\n/**\n * @name isThisSecond\n * @category Second Helpers\n * @summary Is the given date in the same second as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same second as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this second\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:30:15.000 in this second?\n * var result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15))\n * //=> true\n */\n\nexport default function isThisSecond(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameSecond(Date.now(), dirtyDate);\n}","import isSameWeek from '../isSameWeek/index.js';\n/**\n * @name isThisWeek\n * @category Week Helpers\n * @summary Is the given date in the same week as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same week as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @param {Object} [options] - the object with options\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Boolean} the date is in this week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // If today is 25 September 2014, is 21 September 2014 in this week?\n * var result = isThisWeek(new Date(2014, 8, 21))\n * //=> true\n *\n * @example\n * // If today is 25 September 2014 and week starts with Monday\n * // is 21 September 2014 in this week?\n * var result = isThisWeek(new Date(2014, 8, 21), { weekStartsOn: 1 })\n * //=> false\n */\n\nexport default function isThisWeek(dirtyDate, options) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameWeek(dirtyDate, Date.now(), options);\n}","import isSameYear from '../isSameYear/index.js';\n/**\n * @name isThisYear\n * @category Year Helpers\n * @summary Is the given date in the same year as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same year as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 25 September 2014, is 2 July 2014 in this year?\n * var result = isThisYear(new Date(2014, 6, 2))\n * //=> true\n */\n\nexport default function isThisYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameYear(dirtyDate, Date.now());\n}","import toDate from '../toDate/index.js';\n/**\n * @name isThursday\n * @category Weekday Helpers\n * @summary Is the given date Thursday?\n *\n * @description\n * Is the given date Thursday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Thursday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 25 September 2014 Thursday?\n * var result = isThursday(new Date(2014, 8, 25))\n * //=> true\n */\n\nexport default function isThursday(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return toDate(dirtyDate).getDay() === 4;\n}","import isSameDay from '../isSameDay/index.js';\n/**\n * @name isToday\n * @category Day Helpers\n * @summary Is the given date today?\n * @pure false\n *\n * @description\n * Is the given date today?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is today\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 6 October 14:00:00 today?\n * var result = isToday(new Date(2014, 9, 6, 14, 0))\n * //=> true\n */\n\nexport default function isToday(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameDay(dirtyDate, Date.now());\n}","import addDays from '../addDays/index.js';\nimport isSameDay from '../isSameDay/index.js';\n/**\n * @name isTomorrow\n * @category Day Helpers\n * @summary Is the given date tomorrow?\n * @pure false\n *\n * @description\n * Is the given date tomorrow?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is tomorrow\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow?\n * var result = isTomorrow(new Date(2014, 9, 7, 14, 0))\n * //=> true\n */\n\nexport default function isTomorrow(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameDay(dirtyDate, addDays(Date.now(), 1));\n}","import toDate from '../toDate/index.js';\n/**\n * @name isTuesday\n * @category Weekday Helpers\n * @summary Is the given date Tuesday?\n *\n * @description\n * Is the given date Tuesday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Tuesday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 23 September 2014 Tuesday?\n * var result = isTuesday(new Date(2014, 8, 23))\n * //=> true\n */\n\nexport default function isTuesday(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return toDate(dirtyDate).getDay() === 2;\n}","import toDate from '../toDate/index.js';\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now `isValid` doesn't throw an exception\n * if the first argument is not an instance of Date.\n * Instead, argument is converted beforehand using `toDate`.\n *\n * Examples:\n *\n * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |\n * |---------------------------|---------------|---------------|\n * | `new Date()` | `true` | `true` |\n * | `new Date('2016-01-01')` | `true` | `true` |\n * | `new Date('')` | `false` | `false` |\n * | `new Date(1488370835081)` | `true` | `true` |\n * | `new Date(NaN)` | `false` | `false` |\n * | `'2016-01-01'` | `TypeError` | `true` |\n * | `''` | `TypeError` | `false` |\n * | `1488370835081` | `TypeError` | `true` |\n * | `NaN` | `TypeError` | `false` |\n *\n * We introduce this change to make *date-fns* consistent with ECMAScript behavior\n * that try to coerce arguments to the expected type\n * (which is also the case with other *date-fns* functions).\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // For the valid date:\n * var result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * var result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * var result = isValid(new Date(''))\n * //=> false\n */\n\nexport default function isValid(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n return !isNaN(date);\n}","import toDate from '../toDate/index.js';\n/**\n * @name isWednesday\n * @category Weekday Helpers\n * @summary Is the given date Wednesday?\n *\n * @description\n * Is the given date Wednesday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Wednesday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 24 September 2014 Wednesday?\n * var result = isWednesday(new Date(2014, 8, 24))\n * //=> true\n */\n\nexport default function isWednesday(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return toDate(dirtyDate).getDay() === 3;\n}","import toDate from '../toDate/index.js';\n/**\n * @name isWeekend\n * @category Weekday Helpers\n * @summary Does the given date fall on a weekend?\n *\n * @description\n * Does the given date fall on a weekend?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date falls on a weekend\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Does 5 October 2014 fall on a weekend?\n * var result = isWeekend(new Date(2014, 9, 5))\n * //=> true\n */\n\nexport default function isWeekend(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n return day === 0 || day === 6;\n}","import toDate from '../toDate/index.js';\n/**\n * @name isWithinInterval\n * @category Interval Helpers\n * @summary Is the given date within the interval?\n *\n * @description\n * Is the given date within the interval?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `isWithinRange` to `isWithinInterval`.\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\n *\n * ```\n * 2.1.3\n * time interval\n * part of the time axis limited by two instants\n * ```\n *\n * Also, this function now accepts an object with `start` and `end` properties\n * instead of two arguments as an interval.\n * This function now throws `RangeError` if the start of the interval is after its end\n * or if any date in the interval is `Invalid Date`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * isWithinRange(\n * new Date(2014, 0, 3),\n * new Date(2014, 0, 1), new Date(2014, 0, 7)\n * )\n *\n * // v2.0.0 onward\n *\n * isWithinInterval(\n * new Date(2014, 0, 3),\n * { start: new Date(2014, 0, 1), end: new Date(2014, 0, 7) }\n * )\n * ```\n *\n * @param {Date|Number} date - the date to check\n * @param {Interval} interval - the interval to check\n * @returns {Boolean} the date is within the interval\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // For the date within the interval:\n * isWithinInterval(new Date(2014, 0, 3), {\n * start: new Date(2014, 0, 1),\n * end: new Date(2014, 0, 7)\n * })\n * //=> true\n *\n * @example\n * // For the date outside of the interval:\n * isWithinInterval(new Date(2014, 0, 10), {\n * start: new Date(2014, 0, 1),\n * end: new Date(2014, 0, 7)\n * })\n * //=> false\n */\n\nexport default function isWithinInterval(dirtyDate, dirtyInterval) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var interval = dirtyInterval || {};\n var time = toDate(dirtyDate).getTime();\n var startTime = toDate(interval.start).getTime();\n var endTime = toDate(interval.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startTime <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n return time >= startTime && time <= endTime;\n}","import isSameDay from '../isSameDay/index.js';\nimport subDays from '../subDays/index.js';\n/**\n * @name isYesterday\n * @category Day Helpers\n * @summary Is the given date yesterday?\n * @pure false\n *\n * @description\n * Is the given date yesterday?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is yesterday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 5 October 14:00:00 yesterday?\n * var result = isYesterday(new Date(2014, 9, 5, 14, 0))\n * //=> true\n */\n\nexport default function isYesterday(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return isSameDay(dirtyDate, subDays(Date.now(), 1));\n}","import toDate from '../toDate/index.js';\n/**\n * @name lastDayOfDecade\n * @category Decade Helpers\n * @summary Return the last day of a decade for the given date.\n *\n * @description\n * Return the last day of a decade for the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the last day of a decade\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The last day of a decade for 21 December 2012 21:12:00:\n * var result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00))\n * //=> Wed Dec 31 2019 00:00:00\n */\n\nexport default function lastDayOfDecade(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var decade = 9 + Math.floor(year / 10) * 10;\n date.setFullYear(decade + 1, 0, 0);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import lastDayOfWeek from '../lastDayOfWeek/index.js';\n/**\n * @name lastDayOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the last day of an ISO week for the given date.\n *\n * @description\n * Return the last day of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the last day of an ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The last day of an ISO week for 2 September 2014 11:55:00:\n * var result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 00:00:00\n */\n\nexport default function lastDayOfISOWeek(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return lastDayOfWeek(dirtyDate, {\n weekStartsOn: 1\n });\n}","import getISOWeekYear from '../getISOWeekYear/index.js';\nimport startOfISOWeek from '../startOfISOWeek/index.js';\n/**\n * @name lastDayOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the last day of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the last day of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `lastDayOfISOYear` to `lastDayOfISOWeekYear`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of an ISO week-numbering year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The last day of an ISO week-numbering year for 2 July 2005:\n * var result = lastDayOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Sun Jan 01 2006 00:00:00\n */\n\nexport default function lastDayOfISOWeekYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var year = getISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setFullYear(year + 1, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n var date = startOfISOWeek(fourthOfJanuary);\n date.setDate(date.getDate() - 1);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name lastDayOfMonth\n * @category Month Helpers\n * @summary Return the last day of a month for the given date.\n *\n * @description\n * Return the last day of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the last day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The last day of a month for 2 September 2014 11:55:00:\n * var result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 00:00:00\n */\n\nexport default function lastDayOfMonth(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name lastDayOfQuarter\n * @category Quarter Helpers\n * @summary Return the last day of a year quarter for the given date.\n *\n * @description\n * Return the last day of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * @returns {Date} the last day of a quarter\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // The last day of a quarter for 2 September 2014 11:55:00:\n * var result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 00:00:00\n */\n\nexport default function lastDayOfQuarter(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var currentMonth = date.getMonth();\n var month = currentMonth - currentMonth % 3 + 3;\n date.setMonth(month, 0);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from '../toDate/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name lastDayOfWeek\n * @category Week Helpers\n * @summary Return the last day of a week for the given date.\n *\n * @description\n * Return the last day of a week for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the last day of a week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // The last day of a week for 2 September 2014 11:55:00:\n * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00:\n * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\n\nexport default function lastDayOfWeek(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n date.setHours(0, 0, 0, 0);\n date.setDate(date.getDate() + diff);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name lastDayOfYear\n * @category Year Helpers\n * @summary Return the last day of a year for the given date.\n *\n * @description\n * Return the last day of a year for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the last day of a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The last day of a year for 2 September 2014 11:55:00:\n * var result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Dec 31 2014 00:00:00\n */\n\nexport default function lastDayOfYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n date.setFullYear(year + 1, 0, 0);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from '../toDate/index.js';\nimport formatters from '../_lib/format/lightFormatters/index.js';\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\nimport isValid from '../isValid/index.js';\nimport subMilliseconds from '../subMilliseconds/index.js'; // This RegExp consists of three parts separated by `|`:\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'(.*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name lightFormat\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. Unlike `format`,\n * `lightFormat` doesn't use locales and outputs date using the most popular tokens.\n *\n * > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples |\n * |---------------------------------|---------|-----------------------------------|\n * | AM, PM | a..aaa | AM, PM |\n * | | aaaa | a.m., p.m. |\n * | | aaaaa | a, p |\n * | Calendar year | y | 44, 1, 1900, 2017 |\n * | | yy | 44, 01, 00, 17 |\n * | | yyy | 044, 001, 000, 017 |\n * | | yyyy | 0044, 0001, 1900, 2017 |\n * | Month (formatting) | M | 1, 2, ..., 12 |\n * | | MM | 01, 02, ..., 12 |\n * | Day of month | d | 1, 2, ..., 31 |\n * | | dd | 01, 02, ..., 31 |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 |\n * | | hh | 01, 02, ..., 11, 12 |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 |\n * | | HH | 00, 01, 02, ..., 23 |\n * | Minute | m | 0, 1, ..., 59 |\n * | | mm | 00, 01, ..., 59 |\n * | Second | s | 0, 1, ..., 59 |\n * | | ss | 00, 01, ..., 59 |\n * | Fraction of second | S | 0, 1, ..., 9 |\n * | | SS | 00, 01, ..., 99 |\n * | | SSS | 000, 0001, ..., 999 |\n * | | SSSS | ... |\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * var result = format(new Date(2014, 1, 11), 'yyyy-MM-dd')\n * //=> '1987-02-11'\n */\n\nexport default function lightFormat(dirtyDate, dirtyFormatStr) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var formatStr = String(dirtyFormatStr);\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var result = formatStr.match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n return formatter(utcDate, substring, null, {});\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","export default function buildFormatLongFn(args) {\n return function (dirtyOptions) {\n var options = dirtyOptions || {};\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, dirtyOptions) {\n var options = dirtyOptions || {};\n var context = options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;\n return valuesArray[index];\n };\n}","export default function buildMatchFn(args) {\n return function (dirtyString, dirtyOptions) {\n var string = String(dirtyString);\n var options = dirtyOptions || {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var value;\n\n if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {\n value = parsePatterns.findIndex(function (pattern) {\n return pattern.test(string);\n });\n } else {\n value = findKey(parsePatterns, function (pattern) {\n return pattern.test(string);\n });\n }\n\n value = args.valueCallback ? args.valueCallback(value) : value;\n value = options.valueCallback ? options.valueCallback(value) : value;\n return {\n value: value,\n rest: string.slice(matchedString.length)\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n}","export default function buildMatchPatternFn(args) {\n return function (dirtyString, dirtyOptions) {\n var string = String(dirtyString);\n var options = dirtyOptions || {};\n var matchResult = string.match(args.matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n\n if (!parseResult) {\n return null;\n }\n\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n return {\n value: value,\n rest: string.slice(matchedString.length)\n };\n };\n}","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\nexport default function formatDistance(token, count, options) {\n options = options || {};\n var result;\n\n if (typeof formatDistanceLocale[token] === 'string') {\n result = formatDistanceLocale[token];\n } else if (count === 1) {\n result = formatDistanceLocale[token].one;\n } else {\n result = formatDistanceLocale[token].other.replace('{{count}}', count);\n }\n\n if (options.addSuffix) {\n if (options.comparison > 0) {\n return 'in ' + result;\n } else {\n return result + ' ago';\n }\n }\n\n return result;\n}","import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index.js';\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar timeFormats = {\n full: 'h:mm:ss a zzzz',\n long: 'h:mm:ss a z',\n medium: 'h:mm:ss a',\n short: 'h:mm a'\n};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","var formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: 'P'\n};\nexport default function formatRelative(token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n}","import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index.js';\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] // Note: in English, the names of days of the week and months are capitalized.\n // If you are making a new locale based on this one, check if the same is true for the language you're working on.\n // Generally, formatted dates should look like they are in the middle of a sentence,\n // e.g. in Spanish language the weekdays and months should be in the lowercase.\n\n};\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar dayValues = {\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar dayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n }\n};\nvar formattingDayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n }\n};\n\nfunction ordinalNumber(dirtyNumber, _dirtyOptions) {\n var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`:\n //\n // var options = dirtyOptions || {}\n // var unit = String(options.unit)\n //\n // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'\n\n var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n}\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function (quarter) {\n return Number(quarter) - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index.js';\nimport buildMatchFn from '../../../_lib/buildMatchFn/index.js';\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i\n};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\n};\nvar parseMonthPatterns = {\n narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],\n any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]\n};\nvar matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\n};\nvar parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\n};\nvar matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\n};\nvar parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i\n }\n};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function (index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","import formatDistance from './_lib/formatDistance/index.js';\nimport formatLong from './_lib/formatLong/index.js';\nimport formatRelative from './_lib/formatRelative/index.js';\nimport localize from './_lib/localize/index.js';\nimport match from './_lib/match/index.js';\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\n\nvar locale = {\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import toDate from '../toDate/index.js';\n/**\n * @name max\n * @category Common Helpers\n * @summary Return the latest of the given dates.\n *\n * @description\n * Return the latest of the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - `max` function now accepts an array of dates rather than spread arguments.\n *\n * ```javascript\n * // Before v2.0.0\n * var date1 = new Date(1989, 6, 10)\n * var date2 = new Date(1987, 1, 11)\n * var maxDate = max(date1, date2)\n *\n * // v2.0.0 onward:\n * var dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)]\n * var maxDate = max(dates)\n * ```\n *\n * @param {Date[]|Number[]} datesArray - the dates to compare\n * @returns {Date} the latest of the dates\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which of these dates is the latest?\n * var result = max([\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * ])\n * //=> Sun Jul 02 1995 00:00:00\n */\n\nexport default function max(dirtyDatesArray) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var datesArray; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\n\n if (dirtyDatesArray && typeof dirtyDatesArray.forEach === 'function') {\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array.\n } else if (typeof dirtyDatesArray === 'object' && dirtyDatesArray !== null) {\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\n } else {\n // `dirtyDatesArray` is non-iterable, return Invalid Date\n return new Date(NaN);\n }\n\n var result;\n datesArray.forEach(function (dirtyDate) {\n var currentDate = toDate(dirtyDate);\n\n if (result === undefined || result < currentDate || isNaN(currentDate)) {\n result = currentDate;\n }\n });\n return result || new Date(NaN);\n}","import toDate from '../toDate/index.js';\n/**\n * @name min\n * @category Common Helpers\n * @summary Return the earliest of the given dates.\n *\n * @description\n * Return the earliest of the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - `min` function now accepts an array of dates rather than spread arguments.\n *\n * ```javascript\n * // Before v2.0.0\n * var date1 = new Date(1989, 6, 10)\n * var date2 = new Date(1987, 1, 11)\n * var minDate = min(date1, date2)\n *\n * // v2.0.0 onward:\n * var dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)]\n * var minDate = min(dates)\n * ```\n *\n * @param {Date[]|Number[]} datesArray - the dates to compare\n * @returns {Date} the earliest of the dates\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which of these dates is the earliest?\n * var result = min([\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * ])\n * //=> Wed Feb 11 1987 00:00:00\n */\n\nexport default function min(dirtyDatesArray) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var datesArray; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\n\n if (dirtyDatesArray && typeof dirtyDatesArray.forEach === 'function') {\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array.\n } else if (typeof dirtyDatesArray === 'object' && dirtyDatesArray !== null) {\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\n } else {\n // `dirtyDatesArray` is non-iterable, return Invalid Date\n return new Date(NaN);\n }\n\n var result;\n datesArray.forEach(function (dirtyDate) {\n var currentDate = toDate(dirtyDate);\n\n if (result === undefined || result > currentDate || isNaN(currentDate)) {\n result = currentDate;\n }\n });\n return result || new Date(NaN);\n}","import getUTCWeekYear from '../../../_lib/getUTCWeekYear/index.js';\nimport setUTCDay from '../../../_lib/setUTCDay/index.js';\nimport setUTCISODay from '../../../_lib/setUTCISODay/index.js';\nimport setUTCISOWeek from '../../../_lib/setUTCISOWeek/index.js';\nimport setUTCWeek from '../../../_lib/setUTCWeek/index.js';\nimport startOfUTCISOWeek from '../../../_lib/startOfUTCISOWeek/index.js';\nimport startOfUTCWeek from '../../../_lib/startOfUTCWeek/index.js';\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar MILLISECONDS_IN_SECOND = 1000;\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/,\n // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/,\n // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/,\n // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n minute: /^[0-5]?\\d/,\n // 0 to 59\n second: /^[0-5]?\\d/,\n // 0 to 59\n singleDigit: /^\\d/,\n // 0 to 9\n twoDigits: /^\\d{1,2}/,\n // 0 to 99\n threeDigits: /^\\d{1,3}/,\n // 0 to 999\n fourDigits: /^\\d{1,4}/,\n // 0 to 9999\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/,\n // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/,\n // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\n\n};\nvar timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/\n};\n\nfunction parseNumericPattern(pattern, string, valueCallback) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n var value = parseInt(matchResult[0], 10);\n return {\n value: valueCallback ? valueCallback(value) : value,\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseTimezonePattern(pattern, string) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n } // Input is 'Z'\n\n\n if (matchResult[0] === 'Z') {\n return {\n value: 0,\n rest: string.slice(1)\n };\n }\n\n var sign = matchResult[1] === '+' ? 1 : -1;\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseAnyDigitsSigned(string, valueCallback) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\n}\n\nfunction parseNDigits(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction parseNDigitsSigned(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction dayPeriodEnumToHours(enumValue) {\n switch (enumValue) {\n case 'morning':\n return 4;\n\n case 'evening':\n return 17;\n\n case 'pm':\n case 'noon':\n case 'afternoon':\n return 12;\n\n case 'am':\n case 'midnight':\n case 'night':\n default:\n return 0;\n }\n}\n\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n var result;\n\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n var rangeEnd = absCurrentYear + 50;\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n\n\nvar parsers = {\n // Era\n G: {\n priority: 140,\n parse: function (string, token, match, _options) {\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n // A, B\n\n case 'GGGGG':\n return match.era(string, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return match.era(string, {\n width: 'wide'\n }) || match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n }\n },\n set: function (date, flags, value, _options) {\n flags.era = value;\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['R', 'u', 't', 'T']\n },\n // Year\n y: {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'yy'\n };\n };\n\n switch (token) {\n case 'y':\n return parseNDigits(4, string, valueCallback);\n\n case 'yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, _options) {\n var currentYear = date.getUTCFullYear();\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Local week-numbering year\n Y: {\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'YY'\n };\n };\n\n switch (token) {\n case 'Y':\n return parseNDigits(4, string, valueCallback);\n\n case 'Yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, options) {\n var currentYear = getUTCWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week-numbering year\n R: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'R') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (_date, _flags, value, _options) {\n var firstWeekOfYear = new Date(0);\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\n return startOfUTCISOWeek(firstWeekOfYear);\n },\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Extended year\n u: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'u') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Quarter\n Q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n case 'QQ':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone quarter\n q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n case 'qq':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Month\n M: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'M':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'MM':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone month\n L: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'LL':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Local week of year\n w: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'w':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'wo':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week of year\n I: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'I':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'Io':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Day of the month\n d: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'd':\n return parseNumericPattern(numericPatterns.date, string);\n\n case 'do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n var month = date.getUTCMonth();\n\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCDate(value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Day of year\n D: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'D':\n case 'DD':\n return parseNumericPattern(numericPatterns.dayOfYear, string);\n\n case 'Do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(0, value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\n },\n // Day of week\n E: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\n },\n // Local day of week\n e: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'e':\n case 'ee':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'eo':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'eee':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\n },\n // Stand-alone local day of week\n c: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'c':\n case 'cc':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'co':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'ccc':\n return match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\n },\n // ISO day of week\n i: {\n priority: 90,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n if (value === 0) {\n return 7;\n }\n\n return value;\n };\n\n switch (token) {\n // 2\n case 'i':\n case 'ii':\n // 02\n return parseNDigits(token.length, string);\n // 2nd\n\n case 'io':\n return match.ordinalNumber(string, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // T\n\n case 'iiiii':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tu\n\n case 'iiiiii':\n return match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tuesday\n\n case 'iiii':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 7;\n },\n set: function (date, _flags, value, options) {\n date = setUTCISODay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\n },\n // AM or PM\n a: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // AM, PM, midnight\n b: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // in the morning, in the afternoon, in the evening, at night\n B: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 't', 'T']\n },\n // Hour [1-12]\n h: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'h':\n return parseNumericPattern(numericPatterns.hour12h, string);\n\n case 'ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 12;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setUTCHours(0, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\n },\n // Hour [0-23]\n H: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'H':\n return parseNumericPattern(numericPatterns.hour23h, string);\n\n case 'Ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 23;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(value, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\n },\n // Hour [0-11]\n K: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'K':\n return parseNumericPattern(numericPatterns.hour11h, string);\n\n case 'Ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']\n },\n // Hour [1-24]\n k: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'k':\n return parseNumericPattern(numericPatterns.hour24h, string);\n\n case 'ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 24;\n },\n set: function (date, _flags, value, _options) {\n var hours = value <= 24 ? value % 24 : value;\n date.setUTCHours(hours, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\n },\n // Minute\n m: {\n priority: 60,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'm':\n return parseNumericPattern(numericPatterns.minute, string);\n\n case 'mo':\n return match.ordinalNumber(string, {\n unit: 'minute'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMinutes(value, 0, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Second\n s: {\n priority: 50,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 's':\n return parseNumericPattern(numericPatterns.second, string);\n\n case 'so':\n return match.ordinalNumber(string, {\n unit: 'second'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCSeconds(value, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Fraction of second\n S: {\n priority: 30,\n parse: function (string, token, _match, _options) {\n var valueCallback = function (value) {\n return Math.floor(value * Math.pow(10, -token.length + 3));\n };\n\n return parseNDigits(token.length, string, valueCallback);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMilliseconds(value);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Timezone (ISO-8601. +00:00 is `'Z'`)\n X: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'X':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'XX':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'XXXX':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'XXXXX':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'XXX':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'x']\n },\n // Timezone (ISO-8601)\n x: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'x':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'xx':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'xxxx':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'xxxxx':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'xxx':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'X']\n },\n // Seconds timestamp\n t: {\n priority: 40,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value * 1000), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n },\n // Milliseconds timestamp\n T: {\n priority: 20,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n }\n};\nexport default parsers;","import defaultLocale from '../locale/en-US/index.js';\nimport subMilliseconds from '../subMilliseconds/index.js';\nimport toDate from '../toDate/index.js';\nimport assign from '../_lib/assign/index.js';\nimport longFormatters from '../_lib/format/longFormatters/index.js';\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from '../_lib/protectedTokens/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\nimport parsers from './_lib/parsers/index.js';\nvar TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'(.*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Su | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Su | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Su | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 1, 2, ..., 11, 0 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 0001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `backupDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `backupDate` which works as a context of parsing.\n *\n * `backupDate` must be passed for correct work of the function.\n * If you're not sure which `backupDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `backupDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `backupDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Old `parse` was renamed to `toDate`.\n * Now `parse` is a new function which parses a string using a provided format.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward\n * toDate('2016-01-01')\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\n * ```\n *\n * @param {String} dateString - the string to parse\n * @param {String} formatString - the string of tokens\n * @param {Date|Number} backupDate - defines values missing from the parsed dateString\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Date} the parsed date\n * @throws {TypeError} 3 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\n\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyBackupDate, dirtyOptions) {\n if (arguments.length < 3) {\n throw new TypeError('3 arguments required, but only ' + arguments.length + ' present');\n }\n\n var dateString = String(dirtyDateString);\n var formatString = String(dirtyFormatString);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.match) {\n throw new RangeError('locale must contain match property');\n }\n\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (formatString === '') {\n if (dateString === '') {\n return toDate(dirtyBackupDate);\n } else {\n return new Date(NaN);\n }\n }\n\n var subFnOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale // If timezone isn't specified, it will be set to the system timezone\n\n };\n var setters = [{\n priority: TIMEZONE_UNIT_PRIORITY,\n set: dateToSystemTimezone,\n index: 0\n }];\n var i;\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, subFnOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp);\n var usedTokens = [];\n\n for (i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n throwProtectedError(token);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n throwProtectedError(token);\n }\n\n var firstCharacter = token[0];\n var parser = parsers[firstCharacter];\n\n if (parser) {\n var incompatibleTokens = parser.incompatibleTokens;\n\n if (Array.isArray(incompatibleTokens)) {\n var incompatibleToken = void 0;\n\n for (var _i = 0; _i < usedTokens.length; _i++) {\n var usedToken = usedTokens[_i].token;\n\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\n incompatibleToken = usedTokens[_i];\n break;\n }\n }\n\n if (incompatibleToken) {\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\n }\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\n }\n\n usedTokens.push({\n token: firstCharacter,\n fullToken: token\n });\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\n\n if (!parseResult) {\n return new Date(NaN);\n }\n\n setters.push({\n priority: parser.priority,\n set: parser.set,\n validate: parser.validate,\n value: parseResult.value,\n index: setters.length\n });\n dateString = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n } // Replace two single quote characters with one single quote character\n\n\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\n\n\n if (dateString.indexOf(token) === 0) {\n dateString = dateString.slice(token.length);\n } else {\n return new Date(NaN);\n }\n }\n } // Check if the remaining input contains something other than whitespace\n\n\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\n return new Date(NaN);\n }\n\n var uniquePrioritySetters = setters.map(function (setter) {\n return setter.priority;\n }).sort(function (a, b) {\n return b - a;\n }).filter(function (priority, index, array) {\n return array.indexOf(priority) === index;\n }).map(function (priority) {\n return setters.filter(function (setter) {\n return setter.priority === priority;\n }).reverse();\n }).map(function (setterArray) {\n return setterArray[0];\n });\n var date = toDate(dirtyBackupDate);\n\n if (isNaN(date)) {\n return new Date(NaN);\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\n\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var flags = {};\n\n for (i = 0; i < uniquePrioritySetters.length; i++) {\n var setter = uniquePrioritySetters[i];\n\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\n return new Date(NaN);\n }\n\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\n\n if (result[0]) {\n utcDate = result[0];\n assign(flags, result[1]); // Result is date\n } else {\n utcDate = result;\n }\n }\n\n return utcDate;\n}\n\nfunction dateToSystemTimezone(date, flags) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n var convertedDate = new Date(0);\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n return convertedDate;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","import toInteger from '../_lib/toInteger/index.js';\nimport getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar DEFAULT_ADDITIONAL_DIGITS = 2;\nvar patterns = {\n dateTimeDelimiter: /[T ]/,\n timeZoneDelimiter: /[Z ]/i,\n timezone: /([Z+-].*)$/\n};\nvar dateRegex = /^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/;\nvar timeRegex = /^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/;\nvar timezoneRegex = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\n/**\n * @name parseISO\n * @category Common Helpers\n * @summary Parse ISO string\n *\n * @description\n * Parse the given string in ISO 8601 format and return an instance of Date.\n *\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If the argument isn't a string, the function cannot parse the string or\n * the values are invalid, it returns Invalid Date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The previous `parse` implementation was renamed to `parseISO`.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward\n * parseISO('2016-01-01')\n * ```\n *\n * - `parseISO` now validates separate date and time values in ISO-8601 strings\n * and returns `Invalid Date` if the date is invalid.\n *\n * ```javascript\n * parseISO('2018-13-32')\n * //=> Invalid Date\n * ```\n *\n * - `parseISO` now doesn't fall back to `new Date` constructor\n * if it fails to parse a string argument. Instead, it returns `Invalid Date`.\n *\n * @param {String} argument - the value to convert\n * @param {Object} [options] - an object with options.\n * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * var result = parseISO('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert string '+02014101' to date,\n * // if the additional number of digits in the extended year format is 1:\n * var result = parseISO('+02014101', { additionalDigits: 1 })\n * //=> Fri Apr 11 2014 00:00:00\n */\n\nexport default function parseISO(argument, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : toInteger(options.additionalDigits);\n\n if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {\n throw new RangeError('additionalDigits must be 0, 1 or 2');\n }\n\n if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {\n return new Date(NaN);\n }\n\n var dateStrings = splitDateString(argument);\n var date;\n\n if (dateStrings.date) {\n var parseYearResult = parseYear(dateStrings.date, additionalDigits);\n date = parseDate(parseYearResult.restDateString, parseYearResult.year);\n }\n\n if (isNaN(date) || !date) {\n return new Date(NaN);\n }\n\n var timestamp = date.getTime();\n var time = 0;\n var offset;\n\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n\n if (isNaN(time) || time === null) {\n return new Date(NaN);\n }\n }\n\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone);\n\n if (isNaN(offset)) {\n return new Date(NaN);\n }\n } else {\n var fullTime = timestamp + time;\n var fullTimeDate = new Date(fullTime);\n offset = getTimezoneOffsetInMilliseconds(fullTimeDate); // Adjust time when it's coming from DST\n\n var fullTimeDateNextDay = new Date(fullTime);\n fullTimeDateNextDay.setDate(fullTimeDate.getDate() + 1);\n var offsetDiff = getTimezoneOffsetInMilliseconds(fullTimeDateNextDay) - offset;\n\n if (offsetDiff > 0) {\n offset += offsetDiff;\n }\n }\n\n return new Date(timestamp + time + offset);\n}\n\nfunction splitDateString(dateString) {\n var dateStrings = {};\n var array = dateString.split(patterns.dateTimeDelimiter);\n var timeString;\n\n if (/:/.test(array[0])) {\n dateStrings.date = null;\n timeString = array[0];\n } else {\n dateStrings.date = array[0];\n timeString = array[1];\n\n if (patterns.timeZoneDelimiter.test(dateStrings.date)) {\n dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];\n timeString = dateString.substr(dateStrings.date.length, dateString.length);\n }\n }\n\n if (timeString) {\n var token = patterns.timezone.exec(timeString);\n\n if (token) {\n dateStrings.time = timeString.replace(token[1], '');\n dateStrings.timezone = token[1];\n } else {\n dateStrings.time = timeString;\n }\n }\n\n return dateStrings;\n}\n\nfunction parseYear(dateString, additionalDigits) {\n var regex = new RegExp('^(?:(\\\\d{4}|[+-]\\\\d{' + (4 + additionalDigits) + '})|(\\\\d{2}|[+-]\\\\d{' + (2 + additionalDigits) + '})$)');\n var captures = dateString.match(regex); // Invalid ISO-formatted year\n\n if (!captures) return {\n year: null\n };\n var year = captures[1] && parseInt(captures[1]);\n var century = captures[2] && parseInt(captures[2]);\n return {\n year: century == null ? year : century * 100,\n restDateString: dateString.slice((captures[1] || captures[2]).length)\n };\n}\n\nfunction parseDate(dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) return null;\n var captures = dateString.match(dateRegex); // Invalid ISO-formatted string\n\n if (!captures) return null;\n var isWeekDate = !!captures[4];\n var dayOfYear = parseDateUnit(captures[1]);\n var month = parseDateUnit(captures[2]) - 1;\n var day = parseDateUnit(captures[3]);\n var week = parseDateUnit(captures[4]);\n var dayOfWeek = parseDateUnit(captures[5]) - 1;\n\n if (isWeekDate) {\n if (!validateWeekDate(year, week, dayOfWeek)) {\n return new Date(NaN);\n }\n\n return dayOfISOWeekYear(year, week, dayOfWeek);\n } else {\n var date = new Date(0);\n\n if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {\n return new Date(NaN);\n }\n\n date.setUTCFullYear(year, month, Math.max(dayOfYear, day));\n return date;\n }\n}\n\nfunction parseDateUnit(value) {\n return value ? parseInt(value) : 1;\n}\n\nfunction parseTime(timeString) {\n var captures = timeString.match(timeRegex);\n if (!captures) return null; // Invalid ISO-formatted time\n\n var hours = parseTimeUnit(captures[1]);\n var minutes = parseTimeUnit(captures[2]);\n var seconds = parseTimeUnit(captures[3]);\n\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n\n return hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1000;\n}\n\nfunction parseTimeUnit(value) {\n return value && parseFloat(value.replace(',', '.')) || 0;\n}\n\nfunction parseTimezone(timezoneString) {\n if (timezoneString === 'Z') return 0;\n var captures = timezoneString.match(timezoneRegex);\n if (!captures) return 0;\n var sign = captures[1] === '+' ? -1 : 1;\n var hours = parseInt(captures[2]);\n var minutes = captures[3] && parseInt(captures[3]) || 0;\n\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n\n return sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE);\n}\n\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n var date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n var fourthOfJanuaryDay = date.getUTCDay() || 7;\n var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n} // Validation functions\n// February is null to handle the leap year (using ||)\n\n\nvar daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100;\n}\n\nfunction validateDate(year, month, date) {\n return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));\n}\n\nfunction validateDayOfYearDate(year, dayOfYear) {\n return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);\n}\n\nfunction validateWeekDate(_year, week, day) {\n return week >= 1 && week <= 53 && day >= 0 && day <= 6;\n}\n\nfunction validateTime(hours, minutes, seconds) {\n if (hours === 24) {\n return minutes === 0 && seconds === 0;\n }\n\n return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;\n}\n\nfunction validateTimezone(_hours, minutes) {\n return minutes >= 0 && minutes <= 59;\n}","import toDate from '../toDate/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name roundToNearestMinutes\n * @category Minute Helpers\n * @summary Rounds the given date to the nearest minute\n *\n * @description\n * Rounds the given date to the nearest minute\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to round\n * @param {Object} [options] - an object with options.\n * @param {Number} [options.nearestTo=1] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * @returns {Date} the new date rounded to the closest minute\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.nearestTo` must be between 1 and 30\n *\n * @example\n * // Round 10 July 2014 12:12:34 to nearest minute:\n * var result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34))\n * //=> Thu Jul 10 2014 12:13:00\n */\n\nexport default function roundToNearestMinutes(dirtyDate, options) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only none provided present');\n }\n\n var nearestTo = options && 'nearestTo' in options ? toInteger(options.nearestTo) : 1;\n\n if (nearestTo < 1 || nearestTo > 30) {\n throw new RangeError('`options.nearestTo` must be between 1 and 30');\n }\n\n var date = toDate(dirtyDate);\n var seconds = date.getSeconds(); // relevant if nearestTo is 1, which is the default case\n\n var minutes = date.getMinutes() + seconds / 60;\n var roundedMinutes = Math.floor(minutes / nearestTo) * nearestTo;\n var remainderMinutes = minutes % nearestTo;\n var addedMinutes = Math.round(remainderMinutes / nearestTo) * nearestTo;\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), roundedMinutes + addedMinutes);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name setDate\n * @category Day Helpers\n * @summary Set the day of the month to the given date.\n *\n * @description\n * Set the day of the month to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} dayOfMonth - the day of the month of the new date\n * @returns {Date} the new date with the day of the month set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set the 30th day of the month to 1 September 2014:\n * var result = setDate(new Date(2014, 8, 1), 30)\n * //=> Tue Sep 30 2014 00:00:00\n */\n\nexport default function setDate(dirtyDate, dirtyDayOfMonth) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var dayOfMonth = toInteger(dirtyDayOfMonth);\n date.setDate(dayOfMonth);\n return date;\n}","import addDays from '../addDays/index.js';\nimport toDate from '../toDate/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} day - the day of the week of the new date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the new date with the day of the week set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * var result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If week starts with Monday, set Sunday to 1 September 2014:\n * var result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\n\nexport default function setDay(dirtyDate, dirtyDay, dirtyOptions) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate, options);\n var day = toInteger(dirtyDay);\n var currentDay = date.getDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n return addDays(date, diff, options);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name setDayOfYear\n * @category Day Helpers\n * @summary Set the day of the year to the given date.\n *\n * @description\n * Set the day of the year to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} dayOfYear - the day of the year of the new date\n * @returns {Date} the new date with the day of the year set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set the 2nd day of the year to 2 July 2014:\n * var result = setDayOfYear(new Date(2014, 6, 2), 2)\n * //=> Thu Jan 02 2014 00:00:00\n */\n\nexport default function setDayOfYear(dirtyDate, dirtyDayOfYear) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var dayOfYear = toInteger(dirtyDayOfYear);\n date.setMonth(0);\n date.setDate(dayOfYear);\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name setHours\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} hours - the hours of the new date\n * @returns {Date} the new date with the hours set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * var result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\n\nexport default function setHours(dirtyDate, dirtyHours) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var hours = toInteger(dirtyHours);\n date.setHours(hours);\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\nimport addDays from '../addDays/index.js';\nimport getISODay from '../getISODay/index.js';\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} day - the day of the ISO week of the new date\n * @returns {Date} the new date with the day of the ISO week set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * var result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\n\nexport default function setISODay(dirtyDate, dirtyDay) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = getISODay(date);\n var diff = day - currentDay;\n return addDays(date, diff);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\nimport getISOWeek from '../getISOWeek/index.js';\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} isoWeek - the ISO week of the new date\n * @returns {Date} the new date with the ISO week set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * var result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\n\nexport default function setISOWeek(dirtyDate, dirtyISOWeek) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getISOWeek(date) - isoWeek;\n date.setDate(date.getDate() - diff * 7);\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\nimport startOfISOWeekYear from '../startOfISOWeekYear/index.js';\nimport differenceInCalendarDays from '../differenceInCalendarDays/index.js';\n/**\n * @name setISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Set the ISO week-numbering year to the given date.\n *\n * @description\n * Set the ISO week-numbering year to the given date,\n * saving the week number and the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `setISOYear` to `setISOWeekYear`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `setWeekYear`.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} isoWeekYear - the ISO week-numbering year of the new date\n * @returns {Date} the new date with the ISO week-numbering year set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set ISO week-numbering year 2007 to 29 December 2008:\n * var result = setISOWeekYear(new Date(2008, 11, 29), 2007)\n * //=> Mon Jan 01 2007 00:00:00\n */\n\nexport default function setISOWeekYear(dirtyDate, dirtyISOWeekYear) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var isoWeekYear = toInteger(dirtyISOWeekYear);\n var diff = differenceInCalendarDays(date, startOfISOWeekYear(date));\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setFullYear(isoWeekYear, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n date = startOfISOWeekYear(fourthOfJanuary);\n date.setDate(date.getDate() + diff);\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name setMilliseconds\n * @category Millisecond Helpers\n * @summary Set the milliseconds to the given date.\n *\n * @description\n * Set the milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} milliseconds - the milliseconds of the new date\n * @returns {Date} the new date with the milliseconds set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 300 milliseconds to 1 September 2014 11:30:40.500:\n * var result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)\n * //=> Mon Sep 01 2014 11:30:40.300\n */\n\nexport default function setMilliseconds(dirtyDate, dirtyMilliseconds) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var milliseconds = toInteger(dirtyMilliseconds);\n date.setMilliseconds(milliseconds);\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name setMinutes\n * @category Minute Helpers\n * @summary Set the minutes to the given date.\n *\n * @description\n * Set the minutes to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} minutes - the minutes of the new date\n * @returns {Date} the new date with the minutes set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 45 minutes to 1 September 2014 11:30:40:\n * var result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:45:40\n */\n\nexport default function setMinutes(dirtyDate, dirtyMinutes) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var minutes = toInteger(dirtyMinutes);\n date.setMinutes(minutes);\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\nimport getDaysInMonth from '../getDaysInMonth/index.js';\n/**\n * @name setMonth\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} month - the month of the new date\n * @returns {Date} the new date with the month set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set February to 1 September 2014:\n * var result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\n\nexport default function setMonth(dirtyDate, dirtyMonth) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var month = toInteger(dirtyMonth);\n var year = date.getFullYear();\n var day = date.getDate();\n var dateWithDesiredMonth = new Date(0);\n dateWithDesiredMonth.setFullYear(year, month, 15);\n dateWithDesiredMonth.setHours(0, 0, 0, 0);\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth); // Set the last day of the new month\n // if the original date was the last day of the longer month\n\n date.setMonth(month, Math.min(day, daysInMonth));\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\nimport setMonth from '../setMonth/index.js';\n/**\n * @name setQuarter\n * @category Quarter Helpers\n * @summary Set the year quarter to the given date.\n *\n * @description\n * Set the year quarter to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} quarter - the quarter of the new date\n * @returns {Date} the new date with the quarter set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set the 2nd quarter to 2 July 2014:\n * var result = setQuarter(new Date(2014, 6, 2), 2)\n * //=> Wed Apr 02 2014 00:00:00\n */\n\nexport default function setQuarter(dirtyDate, dirtyQuarter) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var quarter = toInteger(dirtyQuarter);\n var oldQuarter = Math.floor(date.getMonth() / 3) + 1;\n var diff = quarter - oldQuarter;\n return setMonth(date, date.getMonth() + diff * 3);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name setSeconds\n * @category Second Helpers\n * @summary Set the seconds to the given date.\n *\n * @description\n * Set the seconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} seconds - the seconds of the new date\n * @returns {Date} the new date with the seconds set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 45 seconds to 1 September 2014 11:30:40:\n * var result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:30:45\n */\n\nexport default function setSeconds(dirtyDate, dirtySeconds) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var seconds = toInteger(dirtySeconds);\n date.setSeconds(seconds);\n return date;\n}","import getWeek from '../getWeek/index.js';\nimport toDate from '../toDate/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} week - the week of the new date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @returns {Date} the new date with the local week set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * var result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * var result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\n\nexport default function setWeek(dirtyDate, dirtyWeek, dirtyOptions) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getWeek(date, dirtyOptions) - week;\n date.setDate(date.getDate() - diff * 7);\n return date;\n}","import differenceInCalendarDays from '../differenceInCalendarDays/index.js';\nimport startOfWeekYear from '../startOfWeekYear/index.js';\nimport toDate from '../toDate/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name setWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Set the local week-numbering year to the given date.\n *\n * @description\n * Set the local week-numbering year to the given date,\n * saving the week number and the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} weekYear - the local week-numbering year of the new date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @returns {Date} the new date with the local week-numbering year set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n *\n * @example\n * // Set the local week-numbering year 2004 to 2 January 2010 with default options:\n * var result = setWeekYear(new Date(2010, 0, 2), 2004)\n * //=> Sat Jan 03 2004 00:00:00\n *\n * @example\n * // Set the local week-numbering year 2004 to 2 January 2010,\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * var result = setWeekYear(new Date(2010, 0, 2), 2004, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sat Jan 01 2005 00:00:00\n */\n\nexport default function setWeekYear(dirtyDate, dirtyWeekYear, dirtyOptions) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var date = toDate(dirtyDate);\n var weekYear = toInteger(dirtyWeekYear);\n var diff = differenceInCalendarDays(date, startOfWeekYear(date, dirtyOptions));\n var firstWeek = new Date(0);\n firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n date = startOfWeekYear(firstWeek, dirtyOptions);\n date.setDate(date.getDate() + diff);\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport toDate from '../toDate/index.js';\n/**\n * @name setYear\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} year - the year of the new date\n * @returns {Date} the new date with the year set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * var result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\n\nexport default function setYear(dirtyDate, dirtyYear) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = toInteger(dirtyYear); // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\n\n if (isNaN(date)) {\n return new Date(NaN);\n }\n\n date.setFullYear(year);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\n\nexport default function startOfDay(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name startOfDecade\n * @category Decade Helpers\n * @summary Return the start of a decade for the given date.\n *\n * @description\n * Return the start of a decade for the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a decade\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a decade for 21 October 2015 00:00:00:\n * var result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00))\n * //=> Jan 01 2010 00:00:00\n */\n\nexport default function startOfDecade(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var decade = Math.floor(year / 10) * 10;\n date.setFullYear(decade, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name startOfHour\n * @category Hour Helpers\n * @summary Return the start of an hour for the given date.\n *\n * @description\n * Return the start of an hour for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of an hour\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of an hour for 2 September 2014 11:55:00:\n * var result = startOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:00:00\n */\n\nexport default function startOfHour(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n date.setMinutes(0, 0, 0);\n return date;\n}","import startOfWeek from '../startOfWeek/index.js';\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of an ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\n\nexport default function startOfISOWeek(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n return startOfWeek(dirtyDate, {\n weekStartsOn: 1\n });\n}","import getISOWeekYear from '../getISOWeekYear/index.js';\nimport startOfISOWeek from '../startOfISOWeek/index.js';\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of an ISO week-numbering year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * var result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\n\nexport default function startOfISOWeekYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var year = getISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n var date = startOfISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name startOfMinute\n * @category Minute Helpers\n * @summary Return the start of a minute for the given date.\n *\n * @description\n * Return the start of a minute for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a minute\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a minute for 1 December 2014 22:15:45.400:\n * var result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:00\n */\n\nexport default function startOfMinute(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n date.setSeconds(0, 0);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name startOfMonth\n * @category Month Helpers\n * @summary Return the start of a month for the given date.\n *\n * @description\n * Return the start of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a month for 2 September 2014 11:55:00:\n * var result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\n\nexport default function startOfMonth(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name startOfQuarter\n * @category Quarter Helpers\n * @summary Return the start of a year quarter for the given date.\n *\n * @description\n * Return the start of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a quarter\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a quarter for 2 September 2014 11:55:00:\n * var result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Jul 01 2014 00:00:00\n */\n\nexport default function startOfQuarter(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n var currentMonth = date.getMonth();\n var month = currentMonth - currentMonth % 3;\n date.setMonth(month, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name startOfSecond\n * @category Second Helpers\n * @summary Return the start of a second for the given date.\n *\n * @description\n * Return the start of a second for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a second\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a second for 1 December 2014 22:15:45.400:\n * var result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.000\n */\n\nexport default function startOfSecond(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = toDate(dirtyDate);\n date.setMilliseconds(0);\n return date;\n}","import startOfDay from '../startOfDay/index.js';\n/**\n * @name startOfToday\n * @category Day Helpers\n * @summary Return the start of today.\n * @pure false\n *\n * @description\n * Return the start of today.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the start of today\n *\n * @example\n * // If today is 6 October 2014:\n * var result = startOfToday()\n * //=> Mon Oct 6 2014 00:00:00\n */\n\nexport default function startOfToday() {\n return startOfDay(Date.now());\n}","/**\n * @name startOfTomorrow\n * @category Day Helpers\n * @summary Return the start of tomorrow.\n * @pure false\n *\n * @description\n * Return the start of tomorrow.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the start of tomorrow\n *\n * @example\n * // If today is 6 October 2014:\n * var result = startOfTomorrow()\n * //=> Tue Oct 7 2014 00:00:00\n */\nexport default function startOfTomorrow() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth();\n var day = now.getDate();\n var date = new Date(0);\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from '../toDate/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the start of a week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\n\nexport default function startOfWeek(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setDate(date.getDate() - diff);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import getWeekYear from '../getWeekYear/index.js';\nimport startOfWeek from '../startOfWeek/index.js';\nimport toInteger from '../_lib/toInteger/index.js';\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @returns {Date} the start of a week-numbering year\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * var result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * var result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\n\nexport default function startOfWeekYear(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n var date = startOfWeek(firstWeek, dirtyOptions);\n return date;\n}","import toDate from '../toDate/index.js';\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * var result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\n\nexport default function startOfYear(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var cleanDate = toDate(dirtyDate);\n var date = new Date(0);\n date.setFullYear(cleanDate.getFullYear(), 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","/**\n * @name startOfYesterday\n * @category Day Helpers\n * @summary Return the start of yesterday.\n * @pure false\n *\n * @description\n * Return the start of yesterday.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the start of yesterday\n *\n * @example\n * // If today is 6 October 2014:\n * var result = startOfYesterday()\n * //=> Sun Oct 5 2014 00:00:00\n */\nexport default function startOfYesterday() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth();\n var day = now.getDate();\n var date = new Date(0);\n date.setFullYear(year, month, day - 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addDays from '../addDays/index.js';\n/**\n * @name subDays\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @description\n * Subtract the specified number of days from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be subtracted\n * @returns {Date} the new date with the days subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * var result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\n\nexport default function subDays(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addDays(dirtyDate, -amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addHours from '../addHours/index.js';\n/**\n * @name subHours\n * @category Hour Helpers\n * @summary Subtract the specified number of hours from the given date.\n *\n * @description\n * Subtract the specified number of hours from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be subtracted\n * @returns {Date} the new date with the hours subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 2 hours from 11 July 2014 01:00:00:\n * var result = subHours(new Date(2014, 6, 11, 1, 0), 2)\n * //=> Thu Jul 10 2014 23:00:00\n */\n\nexport default function subHours(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addHours(dirtyDate, -amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addISOWeekYears from '../addISOWeekYears/index.js';\n/**\n * @name subISOWeekYears\n * @category ISO Week-Numbering Year Helpers\n * @summary Subtract the specified number of ISO week-numbering years from the given date.\n *\n * @description\n * Subtract the specified number of ISO week-numbering years from the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `subISOYears` to `subISOWeekYears`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `setWeekYear`.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of ISO week-numbering years to be subtracted\n * @returns {Date} the new date with the ISO week-numbering years subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 5 ISO week-numbering years from 1 September 2014:\n * var result = subISOWeekYears(new Date(2014, 8, 1), 5)\n * //=> Mon Aug 31 2009 00:00:00\n */\n\nexport default function subISOWeekYears(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addISOWeekYears(dirtyDate, -amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addMilliseconds from '../addMilliseconds/index.js';\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addMinutes from '../addMinutes/index.js';\n/**\n * @name subMinutes\n * @category Minute Helpers\n * @summary Subtract the specified number of minutes from the given date.\n *\n * @description\n * Subtract the specified number of minutes from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be subtracted\n * @returns {Date} the new date with the minutes subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\n * var result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 11:30:00\n */\n\nexport default function subMinutes(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addMinutes(dirtyDate, -amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addMonths from '../addMonths/index.js';\n/**\n * @name subMonths\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be subtracted\n * @returns {Date} the new date with the months subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * var result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\n\nexport default function subMonths(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, -amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addQuarters from '../addQuarters/index.js';\n/**\n * @name subQuarters\n * @category Quarter Helpers\n * @summary Subtract the specified number of year quarters from the given date.\n *\n * @description\n * Subtract the specified number of year quarters from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of quarters to be subtracted\n * @returns {Date} the new date with the quarters subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 3 quarters from 1 September 2014:\n * var result = subQuarters(new Date(2014, 8, 1), 3)\n * //=> Sun Dec 01 2013 00:00:00\n */\n\nexport default function subQuarters(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addQuarters(dirtyDate, -amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addSeconds from '../addSeconds/index.js';\n/**\n * @name subSeconds\n * @category Second Helpers\n * @summary Subtract the specified number of seconds from the given date.\n *\n * @description\n * Subtract the specified number of seconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be subtracted\n * @returns {Date} the new date with the seconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 30 seconds from 10 July 2014 12:45:00:\n * var result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:44:30\n */\n\nexport default function subSeconds(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addSeconds(dirtyDate, -amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addWeeks from '../addWeeks/index.js';\n/**\n * @name subWeeks\n * @category Week Helpers\n * @summary Subtract the specified number of weeks from the given date.\n *\n * @description\n * Subtract the specified number of weeks from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of weeks to be subtracted\n * @returns {Date} the new date with the weeks subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 4 weeks from 1 September 2014:\n * var result = subWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Aug 04 2014 00:00:00\n */\n\nexport default function subWeeks(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addWeeks(dirtyDate, -amount);\n}","import toInteger from '../_lib/toInteger/index.js';\nimport addYears from '../addYears/index.js';\n/**\n * @name subYears\n * @category Year Helpers\n * @summary Subtract the specified number of years from the given date.\n *\n * @description\n * Subtract the specified number of years from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be subtracted\n * @returns {Date} the new date with the years subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 5 years from 1 September 2014:\n * var result = subYears(new Date(2014, 8, 1), 5)\n * //=> Tue Sep 01 2009 00:00:00\n */\n\nexport default function subYears(dirtyDate, dirtyAmount) {\n if (arguments.length < 2) {\n throw new TypeError('2 arguments required, but only ' + arguments.length + ' present');\n }\n\n var amount = toInteger(dirtyAmount);\n return addYears(dirtyDate, -amount);\n}","/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only ' + arguments.length + ' present');\n }\n\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n\n return new Date(NaN);\n }\n}","// This file can be required in Browserify and Node.js for automatic polyfill\n// To use it: require('es6-promise/auto');\n'use strict';\nmodule.exports = require('./').polyfill();\n","/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.8+1e68dce6\n */\n\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.ES6Promise = factory());\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n var type = typeof x;\n return x !== null && (type === 'object' || type === 'function');\n}\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\n\n\nvar _isArray = void 0;\nif (Array.isArray) {\n _isArray = Array.isArray;\n} else {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = void 0;\nvar customSchedulerFn = void 0;\n\nvar asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nfunction setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n if (typeof vertxNext !== 'undefined') {\n return function () {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var vertx = Function('return this')().require('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = void 0;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n\n if (_state) {\n var callback = arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nfunction resolve$1(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n resolve(promise, object);\n return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(2);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {\n try {\n then$$1.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then$$1) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then$$1, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return resolve(promise, value);\n }, function (reason) {\n return reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$1) {\n if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$1 === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$1)) {\n handleForeignThenable(promise, maybeThenable, then$$1);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction resolve(promise, value) {\n if (promise === value) {\n reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n var then$$1 = void 0;\n try {\n then$$1 = value.then;\n } catch (error) {\n reject(promise, error);\n return;\n }\n handleMaybeThenable(promise, value, then$$1);\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = void 0,\n callback = void 0,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = void 0,\n error = void 0,\n succeeded = true;\n\n if (hasCallback) {\n try {\n value = callback(detail);\n } catch (e) {\n succeeded = false;\n error = e;\n }\n\n if (promise === value) {\n reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (succeeded === false) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n resolve(promise, value);\n }, function rejectPromise(reason) {\n reject(promise, reason);\n });\n } catch (e) {\n reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n}\n\nvar Enumerator = function () {\n function Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate(input);\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n reject(this.promise, validationError());\n }\n }\n\n Enumerator.prototype._enumerate = function _enumerate(input) {\n for (var i = 0; this._state === PENDING && i < input.length; i++) {\n this._eachEntry(input[i], i);\n }\n };\n\n Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n var c = this._instanceConstructor;\n var resolve$$1 = c.resolve;\n\n\n if (resolve$$1 === resolve$1) {\n var _then = void 0;\n var error = void 0;\n var didError = false;\n try {\n _then = entry.then;\n } catch (e) {\n didError = true;\n error = e;\n }\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise$1) {\n var promise = new c(noop);\n if (didError) {\n reject(promise, error);\n } else {\n handleMaybeThenable(promise, entry, _then);\n }\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve$$1) {\n return resolve$$1(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve$$1(entry), i);\n }\n };\n\n Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n var promise = this.promise;\n\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n };\n\n Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n };\n\n return Enumerator;\n}();\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nfunction all(entries) {\n return new Enumerator(this, entries).promise;\n}\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nfunction race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject$1(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n reject(promise, reason);\n return promise;\n}\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise$1 = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n if (isFunction(callback)) {\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n }\n\n return promise.then(callback, callback);\n };\n\n return Promise;\n}();\n\nPromise$1.prototype.then = then;\nPromise$1.all = all;\nPromise$1.race = race;\nPromise$1.resolve = resolve$1;\nPromise$1.reject = reject$1;\nPromise$1._setScheduler = setScheduler;\nPromise$1._setAsap = setAsap;\nPromise$1._asap = asap;\n\n/*global self*/\nfunction polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise$1;\n}\n\n// Strange compat..\nPromise$1.polyfill = polyfill;\nPromise$1.Promise = Promise$1;\n\nreturn Promise$1;\n\n})));\n\n\n\n//# sourceMappingURL=es6-promise.map\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction $getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return $getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = $getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) args.push(arguments[i]);\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n ReflectApply(this.listener, this.target, args);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n","/*!\n * html2canvas 1.0.0-rc.5 \n * Copyright (c) 2019 Niklas von Hertzen \n * Released under MIT License\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.html2canvas = factory());\n}(this, function () { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\r\n\r\n function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n }\r\n\r\n function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n }\n\n var Bounds = /** @class */ (function () {\r\n function Bounds(x, y, w, h) {\r\n this.left = x;\r\n this.top = y;\r\n this.width = w;\r\n this.height = h;\r\n }\r\n Bounds.prototype.add = function (x, y, w, h) {\r\n return new Bounds(this.left + x, this.top + y, this.width + w, this.height + h);\r\n };\r\n Bounds.fromClientRect = function (clientRect) {\r\n return new Bounds(clientRect.left, clientRect.top, clientRect.width, clientRect.height);\r\n };\r\n return Bounds;\r\n }());\r\n var parseBounds = function (node) {\r\n return Bounds.fromClientRect(node.getBoundingClientRect());\r\n };\r\n var parseDocumentSize = function (document) {\r\n var body = document.body;\r\n var documentElement = document.documentElement;\r\n if (!body || !documentElement) {\r\n throw new Error(\"Unable to get document size\");\r\n }\r\n var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));\r\n var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));\r\n return new Bounds(0, 0, width, height);\r\n };\n\n /*\n * css-line-break 1.1.1 \n * Copyright (c) 2019 Niklas von Hertzen \n * Released under MIT License\n */\n var toCodePoints = function (str) {\r\n var codePoints = [];\r\n var i = 0;\r\n var length = str.length;\r\n while (i < length) {\r\n var value = str.charCodeAt(i++);\r\n if (value >= 0xd800 && value <= 0xdbff && i < length) {\r\n var extra = str.charCodeAt(i++);\r\n if ((extra & 0xfc00) === 0xdc00) {\r\n codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);\r\n }\r\n else {\r\n codePoints.push(value);\r\n i--;\r\n }\r\n }\r\n else {\r\n codePoints.push(value);\r\n }\r\n }\r\n return codePoints;\r\n };\r\n var fromCodePoint = function () {\r\n var codePoints = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n codePoints[_i] = arguments[_i];\r\n }\r\n if (String.fromCodePoint) {\r\n return String.fromCodePoint.apply(String, codePoints);\r\n }\r\n var length = codePoints.length;\r\n if (!length) {\r\n return '';\r\n }\r\n var codeUnits = [];\r\n var index = -1;\r\n var result = '';\r\n while (++index < length) {\r\n var codePoint = codePoints[index];\r\n if (codePoint <= 0xffff) {\r\n codeUnits.push(codePoint);\r\n }\r\n else {\r\n codePoint -= 0x10000;\r\n codeUnits.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00);\r\n }\r\n if (index + 1 === length || codeUnits.length > 0x4000) {\r\n result += String.fromCharCode.apply(String, codeUnits);\r\n codeUnits.length = 0;\r\n }\r\n }\r\n return result;\r\n };\r\n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\r\n // Use a lookup table to find the index.\r\n var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\r\n for (var i = 0; i < chars.length; i++) {\r\n lookup[chars.charCodeAt(i)] = i;\r\n }\r\n var decode = function (base64) {\r\n var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\r\n if (base64[base64.length - 1] === '=') {\r\n bufferLength--;\r\n if (base64[base64.length - 2] === '=') {\r\n bufferLength--;\r\n }\r\n }\r\n var buffer = typeof ArrayBuffer !== 'undefined' &&\r\n typeof Uint8Array !== 'undefined' &&\r\n typeof Uint8Array.prototype.slice !== 'undefined'\r\n ? new ArrayBuffer(bufferLength)\r\n : new Array(bufferLength);\r\n var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);\r\n for (i = 0; i < len; i += 4) {\r\n encoded1 = lookup[base64.charCodeAt(i)];\r\n encoded2 = lookup[base64.charCodeAt(i + 1)];\r\n encoded3 = lookup[base64.charCodeAt(i + 2)];\r\n encoded4 = lookup[base64.charCodeAt(i + 3)];\r\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\r\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\r\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\r\n }\r\n return buffer;\r\n };\r\n var polyUint16Array = function (buffer) {\r\n var length = buffer.length;\r\n var bytes = [];\r\n for (var i = 0; i < length; i += 2) {\r\n bytes.push((buffer[i + 1] << 8) | buffer[i]);\r\n }\r\n return bytes;\r\n };\r\n var polyUint32Array = function (buffer) {\r\n var length = buffer.length;\r\n var bytes = [];\r\n for (var i = 0; i < length; i += 4) {\r\n bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);\r\n }\r\n return bytes;\r\n };\n\n /** Shift size for getting the index-2 table offset. */\r\n var UTRIE2_SHIFT_2 = 5;\r\n /** Shift size for getting the index-1 table offset. */\r\n var UTRIE2_SHIFT_1 = 6 + 5;\r\n /**\r\n * Shift size for shifting left the index array values.\r\n * Increases possible data size with 16-bit index values at the cost\r\n * of compactability.\r\n * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.\r\n */\r\n var UTRIE2_INDEX_SHIFT = 2;\r\n /**\r\n * Difference between the two shift sizes,\r\n * for getting an index-1 offset from an index-2 offset. 6=11-5\r\n */\r\n var UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;\r\n /**\r\n * The part of the index-2 table for U+D800..U+DBFF stores values for\r\n * lead surrogate code _units_ not code _points_.\r\n * Values for lead surrogate code _points_ are indexed with this portion of the table.\r\n * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)\r\n */\r\n var UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;\r\n /** Number of entries in a data block. 32=0x20 */\r\n var UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;\r\n /** Mask for getting the lower bits for the in-data-block offset. */\r\n var UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;\r\n var UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;\r\n /** Count the lengths of both BMP pieces. 2080=0x820 */\r\n var UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;\r\n /**\r\n * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.\r\n * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.\r\n */\r\n var UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;\r\n var UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */\r\n /**\r\n * The index-1 table, only used for supplementary code points, at offset 2112=0x840.\r\n * Variable length, for code points up to highStart, where the last single-value range starts.\r\n * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.\r\n * (For 0x100000 supplementary code points U+10000..U+10ffff.)\r\n *\r\n * The part of the index-2 table for supplementary code points starts\r\n * after this index-1 table.\r\n *\r\n * Both the index-1 table and the following part of the index-2 table\r\n * are omitted completely if there is only BMP data.\r\n */\r\n var UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;\r\n /**\r\n * Number of index-1 entries for the BMP. 32=0x20\r\n * This part of the index-1 table is omitted from the serialized form.\r\n */\r\n var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;\r\n /** Number of entries in an index-2 block. 64=0x40 */\r\n var UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;\r\n /** Mask for getting the lower bits for the in-index-2-block offset. */\r\n var UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;\r\n var slice16 = function (view, start, end) {\r\n if (view.slice) {\r\n return view.slice(start, end);\r\n }\r\n return new Uint16Array(Array.prototype.slice.call(view, start, end));\r\n };\r\n var slice32 = function (view, start, end) {\r\n if (view.slice) {\r\n return view.slice(start, end);\r\n }\r\n return new Uint32Array(Array.prototype.slice.call(view, start, end));\r\n };\r\n var createTrieFromBase64 = function (base64) {\r\n var buffer = decode(base64);\r\n var view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);\r\n var view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);\r\n var headerLength = 24;\r\n var index = slice16(view16, headerLength / 2, view32[4] / 2);\r\n var data = view32[5] === 2\r\n ? slice16(view16, (headerLength + view32[4]) / 2)\r\n : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));\r\n return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);\r\n };\r\n var Trie = /** @class */ (function () {\r\n function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {\r\n this.initialValue = initialValue;\r\n this.errorValue = errorValue;\r\n this.highStart = highStart;\r\n this.highValueIndex = highValueIndex;\r\n this.index = index;\r\n this.data = data;\r\n }\r\n /**\r\n * Get the value for a code point as stored in the Trie.\r\n *\r\n * @param codePoint the code point\r\n * @return the value\r\n */\r\n Trie.prototype.get = function (codePoint) {\r\n var ix;\r\n if (codePoint >= 0) {\r\n if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {\r\n // Ordinary BMP code point, excluding leading surrogates.\r\n // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.\r\n // 16 bit data is stored in the index array itself.\r\n ix = this.index[codePoint >> UTRIE2_SHIFT_2];\r\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\r\n return this.data[ix];\r\n }\r\n if (codePoint <= 0xffff) {\r\n // Lead Surrogate Code Point. A Separate index section is stored for\r\n // lead surrogate code units and code points.\r\n // The main index has the code unit data.\r\n // For this function, we need the code point data.\r\n // Note: this expression could be refactored for slightly improved efficiency, but\r\n // surrogate code points will be so rare in practice that it's not worth it.\r\n ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)];\r\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\r\n return this.data[ix];\r\n }\r\n if (codePoint < this.highStart) {\r\n // Supplemental code point, use two-level lookup.\r\n ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);\r\n ix = this.index[ix];\r\n ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK;\r\n ix = this.index[ix];\r\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\r\n return this.data[ix];\r\n }\r\n if (codePoint <= 0x10ffff) {\r\n return this.data[this.highValueIndex];\r\n }\r\n }\r\n // Fall through. The code point is outside of the legal range of 0..0x10ffff.\r\n return this.errorValue;\r\n };\r\n return Trie;\r\n }());\n\n var base64 = 'KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAf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iWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADA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B4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQAB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ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAE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AFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUAB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QAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUA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AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA';\n\n /* @flow */\r\n var LETTER_NUMBER_MODIFIER = 50;\r\n // Non-tailorable Line Breaking Classes\r\n var BK = 1; // Cause a line break (after)\r\n var CR = 2; // Cause a line break (after), except between CR and LF\r\n var LF = 3; // Cause a line break (after)\r\n var CM = 4; // Prohibit a line break between the character and the preceding character\r\n var NL = 5; // Cause a line break (after)\r\n var WJ = 7; // Prohibit line breaks before and after\r\n var ZW = 8; // Provide a break opportunity\r\n var GL = 9; // Prohibit line breaks before and after\r\n var SP = 10; // Enable indirect line breaks\r\n var ZWJ = 11; // Prohibit line breaks within joiner sequences\r\n // Break Opportunities\r\n var B2 = 12; // Provide a line break opportunity before and after the character\r\n var BA = 13; // Generally provide a line break opportunity after the character\r\n var BB = 14; // Generally provide a line break opportunity before the character\r\n var HY = 15; // Provide a line break opportunity after the character, except in numeric context\r\n var CB = 16; // Provide a line break opportunity contingent on additional information\r\n // Characters Prohibiting Certain Breaks\r\n var CL = 17; // Prohibit line breaks before\r\n var CP = 18; // Prohibit line breaks before\r\n var EX = 19; // Prohibit line breaks before\r\n var IN = 20; // Allow only indirect line breaks between pairs\r\n var NS = 21; // Allow only indirect line breaks before\r\n var OP = 22; // Prohibit line breaks after\r\n var QU = 23; // Act like they are both opening and closing\r\n // Numeric Context\r\n var IS = 24; // Prevent breaks after any and before numeric\r\n var NU = 25; // Form numeric expressions for line breaking purposes\r\n var PO = 26; // Do not break following a numeric expression\r\n var PR = 27; // Do not break in front of a numeric expression\r\n var SY = 28; // Prevent a break before; and allow a break after\r\n // Other Characters\r\n var AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID\r\n var AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters\r\n var CJ = 31; // Treat as NS or ID for strict or normal breaking.\r\n var EB = 32; // Do not break from following Emoji Modifier\r\n var EM = 33; // Do not break from preceding Emoji Base\r\n var H2 = 34; // Form Korean syllable blocks\r\n var H3 = 35; // Form Korean syllable blocks\r\n var HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic\r\n var ID = 37; // Break before or after; except in some numeric context\r\n var JL = 38; // Form Korean syllable blocks\r\n var JV = 39; // Form Korean syllable blocks\r\n var JT = 40; // Form Korean syllable blocks\r\n var RI = 41; // Keep pairs together. For pairs; break before and after other classes\r\n var SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis\r\n var XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions\r\n var BREAK_MANDATORY = '!';\r\n var BREAK_NOT_ALLOWED = '×';\r\n var BREAK_ALLOWED = '÷';\r\n var UnicodeTrie = createTrieFromBase64(base64);\r\n var ALPHABETICS = [AL, HL];\r\n var HARD_LINE_BREAKS = [BK, CR, LF, NL];\r\n var SPACE = [SP, ZW];\r\n var PREFIX_POSTFIX = [PR, PO];\r\n var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);\r\n var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];\r\n var HYPHEN = [HY, BA];\r\n var codePointsToCharacterClasses = function (codePoints, lineBreak) {\r\n if (lineBreak === void 0) { lineBreak = 'strict'; }\r\n var types = [];\r\n var indicies = [];\r\n var categories = [];\r\n codePoints.forEach(function (codePoint, index) {\r\n var classType = UnicodeTrie.get(codePoint);\r\n if (classType > LETTER_NUMBER_MODIFIER) {\r\n categories.push(true);\r\n classType -= LETTER_NUMBER_MODIFIER;\r\n }\r\n else {\r\n categories.push(false);\r\n }\r\n if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {\r\n // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0\r\n if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {\r\n indicies.push(index);\r\n return types.push(CB);\r\n }\r\n }\r\n if (classType === CM || classType === ZWJ) {\r\n // LB10 Treat any remaining combining mark or ZWJ as AL.\r\n if (index === 0) {\r\n indicies.push(index);\r\n return types.push(AL);\r\n }\r\n // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of\r\n // the base character in all of the following rules. Treat ZWJ as if it were CM.\r\n var prev = types[index - 1];\r\n if (LINE_BREAKS.indexOf(prev) === -1) {\r\n indicies.push(indicies[index - 1]);\r\n return types.push(prev);\r\n }\r\n indicies.push(index);\r\n return types.push(AL);\r\n }\r\n indicies.push(index);\r\n if (classType === CJ) {\r\n return types.push(lineBreak === 'strict' ? NS : ID);\r\n }\r\n if (classType === SA) {\r\n return types.push(AL);\r\n }\r\n if (classType === AI) {\r\n return types.push(AL);\r\n }\r\n // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL\r\n // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised\r\n // to take into account the actual line breaking properties for these characters.\r\n if (classType === XX) {\r\n if ((codePoint >= 0x20000 && codePoint <= 0x2fffd) || (codePoint >= 0x30000 && codePoint <= 0x3fffd)) {\r\n return types.push(ID);\r\n }\r\n else {\r\n return types.push(AL);\r\n }\r\n }\r\n types.push(classType);\r\n });\r\n return [indicies, types, categories];\r\n };\r\n var isAdjacentWithSpaceIgnored = function (a, b, currentIndex, classTypes) {\r\n var current = classTypes[currentIndex];\r\n if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {\r\n var i = currentIndex;\r\n while (i <= classTypes.length) {\r\n i++;\r\n var next = classTypes[i];\r\n if (next === b) {\r\n return true;\r\n }\r\n if (next !== SP) {\r\n break;\r\n }\r\n }\r\n }\r\n if (current === SP) {\r\n var i = currentIndex;\r\n while (i > 0) {\r\n i--;\r\n var prev = classTypes[i];\r\n if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {\r\n var n = currentIndex;\r\n while (n <= classTypes.length) {\r\n n++;\r\n var next = classTypes[n];\r\n if (next === b) {\r\n return true;\r\n }\r\n if (next !== SP) {\r\n break;\r\n }\r\n }\r\n }\r\n if (prev !== SP) {\r\n break;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n var previousNonSpaceClassType = function (currentIndex, classTypes) {\r\n var i = currentIndex;\r\n while (i >= 0) {\r\n var type = classTypes[i];\r\n if (type === SP) {\r\n i--;\r\n }\r\n else {\r\n return type;\r\n }\r\n }\r\n return 0;\r\n };\r\n var _lineBreakAtIndex = function (codePoints, classTypes, indicies, index, forbiddenBreaks) {\r\n if (indicies[index] === 0) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n var currentIndex = index - 1;\r\n if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n var beforeIndex = currentIndex - 1;\r\n var afterIndex = currentIndex + 1;\r\n var current = classTypes[currentIndex];\r\n // LB4 Always break after hard line breaks.\r\n // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.\r\n var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;\r\n var next = classTypes[afterIndex];\r\n if (current === CR && next === LF) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n if (HARD_LINE_BREAKS.indexOf(current) !== -1) {\r\n return BREAK_MANDATORY;\r\n }\r\n // LB6 Do not break before hard line breaks.\r\n if (HARD_LINE_BREAKS.indexOf(next) !== -1) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB7 Do not break before spaces or zero width space.\r\n if (SPACE.indexOf(next) !== -1) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.\r\n if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {\r\n return BREAK_ALLOWED;\r\n }\r\n // LB8a Do not break between a zero width joiner and an ideograph, emoji base or emoji modifier.\r\n if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB11 Do not break before or after Word joiner and related characters.\r\n if (current === WJ || next === WJ) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB12 Do not break after NBSP and related characters.\r\n if (current === GL) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.\r\n if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.\r\n if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB14 Do not break after ‘[’, even after spaces.\r\n if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB15 Do not break within ‘”[’, even with intervening spaces.\r\n if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.\r\n if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB17 Do not break within ‘——’, even with intervening spaces.\r\n if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB18 Break after spaces.\r\n if (current === SP) {\r\n return BREAK_ALLOWED;\r\n }\r\n // LB19 Do not break before or after quotation marks, such as ‘ ” ’.\r\n if (current === QU || next === QU) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB20 Break before and after unresolved CB.\r\n if (next === CB || current === CB) {\r\n return BREAK_ALLOWED;\r\n }\r\n // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.\r\n if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB21a Don't break after Hebrew + Hyphen.\r\n if (before === HL && HYPHEN.indexOf(current) !== -1) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB21b Don’t break between Solidus and Hebrew letters.\r\n if (current === SY && next === HL) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB22 Do not break between two ellipses, or between letters, numbers or exclamations and ellipsis.\r\n if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB23 Do not break between digits and letters.\r\n if ((ALPHABETICS.indexOf(next) !== -1 && current === NU) || (ALPHABETICS.indexOf(current) !== -1 && next === NU)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.\r\n if ((current === PR && [ID, EB, EM].indexOf(next) !== -1) ||\r\n ([ID, EB, EM].indexOf(current) !== -1 && next === PO)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.\r\n if ((ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1) ||\r\n (PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB25 Do not break between the following pairs of classes relevant to numbers:\r\n if (\r\n // (PR | PO) × ( OP | HY )? NU\r\n ([PR, PO].indexOf(current) !== -1 &&\r\n (next === NU || ([OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU))) ||\r\n // ( OP | HY ) × NU\r\n ([OP, HY].indexOf(current) !== -1 && next === NU) ||\r\n // NU ×\t(NU | SY | IS)\r\n (current === NU && [NU, SY, IS].indexOf(next) !== -1)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)\r\n if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {\r\n var prevIndex = currentIndex;\r\n while (prevIndex >= 0) {\r\n var type = classTypes[prevIndex];\r\n if (type === NU) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n else if ([SY, IS].indexOf(type) !== -1) {\r\n prevIndex--;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n }\r\n // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))\r\n if ([PR, PO].indexOf(next) !== -1) {\r\n var prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;\r\n while (prevIndex >= 0) {\r\n var type = classTypes[prevIndex];\r\n if (type === NU) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n else if ([SY, IS].indexOf(type) !== -1) {\r\n prevIndex--;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n }\r\n // LB26 Do not break a Korean syllable.\r\n if ((JL === current && [JL, JV, H2, H3].indexOf(next) !== -1) ||\r\n ([JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1) ||\r\n ([JT, H3].indexOf(current) !== -1 && next === JT)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB27 Treat a Korean Syllable Block the same as ID.\r\n if ((KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1) ||\r\n (KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB28 Do not break between alphabetics (“at”).\r\n if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).\r\n if (current === IS && ALPHABETICS.indexOf(next) !== -1) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.\r\n if ((ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP) ||\r\n (ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP)) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n // LB30a Break between two regional indicator symbols if and only if there are an even number of regional\r\n // indicators preceding the position of the break.\r\n if (current === RI && next === RI) {\r\n var i = indicies[currentIndex];\r\n var count = 1;\r\n while (i > 0) {\r\n i--;\r\n if (classTypes[i] === RI) {\r\n count++;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if (count % 2 !== 0) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n }\r\n // LB30b Do not break between an emoji base and an emoji modifier.\r\n if (current === EB && next === EM) {\r\n return BREAK_NOT_ALLOWED;\r\n }\r\n return BREAK_ALLOWED;\r\n };\r\n var cssFormattedClasses = function (codePoints, options) {\r\n if (!options) {\r\n options = { lineBreak: 'normal', wordBreak: 'normal' };\r\n }\r\n var _a = codePointsToCharacterClasses(codePoints, options.lineBreak), indicies = _a[0], classTypes = _a[1], isLetterNumber = _a[2];\r\n if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {\r\n classTypes = classTypes.map(function (type) { return ([NU, AL, SA].indexOf(type) !== -1 ? ID : type); });\r\n }\r\n var forbiddenBreakpoints = options.wordBreak === 'keep-all'\r\n ? isLetterNumber.map(function (letterNumber, i) {\r\n return letterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;\r\n })\r\n : undefined;\r\n return [indicies, classTypes, forbiddenBreakpoints];\r\n };\r\n var Break = /** @class */ (function () {\r\n function Break(codePoints, lineBreak, start, end) {\r\n this.codePoints = codePoints;\r\n this.required = lineBreak === BREAK_MANDATORY;\r\n this.start = start;\r\n this.end = end;\r\n }\r\n Break.prototype.slice = function () {\r\n return fromCodePoint.apply(void 0, this.codePoints.slice(this.start, this.end));\r\n };\r\n return Break;\r\n }());\r\n var LineBreaker = function (str, options) {\r\n var codePoints = toCodePoints(str);\r\n var _a = cssFormattedClasses(codePoints, options), indicies = _a[0], classTypes = _a[1], forbiddenBreakpoints = _a[2];\r\n var length = codePoints.length;\r\n var lastEnd = 0;\r\n var nextIndex = 0;\r\n return {\r\n next: function () {\r\n if (nextIndex >= length) {\r\n return { done: true, value: null };\r\n }\r\n var lineBreak = BREAK_NOT_ALLOWED;\r\n while (nextIndex < length &&\r\n (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) ===\r\n BREAK_NOT_ALLOWED) { }\r\n if (lineBreak !== BREAK_NOT_ALLOWED || nextIndex === length) {\r\n var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);\r\n lastEnd = nextIndex;\r\n return { value: value, done: false };\r\n }\r\n return { done: true, value: null };\r\n },\r\n };\r\n };\n\n // https://www.w3.org/TR/css-syntax-3\r\n var TokenType;\r\n (function (TokenType) {\r\n TokenType[TokenType[\"STRING_TOKEN\"] = 0] = \"STRING_TOKEN\";\r\n TokenType[TokenType[\"BAD_STRING_TOKEN\"] = 1] = \"BAD_STRING_TOKEN\";\r\n TokenType[TokenType[\"LEFT_PARENTHESIS_TOKEN\"] = 2] = \"LEFT_PARENTHESIS_TOKEN\";\r\n TokenType[TokenType[\"RIGHT_PARENTHESIS_TOKEN\"] = 3] = \"RIGHT_PARENTHESIS_TOKEN\";\r\n TokenType[TokenType[\"COMMA_TOKEN\"] = 4] = \"COMMA_TOKEN\";\r\n TokenType[TokenType[\"HASH_TOKEN\"] = 5] = \"HASH_TOKEN\";\r\n TokenType[TokenType[\"DELIM_TOKEN\"] = 6] = \"DELIM_TOKEN\";\r\n TokenType[TokenType[\"AT_KEYWORD_TOKEN\"] = 7] = \"AT_KEYWORD_TOKEN\";\r\n TokenType[TokenType[\"PREFIX_MATCH_TOKEN\"] = 8] = \"PREFIX_MATCH_TOKEN\";\r\n TokenType[TokenType[\"DASH_MATCH_TOKEN\"] = 9] = \"DASH_MATCH_TOKEN\";\r\n TokenType[TokenType[\"INCLUDE_MATCH_TOKEN\"] = 10] = \"INCLUDE_MATCH_TOKEN\";\r\n TokenType[TokenType[\"LEFT_CURLY_BRACKET_TOKEN\"] = 11] = \"LEFT_CURLY_BRACKET_TOKEN\";\r\n TokenType[TokenType[\"RIGHT_CURLY_BRACKET_TOKEN\"] = 12] = \"RIGHT_CURLY_BRACKET_TOKEN\";\r\n TokenType[TokenType[\"SUFFIX_MATCH_TOKEN\"] = 13] = \"SUFFIX_MATCH_TOKEN\";\r\n TokenType[TokenType[\"SUBSTRING_MATCH_TOKEN\"] = 14] = \"SUBSTRING_MATCH_TOKEN\";\r\n TokenType[TokenType[\"DIMENSION_TOKEN\"] = 15] = \"DIMENSION_TOKEN\";\r\n TokenType[TokenType[\"PERCENTAGE_TOKEN\"] = 16] = \"PERCENTAGE_TOKEN\";\r\n TokenType[TokenType[\"NUMBER_TOKEN\"] = 17] = \"NUMBER_TOKEN\";\r\n TokenType[TokenType[\"FUNCTION\"] = 18] = \"FUNCTION\";\r\n TokenType[TokenType[\"FUNCTION_TOKEN\"] = 19] = \"FUNCTION_TOKEN\";\r\n TokenType[TokenType[\"IDENT_TOKEN\"] = 20] = \"IDENT_TOKEN\";\r\n TokenType[TokenType[\"COLUMN_TOKEN\"] = 21] = \"COLUMN_TOKEN\";\r\n TokenType[TokenType[\"URL_TOKEN\"] = 22] = \"URL_TOKEN\";\r\n TokenType[TokenType[\"BAD_URL_TOKEN\"] = 23] = \"BAD_URL_TOKEN\";\r\n TokenType[TokenType[\"CDC_TOKEN\"] = 24] = \"CDC_TOKEN\";\r\n TokenType[TokenType[\"CDO_TOKEN\"] = 25] = \"CDO_TOKEN\";\r\n TokenType[TokenType[\"COLON_TOKEN\"] = 26] = \"COLON_TOKEN\";\r\n TokenType[TokenType[\"SEMICOLON_TOKEN\"] = 27] = \"SEMICOLON_TOKEN\";\r\n TokenType[TokenType[\"LEFT_SQUARE_BRACKET_TOKEN\"] = 28] = \"LEFT_SQUARE_BRACKET_TOKEN\";\r\n TokenType[TokenType[\"RIGHT_SQUARE_BRACKET_TOKEN\"] = 29] = \"RIGHT_SQUARE_BRACKET_TOKEN\";\r\n TokenType[TokenType[\"UNICODE_RANGE_TOKEN\"] = 30] = \"UNICODE_RANGE_TOKEN\";\r\n TokenType[TokenType[\"WHITESPACE_TOKEN\"] = 31] = \"WHITESPACE_TOKEN\";\r\n TokenType[TokenType[\"EOF_TOKEN\"] = 32] = \"EOF_TOKEN\";\r\n })(TokenType || (TokenType = {}));\r\n var FLAG_UNRESTRICTED = 1 << 0;\r\n var FLAG_ID = 1 << 1;\r\n var FLAG_INTEGER = 1 << 2;\r\n var FLAG_NUMBER = 1 << 3;\r\n var LINE_FEED = 0x000a;\r\n var SOLIDUS = 0x002f;\r\n var REVERSE_SOLIDUS = 0x005c;\r\n var CHARACTER_TABULATION = 0x0009;\r\n var SPACE$1 = 0x0020;\r\n var QUOTATION_MARK = 0x0022;\r\n var EQUALS_SIGN = 0x003d;\r\n var NUMBER_SIGN = 0x0023;\r\n var DOLLAR_SIGN = 0x0024;\r\n var PERCENTAGE_SIGN = 0x0025;\r\n var APOSTROPHE = 0x0027;\r\n var LEFT_PARENTHESIS = 0x0028;\r\n var RIGHT_PARENTHESIS = 0x0029;\r\n var LOW_LINE = 0x005f;\r\n var HYPHEN_MINUS = 0x002d;\r\n var EXCLAMATION_MARK = 0x0021;\r\n var LESS_THAN_SIGN = 0x003c;\r\n var GREATER_THAN_SIGN = 0x003e;\r\n var COMMERCIAL_AT = 0x0040;\r\n var LEFT_SQUARE_BRACKET = 0x005b;\r\n var RIGHT_SQUARE_BRACKET = 0x005d;\r\n var CIRCUMFLEX_ACCENT = 0x003d;\r\n var LEFT_CURLY_BRACKET = 0x007b;\r\n var QUESTION_MARK = 0x003f;\r\n var RIGHT_CURLY_BRACKET = 0x007d;\r\n var VERTICAL_LINE = 0x007c;\r\n var TILDE = 0x007e;\r\n var CONTROL = 0x0080;\r\n var REPLACEMENT_CHARACTER = 0xfffd;\r\n var ASTERISK = 0x002a;\r\n var PLUS_SIGN = 0x002b;\r\n var COMMA = 0x002c;\r\n var COLON = 0x003a;\r\n var SEMICOLON = 0x003b;\r\n var FULL_STOP = 0x002e;\r\n var NULL = 0x0000;\r\n var BACKSPACE = 0x0008;\r\n var LINE_TABULATION = 0x000b;\r\n var SHIFT_OUT = 0x000e;\r\n var INFORMATION_SEPARATOR_ONE = 0x001f;\r\n var DELETE = 0x007f;\r\n var EOF = -1;\r\n var ZERO = 0x0030;\r\n var a = 0x0061;\r\n var e = 0x0065;\r\n var f = 0x0066;\r\n var u = 0x0075;\r\n var z = 0x007a;\r\n var A = 0x0041;\r\n var E = 0x0045;\r\n var F = 0x0046;\r\n var U = 0x0055;\r\n var Z = 0x005a;\r\n var isDigit = function (codePoint) { return codePoint >= ZERO && codePoint <= 0x0039; };\r\n var isSurrogateCodePoint = function (codePoint) { return codePoint >= 0xd800 && codePoint <= 0xdfff; };\r\n var isHex = function (codePoint) {\r\n return isDigit(codePoint) || (codePoint >= A && codePoint <= F) || (codePoint >= a && codePoint <= f);\r\n };\r\n var isLowerCaseLetter = function (codePoint) { return codePoint >= a && codePoint <= z; };\r\n var isUpperCaseLetter = function (codePoint) { return codePoint >= A && codePoint <= Z; };\r\n var isLetter = function (codePoint) { return isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint); };\r\n var isNonASCIICodePoint = function (codePoint) { return codePoint >= CONTROL; };\r\n var isWhiteSpace = function (codePoint) {\r\n return codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE$1;\r\n };\r\n var isNameStartCodePoint = function (codePoint) {\r\n return isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE;\r\n };\r\n var isNameCodePoint = function (codePoint) {\r\n return isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS;\r\n };\r\n var isNonPrintableCodePoint = function (codePoint) {\r\n return ((codePoint >= NULL && codePoint <= BACKSPACE) ||\r\n codePoint === LINE_TABULATION ||\r\n (codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE) ||\r\n codePoint === DELETE);\r\n };\r\n var isValidEscape = function (c1, c2) {\r\n if (c1 !== REVERSE_SOLIDUS) {\r\n return false;\r\n }\r\n return c2 !== LINE_FEED;\r\n };\r\n var isIdentifierStart = function (c1, c2, c3) {\r\n if (c1 === HYPHEN_MINUS) {\r\n return isNameStartCodePoint(c2) || isValidEscape(c2, c3);\r\n }\r\n else if (isNameStartCodePoint(c1)) {\r\n return true;\r\n }\r\n else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c2)) {\r\n return true;\r\n }\r\n return false;\r\n };\r\n var isNumberStart = function (c1, c2, c3) {\r\n if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {\r\n if (isDigit(c2)) {\r\n return true;\r\n }\r\n return c2 === FULL_STOP && isDigit(c3);\r\n }\r\n if (c1 === FULL_STOP) {\r\n return isDigit(c2);\r\n }\r\n return isDigit(c1);\r\n };\r\n var stringToNumber = function (codePoints) {\r\n var c = 0;\r\n var sign = 1;\r\n if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {\r\n if (codePoints[c] === HYPHEN_MINUS) {\r\n sign = -1;\r\n }\r\n c++;\r\n }\r\n var integers = [];\r\n while (isDigit(codePoints[c])) {\r\n integers.push(codePoints[c++]);\r\n }\r\n var int = integers.length ? parseInt(fromCodePoint.apply(void 0, integers), 10) : 0;\r\n if (codePoints[c] === FULL_STOP) {\r\n c++;\r\n }\r\n var fraction = [];\r\n while (isDigit(codePoints[c])) {\r\n fraction.push(codePoints[c++]);\r\n }\r\n var fracd = fraction.length;\r\n var frac = fracd ? parseInt(fromCodePoint.apply(void 0, fraction), 10) : 0;\r\n if (codePoints[c] === E || codePoints[c] === e) {\r\n c++;\r\n }\r\n var expsign = 1;\r\n if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {\r\n if (codePoints[c] === HYPHEN_MINUS) {\r\n expsign = -1;\r\n }\r\n c++;\r\n }\r\n var exponent = [];\r\n while (isDigit(codePoints[c])) {\r\n exponent.push(codePoints[c++]);\r\n }\r\n var exp = exponent.length ? parseInt(fromCodePoint.apply(void 0, exponent), 10) : 0;\r\n return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp);\r\n };\r\n var LEFT_PARENTHESIS_TOKEN = {\r\n type: TokenType.LEFT_PARENTHESIS_TOKEN\r\n };\r\n var RIGHT_PARENTHESIS_TOKEN = {\r\n type: TokenType.RIGHT_PARENTHESIS_TOKEN\r\n };\r\n var COMMA_TOKEN = { type: TokenType.COMMA_TOKEN };\r\n var SUFFIX_MATCH_TOKEN = { type: TokenType.SUFFIX_MATCH_TOKEN };\r\n var PREFIX_MATCH_TOKEN = { type: TokenType.PREFIX_MATCH_TOKEN };\r\n var COLUMN_TOKEN = { type: TokenType.COLUMN_TOKEN };\r\n var DASH_MATCH_TOKEN = { type: TokenType.DASH_MATCH_TOKEN };\r\n var INCLUDE_MATCH_TOKEN = { type: TokenType.INCLUDE_MATCH_TOKEN };\r\n var LEFT_CURLY_BRACKET_TOKEN = {\r\n type: TokenType.LEFT_CURLY_BRACKET_TOKEN\r\n };\r\n var RIGHT_CURLY_BRACKET_TOKEN = {\r\n type: TokenType.RIGHT_CURLY_BRACKET_TOKEN\r\n };\r\n var SUBSTRING_MATCH_TOKEN = { type: TokenType.SUBSTRING_MATCH_TOKEN };\r\n var BAD_URL_TOKEN = { type: TokenType.BAD_URL_TOKEN };\r\n var BAD_STRING_TOKEN = { type: TokenType.BAD_STRING_TOKEN };\r\n var CDO_TOKEN = { type: TokenType.CDO_TOKEN };\r\n var CDC_TOKEN = { type: TokenType.CDC_TOKEN };\r\n var COLON_TOKEN = { type: TokenType.COLON_TOKEN };\r\n var SEMICOLON_TOKEN = { type: TokenType.SEMICOLON_TOKEN };\r\n var LEFT_SQUARE_BRACKET_TOKEN = {\r\n type: TokenType.LEFT_SQUARE_BRACKET_TOKEN\r\n };\r\n var RIGHT_SQUARE_BRACKET_TOKEN = {\r\n type: TokenType.RIGHT_SQUARE_BRACKET_TOKEN\r\n };\r\n var WHITESPACE_TOKEN = { type: TokenType.WHITESPACE_TOKEN };\r\n var EOF_TOKEN = { type: TokenType.EOF_TOKEN };\r\n var Tokenizer = /** @class */ (function () {\r\n function Tokenizer() {\r\n this._value = [];\r\n }\r\n Tokenizer.prototype.write = function (chunk) {\r\n this._value = this._value.concat(toCodePoints(chunk));\r\n };\r\n Tokenizer.prototype.read = function () {\r\n var tokens = [];\r\n var token = this.consumeToken();\r\n while (token !== EOF_TOKEN) {\r\n tokens.push(token);\r\n token = this.consumeToken();\r\n }\r\n return tokens;\r\n };\r\n Tokenizer.prototype.consumeToken = function () {\r\n var codePoint = this.consumeCodePoint();\r\n switch (codePoint) {\r\n case QUOTATION_MARK:\r\n return this.consumeStringToken(QUOTATION_MARK);\r\n case NUMBER_SIGN:\r\n var c1 = this.peekCodePoint(0);\r\n var c2 = this.peekCodePoint(1);\r\n var c3 = this.peekCodePoint(2);\r\n if (isNameCodePoint(c1) || isValidEscape(c2, c3)) {\r\n var flags = isIdentifierStart(c1, c2, c3) ? FLAG_ID : FLAG_UNRESTRICTED;\r\n var value = this.consumeName();\r\n return { type: TokenType.HASH_TOKEN, value: value, flags: flags };\r\n }\r\n break;\r\n case DOLLAR_SIGN:\r\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\r\n this.consumeCodePoint();\r\n return SUFFIX_MATCH_TOKEN;\r\n }\r\n break;\r\n case APOSTROPHE:\r\n return this.consumeStringToken(APOSTROPHE);\r\n case LEFT_PARENTHESIS:\r\n return LEFT_PARENTHESIS_TOKEN;\r\n case RIGHT_PARENTHESIS:\r\n return RIGHT_PARENTHESIS_TOKEN;\r\n case ASTERISK:\r\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\r\n this.consumeCodePoint();\r\n return SUBSTRING_MATCH_TOKEN;\r\n }\r\n break;\r\n case PLUS_SIGN:\r\n if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {\r\n this.reconsumeCodePoint(codePoint);\r\n return this.consumeNumericToken();\r\n }\r\n break;\r\n case COMMA:\r\n return COMMA_TOKEN;\r\n case HYPHEN_MINUS:\r\n var e1 = codePoint;\r\n var e2 = this.peekCodePoint(0);\r\n var e3 = this.peekCodePoint(1);\r\n if (isNumberStart(e1, e2, e3)) {\r\n this.reconsumeCodePoint(codePoint);\r\n return this.consumeNumericToken();\r\n }\r\n if (isIdentifierStart(e1, e2, e3)) {\r\n this.reconsumeCodePoint(codePoint);\r\n return this.consumeIdentLikeToken();\r\n }\r\n if (e2 === HYPHEN_MINUS && e3 === GREATER_THAN_SIGN) {\r\n this.consumeCodePoint();\r\n this.consumeCodePoint();\r\n return CDC_TOKEN;\r\n }\r\n break;\r\n case FULL_STOP:\r\n if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {\r\n this.reconsumeCodePoint(codePoint);\r\n return this.consumeNumericToken();\r\n }\r\n break;\r\n case SOLIDUS:\r\n if (this.peekCodePoint(0) === ASTERISK) {\r\n this.consumeCodePoint();\r\n while (true) {\r\n var c = this.consumeCodePoint();\r\n if (c === ASTERISK) {\r\n c = this.consumeCodePoint();\r\n if (c === SOLIDUS) {\r\n return this.consumeToken();\r\n }\r\n }\r\n if (c === EOF) {\r\n return this.consumeToken();\r\n }\r\n }\r\n }\r\n break;\r\n case COLON:\r\n return COLON_TOKEN;\r\n case SEMICOLON:\r\n return SEMICOLON_TOKEN;\r\n case LESS_THAN_SIGN:\r\n if (this.peekCodePoint(0) === EXCLAMATION_MARK &&\r\n this.peekCodePoint(1) === HYPHEN_MINUS &&\r\n this.peekCodePoint(2) === HYPHEN_MINUS) {\r\n this.consumeCodePoint();\r\n this.consumeCodePoint();\r\n return CDO_TOKEN;\r\n }\r\n break;\r\n case COMMERCIAL_AT:\r\n var a1 = this.peekCodePoint(0);\r\n var a2 = this.peekCodePoint(1);\r\n var a3 = this.peekCodePoint(2);\r\n if (isIdentifierStart(a1, a2, a3)) {\r\n var value = this.consumeName();\r\n return { type: TokenType.AT_KEYWORD_TOKEN, value: value };\r\n }\r\n break;\r\n case LEFT_SQUARE_BRACKET:\r\n return LEFT_SQUARE_BRACKET_TOKEN;\r\n case REVERSE_SOLIDUS:\r\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\r\n this.reconsumeCodePoint(codePoint);\r\n return this.consumeIdentLikeToken();\r\n }\r\n break;\r\n case RIGHT_SQUARE_BRACKET:\r\n return RIGHT_SQUARE_BRACKET_TOKEN;\r\n case CIRCUMFLEX_ACCENT:\r\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\r\n this.consumeCodePoint();\r\n return PREFIX_MATCH_TOKEN;\r\n }\r\n break;\r\n case LEFT_CURLY_BRACKET:\r\n return LEFT_CURLY_BRACKET_TOKEN;\r\n case RIGHT_CURLY_BRACKET:\r\n return RIGHT_CURLY_BRACKET_TOKEN;\r\n case u:\r\n case U:\r\n var u1 = this.peekCodePoint(0);\r\n var u2 = this.peekCodePoint(1);\r\n if (u1 === PLUS_SIGN && (isHex(u2) || u2 === QUESTION_MARK)) {\r\n this.consumeCodePoint();\r\n this.consumeUnicodeRangeToken();\r\n }\r\n this.reconsumeCodePoint(codePoint);\r\n return this.consumeIdentLikeToken();\r\n case VERTICAL_LINE:\r\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\r\n this.consumeCodePoint();\r\n return DASH_MATCH_TOKEN;\r\n }\r\n if (this.peekCodePoint(0) === VERTICAL_LINE) {\r\n this.consumeCodePoint();\r\n return COLUMN_TOKEN;\r\n }\r\n break;\r\n case TILDE:\r\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\r\n this.consumeCodePoint();\r\n return INCLUDE_MATCH_TOKEN;\r\n }\r\n break;\r\n case EOF:\r\n return EOF_TOKEN;\r\n }\r\n if (isWhiteSpace(codePoint)) {\r\n this.consumeWhiteSpace();\r\n return WHITESPACE_TOKEN;\r\n }\r\n if (isDigit(codePoint)) {\r\n this.reconsumeCodePoint(codePoint);\r\n return this.consumeNumericToken();\r\n }\r\n if (isNameStartCodePoint(codePoint)) {\r\n this.reconsumeCodePoint(codePoint);\r\n return this.consumeIdentLikeToken();\r\n }\r\n return { type: TokenType.DELIM_TOKEN, value: fromCodePoint(codePoint) };\r\n };\r\n Tokenizer.prototype.consumeCodePoint = function () {\r\n var value = this._value.shift();\r\n return typeof value === 'undefined' ? -1 : value;\r\n };\r\n Tokenizer.prototype.reconsumeCodePoint = function (codePoint) {\r\n this._value.unshift(codePoint);\r\n };\r\n Tokenizer.prototype.peekCodePoint = function (delta) {\r\n if (delta >= this._value.length) {\r\n return -1;\r\n }\r\n return this._value[delta];\r\n };\r\n Tokenizer.prototype.consumeUnicodeRangeToken = function () {\r\n var digits = [];\r\n var codePoint = this.consumeCodePoint();\r\n while (isHex(codePoint) && digits.length < 6) {\r\n digits.push(codePoint);\r\n codePoint = this.consumeCodePoint();\r\n }\r\n var questionMarks = false;\r\n while (codePoint === QUESTION_MARK && digits.length < 6) {\r\n digits.push(codePoint);\r\n codePoint = this.consumeCodePoint();\r\n questionMarks = true;\r\n }\r\n if (questionMarks) {\r\n var start_1 = parseInt(fromCodePoint.apply(void 0, digits.map(function (digit) { return (digit === QUESTION_MARK ? ZERO : digit); })), 16);\r\n var end = parseInt(fromCodePoint.apply(void 0, digits.map(function (digit) { return (digit === QUESTION_MARK ? F : digit); })), 16);\r\n return { type: TokenType.UNICODE_RANGE_TOKEN, start: start_1, end: end };\r\n }\r\n var start = parseInt(fromCodePoint.apply(void 0, digits), 16);\r\n if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {\r\n this.consumeCodePoint();\r\n codePoint = this.consumeCodePoint();\r\n var endDigits = [];\r\n while (isHex(codePoint) && endDigits.length < 6) {\r\n endDigits.push(codePoint);\r\n codePoint = this.consumeCodePoint();\r\n }\r\n var end = parseInt(fromCodePoint.apply(void 0, endDigits), 16);\r\n return { type: TokenType.UNICODE_RANGE_TOKEN, start: start, end: end };\r\n }\r\n else {\r\n return { type: TokenType.UNICODE_RANGE_TOKEN, start: start, end: start };\r\n }\r\n };\r\n Tokenizer.prototype.consumeIdentLikeToken = function () {\r\n var value = this.consumeName();\r\n if (value.toLowerCase() === 'url' && this.peekCodePoint(0) === LEFT_PARENTHESIS) {\r\n this.consumeCodePoint();\r\n return this.consumeUrlToken();\r\n }\r\n else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) {\r\n this.consumeCodePoint();\r\n return { type: TokenType.FUNCTION_TOKEN, value: value };\r\n }\r\n return { type: TokenType.IDENT_TOKEN, value: value };\r\n };\r\n Tokenizer.prototype.consumeUrlToken = function () {\r\n var value = [];\r\n this.consumeWhiteSpace();\r\n if (this.peekCodePoint(0) === EOF) {\r\n return { type: TokenType.URL_TOKEN, value: '' };\r\n }\r\n var next = this.peekCodePoint(0);\r\n if (next === APOSTROPHE || next === QUOTATION_MARK) {\r\n var stringToken = this.consumeStringToken(this.consumeCodePoint());\r\n if (stringToken.type === TokenType.STRING_TOKEN) {\r\n this.consumeWhiteSpace();\r\n if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {\r\n this.consumeCodePoint();\r\n return { type: TokenType.URL_TOKEN, value: stringToken.value };\r\n }\r\n }\r\n this.consumeBadUrlRemnants();\r\n return BAD_URL_TOKEN;\r\n }\r\n while (true) {\r\n var codePoint = this.consumeCodePoint();\r\n if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {\r\n return { type: TokenType.URL_TOKEN, value: fromCodePoint.apply(void 0, value) };\r\n }\r\n else if (isWhiteSpace(codePoint)) {\r\n this.consumeWhiteSpace();\r\n if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {\r\n this.consumeCodePoint();\r\n return { type: TokenType.URL_TOKEN, value: fromCodePoint.apply(void 0, value) };\r\n }\r\n this.consumeBadUrlRemnants();\r\n return BAD_URL_TOKEN;\r\n }\r\n else if (codePoint === QUOTATION_MARK ||\r\n codePoint === APOSTROPHE ||\r\n codePoint === LEFT_PARENTHESIS ||\r\n isNonPrintableCodePoint(codePoint)) {\r\n this.consumeBadUrlRemnants();\r\n return BAD_URL_TOKEN;\r\n }\r\n else if (codePoint === REVERSE_SOLIDUS) {\r\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\r\n value.push(this.consumeEscapedCodePoint());\r\n }\r\n else {\r\n this.consumeBadUrlRemnants();\r\n return BAD_URL_TOKEN;\r\n }\r\n }\r\n else {\r\n value.push(codePoint);\r\n }\r\n }\r\n };\r\n Tokenizer.prototype.consumeWhiteSpace = function () {\r\n while (isWhiteSpace(this.peekCodePoint(0))) {\r\n this.consumeCodePoint();\r\n }\r\n };\r\n Tokenizer.prototype.consumeBadUrlRemnants = function () {\r\n while (true) {\r\n var codePoint = this.consumeCodePoint();\r\n if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) {\r\n return;\r\n }\r\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\r\n this.consumeEscapedCodePoint();\r\n }\r\n }\r\n };\r\n Tokenizer.prototype.consumeStringSlice = function (count) {\r\n var SLICE_STACK_SIZE = 60000;\r\n var value = '';\r\n while (count > 0) {\r\n var amount = Math.min(SLICE_STACK_SIZE, count);\r\n value += fromCodePoint.apply(void 0, this._value.splice(0, amount));\r\n count -= amount;\r\n }\r\n this._value.shift();\r\n return value;\r\n };\r\n Tokenizer.prototype.consumeStringToken = function (endingCodePoint) {\r\n var value = '';\r\n var i = 0;\r\n do {\r\n var codePoint = this._value[i];\r\n if (codePoint === EOF || codePoint === undefined || codePoint === endingCodePoint) {\r\n value += this.consumeStringSlice(i);\r\n return { type: TokenType.STRING_TOKEN, value: value };\r\n }\r\n if (codePoint === LINE_FEED) {\r\n this._value.splice(0, i);\r\n return BAD_STRING_TOKEN;\r\n }\r\n if (codePoint === REVERSE_SOLIDUS) {\r\n var next = this._value[i + 1];\r\n if (next !== EOF && next !== undefined) {\r\n if (next === LINE_FEED) {\r\n value += this.consumeStringSlice(i);\r\n i = -1;\r\n this._value.shift();\r\n }\r\n else if (isValidEscape(codePoint, next)) {\r\n value += this.consumeStringSlice(i);\r\n value += fromCodePoint(this.consumeEscapedCodePoint());\r\n i = -1;\r\n }\r\n }\r\n }\r\n i++;\r\n } while (true);\r\n };\r\n Tokenizer.prototype.consumeNumber = function () {\r\n var repr = [];\r\n var type = FLAG_INTEGER;\r\n var c1 = this.peekCodePoint(0);\r\n if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {\r\n repr.push(this.consumeCodePoint());\r\n }\r\n while (isDigit(this.peekCodePoint(0))) {\r\n repr.push(this.consumeCodePoint());\r\n }\r\n c1 = this.peekCodePoint(0);\r\n var c2 = this.peekCodePoint(1);\r\n if (c1 === FULL_STOP && isDigit(c2)) {\r\n repr.push(this.consumeCodePoint(), this.consumeCodePoint());\r\n type = FLAG_NUMBER;\r\n while (isDigit(this.peekCodePoint(0))) {\r\n repr.push(this.consumeCodePoint());\r\n }\r\n }\r\n c1 = this.peekCodePoint(0);\r\n c2 = this.peekCodePoint(1);\r\n var c3 = this.peekCodePoint(2);\r\n if ((c1 === E || c1 === e) && (((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3)) || isDigit(c2))) {\r\n repr.push(this.consumeCodePoint(), this.consumeCodePoint());\r\n type = FLAG_NUMBER;\r\n while (isDigit(this.peekCodePoint(0))) {\r\n repr.push(this.consumeCodePoint());\r\n }\r\n }\r\n return [stringToNumber(repr), type];\r\n };\r\n Tokenizer.prototype.consumeNumericToken = function () {\r\n var _a = this.consumeNumber(), number = _a[0], flags = _a[1];\r\n var c1 = this.peekCodePoint(0);\r\n var c2 = this.peekCodePoint(1);\r\n var c3 = this.peekCodePoint(2);\r\n if (isIdentifierStart(c1, c2, c3)) {\r\n var unit = this.consumeName();\r\n return { type: TokenType.DIMENSION_TOKEN, number: number, flags: flags, unit: unit };\r\n }\r\n if (c1 === PERCENTAGE_SIGN) {\r\n this.consumeCodePoint();\r\n return { type: TokenType.PERCENTAGE_TOKEN, number: number, flags: flags };\r\n }\r\n return { type: TokenType.NUMBER_TOKEN, number: number, flags: flags };\r\n };\r\n Tokenizer.prototype.consumeEscapedCodePoint = function () {\r\n var codePoint = this.consumeCodePoint();\r\n if (isHex(codePoint)) {\r\n var hex = fromCodePoint(codePoint);\r\n while (isHex(this.peekCodePoint(0)) && hex.length < 6) {\r\n hex += fromCodePoint(this.consumeCodePoint());\r\n }\r\n if (isWhiteSpace(this.peekCodePoint(0))) {\r\n this.consumeCodePoint();\r\n }\r\n var hexCodePoint = parseInt(hex, 16);\r\n if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 0x10ffff) {\r\n return REPLACEMENT_CHARACTER;\r\n }\r\n return hexCodePoint;\r\n }\r\n if (codePoint === EOF) {\r\n return REPLACEMENT_CHARACTER;\r\n }\r\n return codePoint;\r\n };\r\n Tokenizer.prototype.consumeName = function () {\r\n var result = '';\r\n while (true) {\r\n var codePoint = this.consumeCodePoint();\r\n if (isNameCodePoint(codePoint)) {\r\n result += fromCodePoint(codePoint);\r\n }\r\n else if (isValidEscape(codePoint, this.peekCodePoint(0))) {\r\n result += fromCodePoint(this.consumeEscapedCodePoint());\r\n }\r\n else {\r\n this.reconsumeCodePoint(codePoint);\r\n return result;\r\n }\r\n }\r\n };\r\n return Tokenizer;\r\n }());\n\n var Parser = /** @class */ (function () {\r\n function Parser(tokens) {\r\n this._tokens = tokens;\r\n }\r\n Parser.create = function (value) {\r\n var tokenizer = new Tokenizer();\r\n tokenizer.write(value);\r\n return new Parser(tokenizer.read());\r\n };\r\n Parser.parseValue = function (value) {\r\n return Parser.create(value).parseComponentValue();\r\n };\r\n Parser.parseValues = function (value) {\r\n return Parser.create(value).parseComponentValues();\r\n };\r\n Parser.prototype.parseComponentValue = function () {\r\n var token = this.consumeToken();\r\n while (token.type === TokenType.WHITESPACE_TOKEN) {\r\n token = this.consumeToken();\r\n }\r\n if (token.type === TokenType.EOF_TOKEN) {\r\n throw new SyntaxError(\"Error parsing CSS component value, unexpected EOF\");\r\n }\r\n this.reconsumeToken(token);\r\n var value = this.consumeComponentValue();\r\n do {\r\n token = this.consumeToken();\r\n } while (token.type === TokenType.WHITESPACE_TOKEN);\r\n if (token.type === TokenType.EOF_TOKEN) {\r\n return value;\r\n }\r\n throw new SyntaxError(\"Error parsing CSS component value, multiple values found when expecting only one\");\r\n };\r\n Parser.prototype.parseComponentValues = function () {\r\n var values = [];\r\n while (true) {\r\n var value = this.consumeComponentValue();\r\n if (value.type === TokenType.EOF_TOKEN) {\r\n return values;\r\n }\r\n values.push(value);\r\n values.push();\r\n }\r\n };\r\n Parser.prototype.consumeComponentValue = function () {\r\n var token = this.consumeToken();\r\n switch (token.type) {\r\n case TokenType.LEFT_CURLY_BRACKET_TOKEN:\r\n case TokenType.LEFT_SQUARE_BRACKET_TOKEN:\r\n case TokenType.LEFT_PARENTHESIS_TOKEN:\r\n return this.consumeSimpleBlock(token.type);\r\n case TokenType.FUNCTION_TOKEN:\r\n return this.consumeFunction(token);\r\n }\r\n return token;\r\n };\r\n Parser.prototype.consumeSimpleBlock = function (type) {\r\n var block = { type: type, values: [] };\r\n var token = this.consumeToken();\r\n while (true) {\r\n if (token.type === TokenType.EOF_TOKEN || isEndingTokenFor(token, type)) {\r\n return block;\r\n }\r\n this.reconsumeToken(token);\r\n block.values.push(this.consumeComponentValue());\r\n token = this.consumeToken();\r\n }\r\n };\r\n Parser.prototype.consumeFunction = function (functionToken) {\r\n var cssFunction = {\r\n name: functionToken.value,\r\n values: [],\r\n type: TokenType.FUNCTION\r\n };\r\n while (true) {\r\n var token = this.consumeToken();\r\n if (token.type === TokenType.EOF_TOKEN || token.type === TokenType.RIGHT_PARENTHESIS_TOKEN) {\r\n return cssFunction;\r\n }\r\n this.reconsumeToken(token);\r\n cssFunction.values.push(this.consumeComponentValue());\r\n }\r\n };\r\n Parser.prototype.consumeToken = function () {\r\n var token = this._tokens.shift();\r\n return typeof token === 'undefined' ? EOF_TOKEN : token;\r\n };\r\n Parser.prototype.reconsumeToken = function (token) {\r\n this._tokens.unshift(token);\r\n };\r\n return Parser;\r\n }());\r\n var isDimensionToken = function (token) { return token.type === TokenType.DIMENSION_TOKEN; };\r\n var isNumberToken = function (token) { return token.type === TokenType.NUMBER_TOKEN; };\r\n var isIdentToken = function (token) { return token.type === TokenType.IDENT_TOKEN; };\r\n var isStringToken = function (token) { return token.type === TokenType.STRING_TOKEN; };\r\n var isIdentWithValue = function (token, value) {\r\n return isIdentToken(token) && token.value === value;\r\n };\r\n var nonWhiteSpace = function (token) { return token.type !== TokenType.WHITESPACE_TOKEN; };\r\n var nonFunctionArgSeparator = function (token) {\r\n return token.type !== TokenType.WHITESPACE_TOKEN && token.type !== TokenType.COMMA_TOKEN;\r\n };\r\n var parseFunctionArgs = function (tokens) {\r\n var args = [];\r\n var arg = [];\r\n tokens.forEach(function (token) {\r\n if (token.type === TokenType.COMMA_TOKEN) {\r\n if (arg.length === 0) {\r\n throw new Error(\"Error parsing function args, zero tokens for arg\");\r\n }\r\n args.push(arg);\r\n arg = [];\r\n return;\r\n }\r\n if (token.type !== TokenType.WHITESPACE_TOKEN) {\r\n arg.push(token);\r\n }\r\n });\r\n if (arg.length) {\r\n args.push(arg);\r\n }\r\n return args;\r\n };\r\n var isEndingTokenFor = function (token, type) {\r\n if (type === TokenType.LEFT_CURLY_BRACKET_TOKEN && token.type === TokenType.RIGHT_CURLY_BRACKET_TOKEN) {\r\n return true;\r\n }\r\n if (type === TokenType.LEFT_SQUARE_BRACKET_TOKEN && token.type === TokenType.RIGHT_SQUARE_BRACKET_TOKEN) {\r\n return true;\r\n }\r\n return type === TokenType.LEFT_PARENTHESIS_TOKEN && token.type === TokenType.RIGHT_PARENTHESIS_TOKEN;\r\n };\n\n var isLength = function (token) {\r\n return token.type === TokenType.NUMBER_TOKEN || token.type === TokenType.DIMENSION_TOKEN;\r\n };\n\n var isLengthPercentage = function (token) {\r\n return token.type === TokenType.PERCENTAGE_TOKEN || isLength(token);\r\n };\r\n var parseLengthPercentageTuple = function (tokens) {\r\n return tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];\r\n };\r\n var ZERO_LENGTH = {\r\n type: TokenType.NUMBER_TOKEN,\r\n number: 0,\r\n flags: FLAG_INTEGER\r\n };\r\n var FIFTY_PERCENT = {\r\n type: TokenType.PERCENTAGE_TOKEN,\r\n number: 50,\r\n flags: FLAG_INTEGER\r\n };\r\n var HUNDRED_PERCENT = {\r\n type: TokenType.PERCENTAGE_TOKEN,\r\n number: 100,\r\n flags: FLAG_INTEGER\r\n };\r\n var getAbsoluteValueForTuple = function (tuple, width, height) {\r\n var x = tuple[0], y = tuple[1];\r\n return [getAbsoluteValue(x, width), getAbsoluteValue(typeof y !== 'undefined' ? y : x, height)];\r\n };\r\n var getAbsoluteValue = function (token, parent) {\r\n if (token.type === TokenType.PERCENTAGE_TOKEN) {\r\n return (token.number / 100) * parent;\r\n }\r\n if (isDimensionToken(token)) {\r\n switch (token.unit) {\r\n case 'rem':\r\n case 'em':\r\n return 16 * token.number; // TODO use correct font-size\r\n case 'px':\r\n default:\r\n return token.number;\r\n }\r\n }\r\n return token.number;\r\n };\n\n var DEG = 'deg';\r\n var GRAD = 'grad';\r\n var RAD = 'rad';\r\n var TURN = 'turn';\r\n var angle = {\r\n name: 'angle',\r\n parse: function (value) {\r\n if (value.type === TokenType.DIMENSION_TOKEN) {\r\n switch (value.unit) {\r\n case DEG:\r\n return (Math.PI * value.number) / 180;\r\n case GRAD:\r\n return (Math.PI / 200) * value.number;\r\n case RAD:\r\n return value.number;\r\n case TURN:\r\n return Math.PI * 2 * value.number;\r\n }\r\n }\r\n throw new Error(\"Unsupported angle type\");\r\n }\r\n };\r\n var isAngle = function (value) {\r\n if (value.type === TokenType.DIMENSION_TOKEN) {\r\n if (value.unit === DEG || value.unit === GRAD || value.unit === RAD || value.unit === TURN) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n var parseNamedSide = function (tokens) {\r\n var sideOrCorner = tokens\r\n .filter(isIdentToken)\r\n .map(function (ident) { return ident.value; })\r\n .join(' ');\r\n switch (sideOrCorner) {\r\n case 'to bottom right':\r\n case 'to right bottom':\r\n case 'left top':\r\n case 'top left':\r\n return [ZERO_LENGTH, ZERO_LENGTH];\r\n case 'to top':\r\n case 'bottom':\r\n return deg(0);\r\n case 'to bottom left':\r\n case 'to left bottom':\r\n case 'right top':\r\n case 'top right':\r\n return [ZERO_LENGTH, HUNDRED_PERCENT];\r\n case 'to right':\r\n case 'left':\r\n return deg(90);\r\n case 'to top left':\r\n case 'to left top':\r\n case 'right bottom':\r\n case 'bottom right':\r\n return [HUNDRED_PERCENT, HUNDRED_PERCENT];\r\n case 'to bottom':\r\n case 'top':\r\n return deg(180);\r\n case 'to top right':\r\n case 'to right top':\r\n case 'left bottom':\r\n case 'bottom left':\r\n return [HUNDRED_PERCENT, ZERO_LENGTH];\r\n case 'to left':\r\n case 'right':\r\n return deg(270);\r\n }\r\n return 0;\r\n };\r\n var deg = function (deg) { return (Math.PI * deg) / 180; };\n\n var color = {\r\n name: 'color',\r\n parse: function (value) {\r\n if (value.type === TokenType.FUNCTION) {\r\n var colorFunction = SUPPORTED_COLOR_FUNCTIONS[value.name];\r\n if (typeof colorFunction === 'undefined') {\r\n throw new Error(\"Attempting to parse an unsupported color function \\\"\" + value.name + \"\\\"\");\r\n }\r\n return colorFunction(value.values);\r\n }\r\n if (value.type === TokenType.HASH_TOKEN) {\r\n if (value.value.length === 3) {\r\n var r = value.value.substring(0, 1);\r\n var g = value.value.substring(1, 2);\r\n var b = value.value.substring(2, 3);\r\n return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), 1);\r\n }\r\n if (value.value.length === 4) {\r\n var r = value.value.substring(0, 1);\r\n var g = value.value.substring(1, 2);\r\n var b = value.value.substring(2, 3);\r\n var a = value.value.substring(3, 4);\r\n return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), parseInt(a + a, 16) / 255);\r\n }\r\n if (value.value.length === 6) {\r\n var r = value.value.substring(0, 2);\r\n var g = value.value.substring(2, 4);\r\n var b = value.value.substring(4, 6);\r\n return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), 1);\r\n }\r\n if (value.value.length === 8) {\r\n var r = value.value.substring(0, 2);\r\n var g = value.value.substring(2, 4);\r\n var b = value.value.substring(4, 6);\r\n var a = value.value.substring(6, 8);\r\n return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), parseInt(a, 16) / 255);\r\n }\r\n }\r\n if (value.type === TokenType.IDENT_TOKEN) {\r\n var namedColor = COLORS[value.value.toUpperCase()];\r\n if (typeof namedColor !== 'undefined') {\r\n return namedColor;\r\n }\r\n }\r\n return COLORS.TRANSPARENT;\r\n }\r\n };\r\n var isTransparent = function (color) { return (0xff & color) === 0; };\r\n var asString = function (color) {\r\n var alpha = 0xff & color;\r\n var blue = 0xff & (color >> 8);\r\n var green = 0xff & (color >> 16);\r\n var red = 0xff & (color >> 24);\r\n return alpha < 255 ? \"rgba(\" + red + \",\" + green + \",\" + blue + \",\" + alpha / 255 + \")\" : \"rgb(\" + red + \",\" + green + \",\" + blue + \")\";\r\n };\r\n var pack = function (r, g, b, a) {\r\n return ((r << 24) | (g << 16) | (b << 8) | (Math.round(a * 255) << 0)) >>> 0;\r\n };\r\n var getTokenColorValue = function (token, i) {\r\n if (token.type === TokenType.NUMBER_TOKEN) {\r\n return token.number;\r\n }\r\n if (token.type === TokenType.PERCENTAGE_TOKEN) {\r\n var max = i === 3 ? 1 : 255;\r\n return i === 3 ? (token.number / 100) * max : Math.round((token.number / 100) * max);\r\n }\r\n return 0;\r\n };\r\n var rgb = function (args) {\r\n var tokens = args.filter(nonFunctionArgSeparator);\r\n if (tokens.length === 3) {\r\n var _a = tokens.map(getTokenColorValue), r = _a[0], g = _a[1], b = _a[2];\r\n return pack(r, g, b, 1);\r\n }\r\n if (tokens.length === 4) {\r\n var _b = tokens.map(getTokenColorValue), r = _b[0], g = _b[1], b = _b[2], a = _b[3];\r\n return pack(r, g, b, a);\r\n }\r\n return 0;\r\n };\r\n function hue2rgb(t1, t2, hue) {\r\n if (hue < 0) {\r\n hue += 1;\r\n }\r\n if (hue >= 1) {\r\n hue -= 1;\r\n }\r\n if (hue < 1 / 6) {\r\n return (t2 - t1) * hue * 6 + t1;\r\n }\r\n else if (hue < 1 / 2) {\r\n return t2;\r\n }\r\n else if (hue < 2 / 3) {\r\n return (t2 - t1) * 6 * (2 / 3 - hue) + t1;\r\n }\r\n else {\r\n return t1;\r\n }\r\n }\r\n var hsl = function (args) {\r\n var tokens = args.filter(nonFunctionArgSeparator);\r\n var hue = tokens[0], saturation = tokens[1], lightness = tokens[2], alpha = tokens[3];\r\n var h = (hue.type === TokenType.NUMBER_TOKEN ? deg(hue.number) : angle.parse(hue)) / (Math.PI * 2);\r\n var s = isLengthPercentage(saturation) ? saturation.number / 100 : 0;\r\n var l = isLengthPercentage(lightness) ? lightness.number / 100 : 0;\r\n var a = typeof alpha !== 'undefined' && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1;\r\n if (s === 0) {\r\n return pack(l * 255, l * 255, l * 255, 1);\r\n }\r\n var t2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\r\n var t1 = l * 2 - t2;\r\n var r = hue2rgb(t1, t2, h + 1 / 3);\r\n var g = hue2rgb(t1, t2, h);\r\n var b = hue2rgb(t1, t2, h - 1 / 3);\r\n return pack(r * 255, g * 255, b * 255, a);\r\n };\r\n var SUPPORTED_COLOR_FUNCTIONS = {\r\n hsl: hsl,\r\n hsla: hsl,\r\n rgb: rgb,\r\n rgba: rgb\r\n };\r\n var COLORS = {\r\n ALICEBLUE: 0xf0f8ffff,\r\n ANTIQUEWHITE: 0xfaebd7ff,\r\n AQUA: 0x00ffffff,\r\n AQUAMARINE: 0x7fffd4ff,\r\n AZURE: 0xf0ffffff,\r\n BEIGE: 0xf5f5dcff,\r\n BISQUE: 0xffe4c4ff,\r\n BLACK: 0x000000ff,\r\n BLANCHEDALMOND: 0xffebcdff,\r\n BLUE: 0x0000ffff,\r\n BLUEVIOLET: 0x8a2be2ff,\r\n BROWN: 0xa52a2aff,\r\n BURLYWOOD: 0xdeb887ff,\r\n CADETBLUE: 0x5f9ea0ff,\r\n CHARTREUSE: 0x7fff00ff,\r\n CHOCOLATE: 0xd2691eff,\r\n CORAL: 0xff7f50ff,\r\n CORNFLOWERBLUE: 0x6495edff,\r\n CORNSILK: 0xfff8dcff,\r\n CRIMSON: 0xdc143cff,\r\n CYAN: 0x00ffffff,\r\n DARKBLUE: 0x00008bff,\r\n DARKCYAN: 0x008b8bff,\r\n DARKGOLDENROD: 0xb886bbff,\r\n DARKGRAY: 0xa9a9a9ff,\r\n DARKGREEN: 0x006400ff,\r\n DARKGREY: 0xa9a9a9ff,\r\n DARKKHAKI: 0xbdb76bff,\r\n DARKMAGENTA: 0x8b008bff,\r\n DARKOLIVEGREEN: 0x556b2fff,\r\n DARKORANGE: 0xff8c00ff,\r\n DARKORCHID: 0x9932ccff,\r\n DARKRED: 0x8b0000ff,\r\n DARKSALMON: 0xe9967aff,\r\n DARKSEAGREEN: 0x8fbc8fff,\r\n DARKSLATEBLUE: 0x483d8bff,\r\n DARKSLATEGRAY: 0x2f4f4fff,\r\n DARKSLATEGREY: 0x2f4f4fff,\r\n DARKTURQUOISE: 0x00ced1ff,\r\n DARKVIOLET: 0x9400d3ff,\r\n DEEPPINK: 0xff1493ff,\r\n DEEPSKYBLUE: 0x00bfffff,\r\n DIMGRAY: 0x696969ff,\r\n DIMGREY: 0x696969ff,\r\n DODGERBLUE: 0x1e90ffff,\r\n FIREBRICK: 0xb22222ff,\r\n FLORALWHITE: 0xfffaf0ff,\r\n FORESTGREEN: 0x228b22ff,\r\n FUCHSIA: 0xff00ffff,\r\n GAINSBORO: 0xdcdcdcff,\r\n GHOSTWHITE: 0xf8f8ffff,\r\n GOLD: 0xffd700ff,\r\n GOLDENROD: 0xdaa520ff,\r\n GRAY: 0x808080ff,\r\n GREEN: 0x008000ff,\r\n GREENYELLOW: 0xadff2fff,\r\n GREY: 0x808080ff,\r\n HONEYDEW: 0xf0fff0ff,\r\n HOTPINK: 0xff69b4ff,\r\n INDIANRED: 0xcd5c5cff,\r\n INDIGO: 0x4b0082ff,\r\n IVORY: 0xfffff0ff,\r\n KHAKI: 0xf0e68cff,\r\n LAVENDER: 0xe6e6faff,\r\n LAVENDERBLUSH: 0xfff0f5ff,\r\n LAWNGREEN: 0x7cfc00ff,\r\n LEMONCHIFFON: 0xfffacdff,\r\n LIGHTBLUE: 0xadd8e6ff,\r\n LIGHTCORAL: 0xf08080ff,\r\n LIGHTCYAN: 0xe0ffffff,\r\n LIGHTGOLDENRODYELLOW: 0xfafad2ff,\r\n LIGHTGRAY: 0xd3d3d3ff,\r\n LIGHTGREEN: 0x90ee90ff,\r\n LIGHTGREY: 0xd3d3d3ff,\r\n LIGHTPINK: 0xffb6c1ff,\r\n LIGHTSALMON: 0xffa07aff,\r\n LIGHTSEAGREEN: 0x20b2aaff,\r\n LIGHTSKYBLUE: 0x87cefaff,\r\n LIGHTSLATEGRAY: 0x778899ff,\r\n LIGHTSLATEGREY: 0x778899ff,\r\n LIGHTSTEELBLUE: 0xb0c4deff,\r\n LIGHTYELLOW: 0xffffe0ff,\r\n LIME: 0x00ff00ff,\r\n LIMEGREEN: 0x32cd32ff,\r\n LINEN: 0xfaf0e6ff,\r\n MAGENTA: 0xff00ffff,\r\n MAROON: 0x800000ff,\r\n MEDIUMAQUAMARINE: 0x66cdaaff,\r\n MEDIUMBLUE: 0x0000cdff,\r\n MEDIUMORCHID: 0xba55d3ff,\r\n MEDIUMPURPLE: 0x9370dbff,\r\n MEDIUMSEAGREEN: 0x3cb371ff,\r\n MEDIUMSLATEBLUE: 0x7b68eeff,\r\n MEDIUMSPRINGGREEN: 0x00fa9aff,\r\n MEDIUMTURQUOISE: 0x48d1ccff,\r\n MEDIUMVIOLETRED: 0xc71585ff,\r\n MIDNIGHTBLUE: 0x191970ff,\r\n MINTCREAM: 0xf5fffaff,\r\n MISTYROSE: 0xffe4e1ff,\r\n MOCCASIN: 0xffe4b5ff,\r\n NAVAJOWHITE: 0xffdeadff,\r\n NAVY: 0x000080ff,\r\n OLDLACE: 0xfdf5e6ff,\r\n OLIVE: 0x808000ff,\r\n OLIVEDRAB: 0x6b8e23ff,\r\n ORANGE: 0xffa500ff,\r\n ORANGERED: 0xff4500ff,\r\n ORCHID: 0xda70d6ff,\r\n PALEGOLDENROD: 0xeee8aaff,\r\n PALEGREEN: 0x98fb98ff,\r\n PALETURQUOISE: 0xafeeeeff,\r\n PALEVIOLETRED: 0xdb7093ff,\r\n PAPAYAWHIP: 0xffefd5ff,\r\n PEACHPUFF: 0xffdab9ff,\r\n PERU: 0xcd853fff,\r\n PINK: 0xffc0cbff,\r\n PLUM: 0xdda0ddff,\r\n POWDERBLUE: 0xb0e0e6ff,\r\n PURPLE: 0x800080ff,\r\n REBECCAPURPLE: 0x663399ff,\r\n RED: 0xff0000ff,\r\n ROSYBROWN: 0xbc8f8fff,\r\n ROYALBLUE: 0x4169e1ff,\r\n SADDLEBROWN: 0x8b4513ff,\r\n SALMON: 0xfa8072ff,\r\n SANDYBROWN: 0xf4a460ff,\r\n SEAGREEN: 0x2e8b57ff,\r\n SEASHELL: 0xfff5eeff,\r\n SIENNA: 0xa0522dff,\r\n SILVER: 0xc0c0c0ff,\r\n SKYBLUE: 0x87ceebff,\r\n SLATEBLUE: 0x6a5acdff,\r\n SLATEGRAY: 0x708090ff,\r\n SLATEGREY: 0x708090ff,\r\n SNOW: 0xfffafaff,\r\n SPRINGGREEN: 0x00ff7fff,\r\n STEELBLUE: 0x4682b4ff,\r\n TAN: 0xd2b48cff,\r\n TEAL: 0x008080ff,\r\n THISTLE: 0xd8bfd8ff,\r\n TOMATO: 0xff6347ff,\r\n TRANSPARENT: 0x00000000,\r\n TURQUOISE: 0x40e0d0ff,\r\n VIOLET: 0xee82eeff,\r\n WHEAT: 0xf5deb3ff,\r\n WHITE: 0xffffffff,\r\n WHITESMOKE: 0xf5f5f5ff,\r\n YELLOW: 0xffff00ff,\r\n YELLOWGREEN: 0x9acd32ff\r\n };\n\n var PropertyDescriptorParsingType;\r\n (function (PropertyDescriptorParsingType) {\r\n PropertyDescriptorParsingType[PropertyDescriptorParsingType[\"VALUE\"] = 0] = \"VALUE\";\r\n PropertyDescriptorParsingType[PropertyDescriptorParsingType[\"LIST\"] = 1] = \"LIST\";\r\n PropertyDescriptorParsingType[PropertyDescriptorParsingType[\"IDENT_VALUE\"] = 2] = \"IDENT_VALUE\";\r\n PropertyDescriptorParsingType[PropertyDescriptorParsingType[\"TYPE_VALUE\"] = 3] = \"TYPE_VALUE\";\r\n PropertyDescriptorParsingType[PropertyDescriptorParsingType[\"TOKEN_VALUE\"] = 4] = \"TOKEN_VALUE\";\r\n })(PropertyDescriptorParsingType || (PropertyDescriptorParsingType = {}));\n\n var BACKGROUND_CLIP;\r\n (function (BACKGROUND_CLIP) {\r\n BACKGROUND_CLIP[BACKGROUND_CLIP[\"BORDER_BOX\"] = 0] = \"BORDER_BOX\";\r\n BACKGROUND_CLIP[BACKGROUND_CLIP[\"PADDING_BOX\"] = 1] = \"PADDING_BOX\";\r\n BACKGROUND_CLIP[BACKGROUND_CLIP[\"CONTENT_BOX\"] = 2] = \"CONTENT_BOX\";\r\n })(BACKGROUND_CLIP || (BACKGROUND_CLIP = {}));\r\n var backgroundClip = {\r\n name: 'background-clip',\r\n initialValue: 'border-box',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n return tokens.map(function (token) {\r\n if (isIdentToken(token)) {\r\n switch (token.value) {\r\n case 'padding-box':\r\n return BACKGROUND_CLIP.PADDING_BOX;\r\n case 'content-box':\r\n return BACKGROUND_CLIP.CONTENT_BOX;\r\n }\r\n }\r\n return BACKGROUND_CLIP.BORDER_BOX;\r\n });\r\n }\r\n };\n\n var backgroundColor = {\r\n name: \"background-color\",\r\n initialValue: 'transparent',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.TYPE_VALUE,\r\n format: 'color'\r\n };\n\n var parseColorStop = function (args) {\r\n var color$1 = color.parse(args[0]);\r\n var stop = args[1];\r\n return stop && isLengthPercentage(stop) ? { color: color$1, stop: stop } : { color: color$1, stop: null };\r\n };\r\n var processColorStops = function (stops, lineLength) {\r\n var first = stops[0];\r\n var last = stops[stops.length - 1];\r\n if (first.stop === null) {\r\n first.stop = ZERO_LENGTH;\r\n }\r\n if (last.stop === null) {\r\n last.stop = HUNDRED_PERCENT;\r\n }\r\n var processStops = [];\r\n var previous = 0;\r\n for (var i = 0; i < stops.length; i++) {\r\n var stop_1 = stops[i].stop;\r\n if (stop_1 !== null) {\r\n var absoluteValue = getAbsoluteValue(stop_1, lineLength);\r\n if (absoluteValue > previous) {\r\n processStops.push(absoluteValue);\r\n }\r\n else {\r\n processStops.push(previous);\r\n }\r\n previous = absoluteValue;\r\n }\r\n else {\r\n processStops.push(null);\r\n }\r\n }\r\n var gapBegin = null;\r\n for (var i = 0; i < processStops.length; i++) {\r\n var stop_2 = processStops[i];\r\n if (stop_2 === null) {\r\n if (gapBegin === null) {\r\n gapBegin = i;\r\n }\r\n }\r\n else if (gapBegin !== null) {\r\n var gapLength = i - gapBegin;\r\n var beforeGap = processStops[gapBegin - 1];\r\n var gapValue = (stop_2 - beforeGap) / (gapLength + 1);\r\n for (var g = 1; g <= gapLength; g++) {\r\n processStops[gapBegin + g - 1] = gapValue * g;\r\n }\r\n gapBegin = null;\r\n }\r\n }\r\n return stops.map(function (_a, i) {\r\n var color = _a.color;\r\n return { color: color, stop: Math.max(Math.min(1, processStops[i] / lineLength), 0) };\r\n });\r\n };\r\n var getAngleFromCorner = function (corner, width, height) {\r\n var centerX = width / 2;\r\n var centerY = height / 2;\r\n var x = getAbsoluteValue(corner[0], width) - centerX;\r\n var y = centerY - getAbsoluteValue(corner[1], height);\r\n return (Math.atan2(y, x) + Math.PI * 2) % (Math.PI * 2);\r\n };\r\n var calculateGradientDirection = function (angle, width, height) {\r\n var radian = typeof angle === 'number' ? angle : getAngleFromCorner(angle, width, height);\r\n var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));\r\n var halfWidth = width / 2;\r\n var halfHeight = height / 2;\r\n var halfLineLength = lineLength / 2;\r\n var yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength;\r\n var xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength;\r\n return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff];\r\n };\r\n var distance = function (a, b) { return Math.sqrt(a * a + b * b); };\r\n var findCorner = function (width, height, x, y, closest) {\r\n var corners = [[0, 0], [0, height], [width, 0], [width, height]];\r\n return corners.reduce(function (stat, corner) {\r\n var cx = corner[0], cy = corner[1];\r\n var d = distance(x - cx, y - cy);\r\n if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {\r\n return {\r\n optimumCorner: corner,\r\n optimumDistance: d\r\n };\r\n }\r\n return stat;\r\n }, {\r\n optimumDistance: closest ? Infinity : -Infinity,\r\n optimumCorner: null\r\n }).optimumCorner;\r\n };\r\n var calculateRadius = function (gradient, x, y, width, height) {\r\n var rx = 0;\r\n var ry = 0;\r\n switch (gradient.size) {\r\n case CSSRadialExtent.CLOSEST_SIDE:\r\n // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.\r\n // If the shape is an ellipse, it exactly meets the closest side in each dimension.\r\n if (gradient.shape === CSSRadialShape.CIRCLE) {\r\n rx = ry = Math.min(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));\r\n }\r\n else if (gradient.shape === CSSRadialShape.ELLIPSE) {\r\n rx = Math.min(Math.abs(x), Math.abs(x - width));\r\n ry = Math.min(Math.abs(y), Math.abs(y - height));\r\n }\r\n break;\r\n case CSSRadialExtent.CLOSEST_CORNER:\r\n // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.\r\n // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.\r\n if (gradient.shape === CSSRadialShape.CIRCLE) {\r\n rx = ry = Math.min(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));\r\n }\r\n else if (gradient.shape === CSSRadialShape.ELLIPSE) {\r\n // Compute the ratio ry/rx (which is to be the same as for \"closest-side\")\r\n var c = Math.min(Math.abs(y), Math.abs(y - height)) / Math.min(Math.abs(x), Math.abs(x - width));\r\n var _a = findCorner(width, height, x, y, true), cx = _a[0], cy = _a[1];\r\n rx = distance(cx - x, (cy - y) / c);\r\n ry = c * rx;\r\n }\r\n break;\r\n case CSSRadialExtent.FARTHEST_SIDE:\r\n // Same as closest-side, except the ending shape is sized based on the farthest side(s)\r\n if (gradient.shape === CSSRadialShape.CIRCLE) {\r\n rx = ry = Math.max(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));\r\n }\r\n else if (gradient.shape === CSSRadialShape.ELLIPSE) {\r\n rx = Math.max(Math.abs(x), Math.abs(x - width));\r\n ry = Math.max(Math.abs(y), Math.abs(y - height));\r\n }\r\n break;\r\n case CSSRadialExtent.FARTHEST_CORNER:\r\n // Same as closest-corner, except the ending shape is sized based on the farthest corner.\r\n // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.\r\n if (gradient.shape === CSSRadialShape.CIRCLE) {\r\n rx = ry = Math.max(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));\r\n }\r\n else if (gradient.shape === CSSRadialShape.ELLIPSE) {\r\n // Compute the ratio ry/rx (which is to be the same as for \"farthest-side\")\r\n var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));\r\n var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1];\r\n rx = distance(cx - x, (cy - y) / c);\r\n ry = c * rx;\r\n }\r\n break;\r\n }\r\n if (Array.isArray(gradient.size)) {\r\n rx = getAbsoluteValue(gradient.size[0], width);\r\n ry = gradient.size.length === 2 ? getAbsoluteValue(gradient.size[1], height) : rx;\r\n }\r\n return [rx, ry];\r\n };\n\n var linearGradient = function (tokens) {\r\n var angle$1 = deg(180);\r\n var stops = [];\r\n parseFunctionArgs(tokens).forEach(function (arg, i) {\r\n if (i === 0) {\r\n var firstToken = arg[0];\r\n if (firstToken.type === TokenType.IDENT_TOKEN && firstToken.value === 'to') {\r\n angle$1 = parseNamedSide(arg);\r\n return;\r\n }\r\n else if (isAngle(firstToken)) {\r\n angle$1 = angle.parse(firstToken);\r\n return;\r\n }\r\n }\r\n var colorStop = parseColorStop(arg);\r\n stops.push(colorStop);\r\n });\r\n return { angle: angle$1, stops: stops, type: CSSImageType.LINEAR_GRADIENT };\r\n };\n\n var prefixLinearGradient = function (tokens) {\r\n var angle$1 = deg(180);\r\n var stops = [];\r\n parseFunctionArgs(tokens).forEach(function (arg, i) {\r\n if (i === 0) {\r\n var firstToken = arg[0];\r\n if (firstToken.type === TokenType.IDENT_TOKEN &&\r\n ['top', 'left', 'right', 'bottom'].indexOf(firstToken.value) !== -1) {\r\n angle$1 = parseNamedSide(arg);\r\n return;\r\n }\r\n else if (isAngle(firstToken)) {\r\n angle$1 = (angle.parse(firstToken) + deg(270)) % deg(360);\r\n return;\r\n }\r\n }\r\n var colorStop = parseColorStop(arg);\r\n stops.push(colorStop);\r\n });\r\n return {\r\n angle: angle$1,\r\n stops: stops,\r\n type: CSSImageType.LINEAR_GRADIENT\r\n };\r\n };\n\n var testRangeBounds = function (document) {\r\n var TEST_HEIGHT = 123;\r\n if (document.createRange) {\r\n var range = document.createRange();\r\n if (range.getBoundingClientRect) {\r\n var testElement = document.createElement('boundtest');\r\n testElement.style.height = TEST_HEIGHT + \"px\";\r\n testElement.style.display = 'block';\r\n document.body.appendChild(testElement);\r\n range.selectNode(testElement);\r\n var rangeBounds = range.getBoundingClientRect();\r\n var rangeHeight = Math.round(rangeBounds.height);\r\n document.body.removeChild(testElement);\r\n if (rangeHeight === TEST_HEIGHT) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n var testCORS = function () { return typeof new Image().crossOrigin !== 'undefined'; };\r\n var testResponseType = function () { return typeof new XMLHttpRequest().responseType === 'string'; };\r\n var testSVG = function (document) {\r\n var img = new Image();\r\n var canvas = document.createElement('canvas');\r\n var ctx = canvas.getContext('2d');\r\n if (!ctx) {\r\n return false;\r\n }\r\n img.src = \"data:image/svg+xml,\";\r\n try {\r\n ctx.drawImage(img, 0, 0);\r\n canvas.toDataURL();\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n var isGreenPixel = function (data) {\r\n return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;\r\n };\r\n var testForeignObject = function (document) {\r\n var canvas = document.createElement('canvas');\r\n var size = 100;\r\n canvas.width = size;\r\n canvas.height = size;\r\n var ctx = canvas.getContext('2d');\r\n if (!ctx) {\r\n return Promise.reject(false);\r\n }\r\n ctx.fillStyle = 'rgb(0, 255, 0)';\r\n ctx.fillRect(0, 0, size, size);\r\n var img = new Image();\r\n var greenImageSrc = canvas.toDataURL();\r\n img.src = greenImageSrc;\r\n var svg = createForeignObjectSVG(size, size, 0, 0, img);\r\n ctx.fillStyle = 'red';\r\n ctx.fillRect(0, 0, size, size);\r\n return loadSerializedSVG(svg)\r\n .then(function (img) {\r\n ctx.drawImage(img, 0, 0);\r\n var data = ctx.getImageData(0, 0, size, size).data;\r\n ctx.fillStyle = 'red';\r\n ctx.fillRect(0, 0, size, size);\r\n var node = document.createElement('div');\r\n node.style.backgroundImage = \"url(\" + greenImageSrc + \")\";\r\n node.style.height = size + \"px\";\r\n // Firefox 55 does not render inline tags\r\n return isGreenPixel(data)\r\n ? loadSerializedSVG(createForeignObjectSVG(size, size, 0, 0, node))\r\n : Promise.reject(false);\r\n })\r\n .then(function (img) {\r\n ctx.drawImage(img, 0, 0);\r\n // Edge does not render background-images\r\n return isGreenPixel(ctx.getImageData(0, 0, size, size).data);\r\n })\r\n .catch(function () { return false; });\r\n };\r\n var createForeignObjectSVG = function (width, height, x, y, node) {\r\n var xmlns = 'http://www.w3.org/2000/svg';\r\n var svg = document.createElementNS(xmlns, 'svg');\r\n var foreignObject = document.createElementNS(xmlns, 'foreignObject');\r\n svg.setAttributeNS(null, 'width', width.toString());\r\n svg.setAttributeNS(null, 'height', height.toString());\r\n foreignObject.setAttributeNS(null, 'width', '100%');\r\n foreignObject.setAttributeNS(null, 'height', '100%');\r\n foreignObject.setAttributeNS(null, 'x', x.toString());\r\n foreignObject.setAttributeNS(null, 'y', y.toString());\r\n foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');\r\n svg.appendChild(foreignObject);\r\n foreignObject.appendChild(node);\r\n return svg;\r\n };\r\n var loadSerializedSVG = function (svg) {\r\n return new Promise(function (resolve, reject) {\r\n var img = new Image();\r\n img.onload = function () { return resolve(img); };\r\n img.onerror = reject;\r\n img.src = \"data:image/svg+xml;charset=utf-8,\" + encodeURIComponent(new XMLSerializer().serializeToString(svg));\r\n });\r\n };\r\n var FEATURES = {\r\n get SUPPORT_RANGE_BOUNDS() {\r\n var value = testRangeBounds(document);\r\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });\r\n return value;\r\n },\r\n get SUPPORT_SVG_DRAWING() {\r\n var value = testSVG(document);\r\n Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value });\r\n return value;\r\n },\r\n get SUPPORT_FOREIGNOBJECT_DRAWING() {\r\n var value = typeof Array.from === 'function' && typeof window.fetch === 'function'\r\n ? testForeignObject(document)\r\n : Promise.resolve(false);\r\n Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value });\r\n return value;\r\n },\r\n get SUPPORT_CORS_IMAGES() {\r\n var value = testCORS();\r\n Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value });\r\n return value;\r\n },\r\n get SUPPORT_RESPONSE_TYPE() {\r\n var value = testResponseType();\r\n Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value });\r\n return value;\r\n },\r\n get SUPPORT_CORS_XHR() {\r\n var value = 'withCredentials' in new XMLHttpRequest();\r\n Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value });\r\n return value;\r\n }\r\n };\n\n var Logger = /** @class */ (function () {\r\n function Logger(_a) {\r\n var id = _a.id, enabled = _a.enabled;\r\n this.id = id;\r\n this.enabled = enabled;\r\n this.start = Date.now();\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n Logger.prototype.debug = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.enabled) {\r\n // eslint-disable-next-line no-console\r\n if (typeof window !== 'undefined' && window.console && typeof console.debug === 'function') {\r\n // eslint-disable-next-line no-console\r\n console.debug.apply(console, [this.id, this.getTime() + \"ms\"].concat(args));\r\n }\r\n else {\r\n this.info.apply(this, args);\r\n }\r\n }\r\n };\r\n Logger.prototype.getTime = function () {\r\n return Date.now() - this.start;\r\n };\r\n Logger.create = function (options) {\r\n Logger.instances[options.id] = new Logger(options);\r\n };\r\n Logger.destroy = function (id) {\r\n delete Logger.instances[id];\r\n };\r\n Logger.getInstance = function (id) {\r\n var instance = Logger.instances[id];\r\n if (typeof instance === 'undefined') {\r\n throw new Error(\"No logger instance found with id \" + id);\r\n }\r\n return instance;\r\n };\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n Logger.prototype.info = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.enabled) {\r\n // eslint-disable-next-line no-console\r\n if (typeof window !== 'undefined' && window.console && typeof console.info === 'function') {\r\n // eslint-disable-next-line no-console\r\n console.info.apply(console, [this.id, this.getTime() + \"ms\"].concat(args));\r\n }\r\n }\r\n };\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n Logger.prototype.error = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (this.enabled) {\r\n // eslint-disable-next-line no-console\r\n if (typeof window !== 'undefined' && window.console && typeof console.error === 'function') {\r\n // eslint-disable-next-line no-console\r\n console.error.apply(console, [this.id, this.getTime() + \"ms\"].concat(args));\r\n }\r\n else {\r\n this.info.apply(this, args);\r\n }\r\n }\r\n };\r\n Logger.instances = {};\r\n return Logger;\r\n }());\n\n var CacheStorage = /** @class */ (function () {\r\n function CacheStorage() {\r\n }\r\n CacheStorage.create = function (name, options) {\r\n return (CacheStorage._caches[name] = new Cache(name, options));\r\n };\r\n CacheStorage.destroy = function (name) {\r\n delete CacheStorage._caches[name];\r\n };\r\n CacheStorage.open = function (name) {\r\n var cache = CacheStorage._caches[name];\r\n if (typeof cache !== 'undefined') {\r\n return cache;\r\n }\r\n throw new Error(\"Cache with key \\\"\" + name + \"\\\" not found\");\r\n };\r\n CacheStorage.getOrigin = function (url) {\r\n var link = CacheStorage._link;\r\n if (!link) {\r\n return 'about:blank';\r\n }\r\n link.href = url;\r\n link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/\r\n return link.protocol + link.hostname + link.port;\r\n };\r\n CacheStorage.isSameOrigin = function (src) {\r\n return CacheStorage.getOrigin(src) === CacheStorage._origin;\r\n };\r\n CacheStorage.setContext = function (window) {\r\n CacheStorage._link = window.document.createElement('a');\r\n CacheStorage._origin = CacheStorage.getOrigin(window.location.href);\r\n };\r\n CacheStorage.getInstance = function () {\r\n var current = CacheStorage._current;\r\n if (current === null) {\r\n throw new Error(\"No cache instance attached\");\r\n }\r\n return current;\r\n };\r\n CacheStorage.attachInstance = function (cache) {\r\n CacheStorage._current = cache;\r\n };\r\n CacheStorage.detachInstance = function () {\r\n CacheStorage._current = null;\r\n };\r\n CacheStorage._caches = {};\r\n CacheStorage._origin = 'about:blank';\r\n CacheStorage._current = null;\r\n return CacheStorage;\r\n }());\r\n var Cache = /** @class */ (function () {\r\n function Cache(id, options) {\r\n this.id = id;\r\n this._options = options;\r\n this._cache = {};\r\n }\r\n Cache.prototype.addImage = function (src) {\r\n var result = Promise.resolve();\r\n if (this.has(src)) {\r\n return result;\r\n }\r\n if (isBlobImage(src) || isRenderable(src)) {\r\n this._cache[src] = this.loadImage(src);\r\n return result;\r\n }\r\n return result;\r\n };\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n Cache.prototype.match = function (src) {\r\n return this._cache[src];\r\n };\r\n Cache.prototype.loadImage = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var isSameOrigin, useCORS, useProxy, src;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n isSameOrigin = CacheStorage.isSameOrigin(key);\r\n useCORS = !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;\r\n useProxy = !isInlineImage(key) &&\r\n !isSameOrigin &&\r\n typeof this._options.proxy === 'string' &&\r\n FEATURES.SUPPORT_CORS_XHR &&\r\n !useCORS;\r\n if (!isSameOrigin && this._options.allowTaint === false && !isInlineImage(key) && !useProxy && !useCORS) {\r\n return [2 /*return*/];\r\n }\r\n src = key;\r\n if (!useProxy) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.proxy(src)];\r\n case 1:\r\n src = _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n Logger.getInstance(this.id).debug(\"Added image \" + key.substring(0, 256));\r\n return [4 /*yield*/, new Promise(function (resolve, reject) {\r\n var img = new Image();\r\n img.onload = function () { return resolve(img); };\r\n img.onerror = reject;\r\n //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous\r\n if (isInlineBase64Image(src) || useCORS) {\r\n img.crossOrigin = 'anonymous';\r\n }\r\n img.src = src;\r\n if (img.complete === true) {\r\n // Inline XML images may fail to parse, throwing an Error later on\r\n setTimeout(function () { return resolve(img); }, 500);\r\n }\r\n if (_this._options.imageTimeout > 0) {\r\n setTimeout(function () { return reject(\"Timed out (\" + _this._options.imageTimeout + \"ms) loading image\"); }, _this._options.imageTimeout);\r\n }\r\n })];\r\n case 3: return [2 /*return*/, _a.sent()];\r\n }\r\n });\r\n });\r\n };\r\n Cache.prototype.has = function (key) {\r\n return typeof this._cache[key] !== 'undefined';\r\n };\r\n Cache.prototype.keys = function () {\r\n return Promise.resolve(Object.keys(this._cache));\r\n };\r\n Cache.prototype.proxy = function (src) {\r\n var _this = this;\r\n var proxy = this._options.proxy;\r\n if (!proxy) {\r\n throw new Error('No proxy defined');\r\n }\r\n var key = src.substring(0, 256);\r\n return new Promise(function (resolve, reject) {\r\n var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';\r\n var xhr = new XMLHttpRequest();\r\n xhr.onload = function () {\r\n if (xhr.status === 200) {\r\n if (responseType === 'text') {\r\n resolve(xhr.response);\r\n }\r\n else {\r\n var reader_1 = new FileReader();\r\n reader_1.addEventListener('load', function () { return resolve(reader_1.result); }, false);\r\n reader_1.addEventListener('error', function (e) { return reject(e); }, false);\r\n reader_1.readAsDataURL(xhr.response);\r\n }\r\n }\r\n else {\r\n reject(\"Failed to proxy resource \" + key + \" with status code \" + xhr.status);\r\n }\r\n };\r\n xhr.onerror = reject;\r\n xhr.open('GET', proxy + \"?url=\" + encodeURIComponent(src) + \"&responseType=\" + responseType);\r\n if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {\r\n xhr.responseType = responseType;\r\n }\r\n if (_this._options.imageTimeout) {\r\n var timeout_1 = _this._options.imageTimeout;\r\n xhr.timeout = timeout_1;\r\n xhr.ontimeout = function () { return reject(\"Timed out (\" + timeout_1 + \"ms) proxying \" + key); };\r\n }\r\n xhr.send();\r\n });\r\n };\r\n return Cache;\r\n }());\r\n var INLINE_SVG = /^data:image\\/svg\\+xml/i;\r\n var INLINE_BASE64 = /^data:image\\/.*;base64,/i;\r\n var INLINE_IMG = /^data:image\\/.*/i;\r\n var isRenderable = function (src) { return FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src); };\r\n var isInlineImage = function (src) { return INLINE_IMG.test(src); };\r\n var isInlineBase64Image = function (src) { return INLINE_BASE64.test(src); };\r\n var isBlobImage = function (src) { return src.substr(0, 4) === 'blob'; };\r\n var isSVG = function (src) { return src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src); };\n\n var webkitGradient = function (tokens) {\r\n var angle = deg(180);\r\n var stops = [];\r\n var type = CSSImageType.LINEAR_GRADIENT;\r\n var shape = CSSRadialShape.CIRCLE;\r\n var size = CSSRadialExtent.FARTHEST_CORNER;\r\n var position = [];\r\n parseFunctionArgs(tokens).forEach(function (arg, i) {\r\n var firstToken = arg[0];\r\n if (i === 0) {\r\n if (isIdentToken(firstToken) && firstToken.value === 'linear') {\r\n type = CSSImageType.LINEAR_GRADIENT;\r\n return;\r\n }\r\n else if (isIdentToken(firstToken) && firstToken.value === 'radial') {\r\n type = CSSImageType.RADIAL_GRADIENT;\r\n return;\r\n }\r\n }\r\n if (firstToken.type === TokenType.FUNCTION) {\r\n if (firstToken.name === 'from') {\r\n var color$1 = color.parse(firstToken.values[0]);\r\n stops.push({ stop: ZERO_LENGTH, color: color$1 });\r\n }\r\n else if (firstToken.name === 'to') {\r\n var color$1 = color.parse(firstToken.values[0]);\r\n stops.push({ stop: HUNDRED_PERCENT, color: color$1 });\r\n }\r\n else if (firstToken.name === 'color-stop') {\r\n var values = firstToken.values.filter(nonFunctionArgSeparator);\r\n if (values.length === 2) {\r\n var color$1 = color.parse(values[1]);\r\n var stop_1 = values[0];\r\n if (isNumberToken(stop_1)) {\r\n stops.push({\r\n stop: { type: TokenType.PERCENTAGE_TOKEN, number: stop_1.number * 100, flags: stop_1.flags },\r\n color: color$1\r\n });\r\n }\r\n }\r\n }\r\n }\r\n });\r\n return type === CSSImageType.LINEAR_GRADIENT\r\n ? {\r\n angle: (angle + deg(180)) % deg(360),\r\n stops: stops,\r\n type: type\r\n }\r\n : { size: size, shape: shape, stops: stops, position: position, type: type };\r\n };\n\n var CLOSEST_SIDE = 'closest-side';\r\n var FARTHEST_SIDE = 'farthest-side';\r\n var CLOSEST_CORNER = 'closest-corner';\r\n var FARTHEST_CORNER = 'farthest-corner';\r\n var CIRCLE = 'circle';\r\n var ELLIPSE = 'ellipse';\r\n var COVER = 'cover';\r\n var CONTAIN = 'contain';\r\n var radialGradient = function (tokens) {\r\n var shape = CSSRadialShape.CIRCLE;\r\n var size = CSSRadialExtent.FARTHEST_CORNER;\r\n var stops = [];\r\n var position = [];\r\n parseFunctionArgs(tokens).forEach(function (arg, i) {\r\n var isColorStop = true;\r\n if (i === 0) {\r\n var isAtPosition_1 = false;\r\n isColorStop = arg.reduce(function (acc, token) {\r\n if (isAtPosition_1) {\r\n if (isIdentToken(token)) {\r\n switch (token.value) {\r\n case 'center':\r\n position.push(FIFTY_PERCENT);\r\n return acc;\r\n case 'top':\r\n case 'left':\r\n position.push(ZERO_LENGTH);\r\n return acc;\r\n case 'right':\r\n case 'bottom':\r\n position.push(HUNDRED_PERCENT);\r\n return acc;\r\n }\r\n }\r\n else if (isLengthPercentage(token) || isLength(token)) {\r\n position.push(token);\r\n }\r\n }\r\n else if (isIdentToken(token)) {\r\n switch (token.value) {\r\n case CIRCLE:\r\n shape = CSSRadialShape.CIRCLE;\r\n return false;\r\n case ELLIPSE:\r\n shape = CSSRadialShape.ELLIPSE;\r\n return false;\r\n case 'at':\r\n isAtPosition_1 = true;\r\n return false;\r\n case CLOSEST_SIDE:\r\n size = CSSRadialExtent.CLOSEST_SIDE;\r\n return false;\r\n case COVER:\r\n case FARTHEST_SIDE:\r\n size = CSSRadialExtent.FARTHEST_SIDE;\r\n return false;\r\n case CONTAIN:\r\n case CLOSEST_CORNER:\r\n size = CSSRadialExtent.CLOSEST_CORNER;\r\n return false;\r\n case FARTHEST_CORNER:\r\n size = CSSRadialExtent.FARTHEST_CORNER;\r\n return false;\r\n }\r\n }\r\n else if (isLength(token) || isLengthPercentage(token)) {\r\n if (!Array.isArray(size)) {\r\n size = [];\r\n }\r\n size.push(token);\r\n return false;\r\n }\r\n return acc;\r\n }, isColorStop);\r\n }\r\n if (isColorStop) {\r\n var colorStop = parseColorStop(arg);\r\n stops.push(colorStop);\r\n }\r\n });\r\n return { size: size, shape: shape, stops: stops, position: position, type: CSSImageType.RADIAL_GRADIENT };\r\n };\n\n var prefixRadialGradient = function (tokens) {\r\n var shape = CSSRadialShape.CIRCLE;\r\n var size = CSSRadialExtent.FARTHEST_CORNER;\r\n var stops = [];\r\n var position = [];\r\n parseFunctionArgs(tokens).forEach(function (arg, i) {\r\n var isColorStop = true;\r\n if (i === 0) {\r\n isColorStop = arg.reduce(function (acc, token) {\r\n if (isIdentToken(token)) {\r\n switch (token.value) {\r\n case 'center':\r\n position.push(FIFTY_PERCENT);\r\n return false;\r\n case 'top':\r\n case 'left':\r\n position.push(ZERO_LENGTH);\r\n return false;\r\n case 'right':\r\n case 'bottom':\r\n position.push(HUNDRED_PERCENT);\r\n return false;\r\n }\r\n }\r\n else if (isLengthPercentage(token) || isLength(token)) {\r\n position.push(token);\r\n return false;\r\n }\r\n return acc;\r\n }, isColorStop);\r\n }\r\n else if (i === 1) {\r\n isColorStop = arg.reduce(function (acc, token) {\r\n if (isIdentToken(token)) {\r\n switch (token.value) {\r\n case CIRCLE:\r\n shape = CSSRadialShape.CIRCLE;\r\n return false;\r\n case ELLIPSE:\r\n shape = CSSRadialShape.ELLIPSE;\r\n return false;\r\n case CONTAIN:\r\n case CLOSEST_SIDE:\r\n size = CSSRadialExtent.CLOSEST_SIDE;\r\n return false;\r\n case FARTHEST_SIDE:\r\n size = CSSRadialExtent.FARTHEST_SIDE;\r\n return false;\r\n case CLOSEST_CORNER:\r\n size = CSSRadialExtent.CLOSEST_CORNER;\r\n return false;\r\n case COVER:\r\n case FARTHEST_CORNER:\r\n size = CSSRadialExtent.FARTHEST_CORNER;\r\n return false;\r\n }\r\n }\r\n else if (isLength(token) || isLengthPercentage(token)) {\r\n if (!Array.isArray(size)) {\r\n size = [];\r\n }\r\n size.push(token);\r\n return false;\r\n }\r\n return acc;\r\n }, isColorStop);\r\n }\r\n if (isColorStop) {\r\n var colorStop = parseColorStop(arg);\r\n stops.push(colorStop);\r\n }\r\n });\r\n return { size: size, shape: shape, stops: stops, position: position, type: CSSImageType.RADIAL_GRADIENT };\r\n };\n\n var CSSImageType;\r\n (function (CSSImageType) {\r\n CSSImageType[CSSImageType[\"URL\"] = 0] = \"URL\";\r\n CSSImageType[CSSImageType[\"LINEAR_GRADIENT\"] = 1] = \"LINEAR_GRADIENT\";\r\n CSSImageType[CSSImageType[\"RADIAL_GRADIENT\"] = 2] = \"RADIAL_GRADIENT\";\r\n })(CSSImageType || (CSSImageType = {}));\r\n var isLinearGradient = function (background) {\r\n return background.type === CSSImageType.LINEAR_GRADIENT;\r\n };\r\n var isRadialGradient = function (background) {\r\n return background.type === CSSImageType.RADIAL_GRADIENT;\r\n };\r\n var CSSRadialShape;\r\n (function (CSSRadialShape) {\r\n CSSRadialShape[CSSRadialShape[\"CIRCLE\"] = 0] = \"CIRCLE\";\r\n CSSRadialShape[CSSRadialShape[\"ELLIPSE\"] = 1] = \"ELLIPSE\";\r\n })(CSSRadialShape || (CSSRadialShape = {}));\r\n var CSSRadialExtent;\r\n (function (CSSRadialExtent) {\r\n CSSRadialExtent[CSSRadialExtent[\"CLOSEST_SIDE\"] = 0] = \"CLOSEST_SIDE\";\r\n CSSRadialExtent[CSSRadialExtent[\"FARTHEST_SIDE\"] = 1] = \"FARTHEST_SIDE\";\r\n CSSRadialExtent[CSSRadialExtent[\"CLOSEST_CORNER\"] = 2] = \"CLOSEST_CORNER\";\r\n CSSRadialExtent[CSSRadialExtent[\"FARTHEST_CORNER\"] = 3] = \"FARTHEST_CORNER\";\r\n })(CSSRadialExtent || (CSSRadialExtent = {}));\r\n var image = {\r\n name: 'image',\r\n parse: function (value) {\r\n if (value.type === TokenType.URL_TOKEN) {\r\n var image_1 = { url: value.value, type: CSSImageType.URL };\r\n CacheStorage.getInstance().addImage(value.value);\r\n return image_1;\r\n }\r\n if (value.type === TokenType.FUNCTION) {\r\n var imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value.name];\r\n if (typeof imageFunction === 'undefined') {\r\n throw new Error(\"Attempting to parse an unsupported image function \\\"\" + value.name + \"\\\"\");\r\n }\r\n return imageFunction(value.values);\r\n }\r\n throw new Error(\"Unsupported image type\");\r\n }\r\n };\r\n function isSupportedImage(value) {\r\n return value.type !== TokenType.FUNCTION || SUPPORTED_IMAGE_FUNCTIONS[value.name];\r\n }\r\n var SUPPORTED_IMAGE_FUNCTIONS = {\r\n 'linear-gradient': linearGradient,\r\n '-moz-linear-gradient': prefixLinearGradient,\r\n '-ms-linear-gradient': prefixLinearGradient,\r\n '-o-linear-gradient': prefixLinearGradient,\r\n '-webkit-linear-gradient': prefixLinearGradient,\r\n 'radial-gradient': radialGradient,\r\n '-moz-radial-gradient': prefixRadialGradient,\r\n '-ms-radial-gradient': prefixRadialGradient,\r\n '-o-radial-gradient': prefixRadialGradient,\r\n '-webkit-radial-gradient': prefixRadialGradient,\r\n '-webkit-gradient': webkitGradient\r\n };\n\n var backgroundImage = {\r\n name: 'background-image',\r\n initialValue: 'none',\r\n type: PropertyDescriptorParsingType.LIST,\r\n prefix: false,\r\n parse: function (tokens) {\r\n if (tokens.length === 0) {\r\n return [];\r\n }\r\n var first = tokens[0];\r\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\r\n return [];\r\n }\r\n return tokens.filter(function (value) { return nonFunctionArgSeparator(value) && isSupportedImage(value); }).map(image.parse);\r\n }\r\n };\n\n var backgroundOrigin = {\r\n name: 'background-origin',\r\n initialValue: 'border-box',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n return tokens.map(function (token) {\r\n if (isIdentToken(token)) {\r\n switch (token.value) {\r\n case 'padding-box':\r\n return 1 /* PADDING_BOX */;\r\n case 'content-box':\r\n return 2 /* CONTENT_BOX */;\r\n }\r\n }\r\n return 0 /* BORDER_BOX */;\r\n });\r\n }\r\n };\n\n var backgroundPosition = {\r\n name: 'background-position',\r\n initialValue: '0% 0%',\r\n type: PropertyDescriptorParsingType.LIST,\r\n prefix: false,\r\n parse: function (tokens) {\r\n return parseFunctionArgs(tokens)\r\n .map(function (values) { return values.filter(isLengthPercentage); })\r\n .map(parseLengthPercentageTuple);\r\n }\r\n };\n\n var BACKGROUND_REPEAT;\r\n (function (BACKGROUND_REPEAT) {\r\n BACKGROUND_REPEAT[BACKGROUND_REPEAT[\"REPEAT\"] = 0] = \"REPEAT\";\r\n BACKGROUND_REPEAT[BACKGROUND_REPEAT[\"NO_REPEAT\"] = 1] = \"NO_REPEAT\";\r\n BACKGROUND_REPEAT[BACKGROUND_REPEAT[\"REPEAT_X\"] = 2] = \"REPEAT_X\";\r\n BACKGROUND_REPEAT[BACKGROUND_REPEAT[\"REPEAT_Y\"] = 3] = \"REPEAT_Y\";\r\n })(BACKGROUND_REPEAT || (BACKGROUND_REPEAT = {}));\r\n var backgroundRepeat = {\r\n name: 'background-repeat',\r\n initialValue: 'repeat',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n return parseFunctionArgs(tokens)\r\n .map(function (values) {\r\n return values\r\n .filter(isIdentToken)\r\n .map(function (token) { return token.value; })\r\n .join(' ');\r\n })\r\n .map(parseBackgroundRepeat);\r\n }\r\n };\r\n var parseBackgroundRepeat = function (value) {\r\n switch (value) {\r\n case 'no-repeat':\r\n return BACKGROUND_REPEAT.NO_REPEAT;\r\n case 'repeat-x':\r\n case 'repeat no-repeat':\r\n return BACKGROUND_REPEAT.REPEAT_X;\r\n case 'repeat-y':\r\n case 'no-repeat repeat':\r\n return BACKGROUND_REPEAT.REPEAT_Y;\r\n case 'repeat':\r\n default:\r\n return BACKGROUND_REPEAT.REPEAT;\r\n }\r\n };\n\n var BACKGROUND_SIZE;\r\n (function (BACKGROUND_SIZE) {\r\n BACKGROUND_SIZE[\"AUTO\"] = \"auto\";\r\n BACKGROUND_SIZE[\"CONTAIN\"] = \"contain\";\r\n BACKGROUND_SIZE[\"COVER\"] = \"cover\";\r\n })(BACKGROUND_SIZE || (BACKGROUND_SIZE = {}));\r\n var backgroundSize = {\r\n name: 'background-size',\r\n initialValue: '0',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n return parseFunctionArgs(tokens).map(function (values) { return values.filter(isBackgroundSizeInfoToken); });\r\n }\r\n };\r\n var isBackgroundSizeInfoToken = function (value) {\r\n return isIdentToken(value) || isLengthPercentage(value);\r\n };\n\n var borderColorForSide = function (side) { return ({\r\n name: \"border-\" + side + \"-color\",\r\n initialValue: 'transparent',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.TYPE_VALUE,\r\n format: 'color'\r\n }); };\r\n var borderTopColor = borderColorForSide('top');\r\n var borderRightColor = borderColorForSide('right');\r\n var borderBottomColor = borderColorForSide('bottom');\r\n var borderLeftColor = borderColorForSide('left');\n\n var borderRadiusForSide = function (side) { return ({\r\n name: \"border-radius-\" + side,\r\n initialValue: '0 0',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) { return parseLengthPercentageTuple(tokens.filter(isLengthPercentage)); }\r\n }); };\r\n var borderTopLeftRadius = borderRadiusForSide('top-left');\r\n var borderTopRightRadius = borderRadiusForSide('top-right');\r\n var borderBottomRightRadius = borderRadiusForSide('bottom-right');\r\n var borderBottomLeftRadius = borderRadiusForSide('bottom-left');\n\n var BORDER_STYLE;\r\n (function (BORDER_STYLE) {\r\n BORDER_STYLE[BORDER_STYLE[\"NONE\"] = 0] = \"NONE\";\r\n BORDER_STYLE[BORDER_STYLE[\"SOLID\"] = 1] = \"SOLID\";\r\n })(BORDER_STYLE || (BORDER_STYLE = {}));\r\n var borderStyleForSide = function (side) { return ({\r\n name: \"border-\" + side + \"-style\",\r\n initialValue: 'solid',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (style) {\r\n switch (style) {\r\n case 'none':\r\n return BORDER_STYLE.NONE;\r\n }\r\n return BORDER_STYLE.SOLID;\r\n }\r\n }); };\r\n var borderTopStyle = borderStyleForSide('top');\r\n var borderRightStyle = borderStyleForSide('right');\r\n var borderBottomStyle = borderStyleForSide('bottom');\r\n var borderLeftStyle = borderStyleForSide('left');\n\n var borderWidthForSide = function (side) { return ({\r\n name: \"border-\" + side + \"-width\",\r\n initialValue: '0',\r\n type: PropertyDescriptorParsingType.VALUE,\r\n prefix: false,\r\n parse: function (token) {\r\n if (isDimensionToken(token)) {\r\n return token.number;\r\n }\r\n return 0;\r\n }\r\n }); };\r\n var borderTopWidth = borderWidthForSide('top');\r\n var borderRightWidth = borderWidthForSide('right');\r\n var borderBottomWidth = borderWidthForSide('bottom');\r\n var borderLeftWidth = borderWidthForSide('left');\n\n var color$1 = {\r\n name: \"color\",\r\n initialValue: 'transparent',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.TYPE_VALUE,\r\n format: 'color'\r\n };\n\n var display = {\r\n name: 'display',\r\n initialValue: 'inline-block',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n return tokens.filter(isIdentToken).reduce(function (bit, token) {\r\n return bit | parseDisplayValue(token.value);\r\n }, 0 /* NONE */);\r\n }\r\n };\r\n var parseDisplayValue = function (display) {\r\n switch (display) {\r\n case 'block':\r\n return 2 /* BLOCK */;\r\n case 'inline':\r\n return 4 /* INLINE */;\r\n case 'run-in':\r\n return 8 /* RUN_IN */;\r\n case 'flow':\r\n return 16 /* FLOW */;\r\n case 'flow-root':\r\n return 32 /* FLOW_ROOT */;\r\n case 'table':\r\n return 64 /* TABLE */;\r\n case 'flex':\r\n case '-webkit-flex':\r\n return 128 /* FLEX */;\r\n case 'grid':\r\n case '-ms-grid':\r\n return 256 /* GRID */;\r\n case 'ruby':\r\n return 512 /* RUBY */;\r\n case 'subgrid':\r\n return 1024 /* SUBGRID */;\r\n case 'list-item':\r\n return 2048 /* LIST_ITEM */;\r\n case 'table-row-group':\r\n return 4096 /* TABLE_ROW_GROUP */;\r\n case 'table-header-group':\r\n return 8192 /* TABLE_HEADER_GROUP */;\r\n case 'table-footer-group':\r\n return 16384 /* TABLE_FOOTER_GROUP */;\r\n case 'table-row':\r\n return 32768 /* TABLE_ROW */;\r\n case 'table-cell':\r\n return 65536 /* TABLE_CELL */;\r\n case 'table-column-group':\r\n return 131072 /* TABLE_COLUMN_GROUP */;\r\n case 'table-column':\r\n return 262144 /* TABLE_COLUMN */;\r\n case 'table-caption':\r\n return 524288 /* TABLE_CAPTION */;\r\n case 'ruby-base':\r\n return 1048576 /* RUBY_BASE */;\r\n case 'ruby-text':\r\n return 2097152 /* RUBY_TEXT */;\r\n case 'ruby-base-container':\r\n return 4194304 /* RUBY_BASE_CONTAINER */;\r\n case 'ruby-text-container':\r\n return 8388608 /* RUBY_TEXT_CONTAINER */;\r\n case 'contents':\r\n return 16777216 /* CONTENTS */;\r\n case 'inline-block':\r\n return 33554432 /* INLINE_BLOCK */;\r\n case 'inline-list-item':\r\n return 67108864 /* INLINE_LIST_ITEM */;\r\n case 'inline-table':\r\n return 134217728 /* INLINE_TABLE */;\r\n case 'inline-flex':\r\n return 268435456 /* INLINE_FLEX */;\r\n case 'inline-grid':\r\n return 536870912 /* INLINE_GRID */;\r\n }\r\n return 0 /* NONE */;\r\n };\n\n var FLOAT;\r\n (function (FLOAT) {\r\n FLOAT[FLOAT[\"NONE\"] = 0] = \"NONE\";\r\n FLOAT[FLOAT[\"LEFT\"] = 1] = \"LEFT\";\r\n FLOAT[FLOAT[\"RIGHT\"] = 2] = \"RIGHT\";\r\n FLOAT[FLOAT[\"INLINE_START\"] = 3] = \"INLINE_START\";\r\n FLOAT[FLOAT[\"INLINE_END\"] = 4] = \"INLINE_END\";\r\n })(FLOAT || (FLOAT = {}));\r\n var float = {\r\n name: 'float',\r\n initialValue: 'none',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (float) {\r\n switch (float) {\r\n case 'left':\r\n return FLOAT.LEFT;\r\n case 'right':\r\n return FLOAT.RIGHT;\r\n case 'inline-start':\r\n return FLOAT.INLINE_START;\r\n case 'inline-end':\r\n return FLOAT.INLINE_END;\r\n }\r\n return FLOAT.NONE;\r\n }\r\n };\n\n var letterSpacing = {\r\n name: 'letter-spacing',\r\n initialValue: '0',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.VALUE,\r\n parse: function (token) {\r\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'normal') {\r\n return 0;\r\n }\r\n if (token.type === TokenType.NUMBER_TOKEN) {\r\n return token.number;\r\n }\r\n if (token.type === TokenType.DIMENSION_TOKEN) {\r\n return token.number;\r\n }\r\n return 0;\r\n }\r\n };\n\n var LINE_BREAK;\r\n (function (LINE_BREAK) {\r\n LINE_BREAK[\"NORMAL\"] = \"normal\";\r\n LINE_BREAK[\"STRICT\"] = \"strict\";\r\n })(LINE_BREAK || (LINE_BREAK = {}));\r\n var lineBreak = {\r\n name: 'line-break',\r\n initialValue: 'normal',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (lineBreak) {\r\n switch (lineBreak) {\r\n case 'strict':\r\n return LINE_BREAK.STRICT;\r\n case 'normal':\r\n default:\r\n return LINE_BREAK.NORMAL;\r\n }\r\n }\r\n };\n\n var lineHeight = {\r\n name: 'line-height',\r\n initialValue: 'normal',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.TOKEN_VALUE\r\n };\r\n var computeLineHeight = function (token, fontSize) {\r\n if (isIdentToken(token) && token.value === 'normal') {\r\n return 1.2 * fontSize;\r\n }\r\n else if (token.type === TokenType.NUMBER_TOKEN) {\r\n return fontSize * token.number;\r\n }\r\n else if (isLengthPercentage(token)) {\r\n return getAbsoluteValue(token, fontSize);\r\n }\r\n return fontSize;\r\n };\n\n var listStyleImage = {\r\n name: 'list-style-image',\r\n initialValue: 'none',\r\n type: PropertyDescriptorParsingType.VALUE,\r\n prefix: false,\r\n parse: function (token) {\r\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\r\n return null;\r\n }\r\n return image.parse(token);\r\n }\r\n };\n\n var LIST_STYLE_POSITION;\r\n (function (LIST_STYLE_POSITION) {\r\n LIST_STYLE_POSITION[LIST_STYLE_POSITION[\"INSIDE\"] = 0] = \"INSIDE\";\r\n LIST_STYLE_POSITION[LIST_STYLE_POSITION[\"OUTSIDE\"] = 1] = \"OUTSIDE\";\r\n })(LIST_STYLE_POSITION || (LIST_STYLE_POSITION = {}));\r\n var listStylePosition = {\r\n name: 'list-style-position',\r\n initialValue: 'outside',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (position) {\r\n switch (position) {\r\n case 'inside':\r\n return LIST_STYLE_POSITION.INSIDE;\r\n case 'outside':\r\n default:\r\n return LIST_STYLE_POSITION.OUTSIDE;\r\n }\r\n }\r\n };\n\n var LIST_STYLE_TYPE;\r\n (function (LIST_STYLE_TYPE) {\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"NONE\"] = -1] = \"NONE\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"DISC\"] = 0] = \"DISC\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"CIRCLE\"] = 1] = \"CIRCLE\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"SQUARE\"] = 2] = \"SQUARE\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"DECIMAL\"] = 3] = \"DECIMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"CJK_DECIMAL\"] = 4] = \"CJK_DECIMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"DECIMAL_LEADING_ZERO\"] = 5] = \"DECIMAL_LEADING_ZERO\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"LOWER_ROMAN\"] = 6] = \"LOWER_ROMAN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"UPPER_ROMAN\"] = 7] = \"UPPER_ROMAN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"LOWER_GREEK\"] = 8] = \"LOWER_GREEK\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"LOWER_ALPHA\"] = 9] = \"LOWER_ALPHA\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"UPPER_ALPHA\"] = 10] = \"UPPER_ALPHA\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"ARABIC_INDIC\"] = 11] = \"ARABIC_INDIC\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"ARMENIAN\"] = 12] = \"ARMENIAN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"BENGALI\"] = 13] = \"BENGALI\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"CAMBODIAN\"] = 14] = \"CAMBODIAN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"CJK_EARTHLY_BRANCH\"] = 15] = \"CJK_EARTHLY_BRANCH\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"CJK_HEAVENLY_STEM\"] = 16] = \"CJK_HEAVENLY_STEM\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"CJK_IDEOGRAPHIC\"] = 17] = \"CJK_IDEOGRAPHIC\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"DEVANAGARI\"] = 18] = \"DEVANAGARI\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"ETHIOPIC_NUMERIC\"] = 19] = \"ETHIOPIC_NUMERIC\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"GEORGIAN\"] = 20] = \"GEORGIAN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"GUJARATI\"] = 21] = \"GUJARATI\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"GURMUKHI\"] = 22] = \"GURMUKHI\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"HEBREW\"] = 22] = \"HEBREW\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"HIRAGANA\"] = 23] = \"HIRAGANA\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"HIRAGANA_IROHA\"] = 24] = \"HIRAGANA_IROHA\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"JAPANESE_FORMAL\"] = 25] = \"JAPANESE_FORMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"JAPANESE_INFORMAL\"] = 26] = \"JAPANESE_INFORMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"KANNADA\"] = 27] = \"KANNADA\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"KATAKANA\"] = 28] = \"KATAKANA\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"KATAKANA_IROHA\"] = 29] = \"KATAKANA_IROHA\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"KHMER\"] = 30] = \"KHMER\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"KOREAN_HANGUL_FORMAL\"] = 31] = \"KOREAN_HANGUL_FORMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"KOREAN_HANJA_FORMAL\"] = 32] = \"KOREAN_HANJA_FORMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"KOREAN_HANJA_INFORMAL\"] = 33] = \"KOREAN_HANJA_INFORMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"LAO\"] = 34] = \"LAO\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"LOWER_ARMENIAN\"] = 35] = \"LOWER_ARMENIAN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"MALAYALAM\"] = 36] = \"MALAYALAM\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"MONGOLIAN\"] = 37] = \"MONGOLIAN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"MYANMAR\"] = 38] = \"MYANMAR\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"ORIYA\"] = 39] = \"ORIYA\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"PERSIAN\"] = 40] = \"PERSIAN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"SIMP_CHINESE_FORMAL\"] = 41] = \"SIMP_CHINESE_FORMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"SIMP_CHINESE_INFORMAL\"] = 42] = \"SIMP_CHINESE_INFORMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"TAMIL\"] = 43] = \"TAMIL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"TELUGU\"] = 44] = \"TELUGU\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"THAI\"] = 45] = \"THAI\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"TIBETAN\"] = 46] = \"TIBETAN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"TRAD_CHINESE_FORMAL\"] = 47] = \"TRAD_CHINESE_FORMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"TRAD_CHINESE_INFORMAL\"] = 48] = \"TRAD_CHINESE_INFORMAL\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"UPPER_ARMENIAN\"] = 49] = \"UPPER_ARMENIAN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"DISCLOSURE_OPEN\"] = 50] = \"DISCLOSURE_OPEN\";\r\n LIST_STYLE_TYPE[LIST_STYLE_TYPE[\"DISCLOSURE_CLOSED\"] = 51] = \"DISCLOSURE_CLOSED\";\r\n })(LIST_STYLE_TYPE || (LIST_STYLE_TYPE = {}));\r\n var listStyleType = {\r\n name: 'list-style-type',\r\n initialValue: 'none',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (type) {\r\n switch (type) {\r\n case 'disc':\r\n return LIST_STYLE_TYPE.DISC;\r\n case 'circle':\r\n return LIST_STYLE_TYPE.CIRCLE;\r\n case 'square':\r\n return LIST_STYLE_TYPE.SQUARE;\r\n case 'decimal':\r\n return LIST_STYLE_TYPE.DECIMAL;\r\n case 'cjk-decimal':\r\n return LIST_STYLE_TYPE.CJK_DECIMAL;\r\n case 'decimal-leading-zero':\r\n return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;\r\n case 'lower-roman':\r\n return LIST_STYLE_TYPE.LOWER_ROMAN;\r\n case 'upper-roman':\r\n return LIST_STYLE_TYPE.UPPER_ROMAN;\r\n case 'lower-greek':\r\n return LIST_STYLE_TYPE.LOWER_GREEK;\r\n case 'lower-alpha':\r\n return LIST_STYLE_TYPE.LOWER_ALPHA;\r\n case 'upper-alpha':\r\n return LIST_STYLE_TYPE.UPPER_ALPHA;\r\n case 'arabic-indic':\r\n return LIST_STYLE_TYPE.ARABIC_INDIC;\r\n case 'armenian':\r\n return LIST_STYLE_TYPE.ARMENIAN;\r\n case 'bengali':\r\n return LIST_STYLE_TYPE.BENGALI;\r\n case 'cambodian':\r\n return LIST_STYLE_TYPE.CAMBODIAN;\r\n case 'cjk-earthly-branch':\r\n return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;\r\n case 'cjk-heavenly-stem':\r\n return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;\r\n case 'cjk-ideographic':\r\n return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;\r\n case 'devanagari':\r\n return LIST_STYLE_TYPE.DEVANAGARI;\r\n case 'ethiopic-numeric':\r\n return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;\r\n case 'georgian':\r\n return LIST_STYLE_TYPE.GEORGIAN;\r\n case 'gujarati':\r\n return LIST_STYLE_TYPE.GUJARATI;\r\n case 'gurmukhi':\r\n return LIST_STYLE_TYPE.GURMUKHI;\r\n case 'hebrew':\r\n return LIST_STYLE_TYPE.HEBREW;\r\n case 'hiragana':\r\n return LIST_STYLE_TYPE.HIRAGANA;\r\n case 'hiragana-iroha':\r\n return LIST_STYLE_TYPE.HIRAGANA_IROHA;\r\n case 'japanese-formal':\r\n return LIST_STYLE_TYPE.JAPANESE_FORMAL;\r\n case 'japanese-informal':\r\n return LIST_STYLE_TYPE.JAPANESE_INFORMAL;\r\n case 'kannada':\r\n return LIST_STYLE_TYPE.KANNADA;\r\n case 'katakana':\r\n return LIST_STYLE_TYPE.KATAKANA;\r\n case 'katakana-iroha':\r\n return LIST_STYLE_TYPE.KATAKANA_IROHA;\r\n case 'khmer':\r\n return LIST_STYLE_TYPE.KHMER;\r\n case 'korean-hangul-formal':\r\n return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;\r\n case 'korean-hanja-formal':\r\n return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;\r\n case 'korean-hanja-informal':\r\n return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;\r\n case 'lao':\r\n return LIST_STYLE_TYPE.LAO;\r\n case 'lower-armenian':\r\n return LIST_STYLE_TYPE.LOWER_ARMENIAN;\r\n case 'malayalam':\r\n return LIST_STYLE_TYPE.MALAYALAM;\r\n case 'mongolian':\r\n return LIST_STYLE_TYPE.MONGOLIAN;\r\n case 'myanmar':\r\n return LIST_STYLE_TYPE.MYANMAR;\r\n case 'oriya':\r\n return LIST_STYLE_TYPE.ORIYA;\r\n case 'persian':\r\n return LIST_STYLE_TYPE.PERSIAN;\r\n case 'simp-chinese-formal':\r\n return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;\r\n case 'simp-chinese-informal':\r\n return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;\r\n case 'tamil':\r\n return LIST_STYLE_TYPE.TAMIL;\r\n case 'telugu':\r\n return LIST_STYLE_TYPE.TELUGU;\r\n case 'thai':\r\n return LIST_STYLE_TYPE.THAI;\r\n case 'tibetan':\r\n return LIST_STYLE_TYPE.TIBETAN;\r\n case 'trad-chinese-formal':\r\n return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;\r\n case 'trad-chinese-informal':\r\n return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;\r\n case 'upper-armenian':\r\n return LIST_STYLE_TYPE.UPPER_ARMENIAN;\r\n case 'disclosure-open':\r\n return LIST_STYLE_TYPE.DISCLOSURE_OPEN;\r\n case 'disclosure-closed':\r\n return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;\r\n case 'none':\r\n default:\r\n return LIST_STYLE_TYPE.NONE;\r\n }\r\n }\r\n };\n\n var marginForSide = function (side) { return ({\r\n name: \"margin-\" + side,\r\n initialValue: '0',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.TOKEN_VALUE\r\n }); };\r\n var marginTop = marginForSide('top');\r\n var marginRight = marginForSide('right');\r\n var marginBottom = marginForSide('bottom');\r\n var marginLeft = marginForSide('left');\n\n var OVERFLOW;\r\n (function (OVERFLOW) {\r\n OVERFLOW[OVERFLOW[\"VISIBLE\"] = 0] = \"VISIBLE\";\r\n OVERFLOW[OVERFLOW[\"HIDDEN\"] = 1] = \"HIDDEN\";\r\n OVERFLOW[OVERFLOW[\"SCROLL\"] = 2] = \"SCROLL\";\r\n OVERFLOW[OVERFLOW[\"AUTO\"] = 3] = \"AUTO\";\r\n })(OVERFLOW || (OVERFLOW = {}));\r\n var overflow = {\r\n name: 'overflow',\r\n initialValue: 'visible',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n return tokens.filter(isIdentToken).map(function (overflow) {\r\n switch (overflow.value) {\r\n case 'hidden':\r\n return OVERFLOW.HIDDEN;\r\n case 'scroll':\r\n return OVERFLOW.SCROLL;\r\n case 'auto':\r\n return OVERFLOW.AUTO;\r\n case 'visible':\r\n default:\r\n return OVERFLOW.VISIBLE;\r\n }\r\n });\r\n }\r\n };\n\n var OVERFLOW_WRAP;\r\n (function (OVERFLOW_WRAP) {\r\n OVERFLOW_WRAP[\"NORMAL\"] = \"normal\";\r\n OVERFLOW_WRAP[\"BREAK_WORD\"] = \"break-word\";\r\n })(OVERFLOW_WRAP || (OVERFLOW_WRAP = {}));\r\n var overflowWrap = {\r\n name: 'overflow-wrap',\r\n initialValue: 'normal',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (overflow) {\r\n switch (overflow) {\r\n case 'break-word':\r\n return OVERFLOW_WRAP.BREAK_WORD;\r\n case 'normal':\r\n default:\r\n return OVERFLOW_WRAP.NORMAL;\r\n }\r\n }\r\n };\n\n var paddingForSide = function (side) { return ({\r\n name: \"padding-\" + side,\r\n initialValue: '0',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.TYPE_VALUE,\r\n format: 'length-percentage'\r\n }); };\r\n var paddingTop = paddingForSide('top');\r\n var paddingRight = paddingForSide('right');\r\n var paddingBottom = paddingForSide('bottom');\r\n var paddingLeft = paddingForSide('left');\n\n var TEXT_ALIGN;\r\n (function (TEXT_ALIGN) {\r\n TEXT_ALIGN[TEXT_ALIGN[\"LEFT\"] = 0] = \"LEFT\";\r\n TEXT_ALIGN[TEXT_ALIGN[\"CENTER\"] = 1] = \"CENTER\";\r\n TEXT_ALIGN[TEXT_ALIGN[\"RIGHT\"] = 2] = \"RIGHT\";\r\n })(TEXT_ALIGN || (TEXT_ALIGN = {}));\r\n var textAlign = {\r\n name: 'text-align',\r\n initialValue: 'left',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (textAlign) {\r\n switch (textAlign) {\r\n case 'right':\r\n return TEXT_ALIGN.RIGHT;\r\n case 'center':\r\n case 'justify':\r\n return TEXT_ALIGN.CENTER;\r\n case 'left':\r\n default:\r\n return TEXT_ALIGN.LEFT;\r\n }\r\n }\r\n };\n\n var POSITION;\r\n (function (POSITION) {\r\n POSITION[POSITION[\"STATIC\"] = 0] = \"STATIC\";\r\n POSITION[POSITION[\"RELATIVE\"] = 1] = \"RELATIVE\";\r\n POSITION[POSITION[\"ABSOLUTE\"] = 2] = \"ABSOLUTE\";\r\n POSITION[POSITION[\"FIXED\"] = 3] = \"FIXED\";\r\n POSITION[POSITION[\"STICKY\"] = 4] = \"STICKY\";\r\n })(POSITION || (POSITION = {}));\r\n var position = {\r\n name: 'position',\r\n initialValue: 'static',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (position) {\r\n switch (position) {\r\n case 'relative':\r\n return POSITION.RELATIVE;\r\n case 'absolute':\r\n return POSITION.ABSOLUTE;\r\n case 'fixed':\r\n return POSITION.FIXED;\r\n case 'sticky':\r\n return POSITION.STICKY;\r\n }\r\n return POSITION.STATIC;\r\n }\r\n };\n\n var textShadow = {\r\n name: 'text-shadow',\r\n initialValue: 'none',\r\n type: PropertyDescriptorParsingType.LIST,\r\n prefix: false,\r\n parse: function (tokens) {\r\n if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {\r\n return [];\r\n }\r\n return parseFunctionArgs(tokens).map(function (values) {\r\n var shadow = {\r\n color: COLORS.TRANSPARENT,\r\n offsetX: ZERO_LENGTH,\r\n offsetY: ZERO_LENGTH,\r\n blur: ZERO_LENGTH\r\n };\r\n var c = 0;\r\n for (var i = 0; i < values.length; i++) {\r\n var token = values[i];\r\n if (isLength(token)) {\r\n if (c === 0) {\r\n shadow.offsetX = token;\r\n }\r\n else if (c === 1) {\r\n shadow.offsetY = token;\r\n }\r\n else {\r\n shadow.blur = token;\r\n }\r\n c++;\r\n }\r\n else {\r\n shadow.color = color.parse(token);\r\n }\r\n }\r\n return shadow;\r\n });\r\n }\r\n };\n\n var TEXT_TRANSFORM;\r\n (function (TEXT_TRANSFORM) {\r\n TEXT_TRANSFORM[TEXT_TRANSFORM[\"NONE\"] = 0] = \"NONE\";\r\n TEXT_TRANSFORM[TEXT_TRANSFORM[\"LOWERCASE\"] = 1] = \"LOWERCASE\";\r\n TEXT_TRANSFORM[TEXT_TRANSFORM[\"UPPERCASE\"] = 2] = \"UPPERCASE\";\r\n TEXT_TRANSFORM[TEXT_TRANSFORM[\"CAPITALIZE\"] = 3] = \"CAPITALIZE\";\r\n })(TEXT_TRANSFORM || (TEXT_TRANSFORM = {}));\r\n var textTransform = {\r\n name: 'text-transform',\r\n initialValue: 'none',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (textTransform) {\r\n switch (textTransform) {\r\n case 'uppercase':\r\n return TEXT_TRANSFORM.UPPERCASE;\r\n case 'lowercase':\r\n return TEXT_TRANSFORM.LOWERCASE;\r\n case 'capitalize':\r\n return TEXT_TRANSFORM.CAPITALIZE;\r\n }\r\n return TEXT_TRANSFORM.NONE;\r\n }\r\n };\n\n var transform = {\r\n name: 'transform',\r\n initialValue: 'none',\r\n prefix: true,\r\n type: PropertyDescriptorParsingType.VALUE,\r\n parse: function (token) {\r\n if (token.type === TokenType.IDENT_TOKEN && token.value === 'none') {\r\n return null;\r\n }\r\n if (token.type === TokenType.FUNCTION) {\r\n var transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name];\r\n if (typeof transformFunction === 'undefined') {\r\n throw new Error(\"Attempting to parse an unsupported transform function \\\"\" + token.name + \"\\\"\");\r\n }\r\n return transformFunction(token.values);\r\n }\r\n return null;\r\n }\r\n };\r\n var matrix = function (args) {\r\n var values = args.filter(function (arg) { return arg.type === TokenType.NUMBER_TOKEN; }).map(function (arg) { return arg.number; });\r\n return values.length === 6 ? values : null;\r\n };\r\n // doesn't support 3D transforms at the moment\r\n var matrix3d = function (args) {\r\n var values = args.filter(function (arg) { return arg.type === TokenType.NUMBER_TOKEN; }).map(function (arg) { return arg.number; });\r\n var a1 = values[0], b1 = values[1], _a = values[2], _b = values[3], a2 = values[4], b2 = values[5], _c = values[6], _d = values[7], _e = values[8], _f = values[9], _g = values[10], _h = values[11], a4 = values[12], b4 = values[13], _j = values[14], _k = values[15];\r\n return values.length === 16 ? [a1, b1, a2, b2, a4, b4] : null;\r\n };\r\n var SUPPORTED_TRANSFORM_FUNCTIONS = {\r\n matrix: matrix,\r\n matrix3d: matrix3d\r\n };\n\n var DEFAULT_VALUE = {\r\n type: TokenType.PERCENTAGE_TOKEN,\r\n number: 50,\r\n flags: FLAG_INTEGER\r\n };\r\n var DEFAULT = [DEFAULT_VALUE, DEFAULT_VALUE];\r\n var transformOrigin = {\r\n name: 'transform-origin',\r\n initialValue: '50% 50%',\r\n prefix: true,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n var origins = tokens.filter(isLengthPercentage);\r\n if (origins.length !== 2) {\r\n return DEFAULT;\r\n }\r\n return [origins[0], origins[1]];\r\n }\r\n };\n\n var VISIBILITY;\r\n (function (VISIBILITY) {\r\n VISIBILITY[VISIBILITY[\"VISIBLE\"] = 0] = \"VISIBLE\";\r\n VISIBILITY[VISIBILITY[\"HIDDEN\"] = 1] = \"HIDDEN\";\r\n VISIBILITY[VISIBILITY[\"COLLAPSE\"] = 2] = \"COLLAPSE\";\r\n })(VISIBILITY || (VISIBILITY = {}));\r\n var visibility = {\r\n name: 'visible',\r\n initialValue: 'none',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (visibility) {\r\n switch (visibility) {\r\n case 'hidden':\r\n return VISIBILITY.HIDDEN;\r\n case 'collapse':\r\n return VISIBILITY.COLLAPSE;\r\n case 'visible':\r\n default:\r\n return VISIBILITY.VISIBLE;\r\n }\r\n }\r\n };\n\n var WORD_BREAK;\r\n (function (WORD_BREAK) {\r\n WORD_BREAK[\"NORMAL\"] = \"normal\";\r\n WORD_BREAK[\"BREAK_ALL\"] = \"break-all\";\r\n WORD_BREAK[\"KEEP_ALL\"] = \"keep-all\";\r\n })(WORD_BREAK || (WORD_BREAK = {}));\r\n var wordBreak = {\r\n name: 'word-break',\r\n initialValue: 'normal',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (wordBreak) {\r\n switch (wordBreak) {\r\n case 'break-all':\r\n return WORD_BREAK.BREAK_ALL;\r\n case 'keep-all':\r\n return WORD_BREAK.KEEP_ALL;\r\n case 'normal':\r\n default:\r\n return WORD_BREAK.NORMAL;\r\n }\r\n }\r\n };\n\n var zIndex = {\r\n name: 'z-index',\r\n initialValue: 'auto',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.VALUE,\r\n parse: function (token) {\r\n if (token.type === TokenType.IDENT_TOKEN) {\r\n return { auto: true, order: 0 };\r\n }\r\n if (isNumberToken(token)) {\r\n return { auto: false, order: token.number };\r\n }\r\n throw new Error(\"Invalid z-index number parsed\");\r\n }\r\n };\n\n var opacity = {\r\n name: 'opacity',\r\n initialValue: '1',\r\n type: PropertyDescriptorParsingType.VALUE,\r\n prefix: false,\r\n parse: function (token) {\r\n if (isNumberToken(token)) {\r\n return token.number;\r\n }\r\n return 1;\r\n }\r\n };\n\n var textDecorationColor = {\r\n name: \"text-decoration-color\",\r\n initialValue: 'transparent',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.TYPE_VALUE,\r\n format: 'color'\r\n };\n\n var textDecorationLine = {\r\n name: 'text-decoration-line',\r\n initialValue: 'none',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n return tokens\r\n .filter(isIdentToken)\r\n .map(function (token) {\r\n switch (token.value) {\r\n case 'underline':\r\n return 1 /* UNDERLINE */;\r\n case 'overline':\r\n return 2 /* OVERLINE */;\r\n case 'line-through':\r\n return 3 /* LINE_THROUGH */;\r\n case 'none':\r\n return 4 /* BLINK */;\r\n }\r\n return 0 /* NONE */;\r\n })\r\n .filter(function (line) { return line !== 0 /* NONE */; });\r\n }\r\n };\n\n var fontFamily = {\r\n name: \"font-family\",\r\n initialValue: '',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n return tokens.filter(isStringToken$1).map(function (token) { return token.value; });\r\n }\r\n };\r\n var isStringToken$1 = function (token) {\r\n return token.type === TokenType.STRING_TOKEN || token.type === TokenType.IDENT_TOKEN;\r\n };\n\n var fontSize = {\r\n name: \"font-size\",\r\n initialValue: '0',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.TYPE_VALUE,\r\n format: 'length'\r\n };\n\n var fontWeight = {\r\n name: 'font-weight',\r\n initialValue: 'normal',\r\n type: PropertyDescriptorParsingType.VALUE,\r\n prefix: false,\r\n parse: function (token) {\r\n if (isNumberToken(token)) {\r\n return token.number;\r\n }\r\n if (isIdentToken(token)) {\r\n switch (token.value) {\r\n case 'bold':\r\n return 700;\r\n case 'normal':\r\n default:\r\n return 400;\r\n }\r\n }\r\n return 400;\r\n }\r\n };\n\n var fontVariant = {\r\n name: 'font-variant',\r\n initialValue: 'none',\r\n type: PropertyDescriptorParsingType.LIST,\r\n prefix: false,\r\n parse: function (tokens) {\r\n return tokens.filter(isIdentToken).map(function (token) { return token.value; });\r\n }\r\n };\n\n var FONT_STYLE;\r\n (function (FONT_STYLE) {\r\n FONT_STYLE[\"NORMAL\"] = \"normal\";\r\n FONT_STYLE[\"ITALIC\"] = \"italic\";\r\n FONT_STYLE[\"OBLIQUE\"] = \"oblique\";\r\n })(FONT_STYLE || (FONT_STYLE = {}));\r\n var fontStyle = {\r\n name: 'font-style',\r\n initialValue: 'normal',\r\n prefix: false,\r\n type: PropertyDescriptorParsingType.IDENT_VALUE,\r\n parse: function (overflow) {\r\n switch (overflow) {\r\n case 'oblique':\r\n return FONT_STYLE.OBLIQUE;\r\n case 'italic':\r\n return FONT_STYLE.ITALIC;\r\n case 'normal':\r\n default:\r\n return FONT_STYLE.NORMAL;\r\n }\r\n }\r\n };\n\n var contains = function (bit, value) { return (bit & value) !== 0; };\n\n var content = {\r\n name: 'content',\r\n initialValue: 'none',\r\n type: PropertyDescriptorParsingType.LIST,\r\n prefix: false,\r\n parse: function (tokens) {\r\n if (tokens.length === 0) {\r\n return [];\r\n }\r\n var first = tokens[0];\r\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\r\n return [];\r\n }\r\n return tokens;\r\n }\r\n };\n\n var counterIncrement = {\r\n name: 'counter-increment',\r\n initialValue: 'none',\r\n prefix: true,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n if (tokens.length === 0) {\r\n return null;\r\n }\r\n var first = tokens[0];\r\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\r\n return null;\r\n }\r\n var increments = [];\r\n var filtered = tokens.filter(nonWhiteSpace);\r\n for (var i = 0; i < filtered.length; i++) {\r\n var counter = filtered[i];\r\n var next = filtered[i + 1];\r\n if (counter.type === TokenType.IDENT_TOKEN) {\r\n var increment = next && isNumberToken(next) ? next.number : 1;\r\n increments.push({ counter: counter.value, increment: increment });\r\n }\r\n }\r\n return increments;\r\n }\r\n };\n\n var counterReset = {\r\n name: 'counter-reset',\r\n initialValue: 'none',\r\n prefix: true,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n if (tokens.length === 0) {\r\n return [];\r\n }\r\n var resets = [];\r\n var filtered = tokens.filter(nonWhiteSpace);\r\n for (var i = 0; i < filtered.length; i++) {\r\n var counter = filtered[i];\r\n var next = filtered[i + 1];\r\n if (isIdentToken(counter) && counter.value !== 'none') {\r\n var reset = next && isNumberToken(next) ? next.number : 0;\r\n resets.push({ counter: counter.value, reset: reset });\r\n }\r\n }\r\n return resets;\r\n }\r\n };\n\n var quotes = {\r\n name: 'quotes',\r\n initialValue: 'none',\r\n prefix: true,\r\n type: PropertyDescriptorParsingType.LIST,\r\n parse: function (tokens) {\r\n if (tokens.length === 0) {\r\n return null;\r\n }\r\n var first = tokens[0];\r\n if (first.type === TokenType.IDENT_TOKEN && first.value === 'none') {\r\n return null;\r\n }\r\n var quotes = [];\r\n var filtered = tokens.filter(isStringToken);\r\n if (filtered.length % 2 !== 0) {\r\n return null;\r\n }\r\n for (var i = 0; i < filtered.length; i += 2) {\r\n var open_1 = filtered[i].value;\r\n var close_1 = filtered[i + 1].value;\r\n quotes.push({ open: open_1, close: close_1 });\r\n }\r\n return quotes;\r\n }\r\n };\r\n var getQuote = function (quotes, depth, open) {\r\n if (!quotes) {\r\n return '';\r\n }\r\n var quote = quotes[Math.min(depth, quotes.length - 1)];\r\n if (!quote) {\r\n return '';\r\n }\r\n return open ? quote.open : quote.close;\r\n };\n\n var boxShadow = {\r\n name: 'box-shadow',\r\n initialValue: 'none',\r\n type: PropertyDescriptorParsingType.LIST,\r\n prefix: false,\r\n parse: function (tokens) {\r\n if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {\r\n return [];\r\n }\r\n return parseFunctionArgs(tokens).map(function (values) {\r\n var shadow = {\r\n color: 0x000000ff,\r\n offsetX: ZERO_LENGTH,\r\n offsetY: ZERO_LENGTH,\r\n blur: ZERO_LENGTH,\r\n spread: ZERO_LENGTH,\r\n inset: false\r\n };\r\n var c = 0;\r\n for (var i = 0; i < values.length; i++) {\r\n var token = values[i];\r\n if (isIdentWithValue(token, 'inset')) {\r\n shadow.inset = true;\r\n }\r\n else if (isLength(token)) {\r\n if (c === 0) {\r\n shadow.offsetX = token;\r\n }\r\n else if (c === 1) {\r\n shadow.offsetY = token;\r\n }\r\n else if (c === 2) {\r\n shadow.blur = token;\r\n }\r\n else {\r\n shadow.spread = token;\r\n }\r\n c++;\r\n }\r\n else {\r\n shadow.color = color.parse(token);\r\n }\r\n }\r\n return shadow;\r\n });\r\n }\r\n };\n\n var CSSParsedDeclaration = /** @class */ (function () {\r\n function CSSParsedDeclaration(declaration) {\r\n this.backgroundClip = parse(backgroundClip, declaration.backgroundClip);\r\n this.backgroundColor = parse(backgroundColor, declaration.backgroundColor);\r\n this.backgroundImage = parse(backgroundImage, declaration.backgroundImage);\r\n this.backgroundOrigin = parse(backgroundOrigin, declaration.backgroundOrigin);\r\n this.backgroundPosition = parse(backgroundPosition, declaration.backgroundPosition);\r\n this.backgroundRepeat = parse(backgroundRepeat, declaration.backgroundRepeat);\r\n this.backgroundSize = parse(backgroundSize, declaration.backgroundSize);\r\n this.borderTopColor = parse(borderTopColor, declaration.borderTopColor);\r\n this.borderRightColor = parse(borderRightColor, declaration.borderRightColor);\r\n this.borderBottomColor = parse(borderBottomColor, declaration.borderBottomColor);\r\n this.borderLeftColor = parse(borderLeftColor, declaration.borderLeftColor);\r\n this.borderTopLeftRadius = parse(borderTopLeftRadius, declaration.borderTopLeftRadius);\r\n this.borderTopRightRadius = parse(borderTopRightRadius, declaration.borderTopRightRadius);\r\n this.borderBottomRightRadius = parse(borderBottomRightRadius, declaration.borderBottomRightRadius);\r\n this.borderBottomLeftRadius = parse(borderBottomLeftRadius, declaration.borderBottomLeftRadius);\r\n this.borderTopStyle = parse(borderTopStyle, declaration.borderTopStyle);\r\n this.borderRightStyle = parse(borderRightStyle, declaration.borderRightStyle);\r\n this.borderBottomStyle = parse(borderBottomStyle, declaration.borderBottomStyle);\r\n this.borderLeftStyle = parse(borderLeftStyle, declaration.borderLeftStyle);\r\n this.borderTopWidth = parse(borderTopWidth, declaration.borderTopWidth);\r\n this.borderRightWidth = parse(borderRightWidth, declaration.borderRightWidth);\r\n this.borderBottomWidth = parse(borderBottomWidth, declaration.borderBottomWidth);\r\n this.borderLeftWidth = parse(borderLeftWidth, declaration.borderLeftWidth);\r\n this.boxShadow = parse(boxShadow, declaration.boxShadow);\r\n this.color = parse(color$1, declaration.color);\r\n this.display = parse(display, declaration.display);\r\n this.float = parse(float, declaration.cssFloat);\r\n this.fontFamily = parse(fontFamily, declaration.fontFamily);\r\n this.fontSize = parse(fontSize, declaration.fontSize);\r\n this.fontStyle = parse(fontStyle, declaration.fontStyle);\r\n this.fontVariant = parse(fontVariant, declaration.fontVariant);\r\n this.fontWeight = parse(fontWeight, declaration.fontWeight);\r\n this.letterSpacing = parse(letterSpacing, declaration.letterSpacing);\r\n this.lineBreak = parse(lineBreak, declaration.lineBreak);\r\n this.lineHeight = parse(lineHeight, declaration.lineHeight);\r\n this.listStyleImage = parse(listStyleImage, declaration.listStyleImage);\r\n this.listStylePosition = parse(listStylePosition, declaration.listStylePosition);\r\n this.listStyleType = parse(listStyleType, declaration.listStyleType);\r\n this.marginTop = parse(marginTop, declaration.marginTop);\r\n this.marginRight = parse(marginRight, declaration.marginRight);\r\n this.marginBottom = parse(marginBottom, declaration.marginBottom);\r\n this.marginLeft = parse(marginLeft, declaration.marginLeft);\r\n this.opacity = parse(opacity, declaration.opacity);\r\n var overflowTuple = parse(overflow, declaration.overflow);\r\n this.overflowX = overflowTuple[0];\r\n this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];\r\n this.overflowWrap = parse(overflowWrap, declaration.overflowWrap);\r\n this.paddingTop = parse(paddingTop, declaration.paddingTop);\r\n this.paddingRight = parse(paddingRight, declaration.paddingRight);\r\n this.paddingBottom = parse(paddingBottom, declaration.paddingBottom);\r\n this.paddingLeft = parse(paddingLeft, declaration.paddingLeft);\r\n this.position = parse(position, declaration.position);\r\n this.textAlign = parse(textAlign, declaration.textAlign);\r\n this.textDecorationColor = parse(textDecorationColor, declaration.textDecorationColor || declaration.color);\r\n this.textDecorationLine = parse(textDecorationLine, declaration.textDecorationLine);\r\n this.textShadow = parse(textShadow, declaration.textShadow);\r\n this.textTransform = parse(textTransform, declaration.textTransform);\r\n this.transform = parse(transform, declaration.transform);\r\n this.transformOrigin = parse(transformOrigin, declaration.transformOrigin);\r\n this.visibility = parse(visibility, declaration.visibility);\r\n this.wordBreak = parse(wordBreak, declaration.wordBreak);\r\n this.zIndex = parse(zIndex, declaration.zIndex);\r\n }\r\n CSSParsedDeclaration.prototype.isVisible = function () {\r\n return this.display > 0 && this.opacity > 0 && this.visibility === VISIBILITY.VISIBLE;\r\n };\r\n CSSParsedDeclaration.prototype.isTransparent = function () {\r\n return isTransparent(this.backgroundColor);\r\n };\r\n CSSParsedDeclaration.prototype.isTransformed = function () {\r\n return this.transform !== null;\r\n };\r\n CSSParsedDeclaration.prototype.isPositioned = function () {\r\n return this.position !== POSITION.STATIC;\r\n };\r\n CSSParsedDeclaration.prototype.isPositionedWithZIndex = function () {\r\n return this.isPositioned() && !this.zIndex.auto;\r\n };\r\n CSSParsedDeclaration.prototype.isFloating = function () {\r\n return this.float !== FLOAT.NONE;\r\n };\r\n CSSParsedDeclaration.prototype.isInlineLevel = function () {\r\n return (contains(this.display, 4 /* INLINE */) ||\r\n contains(this.display, 33554432 /* INLINE_BLOCK */) ||\r\n contains(this.display, 268435456 /* INLINE_FLEX */) ||\r\n contains(this.display, 536870912 /* INLINE_GRID */) ||\r\n contains(this.display, 67108864 /* INLINE_LIST_ITEM */) ||\r\n contains(this.display, 134217728 /* INLINE_TABLE */));\r\n };\r\n return CSSParsedDeclaration;\r\n }());\r\n var CSSParsedPseudoDeclaration = /** @class */ (function () {\r\n function CSSParsedPseudoDeclaration(declaration) {\r\n this.content = parse(content, declaration.content);\r\n this.quotes = parse(quotes, declaration.quotes);\r\n }\r\n return CSSParsedPseudoDeclaration;\r\n }());\r\n var CSSParsedCounterDeclaration = /** @class */ (function () {\r\n function CSSParsedCounterDeclaration(declaration) {\r\n this.counterIncrement = parse(counterIncrement, declaration.counterIncrement);\r\n this.counterReset = parse(counterReset, declaration.counterReset);\r\n }\r\n return CSSParsedCounterDeclaration;\r\n }());\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n var parse = function (descriptor, style) {\r\n var tokenizer = new Tokenizer();\r\n var value = style !== null && typeof style !== 'undefined' ? style.toString() : descriptor.initialValue;\r\n tokenizer.write(value);\r\n var parser = new Parser(tokenizer.read());\r\n switch (descriptor.type) {\r\n case PropertyDescriptorParsingType.IDENT_VALUE:\r\n var token = parser.parseComponentValue();\r\n return descriptor.parse(isIdentToken(token) ? token.value : descriptor.initialValue);\r\n case PropertyDescriptorParsingType.VALUE:\r\n return descriptor.parse(parser.parseComponentValue());\r\n case PropertyDescriptorParsingType.LIST:\r\n return descriptor.parse(parser.parseComponentValues());\r\n case PropertyDescriptorParsingType.TOKEN_VALUE:\r\n return parser.parseComponentValue();\r\n case PropertyDescriptorParsingType.TYPE_VALUE:\r\n switch (descriptor.format) {\r\n case 'angle':\r\n return angle.parse(parser.parseComponentValue());\r\n case 'color':\r\n return color.parse(parser.parseComponentValue());\r\n case 'image':\r\n return image.parse(parser.parseComponentValue());\r\n case 'length':\r\n var length_1 = parser.parseComponentValue();\r\n return isLength(length_1) ? length_1 : ZERO_LENGTH;\r\n case 'length-percentage':\r\n var value_1 = parser.parseComponentValue();\r\n return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;\r\n }\r\n }\r\n throw new Error(\"Attempting to parse unsupported css format type \" + descriptor.format);\r\n };\n\n var ElementContainer = /** @class */ (function () {\r\n function ElementContainer(element) {\r\n this.styles = new CSSParsedDeclaration(window.getComputedStyle(element, null));\r\n this.textNodes = [];\r\n this.elements = [];\r\n if (this.styles.transform !== null && isHTMLElementNode(element)) {\r\n // getBoundingClientRect takes transforms into account\r\n element.style.transform = 'none';\r\n }\r\n this.bounds = parseBounds(element);\r\n this.flags = 0;\r\n }\r\n return ElementContainer;\r\n }());\n\n var TextBounds = /** @class */ (function () {\r\n function TextBounds(text, bounds) {\r\n this.text = text;\r\n this.bounds = bounds;\r\n }\r\n return TextBounds;\r\n }());\r\n var parseTextBounds = function (value, styles, node) {\r\n var textList = breakText(value, styles);\r\n var textBounds = [];\r\n var offset = 0;\r\n textList.forEach(function (text) {\r\n if (styles.textDecorationLine.length || text.trim().length > 0) {\r\n if (FEATURES.SUPPORT_RANGE_BOUNDS) {\r\n textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length)));\r\n }\r\n else {\r\n var replacementNode = node.splitText(text.length);\r\n textBounds.push(new TextBounds(text, getWrapperBounds(node)));\r\n node = replacementNode;\r\n }\r\n }\r\n else if (!FEATURES.SUPPORT_RANGE_BOUNDS) {\r\n node = node.splitText(text.length);\r\n }\r\n offset += text.length;\r\n });\r\n return textBounds;\r\n };\r\n var getWrapperBounds = function (node) {\r\n var ownerDocument = node.ownerDocument;\r\n if (ownerDocument) {\r\n var wrapper = ownerDocument.createElement('html2canvaswrapper');\r\n wrapper.appendChild(node.cloneNode(true));\r\n var parentNode = node.parentNode;\r\n if (parentNode) {\r\n parentNode.replaceChild(wrapper, node);\r\n var bounds = parseBounds(wrapper);\r\n if (wrapper.firstChild) {\r\n parentNode.replaceChild(wrapper.firstChild, wrapper);\r\n }\r\n return bounds;\r\n }\r\n }\r\n return new Bounds(0, 0, 0, 0);\r\n };\r\n var getRangeBounds = function (node, offset, length) {\r\n var ownerDocument = node.ownerDocument;\r\n if (!ownerDocument) {\r\n throw new Error('Node has no owner document');\r\n }\r\n var range = ownerDocument.createRange();\r\n range.setStart(node, offset);\r\n range.setEnd(node, offset + length);\r\n return Bounds.fromClientRect(range.getBoundingClientRect());\r\n };\r\n var breakText = function (value, styles) {\r\n return styles.letterSpacing !== 0 ? toCodePoints(value).map(function (i) { return fromCodePoint(i); }) : breakWords(value, styles);\r\n };\r\n var breakWords = function (str, styles) {\r\n var breaker = LineBreaker(str, {\r\n lineBreak: styles.lineBreak,\r\n wordBreak: styles.overflowWrap === OVERFLOW_WRAP.BREAK_WORD ? 'break-word' : styles.wordBreak\r\n });\r\n var words = [];\r\n var bk;\r\n while (!(bk = breaker.next()).done) {\r\n if (bk.value) {\r\n words.push(bk.value.slice());\r\n }\r\n }\r\n return words;\r\n };\n\n var TextContainer = /** @class */ (function () {\r\n function TextContainer(node, styles) {\r\n this.text = transform$1(node.data, styles.textTransform);\r\n this.textBounds = parseTextBounds(this.text, styles, node);\r\n }\r\n return TextContainer;\r\n }());\r\n var transform$1 = function (text, transform) {\r\n switch (transform) {\r\n case TEXT_TRANSFORM.LOWERCASE:\r\n return text.toLowerCase();\r\n case TEXT_TRANSFORM.CAPITALIZE:\r\n return text.replace(CAPITALIZE, capitalize);\r\n case TEXT_TRANSFORM.UPPERCASE:\r\n return text.toUpperCase();\r\n default:\r\n return text;\r\n }\r\n };\r\n var CAPITALIZE = /(^|\\s|:|-|\\(|\\))([a-z])/g;\r\n var capitalize = function (m, p1, p2) {\r\n if (m.length > 0) {\r\n return p1 + p2.toUpperCase();\r\n }\r\n return m;\r\n };\n\n var ImageElementContainer = /** @class */ (function (_super) {\r\n __extends(ImageElementContainer, _super);\r\n function ImageElementContainer(img) {\r\n var _this = _super.call(this, img) || this;\r\n _this.src = img.currentSrc || img.src;\r\n _this.intrinsicWidth = img.naturalWidth;\r\n _this.intrinsicHeight = img.naturalHeight;\r\n CacheStorage.getInstance().addImage(_this.src);\r\n return _this;\r\n }\r\n return ImageElementContainer;\r\n }(ElementContainer));\n\n var CanvasElementContainer = /** @class */ (function (_super) {\r\n __extends(CanvasElementContainer, _super);\r\n function CanvasElementContainer(canvas) {\r\n var _this = _super.call(this, canvas) || this;\r\n _this.canvas = canvas;\r\n _this.intrinsicWidth = canvas.width;\r\n _this.intrinsicHeight = canvas.height;\r\n return _this;\r\n }\r\n return CanvasElementContainer;\r\n }(ElementContainer));\n\n var SVGElementContainer = /** @class */ (function (_super) {\r\n __extends(SVGElementContainer, _super);\r\n function SVGElementContainer(img) {\r\n var _this = _super.call(this, img) || this;\r\n var s = new XMLSerializer();\r\n _this.svg = \"data:image/svg+xml,\" + encodeURIComponent(s.serializeToString(img));\r\n _this.intrinsicWidth = img.width.baseVal.value;\r\n _this.intrinsicHeight = img.height.baseVal.value;\r\n CacheStorage.getInstance().addImage(_this.svg);\r\n return _this;\r\n }\r\n return SVGElementContainer;\r\n }(ElementContainer));\n\n var LIElementContainer = /** @class */ (function (_super) {\r\n __extends(LIElementContainer, _super);\r\n function LIElementContainer(element) {\r\n var _this = _super.call(this, element) || this;\r\n _this.value = element.value;\r\n return _this;\r\n }\r\n return LIElementContainer;\r\n }(ElementContainer));\n\n var OLElementContainer = /** @class */ (function (_super) {\r\n __extends(OLElementContainer, _super);\r\n function OLElementContainer(element) {\r\n var _this = _super.call(this, element) || this;\r\n _this.start = element.start;\r\n _this.reversed = typeof element.reversed === 'boolean' && element.reversed === true;\r\n return _this;\r\n }\r\n return OLElementContainer;\r\n }(ElementContainer));\n\n var CHECKBOX_BORDER_RADIUS = [\r\n {\r\n type: TokenType.DIMENSION_TOKEN,\r\n flags: 0,\r\n unit: 'px',\r\n number: 3\r\n }\r\n ];\r\n var RADIO_BORDER_RADIUS = [\r\n {\r\n type: TokenType.PERCENTAGE_TOKEN,\r\n flags: 0,\r\n number: 50\r\n }\r\n ];\r\n var reformatInputBounds = function (bounds) {\r\n if (bounds.width > bounds.height) {\r\n return new Bounds(bounds.left + (bounds.width - bounds.height) / 2, bounds.top, bounds.height, bounds.height);\r\n }\r\n else if (bounds.width < bounds.height) {\r\n return new Bounds(bounds.left, bounds.top + (bounds.height - bounds.width) / 2, bounds.width, bounds.width);\r\n }\r\n return bounds;\r\n };\r\n var getInputValue = function (node) {\r\n var value = node.type === PASSWORD ? new Array(node.value.length + 1).join('\\u2022') : node.value;\r\n return value.length === 0 ? node.placeholder || '' : value;\r\n };\r\n var CHECKBOX = 'checkbox';\r\n var RADIO = 'radio';\r\n var PASSWORD = 'password';\r\n var INPUT_COLOR = 0x2a2a2aff;\r\n var InputElementContainer = /** @class */ (function (_super) {\r\n __extends(InputElementContainer, _super);\r\n function InputElementContainer(input) {\r\n var _this = _super.call(this, input) || this;\r\n _this.type = input.type.toLowerCase();\r\n _this.checked = input.checked;\r\n _this.value = getInputValue(input);\r\n if (_this.type === CHECKBOX || _this.type === RADIO) {\r\n _this.styles.backgroundColor = 0xdededeff;\r\n _this.styles.borderTopColor = _this.styles.borderRightColor = _this.styles.borderBottomColor = _this.styles.borderLeftColor = 0xa5a5a5ff;\r\n _this.styles.borderTopWidth = _this.styles.borderRightWidth = _this.styles.borderBottomWidth = _this.styles.borderLeftWidth = 1;\r\n _this.styles.borderTopStyle = _this.styles.borderRightStyle = _this.styles.borderBottomStyle = _this.styles.borderLeftStyle =\r\n BORDER_STYLE.SOLID;\r\n _this.styles.backgroundClip = [BACKGROUND_CLIP.BORDER_BOX];\r\n _this.styles.backgroundOrigin = [0 /* BORDER_BOX */];\r\n _this.bounds = reformatInputBounds(_this.bounds);\r\n }\r\n switch (_this.type) {\r\n case CHECKBOX:\r\n _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;\r\n break;\r\n case RADIO:\r\n _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;\r\n break;\r\n }\r\n return _this;\r\n }\r\n return InputElementContainer;\r\n }(ElementContainer));\n\n var SelectElementContainer = /** @class */ (function (_super) {\r\n __extends(SelectElementContainer, _super);\r\n function SelectElementContainer(element) {\r\n var _this = _super.call(this, element) || this;\r\n var option = element.options[element.selectedIndex || 0];\r\n _this.value = option ? option.text || '' : '';\r\n return _this;\r\n }\r\n return SelectElementContainer;\r\n }(ElementContainer));\n\n var TextareaElementContainer = /** @class */ (function (_super) {\r\n __extends(TextareaElementContainer, _super);\r\n function TextareaElementContainer(element) {\r\n var _this = _super.call(this, element) || this;\r\n _this.value = element.value;\r\n return _this;\r\n }\r\n return TextareaElementContainer;\r\n }(ElementContainer));\n\n var parseColor = function (value) { return color.parse(Parser.create(value).parseComponentValue()); };\r\n var IFrameElementContainer = /** @class */ (function (_super) {\r\n __extends(IFrameElementContainer, _super);\r\n function IFrameElementContainer(iframe) {\r\n var _this = _super.call(this, iframe) || this;\r\n _this.src = iframe.src;\r\n _this.width = parseInt(iframe.width, 10) || 0;\r\n _this.height = parseInt(iframe.height, 10) || 0;\r\n _this.backgroundColor = _this.styles.backgroundColor;\r\n try {\r\n if (iframe.contentWindow &&\r\n iframe.contentWindow.document &&\r\n iframe.contentWindow.document.documentElement) {\r\n _this.tree = parseTree(iframe.contentWindow.document.documentElement);\r\n // http://www.w3.org/TR/css3-background/#special-backgrounds\r\n var documentBackgroundColor = iframe.contentWindow.document.documentElement\r\n ? parseColor(getComputedStyle(iframe.contentWindow.document.documentElement)\r\n .backgroundColor)\r\n : COLORS.TRANSPARENT;\r\n var bodyBackgroundColor = iframe.contentWindow.document.body\r\n ? parseColor(getComputedStyle(iframe.contentWindow.document.body).backgroundColor)\r\n : COLORS.TRANSPARENT;\r\n _this.backgroundColor = isTransparent(documentBackgroundColor)\r\n ? isTransparent(bodyBackgroundColor)\r\n ? _this.styles.backgroundColor\r\n : bodyBackgroundColor\r\n : documentBackgroundColor;\r\n }\r\n }\r\n catch (e) { }\r\n return _this;\r\n }\r\n return IFrameElementContainer;\r\n }(ElementContainer));\n\n var LIST_OWNERS = ['OL', 'UL', 'MENU'];\r\n var parseNodeTree = function (node, parent, root) {\r\n for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {\r\n nextNode = childNode.nextSibling;\r\n if (isTextNode(childNode) && childNode.data.trim().length > 0) {\r\n parent.textNodes.push(new TextContainer(childNode, parent.styles));\r\n }\r\n else if (isElementNode(childNode)) {\r\n var container = createContainer(childNode);\r\n if (container.styles.isVisible()) {\r\n if (createsRealStackingContext(childNode, container, root)) {\r\n container.flags |= 4 /* CREATES_REAL_STACKING_CONTEXT */;\r\n }\r\n else if (createsStackingContext(container.styles)) {\r\n container.flags |= 2 /* CREATES_STACKING_CONTEXT */;\r\n }\r\n if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) {\r\n container.flags |= 8 /* IS_LIST_OWNER */;\r\n }\r\n parent.elements.push(container);\r\n if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) {\r\n parseNodeTree(childNode, container, root);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n var createContainer = function (element) {\r\n if (isImageElement(element)) {\r\n return new ImageElementContainer(element);\r\n }\r\n if (isCanvasElement(element)) {\r\n return new CanvasElementContainer(element);\r\n }\r\n if (isSVGElement(element)) {\r\n return new SVGElementContainer(element);\r\n }\r\n if (isLIElement(element)) {\r\n return new LIElementContainer(element);\r\n }\r\n if (isOLElement(element)) {\r\n return new OLElementContainer(element);\r\n }\r\n if (isInputElement(element)) {\r\n return new InputElementContainer(element);\r\n }\r\n if (isSelectElement(element)) {\r\n return new SelectElementContainer(element);\r\n }\r\n if (isTextareaElement(element)) {\r\n return new TextareaElementContainer(element);\r\n }\r\n if (isIFrameElement(element)) {\r\n return new IFrameElementContainer(element);\r\n }\r\n return new ElementContainer(element);\r\n };\r\n var parseTree = function (element) {\r\n var container = createContainer(element);\r\n container.flags |= 4 /* CREATES_REAL_STACKING_CONTEXT */;\r\n parseNodeTree(element, container, container);\r\n return container;\r\n };\r\n var createsRealStackingContext = function (node, container, root) {\r\n return (container.styles.isPositionedWithZIndex() ||\r\n container.styles.opacity < 1 ||\r\n container.styles.isTransformed() ||\r\n (isBodyElement(node) && root.styles.isTransparent()));\r\n };\r\n var createsStackingContext = function (styles) { return styles.isPositioned() || styles.isFloating(); };\r\n var isTextNode = function (node) { return node.nodeType === Node.TEXT_NODE; };\r\n var isElementNode = function (node) { return node.nodeType === Node.ELEMENT_NODE; };\r\n var isHTMLElementNode = function (node) {\r\n return typeof node.style !== 'undefined';\r\n };\r\n var isLIElement = function (node) { return node.tagName === 'LI'; };\r\n var isOLElement = function (node) { return node.tagName === 'OL'; };\r\n var isInputElement = function (node) { return node.tagName === 'INPUT'; };\r\n var isHTMLElement = function (node) { return node.tagName === 'HTML'; };\r\n var isSVGElement = function (node) { return node.tagName === 'svg'; };\r\n var isBodyElement = function (node) { return node.tagName === 'BODY'; };\r\n var isCanvasElement = function (node) { return node.tagName === 'CANVAS'; };\r\n var isImageElement = function (node) { return node.tagName === 'IMG'; };\r\n var isIFrameElement = function (node) { return node.tagName === 'IFRAME'; };\r\n var isStyleElement = function (node) { return node.tagName === 'STYLE'; };\r\n var isScriptElement = function (node) { return node.tagName === 'SCRIPT'; };\r\n var isTextareaElement = function (node) { return node.tagName === 'TEXTAREA'; };\r\n var isSelectElement = function (node) { return node.tagName === 'SELECT'; };\n\n var CounterState = /** @class */ (function () {\r\n function CounterState() {\r\n this.counters = {};\r\n }\r\n CounterState.prototype.getCounterValue = function (name) {\r\n var counter = this.counters[name];\r\n if (counter && counter.length) {\r\n return counter[counter.length - 1];\r\n }\r\n return 1;\r\n };\r\n CounterState.prototype.getCounterValues = function (name) {\r\n var counter = this.counters[name];\r\n return counter ? counter : [];\r\n };\r\n CounterState.prototype.pop = function (counters) {\r\n var _this = this;\r\n counters.forEach(function (counter) { return _this.counters[counter].pop(); });\r\n };\r\n CounterState.prototype.parse = function (style) {\r\n var _this = this;\r\n var counterIncrement = style.counterIncrement;\r\n var counterReset = style.counterReset;\r\n var canReset = true;\r\n if (counterIncrement !== null) {\r\n counterIncrement.forEach(function (entry) {\r\n var counter = _this.counters[entry.counter];\r\n if (counter && entry.increment !== 0) {\r\n canReset = false;\r\n counter[Math.max(0, counter.length - 1)] += entry.increment;\r\n }\r\n });\r\n }\r\n var counterNames = [];\r\n if (canReset) {\r\n counterReset.forEach(function (entry) {\r\n var counter = _this.counters[entry.counter];\r\n counterNames.push(entry.counter);\r\n if (!counter) {\r\n counter = _this.counters[entry.counter] = [];\r\n }\r\n counter.push(entry.reset);\r\n });\r\n }\r\n return counterNames;\r\n };\r\n return CounterState;\r\n }());\r\n var ROMAN_UPPER = {\r\n integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],\r\n values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']\r\n };\r\n var ARMENIAN = {\r\n integers: [\r\n 9000,\r\n 8000,\r\n 7000,\r\n 6000,\r\n 5000,\r\n 4000,\r\n 3000,\r\n 2000,\r\n 1000,\r\n 900,\r\n 800,\r\n 700,\r\n 600,\r\n 500,\r\n 400,\r\n 300,\r\n 200,\r\n 100,\r\n 90,\r\n 80,\r\n 70,\r\n 60,\r\n 50,\r\n 40,\r\n 30,\r\n 20,\r\n 10,\r\n 9,\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n 1\r\n ],\r\n values: [\r\n 'Ք',\r\n 'Փ',\r\n 'Ւ',\r\n 'Ց',\r\n 'Ր',\r\n 'Տ',\r\n 'Վ',\r\n 'Ս',\r\n 'Ռ',\r\n 'Ջ',\r\n 'Պ',\r\n 'Չ',\r\n 'Ո',\r\n 'Շ',\r\n 'Ն',\r\n 'Յ',\r\n 'Մ',\r\n 'Ճ',\r\n 'Ղ',\r\n 'Ձ',\r\n 'Հ',\r\n 'Կ',\r\n 'Ծ',\r\n 'Խ',\r\n 'Լ',\r\n 'Ի',\r\n 'Ժ',\r\n 'Թ',\r\n 'Ը',\r\n 'Է',\r\n 'Զ',\r\n 'Ե',\r\n 'Դ',\r\n 'Գ',\r\n 'Բ',\r\n 'Ա'\r\n ]\r\n };\r\n var HEBREW = {\r\n integers: [\r\n 10000,\r\n 9000,\r\n 8000,\r\n 7000,\r\n 6000,\r\n 5000,\r\n 4000,\r\n 3000,\r\n 2000,\r\n 1000,\r\n 400,\r\n 300,\r\n 200,\r\n 100,\r\n 90,\r\n 80,\r\n 70,\r\n 60,\r\n 50,\r\n 40,\r\n 30,\r\n 20,\r\n 19,\r\n 18,\r\n 17,\r\n 16,\r\n 15,\r\n 10,\r\n 9,\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n 1\r\n ],\r\n values: [\r\n 'י׳',\r\n 'ט׳',\r\n 'ח׳',\r\n 'ז׳',\r\n 'ו׳',\r\n 'ה׳',\r\n 'ד׳',\r\n 'ג׳',\r\n 'ב׳',\r\n 'א׳',\r\n 'ת',\r\n 'ש',\r\n 'ר',\r\n 'ק',\r\n 'צ',\r\n 'פ',\r\n 'ע',\r\n 'ס',\r\n 'נ',\r\n 'מ',\r\n 'ל',\r\n 'כ',\r\n 'יט',\r\n 'יח',\r\n 'יז',\r\n 'טז',\r\n 'טו',\r\n 'י',\r\n 'ט',\r\n 'ח',\r\n 'ז',\r\n 'ו',\r\n 'ה',\r\n 'ד',\r\n 'ג',\r\n 'ב',\r\n 'א'\r\n ]\r\n };\r\n var GEORGIAN = {\r\n integers: [\r\n 10000,\r\n 9000,\r\n 8000,\r\n 7000,\r\n 6000,\r\n 5000,\r\n 4000,\r\n 3000,\r\n 2000,\r\n 1000,\r\n 900,\r\n 800,\r\n 700,\r\n 600,\r\n 500,\r\n 400,\r\n 300,\r\n 200,\r\n 100,\r\n 90,\r\n 80,\r\n 70,\r\n 60,\r\n 50,\r\n 40,\r\n 30,\r\n 20,\r\n 10,\r\n 9,\r\n 8,\r\n 7,\r\n 6,\r\n 5,\r\n 4,\r\n 3,\r\n 2,\r\n 1\r\n ],\r\n values: [\r\n 'ჵ',\r\n 'ჰ',\r\n 'ჯ',\r\n 'ჴ',\r\n 'ხ',\r\n 'ჭ',\r\n 'წ',\r\n 'ძ',\r\n 'ც',\r\n 'ჩ',\r\n 'შ',\r\n 'ყ',\r\n 'ღ',\r\n 'ქ',\r\n 'ფ',\r\n 'ჳ',\r\n 'ტ',\r\n 'ს',\r\n 'რ',\r\n 'ჟ',\r\n 'პ',\r\n 'ო',\r\n 'ჲ',\r\n 'ნ',\r\n 'მ',\r\n 'ლ',\r\n 'კ',\r\n 'ი',\r\n 'თ',\r\n 'ჱ',\r\n 'ზ',\r\n 'ვ',\r\n 'ე',\r\n 'დ',\r\n 'გ',\r\n 'ბ',\r\n 'ა'\r\n ]\r\n };\r\n var createAdditiveCounter = function (value, min, max, symbols, fallback, suffix) {\r\n if (value < min || value > max) {\r\n return createCounterText(value, fallback, suffix.length > 0);\r\n }\r\n return (symbols.integers.reduce(function (string, integer, index) {\r\n while (value >= integer) {\r\n value -= integer;\r\n string += symbols.values[index];\r\n }\r\n return string;\r\n }, '') + suffix);\r\n };\r\n var createCounterStyleWithSymbolResolver = function (value, codePointRangeLength, isNumeric, resolver) {\r\n var string = '';\r\n do {\r\n if (!isNumeric) {\r\n value--;\r\n }\r\n string = resolver(value) + string;\r\n value /= codePointRangeLength;\r\n } while (value * codePointRangeLength >= codePointRangeLength);\r\n return string;\r\n };\r\n var createCounterStyleFromRange = function (value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {\r\n var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;\r\n return ((value < 0 ? '-' : '') +\r\n (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) {\r\n return fromCodePoint(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);\r\n }) +\r\n suffix));\r\n };\r\n var createCounterStyleFromSymbols = function (value, symbols, suffix) {\r\n if (suffix === void 0) { suffix = '. '; }\r\n var codePointRangeLength = symbols.length;\r\n return (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) { return symbols[Math.floor(codePoint % codePointRangeLength)]; }) + suffix);\r\n };\r\n var CJK_ZEROS = 1 << 0;\r\n var CJK_TEN_COEFFICIENTS = 1 << 1;\r\n var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;\r\n var CJK_HUNDRED_COEFFICIENTS = 1 << 3;\r\n var createCJKCounter = function (value, numbers, multipliers, negativeSign, suffix, flags) {\r\n if (value < -9999 || value > 9999) {\r\n return createCounterText(value, LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);\r\n }\r\n var tmp = Math.abs(value);\r\n var string = suffix;\r\n if (tmp === 0) {\r\n return numbers[0] + string;\r\n }\r\n for (var digit = 0; tmp > 0 && digit <= 4; digit++) {\r\n var coefficient = tmp % 10;\r\n if (coefficient === 0 && contains(flags, CJK_ZEROS) && string !== '') {\r\n string = numbers[coefficient] + string;\r\n }\r\n else if (coefficient > 1 ||\r\n (coefficient === 1 && digit === 0) ||\r\n (coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS)) ||\r\n (coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100) ||\r\n (coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS))) {\r\n string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;\r\n }\r\n else if (coefficient === 1 && digit > 0) {\r\n string = multipliers[digit - 1] + string;\r\n }\r\n tmp = Math.floor(tmp / 10);\r\n }\r\n return (value < 0 ? negativeSign : '') + string;\r\n };\r\n var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';\r\n var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';\r\n var JAPANESE_NEGATIVE = 'マイナス';\r\n var KOREAN_NEGATIVE = '마이너스';\r\n var createCounterText = function (value, type, appendSuffix) {\r\n var defaultSuffix = appendSuffix ? '. ' : '';\r\n var cjkSuffix = appendSuffix ? '、' : '';\r\n var koreanSuffix = appendSuffix ? ', ' : '';\r\n var spaceSuffix = appendSuffix ? ' ' : '';\r\n switch (type) {\r\n case LIST_STYLE_TYPE.DISC:\r\n return '•' + spaceSuffix;\r\n case LIST_STYLE_TYPE.CIRCLE:\r\n return '◦' + spaceSuffix;\r\n case LIST_STYLE_TYPE.SQUARE:\r\n return '◾' + spaceSuffix;\r\n case LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:\r\n var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);\r\n return string.length < 4 ? \"0\" + string : string;\r\n case LIST_STYLE_TYPE.CJK_DECIMAL:\r\n return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);\r\n case LIST_STYLE_TYPE.LOWER_ROMAN:\r\n return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();\r\n case LIST_STYLE_TYPE.UPPER_ROMAN:\r\n return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\r\n case LIST_STYLE_TYPE.LOWER_GREEK:\r\n return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);\r\n case LIST_STYLE_TYPE.LOWER_ALPHA:\r\n return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);\r\n case LIST_STYLE_TYPE.UPPER_ALPHA:\r\n return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);\r\n case LIST_STYLE_TYPE.ARABIC_INDIC:\r\n return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.ARMENIAN:\r\n case LIST_STYLE_TYPE.UPPER_ARMENIAN:\r\n return createAdditiveCounter(value, 1, 9999, ARMENIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\r\n case LIST_STYLE_TYPE.LOWER_ARMENIAN:\r\n return createAdditiveCounter(value, 1, 9999, ARMENIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();\r\n case LIST_STYLE_TYPE.BENGALI:\r\n return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.CAMBODIAN:\r\n case LIST_STYLE_TYPE.KHMER:\r\n return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:\r\n return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);\r\n case LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:\r\n return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);\r\n case LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:\r\n case LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:\r\n return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);\r\n case LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:\r\n return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);\r\n case LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:\r\n return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);\r\n case LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:\r\n return createCJKCounter(value, '零壹贰叁肆伍陆柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);\r\n case LIST_STYLE_TYPE.JAPANESE_INFORMAL:\r\n return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);\r\n case LIST_STYLE_TYPE.JAPANESE_FORMAL:\r\n return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);\r\n case LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:\r\n return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);\r\n case LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:\r\n return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);\r\n case LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:\r\n return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);\r\n case LIST_STYLE_TYPE.DEVANAGARI:\r\n return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.GEORGIAN:\r\n return createAdditiveCounter(value, 1, 19999, GEORGIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\r\n case LIST_STYLE_TYPE.GUJARATI:\r\n return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.GURMUKHI:\r\n return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.HEBREW:\r\n return createAdditiveCounter(value, 1, 10999, HEBREW, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);\r\n case LIST_STYLE_TYPE.HIRAGANA:\r\n return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');\r\n case LIST_STYLE_TYPE.HIRAGANA_IROHA:\r\n return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす');\r\n case LIST_STYLE_TYPE.KANNADA:\r\n return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.KATAKANA:\r\n return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix);\r\n case LIST_STYLE_TYPE.KATAKANA_IROHA:\r\n return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix);\r\n case LIST_STYLE_TYPE.LAO:\r\n return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.MONGOLIAN:\r\n return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.MYANMAR:\r\n return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.ORIYA:\r\n return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.PERSIAN:\r\n return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.TAMIL:\r\n return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.TELUGU:\r\n return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.THAI:\r\n return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.TIBETAN:\r\n return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);\r\n case LIST_STYLE_TYPE.DECIMAL:\r\n default:\r\n return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);\r\n }\r\n };\n\n var IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';\r\n var DocumentCloner = /** @class */ (function () {\r\n function DocumentCloner(element, options) {\r\n this.options = options;\r\n this.scrolledElements = [];\r\n this.referenceElement = element;\r\n this.counters = new CounterState();\r\n this.quoteDepth = 0;\r\n if (!element.ownerDocument) {\r\n throw new Error('Cloned element does not have an owner document');\r\n }\r\n this.documentElement = this.cloneNode(element.ownerDocument.documentElement);\r\n }\r\n DocumentCloner.prototype.toIFrame = function (ownerDocument, windowSize) {\r\n var _this = this;\r\n var iframe = createIFrameContainer(ownerDocument, windowSize);\r\n if (!iframe.contentWindow) {\r\n return Promise.reject(\"Unable to find iframe window\");\r\n }\r\n var scrollX = ownerDocument.defaultView.pageXOffset;\r\n var scrollY = ownerDocument.defaultView.pageYOffset;\r\n var cloneWindow = iframe.contentWindow;\r\n var documentClone = cloneWindow.document;\r\n /* Chrome doesn't detect relative background-images assigned in inline ',i=ie.open();if(null!==i&&i.document.write(r),i||\"undefined\"==typeof safari)return i;case\"datauri\":case\"dataurl\":return ie.document.location.href=\"data:application/pdf;filename=\"+e.filename+\";base64,\"+btoa(n);default:return null}}).foo=function(){try{return F.apply(this,arguments)}catch(t){var e=t.stack||\"\";~e.indexOf(\" at \")&&(e=e.split(\" at \")[1]);var n=\"Error in function \"+e.split(\"\\n\")[0].split(\"<\")[0]+\": \"+t.message;if(!ie.console)throw new Error(n);ie.console.error(n,t),ie.alert&&alert(n)}},(F.foo.bar=F).foo),Bt=function(t){return!0===Array.isArray(Y)&&-1\":\")\"),Y=1):(W=Wt(e),V=Vt(n),G=(l?\"<\":\"(\")+v[H]+(l?\">\":\")\")),void 0!==q&&void 0!==q[H]&&(J=q[H]+\" Tw\\n\"),0!==S.length&&0===H?t.push(J+S.join(\" \")+\" \"+W.toFixed(2)+\" \"+V.toFixed(2)+\" Tm\\n\"+G):1===Y||0===Y&&0===H?t.push(J+W.toFixed(2)+\" \"+V.toFixed(2)+\" Td\\n\"+G):t.push(J+G);t=0===Y?t.join(\" Tj\\nT* \"):t.join(\" Tj\\n\"),t+=\" Tj\\n\";var X=\"BT\\n/\"+$+\" \"+et+\" Tf\\n\"+(et*u).toFixed(2)+\" TL\\n\"+Kt+\"\\n\";return X+=h,X+=t,tt(X+=\"ET\"),K[$]=!0,c},l.__private__.lstext=l.lstext=function(t,e,n,r){return console.warn(\"jsPDF.lstext is deprecated\"),this.text(t,e,n,{charSpace:r})},l.__private__.clip=l.clip=function(t){tt(\"evenodd\"===t?\"W*\":\"W\"),tt(\"n\")},l.__private__.clip_fixed=l.clip_fixed=function(t){console.log(\"clip_fixed is deprecated\"),l.clip(t)};var Ot=l.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,\"S\",\"F\",\"DF\",\"FD\",\"f\",\"f*\",\"B\",\"B*\"].indexOf(t)&&(e=!0),e},qt=l.__private__.getStyle=function(t){var e=\"S\";return\"F\"===t?e=\"f\":\"FD\"===t||\"DF\"===t?e=\"B\":\"f\"!==t&&\"f*\"!==t&&\"B\"!==t&&\"B*\"!==t||(e=t),e};l.__private__.line=l.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error(\"Invalid arguments passed to jsPDF.line\");return this.lines([[n-t,r-e]],t,e)},l.__private__.lines=l.lines=function(t,e,n,r,i,o){var a,s,l,h,u,c,f,p,d,g,m,y;if(\"number\"==typeof t&&(y=n,n=e,e=t,t=y),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Ot(i)||\"boolean\"!=typeof o)throw new Error(\"Invalid arguments passed to jsPDF.lines\");for(tt(Q(Wt(e))+\" \"+Q(Vt(n))+\" m \"),a=r[0],s=r[1],h=t.length,g=e,m=n,l=0;l=o.length-1;if(b&&!x){m+=\" \";continue}if(b||x){if(x)d=w;else if(i.multiline&&a<(h+2)*(y+2)+2)continue t}else{if(!i.multiline)continue t;if(a<(h+2)*(y+2)+2)continue t;d=w}for(var N=\"\",L=p;L<=d;L++)N+=o[L]+\" \";switch(N=\" \"==N.substr(N.length-1)?N.substr(0,N.length-1):N,g=F(N,i,r).width,i.textAlign){case\"right\":c=s-g-2;break;case\"center\":c=(s-g)/2;break;case\"left\":default:c=2}t+=_(c)+\" \"+_(f)+\" Td\\n\",t+=\"(\"+S(N)+\") Tj\\n\",t+=-_(c)+\" 0 Td\\n\",f=-(r+2),g=0,p=d+1,y++,m=\"\"}else;break}return n.text=t,n.fontSize=r,n},F=function(t,e,n){var r=A.internal.getFont(e.fontName,e.fontStyle),i=A.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:A.getStringUnitWidth(\"3\",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},u={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){A.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=A.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&d.call(A,n)}},d=function(t){var e={type:\"reference\",object:t};void 0===A.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&A.internal.getPageInfo(t.page).pageContext.annotations.push(e)},g=function(){if(void 0===A.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error(\"putCatalogCallback: Root missing.\");A.internal.write(\"/AcroForm \"+A.internal.acroformPlugin.acroFormDictionaryRoot.objId+\" 0 R\")},m=function(){A.internal.events.unsubscribe(A.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete A.internal.acroformPlugin.acroFormDictionaryRoot._eventID,A.internal.acroformPlugin.printedOut=!0},L=function(t){var e=!t;t||(A.internal.newObjectDeferredBegin(A.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),A.internal.acroformPlugin.acroFormDictionaryRoot.putStream());t=t||A.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=[],o=r.Rect;if(r.Rect&&(r.Rect=c.call(this,r.Rect)),A.internal.newObjectDeferredBegin(r.objId,!0),r.DA=Y.createDefaultAppearanceStream(r),\"object\"===se(r)&&\"function\"==typeof r.getKeyValueListForStream&&(i=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=f.call(this,r);i.push({key:\"AP\",value:\"<>\"}),A.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var s=\"\";for(var l in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(l)){var h=r.appearanceStreamContent[l];if(s+=\"/\"+l+\" \",s+=\"<<\",1<=Object.keys(h).length||Array.isArray(h))for(var n in h){var u;if(h.hasOwnProperty(n))\"function\"==typeof(u=h[n])&&(u=u.call(this,r)),s+=\"/\"+n+\" \"+u+\" \",0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u)}else\"function\"==typeof(u=h)&&(u=u.call(this,r)),s+=\"/\"+n+\" \"+u,0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u);s+=\">>\"}i.push({key:\"AP\",value:\"<<\\n\"+s+\">>\"})}A.internal.putStream({additionalKeyValues:i}),A.internal.out(\"endobj\")}e&&P.call(this,A.internal.acroformPlugin.xForms)},P=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];A.internal.newObjectDeferredBegin(r&&r.objId,!0),\"object\"===se(r)&&\"function\"==typeof r.putStream&&r.putStream(),delete t[n]}},k=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(A=this,M.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(u)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error(\"Exception while creating AcroformDictionary\");n=A.internal.scaleFactor,A.internal.acroformPlugin.acroFormDictionaryRoot=new E,A.internal.acroformPlugin.acroFormDictionaryRoot._eventID=A.internal.events.subscribe(\"postPutResources\",m),A.internal.events.subscribe(\"buildDocument\",p),A.internal.events.subscribe(\"putCatalog\",g),A.internal.events.subscribe(\"postPutPages\",L),A.internal.acroformPlugin.isInitialized=!0}},I=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e=\"[\",n=0;n>\"),e.join(\"\\n\")}},set:function(t){\"object\"===se(t)&&(n=t)}}),Object.defineProperty(this,\"caption\",{enumerable:!0,configurable:!0,get:function(){return n.CA||\"\"},set:function(t){\"string\"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,\"AS\",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,\"appearanceState\",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e=\"/\"+t}})};r(D,M);var U=function(){D.call(this),this.pushButton=!0};r(U,D);var z=function(){D.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,\"Kids\",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};r(z,D);var H=function(){var e,n;M.call(this),Object.defineProperty(this,\"Parent\",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,\"optionName\",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var r,i={};Object.defineProperty(this,\"MK\",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push(\"<<\"),i)e.push(\"/\"+t+\" (\"+i[t]+\")\");return e.push(\">>\"),e.join(\"\\n\")},set:function(t){\"object\"===se(t)&&(i=t)}}),Object.defineProperty(this,\"caption\",{enumerable:!0,configurable:!0,get:function(){return i.CA||\"\"},set:function(t){\"string\"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,\"AS\",{enumerable:!1,configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,\"appearanceState\",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(t){r=\"/\"+t}}),this.optionName=name,this.caption=\"l\",this.appearanceState=\"Off\",this._AppearanceType=Y.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};r(H,M),z.prototype.setAppearance=function(t){if(!(\"createAppearanceStream\"in t&&\"getCA\"in t))throw new Error(\"Couldn't assign Appearance to RadioButton. Appearance was Invalid!\");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},z.prototype.createOption=function(t){this.Kids.length;var e=new H;return e.Parent=this,e.optionName=t,this.Kids.push(e),J.call(this,e),e};var W=function(){D.call(this),this.fontName=\"zapfdingbats\",this.caption=\"3\",this.appearanceState=\"On\",this.value=\"On\",this.textAlign=\"center\",this.appearanceStreamContent=Y.CheckBox.createAppearanceStream()};r(W,D);var V=function(){M.call(this),this.FT=\"/Tx\",Object.defineProperty(this,\"multiline\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,13):this.Ff=N(this.Ff,13)}}),Object.defineProperty(this,\"fileSelect\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,21):this.Ff=N(this.Ff,21)}}),Object.defineProperty(this,\"doNotSpellCheck\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=N(this.Ff,23)}}),Object.defineProperty(this,\"doNotScroll\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,24):this.Ff=N(this.Ff,24)}}),Object.defineProperty(this,\"comb\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,25):this.Ff=N(this.Ff,25)}}),Object.defineProperty(this,\"richText\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=N(this.Ff,26)}});var e=null;Object.defineProperty(this,\"MaxLen\",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,\"maxLength\",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,\"hasAppearanceStream\",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};r(V,M);var G=function(){V.call(this),Object.defineProperty(this,\"password\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,14):this.Ff=N(this.Ff,14)}}),this.password=!0};r(G,V);var Y={CheckBox:{createAppearanceStream:function(){return{N:{On:Y.CheckBox.YesNormal},D:{On:Y.CheckBox.YesPushDown,Off:Y.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=l(t),n=[],r=A.internal.getFont(t.fontName,t.fontStyle).id,i=A.__private__.encodeColorString(t.color),o=h(t,t.caption);return n.push(\"0.749023 g\"),n.push(\"0 0 \"+_(Y.internal.getWidth(t))+\" \"+_(Y.internal.getHeight(t))+\" re\"),n.push(\"f\"),n.push(\"BMC\"),n.push(\"q\"),n.push(\"0 0 1 rg\"),n.push(\"/\"+r+\" \"+_(o.fontSize)+\" Tf \"+i),n.push(\"BT\"),n.push(o.text),n.push(\"ET\"),n.push(\"Q\"),n.push(\"EMC\"),e.stream=n.join(\"\\n\"),e},YesNormal:function(t){var e=l(t),n=A.internal.getFont(t.fontName,t.fontStyle).id,r=A.__private__.encodeColorString(t.color),i=[],o=Y.internal.getHeight(t),a=Y.internal.getWidth(t),s=h(t,t.caption);return i.push(\"1 g\"),i.push(\"0 0 \"+_(a)+\" \"+_(o)+\" re\"),i.push(\"f\"),i.push(\"q\"),i.push(\"0 0 1 rg\"),i.push(\"0 0 \"+_(a-1)+\" \"+_(o-1)+\" re\"),i.push(\"W\"),i.push(\"n\"),i.push(\"0 g\"),i.push(\"BT\"),i.push(\"/\"+n+\" \"+_(s.fontSize)+\" Tf \"+r),i.push(s.text),i.push(\"ET\"),i.push(\"Q\"),e.stream=i.join(\"\\n\"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push(\"0.749023 g\"),n.push(\"0 0 \"+_(Y.internal.getWidth(t))+\" \"+_(Y.internal.getHeight(t))+\" re\"),n.push(\"f\"),e.stream=n.join(\"\\n\"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Circle.YesNormal,e.D[t]=Y.RadioButton.Circle.YesPushDown,e},getCA:function(){return\"l\"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Y.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push(\"q\"),n.push(\"1 0 0 1 \"+s(Y.internal.getWidth(t)/2)+\" \"+s(Y.internal.getHeight(t)/2)+\" cm\"),n.push(r+\" 0 m\"),n.push(r+\" \"+o+\" \"+o+\" \"+r+\" 0 \"+r+\" c\"),n.push(\"-\"+o+\" \"+r+\" -\"+r+\" \"+o+\" -\"+r+\" 0 c\"),n.push(\"-\"+r+\" -\"+o+\" -\"+o+\" -\"+r+\" 0 -\"+r+\" c\"),n.push(o+\" -\"+r+\" \"+r+\" -\"+o+\" \"+r+\" 0 c\"),n.push(\"f\"),n.push(\"Q\"),e.stream=n.join(\"\\n\"),e},YesPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5)),a=Number((r*Y.internal.Bezier_C).toFixed(5));return n.push(\"0.749023 g\"),n.push(\"q\"),n.push(\"1 0 0 1 \"+s(Y.internal.getWidth(t)/2)+\" \"+s(Y.internal.getHeight(t)/2)+\" cm\"),n.push(i+\" 0 m\"),n.push(i+\" \"+o+\" \"+o+\" \"+i+\" 0 \"+i+\" c\"),n.push(\"-\"+o+\" \"+i+\" -\"+i+\" \"+o+\" -\"+i+\" 0 c\"),n.push(\"-\"+i+\" -\"+o+\" -\"+o+\" -\"+i+\" 0 -\"+i+\" c\"),n.push(o+\" -\"+i+\" \"+i+\" -\"+o+\" \"+i+\" 0 c\"),n.push(\"f\"),n.push(\"Q\"),n.push(\"0 g\"),n.push(\"q\"),n.push(\"1 0 0 1 \"+s(Y.internal.getWidth(t)/2)+\" \"+s(Y.internal.getHeight(t)/2)+\" cm\"),n.push(r+\" 0 m\"),n.push(r+\" \"+a+\" \"+a+\" \"+r+\" 0 \"+r+\" c\"),n.push(\"-\"+a+\" \"+r+\" -\"+r+\" \"+a+\" -\"+r+\" 0 c\"),n.push(\"-\"+r+\" -\"+a+\" -\"+a+\" -\"+r+\" 0 -\"+r+\" c\"),n.push(a+\" -\"+r+\" \"+r+\" -\"+a+\" \"+r+\" 0 c\"),n.push(\"f\"),n.push(\"Q\"),e.stream=n.join(\"\\n\"),e},OffPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5));return n.push(\"0.749023 g\"),n.push(\"q\"),n.push(\"1 0 0 1 \"+s(Y.internal.getWidth(t)/2)+\" \"+s(Y.internal.getHeight(t)/2)+\" cm\"),n.push(i+\" 0 m\"),n.push(i+\" \"+o+\" \"+o+\" \"+i+\" 0 \"+i+\" c\"),n.push(\"-\"+o+\" \"+i+\" -\"+i+\" \"+o+\" -\"+i+\" 0 c\"),n.push(\"-\"+i+\" -\"+o+\" -\"+o+\" -\"+i+\" 0 -\"+i+\" c\"),n.push(o+\" -\"+i+\" \"+i+\" -\"+o+\" \"+i+\" 0 c\"),n.push(\"f\"),n.push(\"Q\"),e.stream=n.join(\"\\n\"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Cross.YesNormal,e.D[t]=Y.RadioButton.Cross.YesPushDown,e},getCA:function(){return\"8\"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.calculateCross(t);return n.push(\"q\"),n.push(\"1 1 \"+_(Y.internal.getWidth(t)-2)+\" \"+_(Y.internal.getHeight(t)-2)+\" re\"),n.push(\"W\"),n.push(\"n\"),n.push(_(r.x1.x)+\" \"+_(r.x1.y)+\" m\"),n.push(_(r.x2.x)+\" \"+_(r.x2.y)+\" l\"),n.push(_(r.x4.x)+\" \"+_(r.x4.y)+\" m\"),n.push(_(r.x3.x)+\" \"+_(r.x3.y)+\" l\"),n.push(\"s\"),n.push(\"Q\"),e.stream=n.join(\"\\n\"),e},YesPushDown:function(t){var e=l(t),n=Y.internal.calculateCross(t),r=[];return r.push(\"0.749023 g\"),r.push(\"0 0 \"+_(Y.internal.getWidth(t))+\" \"+_(Y.internal.getHeight(t))+\" re\"),r.push(\"f\"),r.push(\"q\"),r.push(\"1 1 \"+_(Y.internal.getWidth(t)-2)+\" \"+_(Y.internal.getHeight(t)-2)+\" re\"),r.push(\"W\"),r.push(\"n\"),r.push(_(n.x1.x)+\" \"+_(n.x1.y)+\" m\"),r.push(_(n.x2.x)+\" \"+_(n.x2.y)+\" l\"),r.push(_(n.x4.x)+\" \"+_(n.x4.y)+\" m\"),r.push(_(n.x3.x)+\" \"+_(n.x3.y)+\" l\"),r.push(\"s\"),r.push(\"Q\"),e.stream=r.join(\"\\n\"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push(\"0.749023 g\"),n.push(\"0 0 \"+_(Y.internal.getWidth(t))+\" \"+_(Y.internal.getHeight(t))+\" re\"),n.push(\"f\"),e.stream=n.join(\"\\n\"),e}}},createDefaultAppearanceStream:function(t){var e=A.internal.getFont(t.fontName,t.fontStyle).id,n=A.__private__.encodeColorString(t.color);return\"/\"+e+\" \"+t.fontSize+\" Tf \"+n}};Y.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Y.internal.getWidth(t),n=Y.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},Y.internal.getWidth=function(t){var e=0;return\"object\"===se(t)&&(e=v(t.Rect[2])),e},Y.internal.getHeight=function(t){var e=0;return\"object\"===se(t)&&(e=v(t.Rect[3])),e};var J=t.addField=function(t){if(k.call(this),!(t instanceof M))throw new Error(\"Invalid argument passed to jsPDF.addField.\");return function(t){A.internal.acroformPlugin.printedOut&&(A.internal.acroformPlugin.printedOut=!1,A.internal.acroformPlugin.acroFormDictionaryRoot=null),A.internal.acroformPlugin.acroFormDictionaryRoot||k.call(A),A.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=A.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof D==!1)throw new Error(\"Invalid argument passed to jsPDF.addButton.\");return J.call(this,t)},t.addTextField=function(t){if(t instanceof V==!1)throw new Error(\"Invalid argument passed to jsPDF.addTextField.\");return J.call(this,t)},t.addChoiceField=function(t){if(t instanceof O==!1)throw new Error(\"Invalid argument passed to jsPDF.addChoiceField.\");return J.call(this,t)};\"object\"==se(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=O,e.ListBox=q,e.ComboBox=T,e.EditBox=R,e.Button=D,e.PushButton=U,e.RadioButton=z,e.CheckBox=W,e.TextField=V,e.PasswordField=G,e.AcroForm={Appearance:Y}):console.warn(\"AcroForm-Classes are not populated into global-namespace, because the class-Names exist already.\"),t.AcroFormChoiceField=O,t.AcroFormListBox=q,t.AcroFormComboBox=T,t.AcroFormEditBox=R,t.AcroFormButton=D,t.AcroFormPushButton=U,t.AcroFormRadioButton=z,t.AcroFormCheckBox=W,t.AcroFormTextField=V,t.AcroFormPasswordField=G,t.AcroFormAppearance=Y,t.AcroForm={ChoiceField:O,ListBox:q,ComboBox:T,EditBox:R,Button:D,PushButton:U,RadioButton:z,CheckBox:W,TextField:V,PasswordField:G,Appearance:Y}})((window.tmp=lt).API,\"undefined\"!=typeof window&&window||\"undefined\"!=typeof global&&global),\n/** @license\n * jsPDF addImage plugin\n * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/\n * 2013 Chris Dowling, https://github.com/gingerchris\n * 2013 Trinh Ho, https://github.com/ineedfat\n * 2013 Edwin Alejandro Perez, https://github.com/eaparango\n * 2013 Norah Smith, https://github.com/burnburnrocket\n * 2014 Diego Casorran, https://github.com/diegocr\n * 2014 James Robb, https://github.com/jamesbrobb\n *\n * \n */\nfunction(x){var N=\"addImage_\",l={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},h=x.getImageFileTypeByImageData=function(t,e){var n,r;e=e||\"UNKNOWN\";var i,o,a,s=\"UNKNOWN\";for(a in x.isArrayBufferView(t)&&(t=x.arrayBufferToBinaryString(t)),l)for(i=l[a],n=0;n>\"}),\"trns\"in e&&e.trns.constructor==Array){for(var s=\"\",l=0,h=e.trns.length;l>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+\"==\":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+\"=\"),n},x.createImageInfo=function(t,e,n,r,i,o,a,s,l,h,u,c,f){var p={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(p.f=o),l&&(p.dp=l),h&&(p.trns=h),u&&(p.pal=u),c&&(p.smask=c),f&&(p.p=f),p},x.addImage=function(t,e,n,r,i,o,a,s,l){var h=\"\";if(\"string\"!=typeof e){var u=o;o=i,i=r,r=n,n=e,e=u}if(\"object\"===se(t)&&!_(t)&&\"imageData\"in t){var c=t;t=c.imageData,e=c.format||e||\"UNKNOWN\",n=c.x||n||0,r=c.y||r||0,i=c.w||i,o=c.h||o,a=c.alias||a,s=c.compression||s,l=c.rotation||c.angle||l}var f=this.internal.getFilters();if(void 0===s&&-1!==f.indexOf(\"FlateEncode\")&&(s=\"SLOW\"),\"string\"==typeof t&&(t=unescape(t)),isNaN(n)||isNaN(r))throw console.error(\"jsPDF.addImage: Invalid coordinates\",arguments),new Error(\"Invalid coordinates passed to jsPDF.addImage\");var p,d,g,m,y,v,w,b=function(){var t=this.internal.collections[N+\"images\"];return t||(this.internal.collections[N+\"images\"]=t={},this.internal.events.subscribe(\"putResources\",L),this.internal.events.subscribe(\"putXobjectDict\",A)),t}.call(this);if(!((p=P(t,b))||(_(t)&&(t=F(t,e)),(null==(w=a)||0===w.length)&&(a=\"string\"==typeof(v=t)?x.sHashCode(v):x.isArrayBufferView(v)?x.sHashCode(x.arrayBufferToBinaryString(v)):null),p=P(a,b)))){if(this.isString(t)&&(\"\"!==(h=this.convertStringToImageData(t))?t=h:void 0!==(h=x.loadFile(t))&&(t=h)),e=this.getImageFileTypeByImageData(t,e),!S(e))throw new Error(\"addImage does not support files of type '\"+e+\"', please ensure that a plugin for '\"+e+\"' support is added.\");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t,t=this.binaryStringToUint8Array(t))),!(p=this[\"process\"+e.toUpperCase()](t,(y=0,(m=b)&&(y=Object.keys?Object.keys(m).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(m)),y),a,((g=s)&&\"string\"==typeof g&&(g=g.toUpperCase()),g in x.image_compression?g:x.image_compression.NONE),d)))throw new Error(\"An unknown error occurred whilst processing the image\")}return function(t,e,n,r,i,o,a,s){var l=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),h=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;if(n=l[0],r=l[1],a[o]=i,s){s*=Math.PI/180;var c=Math.cos(s),f=Math.sin(s),p=function(t){return t.toFixed(4)},d=[p(c),p(f),p(-1*f),p(c),0,0,\"cm\"]}this.internal.write(\"q\"),s?(this.internal.write([1,\"0\",\"0\",1,h(t),u(e+r),\"cm\"].join(\" \")),this.internal.write(d.join(\" \")),this.internal.write([h(n),\"0\",\"0\",h(r),\"0\",\"0\",\"cm\"].join(\" \"))):this.internal.write([h(n),\"0\",\"0\",h(r),h(t),u(e+r),\"cm\"].join(\" \")),this.internal.write(\"/I\"+i.i+\" Do\"),this.internal.write(\"Q\")}.call(this,n,r,i,o,p,p.i,b,l),this},x.convertStringToImageData=function(t){var e,n=\"\";if(this.isString(t)){var r;e=null!==(r=this.extractImageFromDataUrl(t))?r.data:t;try{n=atob(e)}catch(t){throw x.validateStringAsBase64(e)?new Error(\"atob-Error in jsPDF.convertStringToImageData \"+t.message):new Error(\"Supplied Data is not a valid base64-String jsPDF.convertStringToImageData \")}}return n};var u=function(t,e){return t.subarray(e,e+5)};x.processJPEG=function(t,e,n,r,i,o){var a,s=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if(\"JPEG\"!==h(t))throw new Error(\"getJpegSize requires a binary string jpeg file\");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r>\",h.content=m;var f=h.objId+\" 0 R\";m=\"<>\",u.content=m,this.internal.write(h.objId,\"0 R\",u.objId,\"0 R\");break;case\"freetext\":var p=\"/Rect [\"+a(l.bounds.x)+\" \"+s(l.bounds.y)+\" \"+a(l.bounds.x+l.bounds.w)+\" \"+s(l.bounds.y+l.bounds.h)+\"] \",d=l.color||\"#000000\";m=\"<>\",this.internal.write(m);break;case\"link\":if(l.options.name){var g=this.annotations._nameMap[l.options.name];l.options.pageNumber=g.page,l.options.top=g.y}else l.options.top||(l.options.top=0);p=\"/Rect [\"+a(l.x)+\" \"+s(l.y)+\" \"+a(l.x+l.w)+\" \"+s(l.y+l.h)+\"] \";var m=\"\";if(l.options.url)m=\"<>\";else if(l.options.pageNumber)switch(m=\"<>\",this.internal.write(m))}}this.internal.write(\"]\")}}]),t.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case\"link\":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case\"text\":case\"freetext\":e.pageContext.annotations.push(t)}},t.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:\"link\"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},\n/**\n * @license\n * Copyright (c) 2017 Aras Abbasi \n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\nfunction(t){var h={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},a={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];t.__arabicParser__={};var r=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==h[t.charCodeAt(0)]},u=t.__arabicParser__.isArabicLetter=function(t){return\"string\"==typeof t&&/^[\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\\uFB50-\\uFDFF\\uFE70-\\uFEFF]+$/.test(t)},i=t.__arabicParser__.isArabicEndLetter=function(t){return u(t)&&r(t)&&h[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return u(t)&&0<=n.indexOf(t.charCodeAt(0))},s=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return u(t)&&r(t)&&1<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return u(t)&&r(t)&&2<=h[t.charCodeAt(0)].length}),l=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return u(t)&&r(t)&&3<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return u(t)&&r(t)&&4==h[t.charCodeAt(0)].length}),c=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=a,r=0,i=\"\",o=0;for(e=0;e>\"),this.internal.out(\"endobj\")}),this.internal.events.subscribe(\"putCatalog\",function(){this.internal.out(\"/OpenAction \"+e+\" 0 R\")})}return this},\n/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\ne=lt.API,(n=function(){var e=void 0;Object.defineProperty(this,\"pdf\",{get:function(){return e},set:function(t){e=t}});var n=150;Object.defineProperty(this,\"width\",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext(\"2d\").pageWrapXEnabled&&(this.getContext(\"2d\").pageWrapX=n+1)}});var r=300;Object.defineProperty(this,\"height\",{get:function(){return r},set:function(t){r=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext(\"2d\").pageWrapYEnabled&&(this.getContext(\"2d\").pageWrapY=r+1)}});var i=[];Object.defineProperty(this,\"childNodes\",{get:function(){return i},set:function(t){i=t}});var o={};Object.defineProperty(this,\"style\",{get:function(){return o},set:function(t){o=t}}),Object.defineProperty(this,\"parentNode\",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if(\"2d\"!==(t=t||\"2d\"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},n.prototype.toDataURL=function(){throw new Error(\"toDataURL is not implemented.\")},e.events.push([\"initialized\",function(){this.canvas=new n,this.canvas.pdf=this}]),\n/** \n * @license\n * ====================================================================\n * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com\n * 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br\n * 2013 Lee Driscoll, https://github.com/lsdriscoll\n * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria\n * 2014 James Hall, james@parall.ax\n * 2014 Diego Casorran, https://github.com/diegocr\n *\n * \n * ====================================================================\n */\n_=lt.API,F={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1,p=function(t,e,n,r,i){F={x:t,y:e,w:n,h:r,ln:i}},d=function(){return F},k={left:0,top:0,bottom:0},_.setHeaderFunction=function(t){l=t},_.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,a=0;if(\"string\"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if(\"[object Array]\"!==Object.prototype.toString.call(t))throw new Error(\"getTextDimensions expects text-parameter to be of type String or an Array of Strings.\");for(var s=0;s=this.internal.pageSize.getHeight()-h.bottom&&(this.cellAddPage(),l=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,l&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,\"FD\"):this.rect(t,e,n,r),\"right\"===a){i instanceof Array||(i=[i]);for(var u=0;u=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:\"arc\",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},n.prototype.arcTo=function(t,e,n,r,i){throw new Error(\"arcTo not implemented.\")},n.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error(\"jsPDF.context2d.rect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.rect\");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},n.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error(\"jsPDF.context2d.fillRect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.fillRect\");if(!N.call(this)){var i={};\"butt\"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap=\"butt\"),\"miter\"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin=\"miter\"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty(\"lineCap\")&&(this.lineCap=i.lineCap),i.hasOwnProperty(\"lineJoin\")&&(this.lineJoin=i.lineJoin)}},n.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error(\"jsPDF.context2d.strokeRect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.strokeRect\");L.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},n.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error(\"jsPDF.context2d.clearRect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.clearRect\");this.ignoreClearRect||(this.fillStyle=\"#ffffff\",this.fillRect(t,e,n,r))},n.prototype.save=function(t){t=\"boolean\"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n\"},s=function(t){var r,e,n,i,o,a=String,s=\"length\",l=\"charCodeAt\",h=\"slice\",u=\"replace\";for(t[h](-2),t=t[h](0,-2)[u](/\\s/g,\"\")[u](\"z\",\"!!!!!\"),n=[],i=0,o=(t+=r=\"uuuuu\"[h](t[s]%5||5))[s];i>24,255&e>>16,255&e>>8,255&e);return function(t,e){for(var n=r[s];0\"},u=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\\s/g,\"\")).indexOf(\">\")&&(t=t.substr(0,t.indexOf(\">\"))),t.length%2&&(t+=\"0\"),!1===e.test(t))return\"\";for(var n=\"\",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),t=String.fromCharCode.apply(null,i)},a.processDataByFilters=function(t,e){var n=0,r=t||\"\",i=[];for(\"string\"==typeof(e=e||[])&&(e=[e]),n=0;n>\"),this.internal.out(\"endobj\"),w=this.internal.newObject(),this.internal.out(\"<<\"),this.internal.out(\"/S /JavaScript\"),this.internal.out(\"/JS (\"+b+\")\"),this.internal.out(\">>\"),this.internal.out(\"endobj\")}),this.internal.events.subscribe(\"putCatalog\",function(){void 0!==v&&void 0!==w&&this.internal.out(\"/Names <>\")}),this},(\n/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\nx=lt.API).events.push([\"postPutResources\",function(){var t=this,e=/^(\\d+) 0 obj$/;if(0> endobj\")}var c=t.internal.newObject();for(t.internal.write(\"<< /Names [ \"),r=0;r>\",\"endobj\"),t.internal.newObject(),t.internal.write(\"<< /Dests \"+c+\" 0 R\"),t.internal.write(\">>\",\"endobj\")}}]),x.events.push([\"putCatalog\",function(){0> \\r\\nendobj\\r\\n\"},a.outline.count_r=function(t,e){for(var n=0;n>>24&255,f[c++]=s>>>16&255,f[c++]=s>>>8&255,f[c++]=255&s,I.arrayBufferToBinaryString(f)},N=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},L=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0>>0},A=function(t,e,n,r){for(var i,o,a,s=t.length/e,l=new Uint8Array(t.length+s),h=T(),u=0;u>>1)&255;return o},O=function(t,e,n){var r,i,o,a,s=[],l=0,h=t.length;for(s[0]=4;l>>d&255,d+=o.bits;y[w]=x>>>d&255}if(16===o.bits){g=(_=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),y=new Uint8Array(g*(32/o.pixelBitlength));for(var x,N=1>>0&255,N&&(m[b++]=x>>>16&255,x=_[w++],m[b++]=x>>>0&255),y[L++]=x>>>16&255;p=8}r!==I.image_compression.NONE&&C()?(t=B(m,o.width*o.colors,o.colors,r),u=B(y,o.width,1,r)):(t=m,u=y,f=null)}if(3===o.colorType&&(c=this.color_spaces.INDEXED,h=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,S=0;for(w=0,g=A.length;wr&&(i.push(t.slice(l,o)),s=0,l=o),s+=e[o],o++;return l!==o&&i.push(t.slice(l,o)),i},J=function(t,e,n){n||(n={});var r,i,o,a,s,l,h=[],u=[h],c=n.textIndent||0,f=0,p=0,d=t.split(\" \"),g=W.apply(this,[\" \",n])[0];if(l=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var m=Array(l).join(\" \"),y=[];d.map(function(t){1<(t=t.split(/\\s*\\n/)).length?y=y.concat(t.map(function(t,e){return(e&&t.length?\"\\n\":\"\")+t})):y.push(t[0])}),d=y,l=G.apply(this,[m,n])}for(o=0,a=d.length;o>\")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},\n/** ==================================================================== \n * jsPDF XMP metadata plugin\n * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi\n * \n * \n * ====================================================================\n */\nnt=lt.API,ot=it=rt=\"\",nt.addMetadata=function(t,e){return it=e||\"http://jspdf.default.namespaceuri/\",rt=t,this.internal.events.subscribe(\"postPutResources\",function(){if(rt){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(rt)),i=unescape(encodeURIComponent(\"\")),o=unescape(encodeURIComponent(\"\")),a=n.length+r.length+i.length+e.length+o.length;ot=this.internal.newObject(),this.internal.write(\"<< /Type /Metadata /Subtype /XML /Length \"+a+\" >>\"),this.internal.write(\"stream\"),this.internal.write(e+n+r+i+o),this.internal.write(\"endstream\"),this.internal.write(\"endobj\")}else ot=\"\"}),this.internal.events.subscribe(\"putCatalog\",function(){ot&&this.internal.write(\"/Metadata \"+ot+\" 0 R\")}),this},function(f,t){var e=f.API;var m=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=[\"\",\"0\",\"00\",\"000\",\"0000\"],o=[\"\"],a=0,s=t.length;a> def\\n/CMapName /Adobe-Identity-UCS def\\n/CMapType 2 def\\n1 begincodespacerange\\n<0000>\\nendcodespacerange\",r=[],a=0,s=(n=Object.keys(t).sort(function(t,e){return t-e})).length;a<\"+i+\">\");return r.length&&(o+=\"\\n\"+r.length+\" beginbfchar\\n\"+r.join(\"\\n\")+\"\\nendbfchar\\n\"),o+=\"endcmap\\nCMapName currentdict /CMap defineresource pop\\nend\\nend\"};e.events.push([\"putFont\",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&\"Identity-H\"===t.encoding){for(var i=t.metadata.Unicode.widths,o=t.metadata.subset.encode(t.metadata.glyIdsUsed,1),a=\"\",s=0;s>\"),e(\"endobj\");var c=n();e(\"<<\"),e(\"/Type /Font\"),e(\"/BaseFont /\"+t.fontName),e(\"/FontDescriptor \"+u+\" 0 R\"),e(\"/W \"+f.API.PDFObject.convert(i)),e(\"/CIDToGIDMap /Identity\"),e(\"/DW 1000\"),e(\"/Subtype /CIDFontType2\"),e(\"/CIDSystemInfo\"),e(\"<<\"),e(\"/Supplement 0\"),e(\"/Registry (Adobe)\"),e(\"/Ordering (\"+t.encoding+\")\"),e(\">>\"),e(\">>\"),e(\"endobj\"),t.objectNumber=n(),e(\"<<\"),e(\"/Type /Font\"),e(\"/Subtype /Type0\"),e(\"/ToUnicode \"+h+\" 0 R\"),e(\"/BaseFont /\"+t.fontName),e(\"/Encoding /\"+t.encoding),e(\"/DescendantFonts [\"+c+\" 0 R]\"),e(\">>\"),e(\"endobj\"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);e.events.push([\"putFont\",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&\"WinAnsiEncoding\"===t.encoding){t.metadata.Unicode.widths;for(var i=t.metadata.rawData,o=\"\",a=0;a>\"),e(\"endobj\"),t.objectNumber=n(),a=0;a>\"),e(\"endobj\"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);var h=function(t){var e,n,r=t.text||\"\",i=t.x,o=t.y,a=t.options||{},s=t.mutex||{},l=s.pdfEscape,h=s.activeFontKey,u=s.fonts,c=(s.activeFontSize,\"\"),f=0,p=\"\",d=u[n=h].encoding;if(\"Identity-H\"!==u[n].encoding)return{text:r,x:i,y:o,options:a,mutex:s};for(p=r,n=h,\"[object Array]\"===Object.prototype.toString.call(r)&&(p=r[0]),f=0;fw-h.top-h.bottom&&s.pagesplit){var p=function(t,e,n,r,i){var o=document.createElement(\"canvas\");o.height=i,o.width=r;var a=o.getContext(\"2d\");return a.mozImageSmoothingEnabled=!1,a.webkitImageSmoothingEnabled=!1,a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,a.fillStyle=s.backgroundColor||\"#ffffff\",a.fillRect(0,0,r,i),a.drawImage(t,e,n,r,i,0,0,r,i),o},n=function(){for(var t,e,n=0,r=0,i={},o=!1;;){var a;if(r=0,i.top=0!==n?h.top:g,i.left=0!==n?h.left:d,o=(v-h.left-h.right)*y=l.width)break;this.addPage()}else s=[a=p(l,0,n,t,e),i.left,i.top,a.width/y,a.height/y,c,null,f],this.addImage.apply(this,s);if((n+=e)>=l.height)break;this.addPage()}m(u,n,null,s)}.bind(this);if(\"CANVAS\"===l.nodeName){var r=new Image;r.onload=n,r.src=l.toDataURL(\"image/png\"),l=r}else n()}else{var i=Math.random().toString(35),o=[l,d,g,u,e,c,i,f];this.addImage.apply(this,o),m(u,e,i,o)}}.bind(this),\"undefined\"!=typeof html2canvas&&!s.rstz)return html2canvas(t,s);if(\"undefined\"==typeof rasterizeHTML)return null;var n=\"drawDocument\";return\"string\"==typeof t&&(n=/^http/.test(t)?\"drawURL\":\"drawHTML\"),s.width=s.width||v*y,rasterizeHTML[n](t,void 0,s).then(function(t){s.onrendered(t.image)},function(t){m(null,t)})},\n/**\n * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser\n * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com\n * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria\n * 2014 Diego Casorran, https://github.com/diegocr\n * 2014 Daniel Husar, https://github.com/danielhusar\n * 2014 Wolfgang Gassler, https://github.com/woolfg\n * 2014 Steven Spungin, https://github.com/flamenco\n *\n * @license\n * \n * ====================================================================\n */\nfunction(t){var P,k,i,a,s,l,h,u,I,w,f,c,p,n,C,B,d,g,m,j;P=function(){return function(t){return e.prototype=t,new e};function e(){}}(),w=function(t){var e,n,r,i,o,a,s;for(n=0,r=t.length,e=void 0,a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0),n--;for(o=/\\s+$/g,s=!0,n=0;n!==r;)\"\\u2028\"!=t[n]&&(e=t[n].replace(/\\s+/g,\" \"),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},c=function(t){var e,n,r;for(e=void 0,n=(r=t.split(\",\")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},p=function(t){var e;return-1<(t=\"auto\"===t?\"0px\":t).indexOf(\"em\")&&!isNaN(Number(t.replace(\"em\",\"\")))&&(t=18.719*Number(t.replace(\"em\",\"\"))+\"px\"),-1i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(n));var b=I(n),x=i.x,N=12/i.pdf.internal.scaleFactor,L=(b[\"margin-left\"]+b[\"padding-left\"])*N,A=(b[\"margin-right\"]+b[\"padding-right\"])*N,S=(b[\"margin-top\"]+b[\"padding-top\"])*N,_=(b[\"margin-bottom\"]+b[\"padding-bottom\"])*N;void 0!==b.float&&\"right\"===b.float?x+=i.settings.width-n.width-A:x+=L,i.pdf.addImage(v,x,i.y+S,n.width,n.height),v=void 0,\"right\"===b.float||\"left\"===b.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!E[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,\"left\"===b.float?-n.width-L-A:0,i.y+n.height+S+_,n.width)),i.watchFunctions.push(function(t,e,n){return!(i.y]*?>/gi,\"\"),h=\"jsPDFhtmlText\"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(l=document.createElement(\"div\")).style.cssText=\"position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;\",l.innerHTML='