{"version":3,"sources":["../node_modules/react-page-visibility/node_modules/prop-types/index.js","../node_modules/react-page-visibility/node_modules/prop-types/factoryWithThrowingShims.js","../node_modules/react-page-visibility/node_modules/prop-types/lib/ReactPropTypesSecret.js","components/Dealers/DraftDealers/DraftDealerListQuery.tsx","components/Forms/RadioButtons.tsx","components/Forms/RadioButtonsField.tsx","../node_modules/querystring-es3/decode.js","../node_modules/querystring-es3/encode.js","components/Dealers/dealerSetupQuestionnaireValidationSchema.ts","../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/extends.js","components/Proposals/ProposalDealerOverview/StatsBox.tsx","components/AccountManagers/AccountManagerActivities/types.ts","components/AccountManagers/AccountManagerActivities/accountManagerActivityValidationSchema.ts","components/AccountManagers/AccountManagerActivities/CreateOrUpdateActivityFormInner.tsx","components/AccountManagers/AccountManagerActivities/fragments.ts","components/AccountManagers/AccountManagerActivities/useAccountManagerActivity.ts","components/AccountManagers/AccountManagerActivities/useCreateOrUpdateActivity.ts","components/AccountManagers/AccountManagerActivities/CreateOrUpdateActivityModal.tsx","components/AccountManagers/AccountManagerActivities/AccountManagerActivityActionButtons.tsx","components/AccountManagers/AccountManagerActivities/useDeleteAccountManagerActivity.ts","components/AccountManagers/AccountManagerActivities/DeleteAccountManagerActivityDropdownItem.tsx","components/AccountManagers/AccountManagerActivities/AccountManagerActivityListItem.tsx","components/AccountManagers/AccountManagerActivities/AccountManagerActivityList.tsx","../node_modules/resolve-pathname/esm/resolve-pathname.js","components/Dealers/dealerValidationSchema.ts","components/Dealers/DealerContacts/dealerContactValidationSchema.ts","components/Dealers/DraftDealers/DraftDealerQuery.tsx","components/Dealers/CreateHouseDealer/CreateHouseDealerMutation.tsx","components/Dealers/DealerList/DealerListFilterPanel.tsx","components/Dealers/DealerBadges.tsx","components/Dealers/DealerList/DealerListSearchForm.tsx","components/AccountManagers/AccountManagerTargetsSummary/AccountManagerTargetsQuery.tsx","../node_modules/reactstrap/es/ButtonGroup.js","../node_modules/querystring-es3/index.js","../node_modules/reactstrap/es/ButtonDropdown.js","components/AccountManagers/AccountManagerActivities/AccountManagerActivityTabContent.tsx","components/Dealers/CreateHouseDealer/HouseDealerFormInner.tsx","components/Dealers/CreateHouseDealer/CreateHouseDealerModal.tsx","components/Dealers/DealerList/DealerListActionButtons.tsx","components/Dealers/DealerList/DealerDropdown.tsx","components/Dealers/DealerList/DealerListItem.tsx","components/Dealers/DealerList/index.tsx","components/Proposals/ProposalDealerOverview/TargetStatsBox.tsx","components/AccountManagers/AccountManagerTargetsSummary/index.tsx","components/AccountManagers/AccountManagerScene/AccountManagerTargetsTabContent.tsx","components/Dealers/CreateDealerMutation.tsx","components/Dealers/DealerLenderList/LendersListQuery.tsx","components/AccountManagers/accountManagerValidationSchema.ts","components/AccountManagers/AccountManagerForm/AccountManagerFormInner.tsx","components/AccountManagers/AccountManagerForm/CreateOrUpdateAccountManagerMutation.tsx","components/AccountManagers/AccountManagerBadges.tsx","components/Dealers/DealerForm/AccountManagerSection.tsx","components/Dealers/DealerForm/CompaniesHouseSearchLink.tsx","components/Dealers/DealerForm/DealerQuestion.tsx","components/Dealers/DealerForm/CompanyDetailsSection.tsx","components/Dealers/DealerForm/CreateQuestionnaireSection.tsx","components/Dealers/DealerForm/CurrentSituationSection.tsx","components/Dealers/DealerForm/DealerBankDetailsSection.tsx","components/Dealers/DealerForm/DealerContactsDetailsSection.tsx","components/Dealers/DealerForm/DealerContactsSection.tsx","components/Dealers/DealerForm/DealerDetailsFormSection.tsx","components/Dealers/DealerForm/DealerInformationSection.tsx","components/Dealers/DealerForm/DealerSummarySection.tsx","components/Dealers/DealerForm/HistoricRelationshipCheckSection.tsx","components/Dealers/DealerForm/ProductMixSection.tsx","components/Dealers/DealerForm/DuplicateDealerFoundModal.tsx","components/Dealers/DealerForm/DealerPricingSection.tsx","components/Dealers/DealerForm/DealerProofsSection.tsx","components/Dealers/DealerForm/LenderPackagesSection.tsx","components/Dealers/DealerForm/index.tsx","components/Dealers/DealerForm/ProofUploadForm.tsx","components/Dealers/DraftDealers/DealerProofsContent.tsx","components/NetworkFolders/FilesPanel.tsx","../node_modules/react-select/creatable/dist/react-select.browser.esm.js","components/Dealers/DraftDealers/DraftDealerListFilterPanel.tsx","components/Dealers/DraftDealers/DeleteDraftDealerMutation.tsx","components/Dealers/DraftDealers/DeleteDraftDealerDropdownItem.tsx","components/Dealers/DraftDealers/DraftDealerBadges.tsx","components/Dealers/DraftDealers/DraftDealerListItem.tsx","components/Dealers/DraftDealers/DraftDealerList.tsx","components/Dealers/DraftDealers/DraftDealerListScene.tsx","components/AccountManagers/AccountManagerForm/CreateAccountManagerModal.tsx","components/AccountManagers/AccountManagerList/AccountManagerListFilterPanel.tsx","components/AccountManagers/AccountManagerList/DeleteAccountManagerMutation.tsx","components/AccountManagers/AccountManagerList/DeleteAccountManagerDropdownItem.tsx","components/AccountManagers/AccountManagerList/AccountManagerListItem.tsx","components/AccountManagers/AccountManagerList/index.tsx","components/Dealers/CreateDealerBreadcrumbs.tsx","components/Dealers/DraftDealers/CreateOrUpdateDraftDealerMutation.tsx","components/Dealers/DraftDealers/DraftDealerService.tsx","components/Dealers/CreateDealerScene.tsx","../node_modules/reactstrap/es/UncontrolledButtonDropdown.js","../node_modules/reactstrap/es/Table.js","components/AccountManagers/AccountManagerActivities/AccountManagerActivityListScene.tsx","components/AccountManagers/AccountManagerListScene.tsx","components/AccountManagers/AccountManagerTargetsList/AccountManagerTargetsListQuery.tsx","components/AccountManagers/AccountManagerScene/AccountManagerDealersTabContent.tsx","components/AccountManagers/AccountManagerForm/AccountManagerFormSummary.tsx","components/AccountManagers/AccountManagerForm/AccountManagerEditForm.tsx","components/AccountManagers/AccountManagerScene/AccountManagerDetailsTabContent.tsx","components/NetworkFolders/FoldersPanel.tsx","components/AccountManagers/AccountManagerNetworkFolder/index.tsx","components/AccountManagers/AccountManagerScene/AccountManagerFilesTabContent.tsx","components/AccountManagers/AccountManagerScene/AccountManagerProposalsTabContent.tsx","components/AccountManagers/AccountManagerScene/AccountManagerTabHeaders.tsx","components/AccountManagers/AccountManagerTargets/accountManagerTargetsValidationSchema.ts","components/AccountManagers/AccountManagerTargets/CreateOrUpdateAccountManagerTargetsMutation.tsx","components/AccountManagers/AccountManagerTargets/CreateOrUpdateAccountManagerTargetsModal.tsx","components/AccountManagers/AccountManagerTargets/DeleteAccountManagerTargetsDropdownItem.tsx","components/AccountManagers/AccountManagerTargetsList/AccountManagerTargetsListActionButtons.tsx","components/AccountManagers/AccountManagerTargetsList/AccountManagerTargetsListItem.tsx","components/AccountManagers/AccountManagerTargetsList/index.tsx","components/AccountManagers/AccountManagerScene/AccountManagerTargetsListTabContent.tsx","components/AccountManagers/AccountManagerScene/index.tsx","components/AccountManagers/AccountManagerScene/UserAccountManagerScene.tsx","components/AccountManagers/AccountManagerRouter.tsx","../node_modules/react-page-visibility/dist/es5/PageVisibility.js","../node_modules/react-page-visibility/dist/es5/index.js"],"names":["module","exports","require","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","Error","name","getShim","isRequired","ReactPropTypes","array","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","DRAFT_DEALER_LIST","gql","DraftDealerShallowFragment","getButtonClass","color","outline","result","defaultComparer","value1","value2","RadioButtons","value","options","onChange","comparer","valueComparer","className","data-toggle","map","x","index","key","classnames","active","type","e","target","checked","label","RadioButtonsField","title","colSize","submitOnChange","Col","lg","form","field","setFieldValue","setFieldTouched","submitForm","hasOwnProperty","obj","prop","Object","prototype","call","qs","sep","eq","length","regexp","split","maxKeys","len","i","kstr","vstr","k","v","replace","idx","indexOf","substr","decodeURIComponent","isArray","push","Array","xs","toString","stringifyPrimitive","isFinite","undefined","objectKeys","ks","encodeURIComponent","join","f","res","keys","dealerSetupQuestionnaireValidationSchema","Yup","hasPreviousRelationship","default","datePreviousRelationshipClosed","nullable","reasonPreviousRelationshipClosed","max","issuesWithDealingAgain","highWriteOffsOrArrears","isOnLenderZList","employeeRelationshipWithEVC","employeeRelationshipPreviousDealer","employeeRelationshipPreviousDealerRelationship","relationshipAdditionalInformation","longTermLeaseOnPremises","longTermLeaseOnPremisesDetails","numberOfVehiclesInStock","transform","min","integer","stockReview","isStockFinanceable","reasonNotFinanceable","isMileageWithinLenderPolicy","highestVehicleMileage","isAgeWithinUnderwritingPolicy","highestVehicleAge","sorStock","smartAndReasonable","hasForecourtAndSignage","reasonNoForecourtOrSignage","vehiclesPhotographedConsistently","advertisesSubprimeFinance","customersFreeToVisit","hasComplaintsProcess","complaintsProcessDetails","reputationConcerns","negativeReviewsOnWeb","negativeReviewsOnWebDetails","negativeReviewsOnSocialMedia","negativeReviewsOnSocialMediaDetails","negativeNews","negativeNewsDetails","hasGoodReputation","wasReferred","referredBy","positiveAndAppropriate","directorsAssociatedWithOtherCompanies","directorOtherCompanyName","directorOtherCompanyUrl","matches","directorOtherCompanyRegNumber","ultimateBeneficialOwners","approvedPersons","investors","otherInterestedParties","financeProviders","financeProvidersDuration","hasVisualShowroomFinance","whyDoesTheDealerWantToWorkWithEVC","productSetupPCP","productSetupLTVLoans","productSetupSubprime","productSetupVATAssist","productSetupZeroPercentSubsidy","productSetupLenders","_extends","assign","arguments","source","apply","this","StatsBox","description","units","loading","ActivityType","accountManagerActivityValidationSchema","id","dealerId","required","accountManagerId","notes","activityDate","activityType","CreateOrUpdateActivityFormInner","values","context","useLoggedInUser","loggedInUser","isAccountManager","useAccountManagerShallow","accountManager","accountManagerLoading","useDealerShallow","dealer","dealerLoading","maxDate","moment","endOf","toDate","create","accountManagerFixed","ContextNames","ACCOUNT_MANAGER","DEALER","dealerFixed","Row","fieldProps","FormGroupWrapper","Input","readOnly","to","icon","faCaretRight","AccountManagerSelect","onSelectAccountManager","autoFocus","isClearable","isDisabled","formikProps","DealerSelect","onSelectDealer","did","includeSuspended","RadioField","VISIT","TELEPHONE_CALL","CustomDatePicker","placeholder","selected","dateFormat","onDayChange","date","toISOString","rows","AccountManagerActivityFragment","SingleDealerFragment","AccountManagerShallowFragment","GET_ACCOUNT_MANAGER_ACTIVITY","useAccountManagerActivity","useQuery","variables","skip","data","activity","CREATE_OR_UPDATE_ACTIVITY_MUTATION","useCreateOrUpdateActivity","useMutation","cleanActivityBeforeSubmit","cleanFormData","CreateOrUpdateActivityModal","accountManagerActivityId","isOpen","toggle","defaults","mutation","refresh","React","PagedListContext","useDealer","initialValues","merge","ModalForm","validationSchema","headerText","submitButtonText","onSubmit","input","then","AccountManagerActivityActionButtons","useToggle","Button","onClick","DELETE_ACCOUNT_MANAGER_ACTIVITY","useDeleteAccountManagerActivity","DeleteAccountManagerActivityDropdownItem","message","confirmButtonText","confirmButtonColor","confirm","DropdownItem","preventDefault","stopPropagation","faTrash","AccountManagerActivityListItem","item","showAccountManagerAndDealer","sm","faPhoneAlt","faStoreAlt","formatEnumValue","format","style","whiteSpace","ActionsDropdown","divider","ACCOUNT_MANAGER_ACTIVITIES_LIST","defaultSearchArgs","page","pageSize","AccountManagerActivityList","regionalSalesManagerId","isEditing","state","setState","hideModal","handleClick","activityId","SearchForm","mapValuesToQuerystring","mapQuerystringToValues","fixedValues","defaultValues","getVariables","memoizeOne","PagedList","query","listItemComponent","getSearchResults","activities","actionButtonsComponent","fetchPolicy","isAbsolute","pathname","charAt","spliceOne","list","n","pop","resolvePathname","from","hasTrailingSlash","toParts","fromParts","isToAbs","isFromAbs","mustEndAbs","concat","last","up","part","unshift","URL_PATTERN","uniqueEmailAddresses","dealerValidationSchema","isSuspended","isMannIslandDealer","isMannIslandZList","isMultiQuote","stockFunding","franchised","url","email","mobile","telephoneValidationSchema","when","is","fax","ccaNumber","vatNumber","ccaExpiry","startOf","add","established","DATE_PATTERN","test","testDateStringIsValid","latitude","longitude","bank","accountNumber","sortCode","accountName","bankAddress","address","line1","line2","line3","town","postcode","countryId","telephone","contacts","dealerContactValidationSchema","uniqArr","emailCount","forEach","requestsDealerPortalUserAccount","lower","toLowerCase","createError","path","parent","some","isDirector","RegExp","EMAIL_PATTERN","isEmailValid","FORMSTATE_contactsError","companiesHouseUrl","companyRegNumber","tradingStyle","assetClass","fCAStatus","fCAUrl","netWorthFromCompaniesHouse","moreThan","averageBalance","monthlyVolume","allProofsProvided","isOnICORegister","icoNumber","agreedApr","questionnaire","FORMSTATE_requiresQuestionnaire","dealerSetupV2","documentStorageRef","uuid","addressValidationSchema","forename","surname","position","sMS","emailInclude","requestsLogin","DealerContactEmailInclude","NONE","directorDateOfBirth","typeError","isFCARegulatedPerson","homeAddress","isMainContact","isSAFTested","GET_DRAFT_DEALER","DraftDealerFragment","DealerEsignatureFragment","GET_DEALER_EIGNATURE","useDealerEsignature","docType","dealerEsignature","DraftDealerQuery","children","draftDealerId","draftDealer","CREATE_HOUSE_DEALER","DealerFragment","useCreateHouseDealer","createHouseDealer","houseDealer","refetchQueries","GET_ACCOUNT_MANAGER","DealerListFilterPanel","isAdministrator","DealerMapType","LOCATIONS","PROPOSAL_PAIDOUT_VALUE","DealerMapStyle","LIGHT","DARK","SATELLITE","md","disabled","hasProposalsPaidOutInTimePeriod","startDateFieldName","endDateFieldName","editDatesFieldName","config","AUTOCONVERT_NAME","dss","DealerSetupStatus","DealerBadges","groups","countOfActiveProposals","contractSigned","autoConvert","setupStatus","isDealer","convertToTitleCase","g","IsStatusFullySetup","el","Math","pow","viewStatePropNames","mapOptionsPropNames","lastMonth","getMonthDateRange","subtract","fundedDealersOnly","hasActivityInLastSixWeeks","hasActivityInLastYear","hasActiveProposalsOnly","hasLocationOnly","locationNotFoundOnly","proposalStartDate","start","proposalEndDate","end","proposalEditDates","mapType","mapStyle","autoConvertOnly","houseDealersOnly","defaultViewState","zoom","pitch","bearing","DealerListSearchForm","fixedPageSize","fixedPage","fixedHasLocationOnly","cleanNumber","omit","viewState","pick","totalFinanceFilter","startDate","endDate","prevValues","currentValues","ignorePropNames","prevFormValues","currentFormValues","shouldSubmit","formValuesChanged","isEqual","searchTextChanged","q","p","prevViewStateValues","currentViewStateValues","setTimeout","initialViewState","onViewStateChanged","nextViewState","ACCOUNT_MANAGER_TARGETS","AccountManagerTargetsFragment","AccountManagerActualsFragment","ACCOUNT_MANAGER_TARGETS_WITHOUT_NET_PROFIT","AccountManagerTargetsFragmentWithoutNetProfit","AccountManagerActualsFragmentWithoutNetProfit","ACCOUNT_MANAGER_SINGLE_TARGET","useAccountManagerTargets","canViewNetProfit","targetTemplate","targets","useAccountManagerSingleTarget","propTypes","tag","tagPropType","cssModule","role","size","vertical","ButtonGroup","Tag","attributes","_objectWithoutPropertiesLoose","classes","mapToCssModules","classNames","createElement","defaultProps","decode","parse","encode","stringify","ButtonDropdown","Dropdown","group","UserAccountManagerActivityTabContent","regionalSalesManager","REGIONAL_SALES_MANAGER","AccountManagerActivityTabContent","match","params","parseInt","HouseDealerFormInner","formSize","wideCol","FormSize","NARROW","amId","requiresHouseDealer","houseDealerValidationSchema","CreateHouseDealerModal","history","useHistory","MapButtonLabel","faMapMarked","getCreateDealerUrl","CreateDealerButton","DealerListActionButtons","rsmId","selectedAccountManager","useAccountManager","loggedInAccountManager","useLoggedInAccountManager","checkCanCreate","isSuperUser","canCreate","PermissionModuleNames","Dealers","useState","showHouseDealerModal","setShowHouseDealerModal","toggleHouseDealerModal","hasHouseDealer","UncontrolledButtonDropdown","DropdownToggle","caret","DropdownMenu","RouterDropdownItem","window","search","faHome","DELETE_DEALER","DealerDropdown","deleteDealer","editDates","DEALER_LIST","DealerListItem","noGutters","getShortAddress","DealerList","SearchFormControls","filterPanel","dealers","defaultFormatter","round","TargetStatsBox","actual","proportionOfPeriodElapsed","projectToEndOfPeriod","formatter","displayActual","progressPercent","formatToPercentage","width","forecast","getQueryStringForReports","args","convertedArgs","querystring","AccountManagerTargetsSummaryInner","now","isBetween","totalDuration","duration","diff","asMilliseconds","getProportionOfPeriodElapsed","isSeniorManager","isRegionalSalesManager","checkCanRead","RegionalSalesManagers","canViewNewStats","isThisMonth","thisMonth","isSame","getIsThisMonth","actuals","xl","PeriodPickerField","monthsOnly","compactView","BooleanCheckboxField","proposalsCreated","totalCreatedCount","proposalsPaidout","totalPaidOutCount","netProfit","netProfit100","formatCurrency","turnover","totalFinance","dealerCreated","dealerPaidOut","dealerSetup","getProportion","holdbackInternal","FileDownloadLink","href","API_URL","faFileExcel","AccountManagerTargetsSummary","QuerystringForm","UserAccountManagerTargetsTabContent","LoadingSpinner","AccountManagerTargetsTabContent","CREATE_OR_UPDATE_DEALER","FullDealerFragment","useCreateOrUpdateDealer","CreateDealer","LENDERS_LIST","LendersListQuery","accountManagerValidationSchema","autoConvertReference","GUID_PATTERN","FORMSTATE_create","AccountManagerFormInner","narrowCol","component","FormInputField","onSelectRegionalSalesManager","CREATE_OR_UPDATE_ACCOUNTMANAGER","AccountManagerFragment","cleanAccountManagerBeforeSubmit","user","useCreateOrUpdateAccountManager","createOrUpdateAccountManager","AccountManagerBadges","suspended","AccountManagerSection","FormGroup","CompaniesHouseSearchLink","rel","faExternalLinkAlt","DealerQuestion","text","Component","fcaStatusList","status","CompanyDetailsSection","isDealerSetupV2","showFlags","SelectField","FollowUpQuestions","show","CreateQuestionnaireSection","validateForm","navigateToSection","DealerFormSectionName","HISTORIC_CHECK","CurrentSituationSection","formik","DealerBankDetailsSection","bankDetails","invalidBankAccount","FORMSTATE_invalidBankAccount","accountNotFound","displayType","onValueChange","formattedValue","onBlur","ValidateBankAccountButton","validateFormData","errors","onBankAccountValidated","isValid","branch","DealerContactsDetailsSection","contact","TitleSelectField","Label","DateSelectRow","AddressFormSection","pathToAddress","ShortContactSummary","DealerContactsSection","isValidated","collapsedItems","_","isSectionTouched","arrayHelpers","getFullName","collapseItem","expandItem","faChevronUp","faChevronDown","remove","validateContactDetails","slice","splice","assetList","asset","CHECK_DEALER_EXISTS","DealerDetailsFormSection_FunctionalComponent","populateModal","handleBlur","useLazyQuery","checkDealerExists","setDuplicateDealers","creatingNewDealer","useEffect","prevState","JSON","spellCheck","event","inputValue","currentTarget","trim","IsDealerSigned","leaseOptions","lease","DealerInformationSection","option","SummaryRowSection","subtitle","useHtmlElementClass","SummaryRow","highlight","AddressRow","hasAddress","getSingleLineAddress","hasContactDetails","DealerSummarySection","proofref","proofsLoaded","setProofsLoaded","proofEnough","setProofEnough","declaration","pt","DealerProofType","loadingProofs","axios","get","headers","r","dp","resp","proofType","c","documents","doc","d","metadata","Proof","isProofEnough","catch","error","console","Alert","fade","scrollTo","document","body","scrollHeight","faArrowDown","hasDealerPricingDetails","roundNumber","HistoricRelationshipCheckSection","lenderOptions","sort","ProductMixSection","defaultValue","isMulti","closeMenuOnSelect","opt","showModal","dealerList","Modal","centered","modalTransition","timeout","scrollable","ModalHeader","ModalBody","Table","hover","cursor","newWindow","open","opener","openInNewTab","origin","ModalFooter","DealerPricingSection","InputGroup","decimalScale","InputGroupAddon","addonType","DealerProofsSection","DealerProofsContent","isDraft","setFieldValueFunc","storageRef","sortByName","a","b","toUpperCase","DealerFormSections","summaryComponent","watchFields","DEALER_DETAILS","DealerDetailsFormSection","isRateForRisk","COMPANY_DETAILS","BANK_DETAILS","CREATE_QUESTIONNAIRE","CreateQuestionnnaireSection","AutoGeneratedFormSectionSummary","firstColumnSize","DEALER_INFORMATION","CURRENT_SITUATION","CONTACTS","DEALER_PRICING","LENDER_PACKAGES","onPackageChange","am","log","action","removedValue","pricing","currL","currP","lender","lenderid","apr","commission","asmoney","lendersListOptions","lendersList","l","unitsPosition","DEALER_PROOFS","PRODUCT_MIX","SUMMARY","DealerForm","setTouched","listOfDealers","duplicateDealerList","toggleModal","getSections","bind","handleSaveDraft","debounce","leading","getDraftDealerValidationMessage","handleSectionChanged","section","initialSection","savingDraft","onSubmitDealer","draftDealerLastSaved","canUpdate","currentSection","setSubmitting","validateOnChange","isInitialValid","validateOnBlur","saveDraftProps","saveDraft","draftLastSaved","draftValidationMessage","isSubmitting","dirty","MultiSectionForm","createOrUpdate","CreateOrUpdateMode","UPDATE","CREATE","sections","onSectionChanged","initialTouched","roles","includes","UserRoles","account_manager","missingFields","touched","formData","editMode","includeQuestionnaire","includeBankDetails","hideAccountMgrSection","hideContactsSection","hideLendersSection","filter","compose","withRouter","withLoggedInUser","isSeparator","getBase64","file","Promise","resolve","baseURL","reader","FileReader","readAsDataURL","onload","getExtension","substring","removeExtension","filename","ext","endsWith","withAlerts","header","proofRef","onFileUploaded","addAlert","setFile","setTitle","uploading","setUploading","getToken","useAuth0","handleSubmit","maxMb","cTitle","payload","DealerProofRef","Filename","Title","Ext","Base64","token","async","tmp","post","authorization","method","encType","files","htmlFor","faSpinner","spin","sortByDocumentProof","sortByDocumentTitle","DealerProofsSummaryContent","proofs","s","rootUrl","rootPath","relativePath","deleting","deletingIndex","faIcons","faIdBadge","faFileAlt","faCreditCard","faCamera","onProofDelete","ev","uniqueId","delete","getFileInfo","ipe","canEdit","canManageProposalFiles","faPlus","iconLookup","faFileWord","faFilePdf","faFileImage","FilesPanel","extension","fixedWidth","faFile","compareOption","candidate","String","optionValue","optionLabel","builtins","formatCreateLabel","isValidNewOption","selectValue","selectOptions","getNewOptionData","__isNew__","_objectSpread","allowCreateWhileLoading","createOptionPosition","SelectCreatable","SelectComponent","_class","_temp","_Component","Creatable","_this","_classCallCheck","_possibleConstructorReturn","_getPrototypeOf","_defineProperty","_assertThisInitialized","newValue","actionMeta","_this$props","onCreateOption","newOption","valueArray","newOptionData","newActionMeta","_toConsumableArray","cleanValue","_inherits","_createClass","nextProps","isLoading","select","focus","blur","_this2","ref","_ref","makeCreatableSelect","Select","manageState","DraftDealerListFilterPanel","DELETE_DRAFT_DEALER","DeleteDraftDealerMutation","DeleteDraftDealerDropdownItem","DraftDealerBadges","updated","Badge","DistanceInWordsText","DraftDealerListItem","DraftDealerList","draftDealers","DraftDealerBreadcrumbs","breadcrumbs","Breadcrumbs","DraftDealerListScene","useParams","Container","CreateAccountManagerModal","AccountManagerListFilterPanel","RegionalSalesManagerSelect","DELETE_AM","DeleteAccountManagerMutation","DeleteAccountManagerDropdownItem","ACCOUNT_MANAGER_LIST","AccountManagerListItem","faMap","canManageAccountManagers","AccountManagerActionButtons","showCreateModal","setShowCreateModal","showCreateWithoutUserModal","setShowCreateWithoutUserModal","toggleCreateModal","useCallback","toggleCreateWithoutUserModal","AccountManagers","CreateUserModal","display","fixedRole","AccountManagerActivity","AccountManagerList","hasIdentityProviderUserId","accountManagers","getBreadcrumbData","amDealersPath","CreateDealerBreadcrumbs","CREATE_OR_UPDATE_DRAFT_DEALER","CreateOrUpdateDraftDealer","DraftDealerService","draftDealerInitialValues","dealerJson","removeIdFields","hydrateTouchedData","touchedFields","CreateOrUpdateDraftDealerMutation","mutationFunction","mutate","existing","cleanDraftDealer","cloneDeep","serializeTouchedData","draft","createOrUpdateDraftDealer","resetFieldsWithErrors","CreateDealerScene","requiresQuestionnaire","draftDealerLoading","CreateDealerMutation","client","submitted","created","createOrUpdateDealer","writeFragment","fragment","fragmentName","CreateDealerNoQuestionnaireScene","omitKeys","defaultOpen","_inheritsLoose","_proto","render","_objectSpread2","bordered","borderless","striped","dark","responsive","responsiveTag","innerRef","ResponsiveTag","table","responsiveClassName","AccountManagerActivityListScene","AccountManagerListScene","ACCOUNT_MANAGER_TARGETS_LIST_WITHOUT_NET_PROFIT","LoggedInUserFragment","ACCOUNT_MANAGER_TARGETS_LIST","ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW_WITHOUT_NET_PROFIT","ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW","AccountManagerDealersTabContent","AccountManagerFormSummary","useRegionalSalesManager","AccountManagerEditForm","disableEditing","EditForm","summary","formValues","UserAccountManagerDetailsTabContent","AccountManagerDetailsTabContent","FolderList","indent","folders","selectedFolder","onSelectedFolderChanged","subFolders","paddingLeft","faFolderOpen","faFolder","FoldersPanel","getFoldersFromPath","handleSelectFolder","addSubFolders","toggleOpenFolder","folderIndex","getSubFolders","rootFolder","rootFolderName","reduce","folder","parentPath","closedFolders","startsWith","ACCOUNT_MANAGER_FOLDERS_QUERY","ACCOUNT_MANAGER_FILES_QUERY","AccountManagerNetworkFolder","useApolloClient","setPath","filesLoading","networkFolder","filePath","folderData","UserAccountManagerFilesTabContent","AccountManagerFilesTabContent","AccountManagerProposalsTabContent","ProposalList","fixedArgs","defaultArgs","AccountManagerTabHeaders","isCaseManagementTeam","showStats","tabs","collapse","FullWidthTabHeaders","accountManagerTargetsValidationSchema","proposalsAccepted","dealerPaidout","dealerSetups","CREATE_OR_UPDATE_ACCOUNT_MANAGER_TARGETS","CreateOrUpdateAccountManagerTargetsModal","accountManagerTargetsId","targetListQuery","targetsList","edges","t","useLastAccountManagerTargets","mostRecentTarget","loadingMostRecent","useCreateOrUpdateAccountManagerTargets","accountManagerTargetsList","accountManagerTargetsListShallow","rawValues","Form","showMonthYearPicker","DeleteAccountManagerTargetsDropdownItem","accountManagerTargets","getQuerystringForReport","AccountManagerTargetsListActionButtons","editAction","checkCanUpdate","checkCanDelete","checkIsAuthorized","AccountManagerTargets","canReadReport","PermissionActivityNames","ReadReport","canDelete","allowClicks","faEdit","TargetValues","percentage","TargetValuesRow","getAverageBalanceProps","showNetProfit","TableWrapper","LoadingPlaceholder","colSpan","NoItemsPlaceholder","preloadMostRecentTargets","AccountManagerTargetsList","toggleEditModal","showEditModal","selectedTargetId","pagedListTargetsQuery","mostRecentTargetsQuery","searchInput","listItemsContainer","loadingPlaceholder","noItemsPlaceholder","AccountManagerTargetsListItem","canManageTargets","withApollo","UserAccountManagerTargetsListTabContent","AccountManagerTargetsListTabContent","CreateHouseDealerButton","AccountManagerSceneInner","usePreloadedData","canManageUsers","username","TabContentContainer","PROPOSAL_LIST","GET_USER","GET_REGIONAL_SALES_MANAGER","case_management_team","AccountManagerScene","SceneLoadingSpinner","PageNotFound","UserAccountManagerScene","DealerMapScene","AccountManagerRouter","fallback","defineProperties","descriptor","enumerable","configurable","writable","defineProperty","Constructor","protoProps","staticProps","arr","arr2","PageVisibility","_React$Component","instance","TypeError","self","ReferenceError","__proto__","getPrototypeOf","isSupported","visibility","subClass","superClass","constructor","setPrototypeOf","handleVisibilityChange","addEventListener","removeEventListener","_props","getHandlerArgs","forceUpdate","_props2","Children","only","displayName"],"mappings":"uFAiBEA,EAAOC,QAAUC,EAAQ,KAARA,I,kCCRnB,IAAIC,EAAuBD,EAAQ,MAEnC,SAASE,KACT,SAASC,KACTA,EAAuBC,kBAAoBF,EAE3CJ,EAAOC,QAAU,WACf,SAASM,EAAKC,EAAOC,EAAUC,EAAeC,EAAUC,EAAcC,GACpE,GAAIA,IAAWV,EAAf,CAIA,IAAIW,EAAM,IAAIC,MACZ,mLAKF,MADAD,EAAIE,KAAO,sBACLF,GAGR,SAASG,IACP,OAAOV,EAFTA,EAAKW,WAAaX,EAMlB,IAAIY,EAAiB,CACnBC,MAAOb,EACPc,KAAMd,EACNe,KAAMf,EACNgB,OAAQhB,EACRiB,OAAQjB,EACRkB,OAAQlB,EACRmB,OAAQnB,EAERoB,IAAKpB,EACLqB,QAASX,EACTY,QAAStB,EACTuB,YAAavB,EACbwB,WAAYd,EACZe,KAAMzB,EACN0B,SAAUhB,EACViB,MAAOjB,EACPkB,UAAWlB,EACXmB,MAAOnB,EACPoB,MAAOpB,EAEPqB,eAAgBjC,EAChBC,kBAAmBF,GAKrB,OAFAe,EAAeoB,UAAYpB,EAEpBA,I,kCCnDTnB,EAAOC,QAFoB,gD,4nBCIpB,IAAMuC,EAAoBC,IAAH,IAuB1BC,M,qFCtBEC,EAAiB,SAACC,EAAgBC,GACtC,IAAIC,EAAS,OAGb,OAFAA,GAAUD,EAAU,WAAa,GACjCC,GAAUF,GAAgB,aAItBG,EAAkB,SAACC,EAAaC,GAAd,OACtBD,IAAWC,IAAYD,IAAWC,GAmCrBC,EAjCM,SAAC,GAQI,IAPxBlC,EAOuB,EAPvBA,KACAmC,EAMuB,EANvBA,MACAC,EAKuB,EALvBA,QACAC,EAIuB,EAJvBA,SACAT,EAGuB,EAHvBA,MACAC,EAEuB,EAFvBA,QAGMS,EADiB,E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AO6C,SAASyI,MAAMuqC,EAAQjR,EAAmBkR,gBAEjC,oBAAxBvqC,KAAKvL,MAAMsc,UAElB/Q,KAAKwqC,gBAGd,CACC1yC,IAAK,SACLV,MAAO,WACH,OAAK4I,KAAKvL,MAAMsc,SAImB,oBAAxB/Q,KAAKvL,MAAMsc,SAGb/Q,KAAKqI,MAAMwhC,aAIRY,EAAUzqC,KAAKvL,OAAOsc,SAAShR,MAAM0qC,EAASpR,EAAmBkR,gBAF9DvqC,KAAKvL,MAAMsc,WAKnBxL,IAAMmlC,SAASC,KAAK3qC,KAAKvL,MAAMsc,UAb3B,KAIP,IAAI05B,MAaTpB,EAnEU,CAoEnB9jC,IAAM+c,WAER+mB,EAAeuB,YAAc,iBAE7BvB,EAAe5xB,UAAY,CACvBngB,SAAUd,IAAUjB,KACpBwb,SAAUva,IAAUJ,UAAU,CAACI,IAAUP,KAAMO,IAAUjB,QAG9C8zC,QCzFAA","file":"static/js/11.9e73d730.chunk.js","sourcesContent":["/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult } from \"react-apollo\";\nimport { SearchArgs, SearchResults, User } from \"../../types\";\nimport { DraftDealerShallowFragment } from \"../fragments\";\nimport { DraftDealer } from \"../types\";\n\nexport interface DraftDealerListData {\n loggedInUser: User & {\n draftDealers: SearchResults;\n };\n}\n\nexport const DRAFT_DEALER_LIST = gql`\n query DraftDealerListQuery($input: DraftDealerSearchArgsInput) {\n loggedInUser {\n id\n username\n roles\n draftDealers(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...DraftDealerShallowFragment\n }\n }\n }\n }\n }\n ${DraftDealerShallowFragment}\n`;\n\nconst DraftDealerListQuery = ({\n children,\n ...input\n}: SearchArgs & {\n children: (\n result: QueryResult\n ) => JSX.Element | null;\n}) => (\n \n query={DRAFT_DEALER_LIST}\n variables={{ input }}\n >\n {children}\n \n);\n\nexport default DraftDealerListQuery;\n","import classnames from \"classnames\";\nimport * as React from \"react\";\nimport \"./formstyles.scss\";\n\nexport interface RadioButtonsProps {\n name: string;\n value?: any;\n options: { label: string | React.ReactElement; value?: any }[];\n onChange: (value?: any) => void;\n color?: string;\n outline?: boolean;\n valueComparer?: (value1?: any, value2?: any) => boolean;\n}\n\nconst getButtonClass = (color?: string, outline?: boolean) => {\n let result = \"btn-\";\n result += outline ? \"outline-\" : \"\";\n result += color ? color : \"secondary\";\n return result;\n};\n\nconst defaultComparer = (value1: any, value2: any) =>\n value1 === value2 || (!value1 && !value2);\n\nconst RadioButtons = ({\n name,\n value,\n options,\n onChange,\n color,\n outline,\n valueComparer\n}: RadioButtonsProps) => {\n const comparer = valueComparer || defaultComparer;\n return (\n
\n {options.map((x, index) => (\n \n {\n e.target.checked && onChange(x.value);\n }}\n checked={comparer(value, x.value)}\n />\n {x.label}\n \n ))}\n
\n );\n};\nexport default RadioButtons;\n","import { Field, FieldProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col } from \"reactstrap\";\nimport \"./formstyles.scss\";\nimport RadioButtons from \"./RadioButtons\";\n\ninterface RadioButtonsFieldProps {\n title?: string;\n name: string;\n options: { label: any; value: any }[];\n color?: string;\n outline?: boolean;\n colSize?: number;\n submitOnChange?: boolean;\n onChange?: (value?: any) => void;\n}\n\nconst RadioButtonsField = ({\n title,\n name,\n options,\n color,\n outline,\n colSize,\n submitOnChange,\n onChange,\n}: RadioButtonsFieldProps) => (\n \n \n {({ form, field }: FieldProps) => (\n <>\n {title && }\n
\n {\n form.setFieldValue(field.name as any, value, !submitOnChange);\n form.setFieldTouched(field.name as any, true, !submitOnChange);\n if (onChange) {\n onChange(value);\n }\n submitOnChange && form.submitForm();\n }}\n />\n
\n \n )}\n
\n \n);\n\nexport default RadioButtonsField;\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\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\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'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n","import * as Yup from \"yup\";\nimport { DealerSetupQuestionnaire } from \"./types\";\n\nconst URL_PATTERN = /^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w\\-._~:/?#[\\]@!$&'()*+,;=.]+$/;\n\nconst dealerSetupQuestionnaireValidationSchema = Yup.object<\n DealerSetupQuestionnaire\n>().shape({\n hasPreviousRelationship: Yup.boolean()\n .label(\"Does the dealer have a previous relationship with EVC\")\n .default(undefined),\n datePreviousRelationshipClosed: Yup.date()\n .label(\"When was the previous relationship closed\")\n .default(undefined)\n .nullable(true),\n reasonPreviousRelationshipClosed: Yup.string()\n .max(100)\n .default(undefined)\n .nullable(true)\n .label(\"Reason previous relationship was closed\"),\n issuesWithDealingAgain: Yup.boolean()\n .label(\n \"Do the reasons that the previous relationship was closed present problems for dealing again?\"\n )\n .default(undefined),\n highWriteOffsOrArrears: Yup.boolean()\n .default(undefined)\n .label(\"Did we experience high levels of write-offs or arrears\"),\n isOnLenderZList: Yup.boolean()\n .default(undefined)\n .label(\"Is the dealer on any lender Z list\"),\n employeeRelationshipWithEVC: Yup.boolean()\n .default(undefined)\n .label(\"Have any dealership employees had a previous relationship with EVC\"),\n employeeRelationshipPreviousDealer: Yup.string()\n .max(100)\n .default(undefined)\n .nullable(true)\n .label(\"What dealership did the employee work for\"),\n employeeRelationshipPreviousDealerRelationship: Yup.string()\n .max(100)\n .default(undefined)\n .nullable(true)\n .label(\"How was the previous dealer's relationship with EVC\"),\n relationshipAdditionalInformation: Yup.string()\n .max(100)\n .label(\"Additional information\")\n .default(undefined)\n .nullable(true),\n longTermLeaseOnPremises: Yup.boolean()\n .default(undefined)\n .label(\"Long term lease on premises\"),\n longTermLeaseOnPremisesDetails: Yup.string()\n .max(100)\n .label(\"Type of ownership or lease\")\n .default(undefined)\n .nullable(true),\n numberOfVehiclesInStock: Yup.number()\n .transform(value => (value || value === 0 ? value : null))\n .label(\"Number of vehicles in stock\")\n .default(undefined)\n .min(0)\n .integer()\n .nullable(true),\n stockReview: Yup.string()\n .max(100)\n .nullable(true)\n .default(undefined),\n isStockFinanceable: Yup.boolean()\n .label(\"Is 90% or more of dealer stock financeable\")\n .default(undefined)\n .nullable(true),\n reasonNotFinanceable: Yup.string()\n .max(100)\n .label(\"Reason 90% or more of dealer stock is not financeable\")\n .default(undefined)\n .nullable(true),\n isMileageWithinLenderPolicy: Yup.boolean()\n .label(\"Is mileage within lender policy\")\n .default(undefined)\n .nullable(true),\n highestVehicleMileage: Yup.number()\n .label(\"Highest vehicle mileage\")\n .min(0)\n .integer()\n .default(undefined)\n .transform(value => (value || value === 0 ? value : null))\n .nullable(true),\n isAgeWithinUnderwritingPolicy: Yup.boolean()\n .label(\"Are the vehicle ages within underwriting policy\")\n .default(undefined)\n .nullable(true),\n highestVehicleAge: Yup.number()\n .label(\"Highest vehicle age\")\n .min(0)\n .integer()\n .default(undefined)\n .transform(value => (value || value === 0 ? value : null))\n .nullable(true),\n sorStock: Yup.boolean()\n .label(\"Does the dealer have SOR stock\")\n .default(undefined)\n .nullable(true),\n smartAndReasonable: Yup.boolean()\n .label(\"Are the vehicles well prepared and reasonably priced\")\n .default(undefined)\n .nullable(true),\n hasForecourtAndSignage: Yup.boolean()\n .label(\"Does the dealer have a forecourt and full signage\")\n .default(undefined)\n .nullable(true),\n reasonNoForecourtOrSignage: Yup.string()\n .max(100)\n .label(\"Reason the dealer does not have a forecourt or signage\")\n .default(undefined)\n .nullable(true),\n vehiclesPhotographedConsistently: Yup.boolean()\n .label(\"Are vehicles photographed consistently on the dealer website\")\n .default(undefined)\n .nullable(true),\n advertisesSubprimeFinance: Yup.boolean()\n .label(\"Does the dealership heavily advertise subprime finance\")\n .default(undefined)\n .nullable(true),\n customersFreeToVisit: Yup.boolean()\n .label(\"Can customers visit the dealership freely\")\n .default(undefined)\n .nullable(true),\n hasComplaintsProcess: Yup.boolean()\n .label(\"Does the dealership have a complaints process\")\n .default(undefined)\n .nullable(true),\n complaintsProcessDetails: Yup.string()\n .label(\"Details of the customer complaints process\")\n .max(100)\n .default(undefined),\n reputationConcerns: Yup.boolean()\n .label(\"Do you have reputation concerns\")\n .default(undefined),\n negativeReviewsOnWeb: Yup.boolean()\n .label(\"Are there negative reviews on the web\")\n .nullable(true)\n .default(undefined),\n negativeReviewsOnWebDetails: Yup.string()\n .max(100)\n .label(\"Details of negative reviews of the dealer from the web\")\n .default(undefined)\n .nullable(true),\n negativeReviewsOnSocialMedia: Yup.boolean()\n .label(\"Are there negative reviews on social media\")\n .nullable(true)\n .default(undefined),\n negativeReviewsOnSocialMediaDetails: Yup.string()\n .max(100)\n .label(\"Details of negative reviews of the dealer on social media\")\n .default(undefined)\n .nullable(true),\n negativeNews: Yup.boolean()\n .label(\"Are there negative news stories or google results about the dealer\")\n .nullable(true)\n .default(undefined),\n negativeNewsDetails: Yup.string()\n .max(100)\n .label(\"Details of negative news stories about the dealer\")\n .default(undefined)\n .nullable(true),\n hasGoodReputation: Yup.boolean()\n .label(\"Does the dealer have a good reputation within the local trade\")\n .default(undefined)\n .nullable(true),\n wasReferred: Yup.boolean()\n .label(\"Was the dealer referred from a local dealer\")\n .default(undefined)\n .nullable(true),\n referredBy: Yup.string()\n .max(100)\n .label(\"Name of the dealer which referred this dealer\")\n .default(undefined)\n .nullable(true),\n positiveAndAppropriate: Yup.boolean()\n .label(\"Will the dealer represent the Eurodrive brand\")\n .default(undefined)\n .nullable(true),\n directorsAssociatedWithOtherCompanies: Yup.boolean()\n .label(\"Is the director associated with other companies\")\n .default(undefined)\n .nullable(true),\n directorOtherCompanyName: Yup.string()\n .max(100)\n .label(\"Name of other companies the directors are associated with\")\n .default(undefined)\n .nullable(true),\n directorOtherCompanyUrl: Yup.string()\n .max(200)\n .matches(URL_PATTERN, \"Website format is not correct\")\n .label(\n \"Companies house url of other companies the directors are associated with\"\n )\n .default(undefined)\n .nullable(true),\n directorOtherCompanyRegNumber: Yup.string()\n .max(100)\n .label(\n \"Registration number of other companies the directors are associated with\"\n )\n .default(undefined)\n .nullable(true),\n ultimateBeneficialOwners: Yup.string()\n .label(\"Who are the dealership's ultimate beneficial owners\")\n .max(100)\n .nullable(true)\n .default(undefined),\n approvedPersons: Yup.string()\n .label(\"Who are the dealership's approved persons\")\n .max(100)\n .nullable(true)\n .default(undefined),\n investors: Yup.string()\n .label(\"Who are the dealership's stock owners / investors\")\n .max(100)\n .nullable(true)\n .default(undefined),\n otherInterestedParties: Yup.string()\n .label(\"Who are the dealership's other interested parties\")\n .max(100)\n .nullable(true)\n .default(undefined),\n financeProviders: Yup.string()\n .label(\"Who are the dealership's current / previous finance providers?\")\n .max(100)\n .nullable(true)\n .default(undefined),\n financeProvidersDuration: Yup.string()\n .label(\"How long has the dealership dealt with these providers?\")\n .max(100)\n .nullable(true)\n .default(undefined),\n hasVisualShowroomFinance: Yup.boolean()\n .label(\"Does the dealership have visual showroom finance offerings?\")\n .default(undefined)\n .nullable(true),\n whyDoesTheDealerWantToWorkWithEVC: Yup.string()\n .label(\"Why does the dealer want to work with EVC?\")\n .default(undefined)\n .max(200)\n .nullable(true),\n productSetupPCP: Yup.boolean()\n .label(\"PCP\")\n .default(false)\n .nullable(true),\n productSetupLTVLoans: Yup.boolean()\n .label(\"LTV\")\n .default(false)\n .nullable(true),\n productSetupSubprime: Yup.boolean()\n .label(\"Sub prime\")\n .default(false)\n .nullable(true),\n productSetupVATAssist: Yup.boolean()\n .label(\"VAT assist\")\n .default(false)\n .nullable(true),\n productSetupZeroPercentSubsidy: Yup.boolean()\n .label(\"0% subsidy\")\n .default(false)\n .nullable(true),\n productSetupLenders: Yup.array(Yup.string().min(1))\n .label(\"Lenders\")\n .default([])\n .nullable(true)\n});\n\nexport default dealerSetupQuestionnaireValidationSchema;\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import * as React from \"react\";\n\nconst StatsBox = ({\n label,\n description,\n value,\n units,\n loading\n}: {\n label: string;\n description?: string;\n value?: string;\n units?: string;\n loading?: boolean;\n}) => (\n
\n {loading ? (\n

 

\n ) : (\n

\n {units ? {units} : null}\n {value || \"0\"}\n

\n )}\n

{label}

\n

{description}

\n
\n);\n\nexport default StatsBox;\n","import { Dealer } from \"../../Dealers/types\";\nimport { SearchArgs } from \"../../types\";\nimport { AccountManager } from \"../types\";\n\nexport interface AccountManagerActivity {\n id?: number;\n dealerId?: number;\n accountManagerId?: string;\n notes?: string;\n activityDate?: string;\n activityType?: ActivityType;\n dealer?: Dealer;\n accountManager?: AccountManager;\n}\n\nexport enum ActivityType {\n TELEPHONE_CALL = \"TELEPHONE_CALL\",\n VISIT = \"VISIT\"\n}\n\nexport interface AccountManagerActivitySearchArgs extends SearchArgs {\n dealerId?: number;\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n}\n","import * as Yup from \"yup\";\nimport { AccountManagerActivity } from \"./types\";\n\nconst accountManagerActivityValidationSchema = Yup.object<\n AccountManagerActivity\n>().shape({\n id: Yup.number()\n .nullable(true)\n .default(undefined),\n dealerId: Yup.number()\n .required()\n .label(\"Dealer\")\n .default(undefined)\n .nullable(true),\n accountManagerId: Yup.string()\n .required()\n .label(\"Account manager\")\n .default(undefined)\n .nullable(true),\n notes: Yup.string()\n .required()\n .label(\"Notes\")\n .max(1000)\n .default(undefined),\n activityDate: Yup.string()\n .required()\n .default(undefined)\n .label(\"Activity date\"),\n activityType: Yup.string()\n .required()\n .default(undefined)\n .label(\"Activity type\")\n});\n\nexport default accountManagerActivityValidationSchema;\n","import { faCaretRight } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field, FieldProps, FormikProps } from \"formik\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { Col, Input, Row } from \"reactstrap\";\nimport CustomDatePicker from \"../../CustomDatePicker\";\nimport { useDealerShallow } from \"../../Dealers/DealerQuery\";\nimport DealerSelect from \"../../Dealers/DealerSelect\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport RadioField from \"../../Forms/RadioField\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport { useAccountManagerShallow } from \"../AccountManagerQuery\";\nimport AccountManagerSelect from \"../AccountManagerSelect\";\nimport { AccountManagerActivity, ActivityType } from \"./types\";\n\nconst CreateOrUpdateActivityFormInner = ({\n values,\n setFieldValue,\n setFieldTouched,\n context\n}: FormikProps & { context?: ContextNames }) => {\n const { loggedInUser, isAccountManager } = useLoggedInUser();\n\n const {\n accountManager,\n loading: accountManagerLoading\n } = useAccountManagerShallow(values.accountManagerId);\n const { dealer, loading: dealerLoading } = useDealerShallow(values.dealerId);\n\n const maxDate = moment()\n .endOf(\"day\")\n .toDate();\n\n if (!loggedInUser || accountManagerLoading || dealerLoading) {\n return null;\n }\n\n const create = !values.id;\n\n const accountManagerFixed =\n !!values.accountManagerId &&\n (!create ||\n isAccountManager ||\n context === ContextNames.ACCOUNT_MANAGER ||\n context === ContextNames.DEALER);\n\n const dealerFixed =\n !values.accountManagerId ||\n (!!values.dealerId && (!create || context === ContextNames.DEALER));\n\n return (\n <>\n {!isAccountManager ||\n values.accountManagerId !== loggedInUser.accountManager?.id ? (\n \n \n \n {(fieldProps: any) => (\n \n {accountManagerFixed ? (\n <>\n \n {context !== ContextNames.ACCOUNT_MANAGER && !create ? (\n \n Go to account manager\n \n \n ) : null}\n \n ) : (\n {\n setFieldTouched(\"accountManagerId\", true);\n setFieldValue(\"accountManagerId\", id);\n setFieldValue(\"dealerId\", null);\n }}\n autoFocus={true}\n isClearable={true}\n isDisabled={accountManagerFixed}\n />\n )}\n \n )}\n \n \n \n ) : null}\n \n \n \n {(formikProps: any) => (\n \n {dealerFixed ? (\n <>\n {\" \"}\n {context !== ContextNames.DEALER && !create ? (\n \n Go to dealer\n \n \n ) : null}\n \n ) : (\n {\n setFieldTouched(\"dealerId\", true);\n setFieldValue(\"dealerId\", did);\n }}\n autoFocus={accountManagerFixed}\n isClearable={true}\n isDisabled={dealerFixed}\n includeSuspended={true}\n />\n )}\n \n )}\n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n {\n setFieldValue(\"activityDate\", moment(date).toISOString());\n }}\n />\n \n \n )}\n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n );\n};\n\nexport default CreateOrUpdateActivityFormInner;\n","import gql from \"graphql-tag\";\nimport { SingleDealerFragment } from \"../../Dealers/fragments\";\nimport { AccountManagerShallowFragment } from \"../fragments\";\n\nexport const AccountManagerActivityFragment = gql`\n fragment AccountManagerActivityFragment on AccountManagerActivity {\n id\n dealerId\n accountManagerId\n notes\n activityDate\n activityType\n dealer {\n ...SingleDealerFragment\n }\n accountManager {\n ...AccountManagerShallowFragment\n }\n }\n ${SingleDealerFragment}\n ${AccountManagerShallowFragment}\n`;\n","import gql from \"graphql-tag\";\nimport { useQuery } from \"react-apollo\";\nimport { AccountManagerActivityFragment } from \"./fragments\";\nimport { AccountManagerActivity } from \"./types\";\n\ninterface AccountManagerActivityData {\n activity?: AccountManagerActivity;\n}\n\ninterface AccountManagerActivityVariables {\n id?: number;\n}\n\nexport const GET_ACCOUNT_MANAGER_ACTIVITY = gql`\n query AccountManagerActivityQuery($id: ID!) {\n activity(id: $id) {\n ...AccountManagerActivityFragment\n }\n }\n ${AccountManagerActivityFragment}\n`;\n\nexport const useAccountManagerActivity = (id?: number) => {\n const { loading, data } = useQuery<\n AccountManagerActivityData,\n AccountManagerActivityVariables\n >(GET_ACCOUNT_MANAGER_ACTIVITY, { variables: { id }, skip: !id });\n\n return { loading, activity: data?.activity };\n};\n\nexport default useAccountManagerActivity;\n","import gql from \"graphql-tag\";\nimport { useMutation } from \"react-apollo\";\nimport { AccountManagerActivityFragment } from \"./fragments\";\nimport { AccountManagerActivity } from \"./types\";\n\ninterface CreateOrUpdateActivityData {\n createOrUpdateActivity: AccountManagerActivity;\n}\n\ninterface CreateOrUpdateActivityVariables {\n input: AccountManagerActivity;\n}\n\nconst CREATE_OR_UPDATE_ACTIVITY_MUTATION = gql`\n mutation CreateOrUpdateAccountManagerActivity(\n $input: AccountManagerActivityInput\n ) {\n createOrUpdateActivity(input: $input) {\n ...AccountManagerActivityFragment\n }\n }\n ${AccountManagerActivityFragment}\n`;\n\nconst useCreateOrUpdateActivity = () => {\n const [createOrUpdateActivity] = useMutation<\n CreateOrUpdateActivityData,\n CreateOrUpdateActivityVariables\n >(CREATE_OR_UPDATE_ACTIVITY_MUTATION);\n return createOrUpdateActivity;\n};\n\nexport default useCreateOrUpdateActivity;\n","import { merge } from \"lodash\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { cleanFormData } from \"../../../utils\";\nimport { useDealer } from \"../../Dealers/DealerQuery\";\nimport ModalForm from \"../../Forms/ModalForm\";\nimport { PagedListContext } from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport accountManagerActivityValidationSchema from \"./accountManagerActivityValidationSchema\";\nimport CreateOrUpdateActivityFormInner from \"./CreateOrUpdateActivityFormInner\";\nimport { AccountManagerActivity } from \"./types\";\nimport useAccountManagerActivity from \"./useAccountManagerActivity\";\nimport useCreateOrUpdateActivity from \"./useCreateOrUpdateActivity\";\n\nconst cleanActivityBeforeSubmit = (values: AccountManagerActivity) => {\n const result = cleanFormData(values);\n\n delete result.accountManager;\n delete result.dealer;\n\n return result;\n};\n\nconst CreateOrUpdateActivityModal = ({\n accountManagerActivityId,\n accountManagerId,\n dealerId,\n context,\n isOpen,\n toggle\n}: {\n accountManagerActivityId?: number;\n accountManagerId?: string;\n dealerId?: number;\n context?: ContextNames;\n isOpen: boolean;\n toggle: () => void;\n}) => {\n const defaults = accountManagerActivityValidationSchema.default() as AccountManagerActivity;\n const { activity, loading } = useAccountManagerActivity(\n accountManagerActivityId\n );\n const mutation = useCreateOrUpdateActivity();\n\n const { refresh } = React.useContext(PagedListContext);\n const { dealer, loading: dealerLoading } = useDealer(dealerId);\n\n if (loading || dealerLoading) {\n return null;\n }\n\n const initialValues = merge(\n {},\n defaults,\n {\n dealerId,\n accountManagerId: accountManagerId || dealer?.accountManager?.id,\n activityDate: moment().toISOString()\n },\n activity\n );\n const create = !initialValues.id;\n\n return (\n {\n const variables = { input: cleanActivityBeforeSubmit(values) };\n\n return mutation({\n variables\n }).then(refresh);\n }}\n >\n {formikProps => (\n \n )}\n \n );\n};\n\nexport default CreateOrUpdateActivityModal;\n","import * as React from \"react\";\nimport { Button } from \"reactstrap\";\nimport { ContextNames } from \"../../types\";\nimport { useToggle } from \"../../withToggleState\";\nimport CreateOrUpdateActivityModal from \"./CreateOrUpdateActivityModal\";\nimport { AccountManagerActivitySearchArgs } from \"./types\";\n\nconst AccountManagerActivityActionButtons = ({\n context,\n variables\n}: {\n context?: ContextNames;\n variables?: { input: AccountManagerActivitySearchArgs };\n}) => {\n const { active, toggle } = useToggle();\n const { dealerId, accountManagerId } = variables?.input || {};\n\n return (\n <>\n
\n \n
\n \n \n );\n};\n\nexport default AccountManagerActivityActionButtons;\n","import gql from \"graphql-tag\";\nimport { useMutation } from \"react-apollo\";\n\nconst DELETE_ACCOUNT_MANAGER_ACTIVITY = gql`\n mutation DeleteAccountManagerActivity($id: ID!) {\n deleteActivity(id: $id) {\n success\n }\n }\n`;\n\nconst useDeleteAccountManagerActivity = () => {\n const [deleteAccountManagerActivity] = useMutation(\n DELETE_ACCOUNT_MANAGER_ACTIVITY\n );\n\n return deleteAccountManagerActivity;\n};\n\nexport default useDeleteAccountManagerActivity;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { PagedListContext } from \"../../PagedList\";\nimport { AccountManagerActivity } from \"./types\";\nimport useDeleteAccountManagerActivity from \"./useDeleteAccountManagerActivity\";\n\ninterface DeleteAccountManagerActivityDropdownItemProps {\n activity: AccountManagerActivity;\n}\n\nconst DeleteAccountManagerActivityDropdownItem = ({\n activity: { id }\n}: DeleteAccountManagerActivityDropdownItemProps) => {\n const mutation = useDeleteAccountManagerActivity();\n const { refresh } = React.useContext(PagedListContext);\n\n if (!id) {\n return null;\n }\n return (\n \n {confirm => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() =>\n mutation({\n variables: { id }\n }).then(refresh)\n );\n }}\n >\n Delete\n \n )}\n \n );\n};\n\nexport default DeleteAccountManagerActivityDropdownItem;\n","import { faPhoneAlt, faStoreAlt } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { Col, DropdownItem, Row } from \"reactstrap\";\nimport { formatEnumValue } from \"../../../utils\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport { ContextNames } from \"../../types\";\nimport DeleteAccountManagerActivityDropdownItem from \"./DeleteAccountManagerActivityDropdownItem\";\nimport { AccountManagerActivity, ActivityType } from \"./types\";\n\nconst AccountManagerActivityListItem = ({\n item,\n context,\n onClick\n}: {\n item: AccountManagerActivity;\n context?: ContextNames;\n onClick?: () => void;\n}) => {\n const showAccountManagerAndDealer =\n context !== ContextNames.ACCOUNT_MANAGER && context !== ContextNames.DEALER;\n\n return (\n
\n \n \n

\n {context !== ContextNames.ACCOUNT_MANAGER ? (\n {item.accountManager?.name}\n ) : null}\n {showAccountManagerAndDealer ? \" | \" : null}\n {context !== ContextNames.DEALER ? (\n {item.dealer?.name}\n ) : null}\n

\n

\n \n {formatEnumValue(item.activityType)}{\" \"}\n {moment(item.activityDate).format(\"Do MMMM YYYY\")}\n

\n

{item.notes}

\n \n \n \n Edit activity\n \n \n \n \n
\n
\n );\n};\n\nexport default AccountManagerActivityListItem;\n","import gql from \"graphql-tag\";\nimport memoizeOne from \"memoize-one\";\nimport * as React from \"react\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport AccountManagerActivityActionButtons from \"./AccountManagerActivityActionButtons\";\nimport AccountManagerActivityListItem from \"./AccountManagerActivityListItem\";\nimport CreateOrUpdateActivityModal from \"./CreateOrUpdateActivityModal\";\nimport { AccountManagerActivityFragment } from \"./fragments\";\nimport {\n AccountManagerActivity,\n AccountManagerActivitySearchArgs\n} from \"./types\";\n\ninterface AccountManagerActivityListProps {\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n dealerId?: number;\n context?: ContextNames;\n}\n\nexport const ACCOUNT_MANAGER_ACTIVITIES_LIST = gql`\n query ActivityListQuery($input: AccountManagerActivitySearchArgsInput) {\n activities(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...AccountManagerActivityFragment\n }\n }\n }\n }\n ${AccountManagerActivityFragment}\n`;\n\nconst defaultSearchArgs = {\n page: 1,\n pageSize: 10\n};\n\nconst AccountManagerActivityList = ({\n accountManagerId,\n regionalSalesManagerId,\n dealerId,\n context\n}: AccountManagerActivityListProps) => {\n const [state, setState] = React.useState<{\n activityId?: number;\n isEditing: boolean;\n }>({ isEditing: false });\n\n const hideModal = React.useCallback(\n () => setState({ ...state, isEditing: false }),\n [state, setState]\n );\n\n const handleClick = React.useCallback(\n (item: AccountManagerActivity) =>\n setState({ activityId: item.id, isEditing: true }),\n [setState]\n );\n\n const { activityId, isEditing } = state;\n\n return (\n <>\n \n placeholder=\"Search activities\"\n context={context}\n mapValuesToQuerystring={values => values}\n mapQuerystringToValues={qs => qs}\n fixedValues={{ accountManagerId, dealerId, regionalSalesManagerId }}\n defaultValues={defaultSearchArgs}\n >\n {formikProps => {\n const getVariables = memoizeOne(initialValues => ({\n input: initialValues || {}\n }));\n return (\n data.activities}\n variables={getVariables(formikProps.initialValues)}\n context={context}\n actionButtonsComponent={AccountManagerActivityActionButtons}\n onClick={handleClick}\n fetchPolicy=\"cache-and-network\"\n >\n \n \n );\n }}\n \n \n );\n};\n\nexport default AccountManagerActivityList;\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","import moment from \"moment\";\nimport * as Yup from \"yup\";\nimport {\n DATE_PATTERN,\n EMAIL_PATTERN,\n testDateStringIsValid,\n} from \"../../utils\";\nimport telephoneValidationSchema from \"../Forms/telephoneValidationSchema\";\nimport { Address } from \"../types\";\nimport dealerContactValidationSchema from \"./DealerContacts/dealerContactValidationSchema\";\nimport dealerSetupQuestionnaireValidationSchema from \"./dealerSetupQuestionnaireValidationSchema\";\nimport { Dealer, DealerBank, DealerContact } from \"./types\";\nimport * as uuid from \"uuid\";\n\nconst URL_PATTERN =\n /^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w\\-._~:/?#[\\]@!$&'()*+,;=.]+$/;\nconst VAT_PATTERN = /^(GB)?([0-9]{9}|[0-9]{12}|(GD|HA)[0-9]{3})$/;\n\nexport const isEmailValid = (value: string | undefined) => {\n // Ignore empty values\n if (!value) {\n return false;\n }\n\n return new RegExp(EMAIL_PATTERN).test(value);\n};\n\nconst uniqueEmailAddresses =\n \"All contacts requesting portal access must have a different email address\";\n\nconst dealerValidationSchema = Yup.object().shape({\n id: Yup.number().nullable(true).default(undefined),\n accountManagerId: Yup.string().nullable(true).default(undefined).required(),\n name: Yup.string().label(\"Dealer name\").nullable(true).max(250).required(),\n isSuspended: Yup.bool().default(true),\n isMannIslandDealer: Yup.bool().default(false),\n isMannIslandZList: Yup.bool().default(false),\n isMultiQuote: Yup.bool().default(true),\n stockFunding: Yup.bool().default(false),\n franchised: Yup.bool().default(false),\n url: Yup.string()\n .label(\"Website\")\n .nullable(true)\n .matches(URL_PATTERN, \"Website format is not correct\")\n .required(),\n email: Yup.string()\n .label(\"Email\")\n .email(\"Email must be in the format example@example.com\")\n .nullable(true)\n .required(),\n mobile: telephoneValidationSchema\n .label(\"Mobile\")\n .when(\"id\", { is: (id) => !id, then: Yup.string().required() }),\n fax: telephoneValidationSchema.label(\"Fax\"),\n ccaNumber: Yup.string().label(\"FCA number\").nullable(true).max(10).required(),\n vatNumber: Yup.string()\n .label(\"VAT number\")\n .matches(VAT_PATTERN, \"VAT number is not correct\")\n .nullable(true)\n .max(20)\n .required(),\n ccaExpiry: Yup.string()\n .nullable(true)\n .default(moment().startOf(\"month\").add(6, \"month\").toISOString(true)),\n established: Yup.string()\n .matches(DATE_PATTERN, \"Established date is a required field\")\n .label(\"Established date\")\n .when(\"id\", { is: (id) => !id, then: Yup.string().required() })\n .default(undefined)\n .test(\n \"date-format-validation\",\n \"Date does not exist\",\n testDateStringIsValid\n )\n .nullable(true),\n location: Yup.object()\n .shape({\n latitude: Yup.number().nullable(true).required().default(undefined),\n longitude: Yup.number().nullable(true).required().default(undefined),\n })\n .nullable(true)\n .default(undefined),\n bank: Yup.object().shape({\n id: Yup.number().default(undefined).nullable(true),\n bank: Yup.string()\n .label(\"Bank\")\n .required()\n .nullable(true)\n .default(undefined)\n .max(100),\n accountNumber: Yup.string()\n .label(\"Account number\")\n .nullable(true)\n .default(undefined)\n .matches(/^\\d{8}$/, \"Bank account number must be 8 digits\")\n .required()\n .max(8),\n sortCode: Yup.string()\n .label(\"Sort code\")\n .nullable(true)\n .default(undefined)\n .matches(/^\\d\\d-\\d\\d-\\d\\d$/, 'Sort code must be in the format \"##-##-##\"')\n .required()\n .max(8),\n accountName: Yup.string()\n .label(\"Account name\")\n .nullable(true)\n .default(undefined)\n .max(100),\n bankAddress: Yup.string()\n .label(\"Bank address\")\n .nullable(true)\n .default(undefined)\n .when(\"id\", { is: (id) => !id, then: Yup.string().required() }),\n }),\n address: Yup.object
()\n .label(\"Address\")\n .shape({\n line1: Yup.string()\n .label(\"Line 1\")\n .default(undefined)\n .nullable(true)\n .required(\"Line 1 of the address is required\")\n .max(50),\n line2: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(50)\n .label(\"Line 2\"),\n line3: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(50)\n .label(\"Line 3\"),\n town: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(50)\n .label(\"Town\"),\n postcode: Yup.string()\n .default(undefined)\n .nullable(true)\n .max(8)\n .label(\"Postcode\"),\n countryId: Yup.string().nullable(true).default(\"GBR\"),\n telephone: telephoneValidationSchema.label(\"Telephone\").required(),\n }),\n contacts: Yup.array(dealerContactValidationSchema)\n .default([dealerContactValidationSchema.default()])\n .nullable(true)\n .when(\"id\", {\n is: (id) => !id,\n then: Yup.array(dealerContactValidationSchema)\n .required(uniqueEmailAddresses)\n .test(\n \"unique-email-addresses\",\n uniqueEmailAddresses,\n // tslint:disable:ter-prefer-arrow-callback\n // tslint:disable:only-arrow-functions\n function (value: DealerContact[]) {\n const uniqArr: string[] = [];\n let emailCount: number = 0;\n value.forEach((v, i) => {\n if (v.email && v.requestsDealerPortalUserAccount) {\n emailCount++;\n const lower = v.email?.toLowerCase();\n if (uniqArr.indexOf(lower) === -1) {\n uniqArr.push(lower);\n }\n }\n });\n if (emailCount !== uniqArr.length) {\n // Use a custom nonexistent path \"FORMSTATE_contactsError\".\n // This stops the other contact messages from being replaced with this one.\n return this.createError({\n path: \"FORMSTATE_contactsError\",\n message: uniqueEmailAddresses,\n });\n }\n return true;\n }\n )\n .test(\n \"director-required\",\n \"At least one director is required\",\n // tslint:disable:ter-prefer-arrow-callback\n // tslint:disable:only-arrow-functions\n function (value: DealerContact[]) {\n if (\n value &&\n !this.parent.id &&\n !value.some(\n (x) => x.isDirector && x.requestsDealerPortalUserAccount\n )\n ) {\n // Use a custom nonexistent path \"FORMSTATE_contactsError\".\n // This stops the other contact messages from being replaced with this one.\n return this.createError({\n path: \"FORMSTATE_contactsError\",\n message: \"At least one director is required with portal access\",\n });\n }\n if (\n value &&\n !this.parent.id &&\n !value.some(\n (x) =>\n x.requestsDealerPortalUserAccount && isEmailValid(x.email)\n )\n ) {\n return this.createError({\n path: \"FORMSTATE_contactsError\",\n message: \"Portal access requires a valid email address\",\n });\n }\n /*\n if (\n value &&\n !this.parent.id &&\n !value.some((x) => x.isFCARegulatedPerson)\n ) {\n return this.createError({\n path: \"FORMSTATE_contactsError\",\n message: \"At least one FCA regulated person is required\",\n });\n }\n */\n return true;\n }\n ),\n }),\n FORMSTATE_contactsError: Yup.string().default(undefined).nullable(true),\n companiesHouseUrl: Yup.string()\n .label(\"Companies House link\")\n .default(undefined)\n .nullable(true)\n .matches(URL_PATTERN, \"Website format is not correct\")\n .max(200),\n companyRegNumber: Yup.string()\n .label(\"Company registration number\")\n .default(undefined)\n .nullable(true)\n .max(100),\n tradingStyle: Yup.string()\n .label(\"Trading style\")\n .default(undefined)\n .nullable(true)\n .when(\"id\", { is: (id) => !id, then: Yup.string().required() })\n .max(100),\n assetClass: Yup.string()\n .label(\"Asset class\")\n .default(undefined)\n .nullable(true)\n .max(100),\n fCAStatus: Yup.string()\n .label(\"FCA status\")\n .default(undefined)\n .nullable(true)\n .max(100),\n fCAUrl: Yup.string()\n .label(\"Link to FCA website\")\n .default(undefined)\n .nullable(true)\n .matches(URL_PATTERN, \"Website format is not correct\")\n .max(200),\n netWorthFromCompaniesHouse: Yup.number()\n .label(\"Net worth from companies house\")\n .default(undefined)\n .nullable(true)\n .moreThan(0),\n averageBalance: Yup.number()\n .label(\"Average balance\")\n .default(undefined)\n .nullable(true)\n .moreThan(0),\n monthlyVolume: Yup.number()\n .label(\"Monthly volume\")\n .default(undefined)\n .nullable(true)\n .moreThan(0),\n allProofsProvided: Yup.boolean()\n .default(undefined)\n .label(\"Are all proofs provided?\")\n .nullable(true)\n .oneOf([true], \"At least one of each type required\")\n .when(\"id\", {\n is: (id) => !id,\n then: Yup.boolean().required(\"Proofs are missing!\"),\n }),\n isOnICORegister: Yup.boolean()\n .default(true)\n .label(\"ICO register check\")\n .nullable(true)\n .required(\"ICO register check has to be performed\"),\n icoNumber: Yup.string()\n .default(undefined)\n .label(\"ICO number\")\n .nullable(true)\n .max(50)\n .when(\"isOnICORegister\", {\n is: (isOnICORegister) => !!isOnICORegister,\n then: Yup.string().required(),\n }),\n agreedApr: Yup.number().default(undefined).label(\"Agreed APR\").nullable(true),\n questionnaire: dealerSetupQuestionnaireValidationSchema\n .default(undefined)\n .nullable(true)\n .when(\"FORMSTATE_requiresQuestionnaire\", {\n is: true,\n then: dealerSetupQuestionnaireValidationSchema.required(),\n }),\n FORMSTATE_requiresQuestionnaire: Yup.boolean().default(true),\n dealerSetupV2: Yup.boolean().default(true),\n documentStorageRef: Yup.string().default(uuid.v4()),\n});\n\nexport default dealerValidationSchema;\n","import * as Yup from \"yup\";\nimport { DATE_PATTERN, testDateStringIsValid } from \"../../../utils\";\nimport telephoneValidationSchema from \"../../Forms/telephoneValidationSchema\";\nimport { Address } from \"../../types\";\nimport { DealerContact, DealerContactEmailInclude } from \"../types\";\n\nconst addressValidationSchema = Yup.object
().shape({\n line1: Yup.string()\n .label(\"Line 1\")\n .default(undefined)\n .required(\"Line 1 of the address is required\")\n .max(50)\n .nullable(true),\n line2: Yup.string()\n .label(\"Line 2\")\n .default(undefined)\n .max(50)\n .nullable(true),\n line3: Yup.string()\n .label(\"Line 3\")\n .default(undefined)\n .max(50)\n .nullable(true),\n town: Yup.string()\n .label(\"Town\")\n .default(undefined)\n .max(50)\n .nullable(true),\n postcode: Yup.string()\n .label(\"Postcode\")\n .default(undefined)\n .max(8)\n .nullable(true)\n});\n\nconst dealerContactValidationSchema = Yup.object().shape({\n id: Yup.string()\n .nullable(true)\n .default(undefined),\n dealerId: Yup.number().default(0),\n title: Yup.string()\n .label(\"Title\")\n .nullable(true)\n .max(10),\n forename: Yup.string()\n .label(\"First name\")\n .max(50)\n .required(),\n surname: Yup.string()\n .label(\"Last name\")\n .max(50)\n .required(),\n position: Yup.string()\n .label(\"Position\")\n .nullable(true)\n .max(100),\n telephone: telephoneValidationSchema.label(\"Telephone\"),\n mobile: telephoneValidationSchema.label(\"Mobile telephone\").when(\"sMS\", {\n is: (sMS?: boolean) => !!sMS,\n then: Yup.string().required()\n }),\n fax: telephoneValidationSchema.label(\"Fax\"),\n email: Yup.string()\n .email()\n .max(255)\n .nullable(true)\n .label(\"Email\")\n .when([\"emailInclude\", \"requestsDealerPortalUserAccount\"], {\n is: (emailInclude?: string, requestsLogin?: boolean) =>\n (!!emailInclude && emailInclude !== DealerContactEmailInclude.NONE) ||\n !!requestsLogin,\n then: Yup.string().required()\n }),\n notes: Yup.string()\n .nullable(true)\n .max(1000),\n emailInclude: Yup.string()\n .default(DealerContactEmailInclude.NONE)\n .label(\"Send notification emails\")\n .nullable(true)\n .required(\"Field is required\"),\n sMS: Yup.boolean()\n .default(false)\n .label(\"Send SMS notifications\")\n .nullable(true),\n isDirector: Yup.boolean()\n .label(\"Director\")\n .default(false)\n .required(),\n directorDateOfBirth: Yup.string()\n .label(\"Director date of birth\")\n .matches(DATE_PATTERN, \"Date of birth is a required field\")\n .default(undefined)\n .nullable(true)\n .test(\n \"director-date-format-validation\",\n \"Date does not exist\",\n testDateStringIsValid\n )\n .typeError(\"Date of birth must be a date\")\n .when(\"isDirector\", {\n is: true,\n then: Yup.string().required()\n }) as any,\n isFCARegulatedPerson: Yup.boolean()\n .label(\"FCA regulated person\")\n .default(false)\n .required(),\n homeAddress: Yup.object
()\n .when(\"isDirector\", { is: true, then: addressValidationSchema.required() })\n .default(addressValidationSchema.default()),\n isMainContact: Yup.boolean()\n .label(\"Is main contact\")\n .default(false)\n .required(),\n isSAFTested: Yup.boolean()\n .label(\"Is user SAF tested?\")\n .default(false)\n .required(),\n requestsDealerPortalUserAccount: Yup.boolean()\n .label(\"Requests dealer portal login\")\n .default(false)\n .required()\n});\n\nexport default dealerContactValidationSchema;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\nimport { User } from \"../../types\";\nimport { DraftDealerFragment, DraftDealerShallowFragment } from \"../fragments\";\nimport { DealerEsignature, DraftDealer } from \"../types\";\n\nexport interface DraftDealerProps {\n loggedInUser: User;\n draftDealer: DraftDealer;\n}\n\ninterface DraftDealerData {\n loggedInUser: User;\n draftDealer: DraftDealer;\n}\n\ninterface DraftDealerArgs {\n draftDealerId?: number;\n}\n\nexport const GET_DRAFT_DEALER = gql`\n query DraftDealerQuery($draftDealerId: Int!) {\n loggedInUser {\n id\n username\n roles\n }\n draftDealer(id: $draftDealerId) {\n ...DraftDealerFragment\n }\n }\n ${DraftDealerFragment}\n`;\n\nexport const GET_DRAFT_DEALER_SHALLOW = gql`\n query DraftDealerQuery($draftDealerId: Int!) {\n loggedInUser {\n id\n username\n roles\n }\n draftDealer(id: $draftDealerId) {\n ...DraftDealerShallowFragment\n }\n }\n ${DraftDealerShallowFragment}\n`;\n\nexport const DealerEsignatureFragment = gql`\n fragment DealerEsignatureFragment on DealerEsignature {\n # id\n confirmed\n remoteAddr\n notes\n forename\n surname\n username\n # startDate\n # endDate\n # priority\n }\n`;\n\nexport const GET_DEALER_EIGNATURE = gql`\n query DealerEsignatureQuery($dealerId: Int!, $docType: Int!) {\n loggedInUser {\n id\n username\n roles\n }\n dealerEsignature(id: $dealerId, docType: $docType) {\n ...DealerEsignatureFragment\n }\n }\n ${DealerEsignatureFragment}\n`;\n\nexport const useDealerEsignature = (id?: number, docType?: number) => {\n const { loading, data } = useQuery(GET_DEALER_EIGNATURE, {\n variables: { dealerId: id, docType: docType },\n skip: !id,\n });\n return { loading, dealerEsignature: data };\n};\n\nconst DraftDealerQuery = ({\n children,\n draftDealerId,\n query,\n}: DraftDealerArgs & {\n children: (\n result: QueryResult & {\n draftDealer?: DraftDealer;\n }\n ) => JSX.Element | null;\n query?: any;\n}) => (\n \n query={query || GET_DRAFT_DEALER}\n variables={{ draftDealerId }}\n skip={!draftDealerId}\n >\n {(result) =>\n children({\n ...result,\n draftDealer: result?.data?.draftDealer,\n })\n }\n \n);\n\nexport default DraftDealerQuery;\n","import { gql } from \"apollo-boost\";\nimport { useMutation } from \"react-apollo\";\nimport { GET_ACCOUNT_MANAGER } from \"../../AccountManagers/AccountManagerQuery\";\nimport { DealerFragment } from \"../fragments\";\nimport { HouseDealer } from \"../types\";\n\nconst CREATE_HOUSE_DEALER = gql`\n mutation CreateHouseDealer($input: HouseDealerInput!) {\n createHouseDealer(input: $input) {\n ...DealerFragment\n }\n }\n ${DealerFragment}\n`;\n\nexport const useCreateHouseDealer = () => {\n const [createHouseDealer] = useMutation(CREATE_HOUSE_DEALER);\n\n return (houseDealer: HouseDealer) =>\n createHouseDealer({\n variables: { input: houseDealer },\n refetchQueries: [\n {\n query: GET_ACCOUNT_MANAGER,\n variables: { id: houseDealer.accountManagerId }\n }\n ]\n });\n};\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, FormGroup, Label, Row } from \"reactstrap\";\nimport config from \"../../../config\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport PeriodPickerField from \"../../Forms/PeriodPickerField\";\nimport RadioButtonsField from \"../../Forms/RadioButtonsField\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport { DealerMapStyle, DealerMapType, DealerSearchArgs } from \"../types\";\n\nconst DealerListFilterPanel = ({\n values,\n setFieldValue,\n submitForm,\n context,\n map\n}: FormikProps & {\n context?: ContextNames;\n map?: boolean;\n}) => {\n const {\n loggedInUser,\n loading,\n isAdministrator,\n isAccountManager\n } = useLoggedInUser();\n\n if (loading || !loggedInUser) {\n return null;\n }\n\n return (\n <>\n {map && (\n <>\n \n \n \n \n \n \n \n )}\n \n \n \n \n \n \n\n {context !== ContextNames.ACCOUNT_MANAGER && !isAccountManager && (\n \n \n \n \n {\n setFieldValue(\"accountManagerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n )}\n \n \n \n \n \n {isAdministrator && (\n \n )}\n \n );\n};\n\nexport default DealerListFilterPanel;\n","import classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Badge } from \"reactstrap\";\nimport config from \"../../config\";\nimport { convertToTitleCase } from \"../../utils\";\nimport { useLoggedInUser } from \"../LoggedInUserQuery\";\nimport { ContextNames } from \"../types\";\nimport { Dealer, DealerSetupStatus } from \"./types\";\nimport { IsStatusFullySetup } from \"./dealerSetup\";\n\nconst dss = Object.keys(DealerSetupStatus) as Array<\n keyof typeof DealerSetupStatus\n>;\n\nconst DealerBadges = ({\n dealer: {\n accountManager,\n groups,\n isSuspended,\n countOfActiveProposals,\n location,\n contractSigned,\n autoConvert,\n isOnICORegister,\n setupStatus,\n franchised,\n },\n className,\n context,\n}: {\n dealer: Dealer;\n context?: ContextNames;\n className?: string;\n}) => {\n const { isDealer, isAccountManager } = useLoggedInUser();\n\n return (\n
\n {context !== ContextNames.ACCOUNT_MANAGER &&\n !isAccountManager &&\n accountManager ? (\n {convertToTitleCase(accountManager.name)} (AM)\n ) : null}\n {isOnICORegister === false ? (\n \n Not on ICO register\n \n ) : !isOnICORegister && !isDealer ? (\n \n ICO check required\n \n ) : null}\n {!autoConvert ? (\n \n Not in {config.AUTOCONVERT_NAME}\n \n ) : null}\n {groups &&\n groups.map((g) => (\n \n {g.name}\n \n ))}\n {countOfActiveProposals && !isDealer && (\n \n {countOfActiveProposals}\n {countOfActiveProposals > 1 ? \" proposals\" : \" proposal\"}\n \n )}\n {!location && !isDealer && (\n \n No location specified\n \n )}\n {isSuspended && contractSigned && Suspended}\n {!contractSigned && isDealer && (\n \n Not approved\n \n )}\n {!isDealer &&\n setupStatus != null &&\n !IsStatusFullySetup(setupStatus) &&\n dss.map(\n (el, index) =>\n index > (franchised ? 1 : 0) && (\n \n \n {DealerSetupStatus[el]}\n {\": \"}\n {(setupStatus || 0) & Math.pow(2, index - 1) ? \"Yes\" : \"No\"}\n {\" \"}\n \n )\n )}\n
\n );\n};\n\nexport default DealerBadges;\n","import { FormikProps } from \"formik\";\nimport { isEqual, omit, pick } from \"lodash\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { ViewState } from \"react-map-gl\";\nimport { cleanNumber, getMonthDateRange } from \"../../../utils\";\nimport FormikEffects from \"../../Forms/FormikEffects\";\nimport SearchFormCore from \"../../Forms/SearchFormCore\";\nimport { ProposalSearchArgs } from \"../../Proposals/types\";\nimport { CompositeComponent, ContextNames } from \"../../types\";\nimport { DealerMapStyle, DealerMapType, DealerSearchArgs } from \"../types\";\n\nexport type DealerListSearchFormValues = DealerSearchArgs &\n Partial & {\n proposalEditDates?: string;\n mapType?: DealerMapType;\n options?: boolean;\n mapStyle?: DealerMapStyle;\n };\n\nconst viewStatePropNames: (keyof ViewState)[] = [\n \"latitude\",\n \"longitude\",\n \"zoom\",\n \"pitch\",\n \"bearing\"\n];\n\nconst mapOptionsPropNames = [\n \"proposalEditDates\",\n \"mapType\",\n \"options\",\n \"mapStyle\"\n];\n\ninterface DealerListProps {\n variables: {\n input: DealerSearchArgs;\n totalFinanceFilter: ProposalSearchArgs;\n };\n initialViewState: Partial;\n context?: ContextNames;\n onViewStateChanged: (viewState: Partial) => void;\n formikProps: FormikProps;\n}\n\ninterface DealerSearchFormProps {\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n fixedPageSize?: number;\n fixedPage?: number;\n fixedHasLocationOnly?: boolean;\n context?: ContextNames;\n className?: string;\n searchPanelWrapper?: CompositeComponent<{ children?: React.ReactNode }>;\n children: (props: DealerListProps) => JSX.Element | null;\n}\n\nconst { value: lastMonth } = getMonthDateRange(moment().subtract(1, \"month\"));\n\nconst defaultSearchArgs = {\n page: 1,\n pageSize: 10,\n includeSuspended: false,\n fundedDealersOnly: false,\n hasActivityInLastSixWeeks: false,\n hasActivityInLastYear: false,\n hasActiveProposalsOnly: false,\n hasLocationOnly: false,\n locationNotFoundOnly: false,\n hasProposalsPaidOutInTimePeriod: false,\n proposalStartDate: lastMonth.start,\n proposalEndDate: lastMonth.end,\n proposalEditDates: false,\n mapType: DealerMapType.LOCATIONS,\n options: false,\n mapStyle: DealerMapStyle.LIGHT,\n autoConvertOnly: false,\n houseDealersOnly: false\n};\n\nconst defaultViewState: any = {\n latitude: null,\n longitude: null,\n zoom: null,\n pitch: null,\n bearing: null\n};\n\nconst DealerListSearchForm = ({\n accountManagerId,\n regionalSalesManagerId,\n fixedPageSize,\n fixedPage,\n fixedHasLocationOnly,\n context,\n className,\n children\n}: DealerSearchFormProps) => (\n ({\n ...qs,\n fundedDealersOnly: qs.fundedDealersOnly === \"true\",\n includeSuspended: qs.includeSuspended === \"true\",\n hasActivityInLastSixWeeks: qs.hasActivityInLastSixWeeks === \"true\",\n hasActivityInLastYear: qs.hasActivityInLastYear === \"true\",\n hasActiveProposalsOnly: qs.hasActiveProposalsOnly === \"true\",\n locationNotFoundOnly: qs.locationNotFoundOnly === \"true\",\n hasLocationOnly: qs.hasLocationOnly === \"true\",\n latitude: cleanNumber(qs.latitude),\n longitude: cleanNumber(qs.longitude),\n pitch: cleanNumber(qs.pitch),\n bearing: cleanNumber(qs.bearing),\n zoom: cleanNumber(qs.zoom),\n proposalEditDates: qs.proposalEditDates === \"true\",\n options: qs.options === \"true\"\n })}\n mapValuesToQuerystring={values => values}\n defaultValues={{ ...defaultSearchArgs, ...defaultViewState }}\n fixedValues={{\n pageSize: fixedPageSize,\n page: fixedPage,\n hasLocationOnly: fixedHasLocationOnly,\n accountManagerId,\n regionalSalesManagerId\n }}\n context={context}\n className={className}\n >\n {(\n formikProps: FormikProps<\n DealerSearchArgs &\n Partial & {\n proposalStartDate?: string;\n proposalEndDate?: string;\n }\n >\n ) => {\n const input: DealerSearchArgs = omit(\n formikProps.initialValues,\n (viewStatePropNames as string[]).concat(mapOptionsPropNames)\n );\n const viewState: Partial = pick(\n formikProps.initialValues,\n viewStatePropNames\n );\n\n const variables = {\n input,\n totalFinanceFilter: {\n startDate: formikProps.initialValues.proposalStartDate,\n endDate: formikProps.initialValues.proposalEndDate\n }\n };\n\n const onViewStateChanged = (nextViewState: Partial) => {\n viewStatePropNames.forEach(k => {\n const value =\n nextViewState[k] || nextViewState[k] === 0\n ? nextViewState[k]\n : null;\n formikProps.setFieldValue(k, value, false);\n });\n };\n\n return (\n <>\n ,\n currentValues: DealerSearchArgs & Partial\n ) => {\n // Do not reset the location when these prop names change\n const ignorePropNames = [\n ...viewStatePropNames,\n \"options\",\n \"mapStyle\",\n \"q\"\n ];\n\n const prevFormValues: DealerSearchArgs & {\n mapType?: string;\n } = omit(prevValues, ignorePropNames);\n const currentFormValues: DealerSearchArgs & {\n mapType?: string;\n } = omit(currentValues, ignorePropNames);\n\n let shouldSubmit = false;\n\n const formValuesChanged = !isEqual(\n prevFormValues,\n currentFormValues\n );\n const searchTextChanged = prevValues.q !== currentValues.q;\n\n // If the search values have changed, reset the map location\n if (formValuesChanged || searchTextChanged) {\n viewStatePropNames.forEach(p =>\n formikProps.setFieldValue(p, null, false)\n );\n }\n\n if (formValuesChanged) {\n shouldSubmit = true;\n }\n\n // If the map type changes to the chart, filter the dealers\n // to only show dealers with recent proposals\n if (\n currentFormValues.mapType ===\n DealerMapType.PROPOSAL_PAIDOUT_VALUE &&\n prevFormValues.mapType !==\n DealerMapType.PROPOSAL_PAIDOUT_VALUE &&\n !currentFormValues.hasProposalsPaidOutInTimePeriod\n ) {\n formikProps.setFieldValue(\n \"hasProposalsPaidOutInTimePeriod\",\n true,\n false\n );\n shouldSubmit = true;\n }\n\n // If the map location has changed, submit the form to update\n // the querystring\n const prevViewStateValues = pick(prevValues, viewStatePropNames);\n const currentViewStateValues = pick(\n currentValues,\n viewStatePropNames\n );\n\n if (!isEqual(prevViewStateValues, currentViewStateValues)) {\n shouldSubmit = true;\n }\n\n // Submit the form after a zero timeout, so the submit happens after\n // any state changes are written\n shouldSubmit && setTimeout(() => formikProps.submitForm(), 0);\n }}\n />\n {children({\n variables,\n context,\n initialViewState: {\n latitude: cleanNumber(viewState.latitude),\n longitude: cleanNumber(viewState.longitude),\n pitch: cleanNumber(viewState.pitch),\n bearing: cleanNumber(viewState.bearing),\n zoom: cleanNumber(viewState.zoom)\n },\n onViewStateChanged,\n formikProps\n })}\n \n );\n }}\n \n);\n\nexport default DealerListSearchForm;\n","import gql from \"graphql-tag\";\nimport { useQuery } from \"react-apollo\";\nimport {\n AccountManagerActualsFragment,\n AccountManagerTargetsFragment,\n AccountManagerTargetsFragmentWithoutNetProfit,\n AccountManagerActualsFragmentWithoutNetProfit,\n} from \"../fragments\";\nimport { AccountManagerTargets } from \"../types\";\n\nexport interface AccountManagerTargetsData {\n targets: AccountManagerTargets;\n}\n\nexport interface AccountManagerSingleTargetData {\n target: AccountManagerTargets;\n}\n\nexport const ACCOUNT_MANAGER_TARGETS = gql`\n query AccountManagerTargetsQuery(\n $input: AccountManagerTargetsArgsInputType!\n ) {\n targets(input: $input) {\n ...AccountManagerTargetsFragment\n actuals {\n ...AccountManagerActualsFragment\n }\n }\n }\n ${AccountManagerTargetsFragment}\n ${AccountManagerActualsFragment}\n`;\n\nexport const ACCOUNT_MANAGER_TARGETS_WITHOUT_NET_PROFIT = gql`\n query AccountManagerTargetsQuery(\n $input: AccountManagerTargetsArgsInputType!\n ) {\n targets(input: $input) {\n ...AccountManagerTargetsFragment\n actuals {\n ...AccountManagerActualsFragment\n }\n }\n }\n ${AccountManagerTargetsFragmentWithoutNetProfit}\n ${AccountManagerActualsFragmentWithoutNetProfit}\n`;\n\nexport const ACCOUNT_MANAGER_SINGLE_TARGET = gql`\n query AccountManagerSingleTargetQuery($id: ID!) {\n target(id: $id) {\n ...AccountManagerTargetsFragment\n actuals {\n ...AccountManagerActualsFragment\n }\n }\n }\n ${AccountManagerTargetsFragment}\n ${AccountManagerActualsFragment}\n`;\n\ninterface AccountManagerTargetsVariables {\n input: {\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n startDate?: string;\n endDate?: string;\n };\n}\n\nexport const useAccountManagerTargets = (\n input: {\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n startDate?: string;\n endDate?: string;\n },\n canViewNetProfit: boolean\n) => {\n let targetTemplate = ACCOUNT_MANAGER_TARGETS_WITHOUT_NET_PROFIT;\n\n if (canViewNetProfit) {\n targetTemplate = ACCOUNT_MANAGER_TARGETS;\n }\n const { data, loading } = useQuery<\n AccountManagerTargetsData,\n AccountManagerTargetsVariables\n >(targetTemplate, { variables: { input } });\n return { loading, targets: data?.targets };\n};\n\nexport const useAccountManagerSingleTarget = (id?: string) => {\n const { data, loading } = useQuery<\n AccountManagerSingleTargetData,\n { id?: string }\n >(ACCOUNT_MANAGER_SINGLE_TARGET, { variables: { id }, skip: !id });\n\n return { loading, target: data?.target };\n};\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n 'aria-label': PropTypes.string,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n role: PropTypes.string,\n size: PropTypes.string,\n vertical: PropTypes.bool\n};\nvar defaultProps = {\n tag: 'div',\n role: 'group'\n};\n\nvar ButtonGroup = function ButtonGroup(props) {\n var className = props.className,\n cssModule = props.cssModule,\n size = props.size,\n vertical = props.vertical,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"size\", \"vertical\", \"tag\"]);\n\n var classes = mapToCssModules(classNames(className, size ? 'btn-group-' + size : false, vertical ? 'btn-group-vertical' : 'btn-group'), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes\n }));\n};\n\nButtonGroup.propTypes = propTypes;\nButtonGroup.defaultProps = defaultProps;\nexport default ButtonGroup;","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Dropdown from './Dropdown';\nvar propTypes = {\n children: PropTypes.node\n};\n\nvar ButtonDropdown = function ButtonDropdown(props) {\n return React.createElement(Dropdown, _extends({\n group: true\n }, props));\n};\n\nButtonDropdown.propTypes = propTypes;\nexport default ButtonDropdown;","import * as React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport AccountManagerActivityList from \"./AccountManagerActivityList\";\n\nconst AccountManagerActivityTabContent = ({\n match\n}: RouteComponentProps<{\n dealerId?: string;\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n}>) => {\n const dealerId = match.params.dealerId\n ? parseInt(match.params.dealerId, 10)\n : undefined;\n const accountManagerId = match.params.accountManagerId\n ? decodeURIComponent(match.params.accountManagerId)\n : undefined;\n const regionalSalesManagerId = match.params.regionalSalesManagerId\n ? decodeURIComponent(match.params.regionalSalesManagerId)\n : undefined;\n\n return (\n \n );\n};\n\nexport const UserAccountManagerActivityTabContent = () => {\n const { loggedInUser, loading } = useLoggedInUser();\n\n if (loading || !loggedInUser) {\n return null;\n }\n\n const accountManagerId = loggedInUser.accountManager?.id;\n const regionalSalesManagerId = loggedInUser.regionalSalesManager?.id;\n\n return (\n \n );\n};\n\nexport default AccountManagerActivityTabContent;\n","import { Field, FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, Row } from \"reactstrap\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport { ContextNames, FormSize } from \"../../types\";\nimport { HouseDealer } from \"../types\";\n\nconst HouseDealerFormInner = ({\n values,\n setFieldValue,\n setFieldTouched,\n formSize,\n context\n}: FormikProps & {\n context?: ContextNames;\n formSize?: FormSize;\n}) => {\n const wideCol = formSize === FormSize.NARROW ? 12 : 6;\n\n return (\n <>\n \n \n \n {(fieldProps: any) => (\n \n {\n setFieldTouched(\"accountManagerId\", true);\n setFieldValue(\"accountManagerId\", amId);\n }}\n isDisabled={\n !!values.accountManagerId &&\n context === ContextNames.ACCOUNT_MANAGER\n }\n requiresHouseDealer={true}\n />\n \n )}\n \n \n \n \n );\n};\n\nexport default HouseDealerFormInner;\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport * as Yup from \"yup\";\nimport { cleanFormData } from \"../../../utils\";\nimport ModalForm from \"../../Forms/ModalForm\";\nimport { ContextNames } from \"../../types\";\nimport { HouseDealer } from \"../types\";\nimport { useCreateHouseDealer } from \"./CreateHouseDealerMutation\";\nimport HouseDealerFormInner from \"./HouseDealerFormInner\";\n\ninterface CreateHouseDealerModalProps {\n isOpen: boolean;\n toggle: () => void;\n context?: ContextNames;\n accountManagerId?: string;\n}\n\nconst houseDealerValidationSchema = Yup.object().shape({\n accountManagerId: Yup.string().required()\n});\n\nconst CreateHouseDealerModal = ({\n isOpen,\n toggle,\n context,\n accountManagerId\n}: CreateHouseDealerModalProps) => {\n const createHouseDealer = useCreateHouseDealer();\n const history = useHistory();\n\n return (\n \n createHouseDealer(cleanFormData(values)).then(result => {\n if (result?.data?.createHouseDealer) {\n history.push(`/dealers/${result.data.createHouseDealer.id}`);\n }\n })\n }\n context={context}\n >\n {(props: FormikProps & { context?: ContextNames }) => (\n \n )}\n \n );\n};\n\nexport default CreateHouseDealerModal;\n","import { faHome, faMapMarked } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport classnames from \"classnames\";\nimport React, { useState } from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport {\n DropdownItem,\n DropdownMenu,\n DropdownToggle,\n UncontrolledButtonDropdown\n} from \"reactstrap\";\nimport {\n useAccountManager,\n useLoggedInAccountManager\n} from \"../../AccountManagers/AccountManagerQuery\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport RouterDropdownItem from \"../../RouterDropdownItem\";\nimport { ContextNames } from \"../../types\";\nimport CreateHouseDealerModal from \"../CreateHouseDealer/CreateHouseDealerModal\";\n\nconst MapButtonLabel = () => (\n <>\n Map view\n \n);\n\nconst getCreateDealerUrl = (accountManagerId?: string) =>\n accountManagerId\n ? `/accountmanagers/${encodeURIComponent(accountManagerId)}/dealers/create`\n : \"/dealers/create\";\n\nconst CreateDealerButton = ({\n accountManagerId\n}: {\n accountManagerId?: string;\n}) => (\n \n New dealer\n \n);\n\nconst DealerListActionButtons = (props: any) => {\n const { context, variables } = props;\n const amId = variables.input.accountManagerId;\n\n const rsmId =\n context === ContextNames.REGIONAL_SALES_MANAGER &&\n variables.input.regionalSalesManagerId;\n\n const { accountManager: selectedAccountManager } = useAccountManager(amId);\n const {\n accountManager: loggedInAccountManager\n } = useLoggedInAccountManager();\n const { checkCanCreate, isSuperUser } = useLoggedInUser();\n\n const accountManager = selectedAccountManager || loggedInAccountManager;\n\n const canCreate = checkCanCreate(PermissionModuleNames.Dealers);\n\n const [showHouseDealerModal, setShowHouseDealerModal] = useState(false);\n const toggleHouseDealerModal = () =>\n setShowHouseDealerModal(!showHouseDealerModal);\n\n const hasHouseDealer = !!accountManager?.houseDealer;\n\n return (\n
\n {canCreate ? (\n <>\n {isSuperUser ? (\n <>\n \n \n \n \n \n New dealer\n \n \n \n New dealer (no questionnaire)\n \n \n New house dealer\n \n \n \n \n \n ) : (\n \n )}\n \n Draft dealers\n \n \n ) : null}\n \n \n \n {accountManager ? (\n \n \n House dealer\n \n ) : null}\n
\n );\n};\n\nexport default DealerListActionButtons;\n","import { faMapMarked, faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field, FieldProps } from \"formik\";\nimport gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { useMutation } from \"react-apollo\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport RouterDropdownItem from \"../../RouterDropdownItem\";\nimport { Dealer } from \"../types\";\nimport { DEALER_LIST } from \"./DealerListQuery\";\n\nconst DELETE_DEALER = gql`\n mutation DeleteDealer($id: ID!) {\n deleteDealer(id: $id) {\n success\n }\n }\n`;\n\nconst DealerDropdown = ({ dealer }: { dealer: Dealer }) => {\n const { id, name, location } = dealer;\n const [deleteDealer] = useMutation(DELETE_DEALER);\n\n const { loggedInUser, isAdministrator } = useLoggedInUser();\n\n if (!loggedInUser || !isAdministrator) {\n return null;\n }\n\n return (\n \n {({\n form: {\n initialValues: {\n editDates,\n latitude,\n longitude,\n zoom,\n pitch,\n bearing,\n mapType,\n mapStyle,\n options,\n proposalEditDates,\n ...initialValues\n }\n }\n }: FieldProps) => (\n \n \n Show on map\n \n\n \n \n

Are you sure you want to delete dealer \"{name}\"?

\n \n }\n confirmButtonText=\"Delete dealer\"\n confirmButtonColor=\"danger\"\n >\n {confirm => (\n \n confirm(() =>\n deleteDealer({\n variables: { id },\n refetchQueries: [\n {\n query: DEALER_LIST,\n variables: {\n input: initialValues || {}\n }\n }\n ]\n })\n )\n }\n >\n \n Delete\n
\n )}\n \n
\n )}\n
\n );\n};\n\nexport default DealerDropdown;\n","import * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Col, Row } from \"reactstrap\";\nimport { getShortAddress } from \"../../../utils\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport DealerBadges from \"../DealerBadges\";\nimport { DealerProps } from \"../types\";\nimport DealerDropdown from \"./DealerDropdown\";\nimport \"./DealerListItem.scss\";\n\nconst DealerListItem = ({ loggedInUser, dealer, context }: DealerProps) => (\n \n \n \n

\n {dealer.name}\n

\n

{getShortAddress(dealer.address)}

\n \n \n \n \n \n
\n
\n);\n\nexport const DealerListItemLoadingPlaceholder = () => (\n
\n \n
\n);\n\nexport default DealerListItem;\n","import * as React from \"react\";\nimport { SearchFormControlsCore } from \"../../Forms/SearchFormControls\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport DealerListActionButtons from \"./DealerListActionButtons\";\nimport DealerListFilterPanel from \"./DealerListFilterPanel\";\nimport DealerListItem from \"./DealerListItem\";\nimport { DEALER_LIST, DealerListData } from \"./DealerListQuery\";\nimport DealerListSearchForm from \"./DealerListSearchForm\";\n\ninterface DealerListProps {\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n context?: ContextNames;\n}\n\nconst DealerList = ({\n accountManagerId,\n regionalSalesManagerId,\n context\n}: DealerListProps) => (\n \n {({ variables, formikProps }) => (\n <>\n {\n formikProps.setFieldValue(\n \"options\",\n !formikProps.values.options,\n false\n );\n formikProps.submitForm();\n }}\n placeholder=\"Search dealers\"\n filterPanel={DealerListFilterPanel}\n formikProps={formikProps}\n context={context}\n />\n \n data.loggedInUser && data.loggedInUser.dealers\n }\n fetchPolicy=\"cache-and-network\"\n actionButtonsComponent={DealerListActionButtons}\n context={context}\n listItemComponent={({ item, loggedInUser }) => (\n \n )}\n />\n \n )}\n \n);\n\nexport default DealerList;\n","import classnames from \"classnames\";\nimport * as React from \"react\";\nimport { formatToPercentage } from \"../../../utils\";\n\nconst defaultFormatter = (value?: number) =>\n value ? Math.round(value).toString() : \"-\";\n\nexport interface TargetStatsBoxProps {\n label?: string;\n target?: number;\n actual?: number;\n proportionOfPeriodElapsed?: number | null;\n formatter?: (value?: number) => string;\n loading?: boolean;\n projectToEndOfPeriod?: boolean;\n}\n\nconst TargetStatsBox = ({\n label,\n target,\n actual,\n loading,\n proportionOfPeriodElapsed,\n projectToEndOfPeriod,\n ...props\n}: TargetStatsBoxProps) => {\n const { formatter = defaultFormatter } = props;\n\n const displayActual =\n projectToEndOfPeriod && actual && proportionOfPeriodElapsed\n ? actual / proportionOfPeriodElapsed\n : actual;\n\n const progressPercent =\n Math.min(target ? (displayActual || 0) / target : 0, 1) * 100;\n return (\n
\n {loading ? (\n

 

\n ) : (\n

\n {(displayActual || displayActual === 0) && target\n ? formatToPercentage((displayActual / target) * 100)\n : \"0%\"}\n

\n )}\n

{label}

\n
\n \n {proportionOfPeriodElapsed && (\n \n )}\n
\n

\n {`${formatter(displayActual)} / ${formatter(target)}`}\n

\n
\n );\n};\nexport default TargetStatsBox;\n","import { faFileExcel } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport classnames from \"classnames\";\nimport { FormikProps } from \"formik\";\nimport moment from \"moment\";\nimport querystring from \"query-string\";\nimport React from \"react\";\nimport { Col, Row } from \"reactstrap\";\nimport config from \"../../../config\";\nimport {\n formatCurrency,\n getMonthDateRange,\n getProportion,\n} from \"../../../utils\";\nimport FileDownloadLink from \"../../FileDownloadLink\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport PeriodPickerField from \"../../Forms/PeriodPickerField\";\nimport QuerystringForm from \"../../Forms/QuerystringForm\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport StatsBox from \"../../Proposals/ProposalDealerOverview/StatsBox\";\nimport TargetStatsBox from \"../../Proposals/ProposalDealerOverview/TargetStatsBox\";\nimport { ContextNames } from \"../../types\";\nimport AccountManagerSelect from \"../AccountManagerSelect\";\nimport { useAccountManagerTargets } from \"./AccountManagerTargetsQuery\";\n\nexport const TargetsTableRow = (props: {\n title: string;\n proportion?: any;\n actual?: any;\n target?: any;\n valueHighlighted?: boolean;\n}) => (\n <>\n \n {props.title}\n \n {props.proportion}\n \n \n {props.actual && props.target\n ? `${props.actual} / ${props.target}`\n : \"0\"}\n \n \n \n);\n\nexport const StatisticsTableRow = (props: {\n title: string;\n value?: any;\n valueHighlighted?: boolean;\n}) => (\n <>\n \n {props.title}\n \n \n {props.value ? props.value : \"0\"}\n \n \n \n);\n\ninterface AccountManagerTargetsSummaryProps {\n regionalSalesManagerId?: string;\n accountManagerId?: string;\n context?: ContextNames;\n}\n\ninterface AccountManagerTargetsFormValues {\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n startDate?: string | null;\n endDate?: string | null;\n editDates?: boolean;\n forecast?: boolean;\n}\n\nconst defaultValues: AccountManagerTargetsFormValues = {\n startDate: moment().startOf(\"month\").format(\"YYYY-MM-DD\"),\n endDate: moment()\n .add(1, \"month\")\n .startOf(\"month\")\n .subtract(1, \"day\")\n .format(\"YYYY-MM-DD\"),\n editDates: false,\n forecast: false,\n};\n\nconst getQueryStringForReports = (args: any) => {\n const { editDates, forecast, ...convertedArgs } = args;\n\n return querystring.stringify(convertedArgs);\n};\n\nconst getProportionOfPeriodElapsed = (start: string, end: string) => {\n if (!start || !end) {\n return null;\n }\n const now = moment();\n if (!now.isBetween(start, end)) {\n return null;\n }\n const totalDuration = moment.duration(moment(end).diff(moment(start)));\n const currentDuration = moment.duration(now.diff(moment(start)));\n\n const result =\n currentDuration.asMilliseconds() / totalDuration.asMilliseconds();\n\n return Math.round(result * 100) / 100;\n};\n\nconst getIsThisMonth = (startDate: string, endDate: string) => {\n if (startDate && endDate) {\n const thisMonth = getMonthDateRange(moment());\n if (\n moment(thisMonth.value.start).isSame(moment(startDate)) &&\n moment(thisMonth.value.end).isSame(moment(endDate))\n ) {\n return true;\n }\n }\n return false;\n};\n\nconst AccountManagerTargetsSummaryInner = ({\n values,\n setFieldValue,\n submitForm,\n context,\n}: FormikProps & { context?: ContextNames }) => {\n const proportionOfPeriodElapsed = getProportionOfPeriodElapsed(\n values.startDate,\n values.endDate\n );\n\n const { isSuperUser, isSeniorManager, isRegionalSalesManager, checkCanRead } =\n useLoggedInUser();\n const canViewNetProfit =\n (isSuperUser || isRegionalSalesManager) &&\n checkCanRead(PermissionModuleNames.RegionalSalesManagers);\n const canViewNewStats =\n (isSuperUser || isRegionalSalesManager || isSeniorManager) &&\n checkCanRead(PermissionModuleNames.RegionalSalesManagers);\n\n const isThisMonth = getIsThisMonth(values.startDate, values.endDate);\n\n const { targets, loading } = useAccountManagerTargets(\n {\n accountManagerId: values.accountManagerId,\n regionalSalesManagerId: values.regionalSalesManagerId,\n startDate: values.startDate,\n endDate: values.endDate,\n },\n canViewNetProfit\n );\n\n const actuals = targets?.actuals;\n\n return (\n
\n {!values.accountManagerId && context !== ContextNames.ACCOUNT_MANAGER && (\n \n \n {\n setFieldValue(\"accountManagerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n )}\n \n \n \n \n \n <>\n \n \n

Proposal targets

\n {proportionOfPeriodElapsed || proportionOfPeriodElapsed === 0 ? (\n <>\n

\n Lower bar shows time elapsed{\" \"}\n {isThisMonth ? \"this month\" : \"in the selected date range\"}\n

\n \n \n ) : null}\n
\n \n \n {canViewNetProfit && (\n \n )}\n \n
\n \n
\n \n \n

Dealers

\n
\n \n \n \n
\n \n
\n \n \n

Stats

\n
\n \n \n \n
\n \n
\n {canViewNewStats && (\n \n \n

New Stats

\n
\n \n \n
\n \n
\n )}\n \n \n \n \n Download report\n \n \n \n \n
\n );\n};\n\nconst AccountManagerTargetsSummary = (\n props: AccountManagerTargetsSummaryProps\n) => {\n const { accountManagerId, regionalSalesManagerId, context } = props;\n\n return (\n ({\n ...qs,\n editDates: qs.editDates === \"true\",\n forecast: qs.forecast === \"true\",\n })}\n mapValuesToQuerystring={(values: any) => values}\n defaultValues={defaultValues}\n fixedValues={{\n accountManagerId,\n regionalSalesManagerId,\n }}\n >\n {(formikProps: any) => (\n \n )}\n \n );\n};\n\nexport default AccountManagerTargetsSummary;\n","import React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport AccountManagerTargetsSummary from \"../AccountManagerTargetsSummary\";\n\nconst AccountManagerTargetsTabContent = ({\n match\n}: RouteComponentProps<{\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n}>) => (\n \n);\n\nexport const UserAccountManagerTargetsTabContent = () => {\n const { loggedInUser } = useLoggedInUser();\n\n if (!loggedInUser) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport default AccountManagerTargetsTabContent;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport {\n Mutation,\n MutationFunction,\n MutationResult,\n useMutation\n} from \"react-apollo\";\nimport { FullDealerFragment } from \"./fragments\";\nimport { Dealer } from \"./types\";\n\ninterface DealerData {\n createOrUpdateDealer: Dealer;\n}\n\ninterface DealerVariables {\n input: Dealer;\n}\n\nexport const CREATE_OR_UPDATE_DEALER = gql`\n mutation CreateOrUpdateDealer($input: DealerInput) {\n createOrUpdateDealer(input: $input) {\n ...FullDealerFragment\n }\n }\n ${FullDealerFragment}\n`;\n\nconst CreateDealer = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport const useCreateOrUpdateDealer = () => {\n const [createDealer] = useMutation(\n CREATE_OR_UPDATE_DEALER\n );\n\n return createDealer;\n};\n\nexport default CreateDealer;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Query, QueryResult, useQuery } from \"react-apollo\";\n\nexport interface LendersListData {\n lendersList: {\n id: number;\n name: string;\n }[]\n}\n\nexport const LENDERS_LIST = gql`\n query LendersListQuery {\n lendersList\n }\n`;\n\nconst LendersListQuery = ({\n children,\n}: {\n children: (result: QueryResult) => JSX.Element | null;\n}) => query={LENDERS_LIST}>{children};\n\nexport const useLendersList = () => {\n const { loading, data } = useQuery(LENDERS_LIST);\n\n return { loading, lendersList: data?.lendersList };\n};\n\nexport default LendersListQuery;\n","import * as Yup from \"yup\";\nimport config from \"../../config\";\nimport { GUID_PATTERN } from \"../../utils\";\nimport telephoneValidationSchema from \"../Forms/telephoneValidationSchema\";\nimport { AccountManager } from \"./types\";\n\nconst accountManagerValidationSchema = Yup.object().shape({\n id: Yup.string()\n .label(\"Initials\")\n .nullable(true)\n .default(undefined)\n .max(10),\n name: Yup.string()\n .label(\"Name\")\n .nullable(true)\n .default(undefined)\n .max(50)\n .required(),\n email: Yup.string()\n .label(\"Email\")\n .email()\n .nullable(true)\n .default(undefined)\n .required(),\n mobile: telephoneValidationSchema.label(\"Mobile\").required(),\n regionalSalesManagerId: Yup.string()\n .label(\"Regional sales manager\")\n .default(undefined)\n .nullable(true)\n .required(),\n autoConvertReference: Yup.string()\n .matches(\n GUID_PATTERN,\n `The ${config.AUTOCONVERT_NAME} user reference must be a valid guid`\n )\n .default(undefined)\n .nullable(),\n FORMSTATE_create: Yup.boolean()\n .nullable(true)\n .default(true)\n});\n\nexport default accountManagerValidationSchema;\n","import { Field, FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, Row } from \"reactstrap\";\nimport config from \"../../../config\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport RegionalSalesManagerSelect from \"../../RegionalSalesManagers/RegionalSalesManagerSelect\";\nimport { ContextNames, FormSize } from \"../../types\";\nimport { AccountManager } from \"../types\";\n\nconst AccountManagerFormInner = ({\n values,\n setFieldValue,\n setFieldTouched,\n formSize,\n context\n}: FormikProps & {\n context?: ContextNames;\n formSize?: FormSize;\n}) => {\n const narrowCol = formSize === FormSize.NARROW ? 8 : 4;\n const wideCol = formSize === FormSize.NARROW ? 12 : 6;\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {(fieldProps: any) => (\n \n {\n setFieldTouched(\"regionalSalesManagerId\", true);\n setFieldValue(\"regionalSalesManagerId\", rsmId);\n }}\n isDisabled={\n !!values.regionalSalesManagerId &&\n context === ContextNames.REGIONAL_SALES_MANAGER\n }\n />\n \n )}\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default AccountManagerFormInner;\n","import gql from \"graphql-tag\";\nimport { useMutation } from \"react-apollo\";\nimport { cleanFormData } from \"../../../utils\";\nimport { AccountManagerFragment } from \"../fragments\";\nimport { AccountManager } from \"../types\";\n\ninterface AccountManagerData {\n createOrUpdateAccountManager: AccountManager;\n}\n\ninterface AccountManagerVariables {\n input: AccountManager;\n}\n\nexport const CREATE_OR_UPDATE_ACCOUNTMANAGER = gql`\n mutation CreateOrUpdateAccountManager($input: AccountManagerInput) {\n createOrUpdateAccountManager(input: $input) {\n ...AccountManagerFragment\n }\n }\n ${AccountManagerFragment}\n`;\n\n/** Remove unused fields from the form data before submitting */\nexport const cleanAccountManagerBeforeSubmit = (\n values: AccountManager\n): AccountManager => {\n const accountManager: AccountManager = cleanFormData(values);\n\n delete accountManager.regionalSalesManager;\n delete accountManager.user;\n delete accountManager.houseDealer;\n\n return accountManager;\n};\n\nexport const useCreateOrUpdateAccountManager = () => {\n const [createOrUpdateAccountManager] = useMutation<\n AccountManagerData,\n AccountManagerVariables\n >(CREATE_OR_UPDATE_ACCOUNTMANAGER);\n\n return (accountManager: AccountManager) =>\n createOrUpdateAccountManager({ variables: { input: accountManager } });\n};\n","import classNames from \"classnames\";\nimport React from \"react\";\nimport { Badge } from \"reactstrap\";\nimport config from \"../../config\";\nimport { AccountManagerProps } from \"./AccountManagerQuery\";\n\nconst AccountManagerBadges = ({\n accountManager: { suspended, autoConvertReference },\n className\n}: AccountManagerProps & { className?: string }) => (\n
\n {suspended ? Suspended : null}\n {!autoConvertReference ? (\n Not in {config.AUTOCONVERT_NAME}\n ) : null}\n
\n);\n\nexport default AccountManagerBadges;\n","import React from \"react\";\nimport { Col, FormGroup, Row } from \"reactstrap\";\nimport { useAccountManager } from \"../../AccountManagers/AccountManagerQuery\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps\n} from \"../../Forms/MultiSectionForm\";\nimport SummaryRow from \"../../shared/SummarySection/SummaryRow\";\nimport { Dealer } from \"../types\";\n\nexport const AccountManagerSummarySection = ({\n values: { accountManagerId }\n}: FormSectionSummaryProps) => {\n const { accountManager } = useAccountManager(accountManagerId);\n\n return accountManager ? (\n \n ) : null;\n};\n\nconst AccountManagerSection = (props: FormSectionProps) => (\n \n \n \n {\n props.setFieldTouched(\"accountManagerId\", true);\n props.setFieldValue(\"accountManagerId\", id);\n }}\n autoFocus={true}\n />\n \n \n \n);\n\nexport default AccountManagerSection;\n","import { faExternalLinkAlt } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport React from \"react\";\n\nconst CompaniesHouseSearchLink = ({ name }: { name?: string }) => (\n
\n \n Search the Companies House register{\" \"}\n \n \n \n \n
\n);\n\nexport default CompaniesHouseSearchLink;\n","import { FormikProps } from \"formik\";\nimport React, { Component } from \"react\";\nimport { Row } from \"reactstrap\";\nimport RadioField from \"../../Forms/RadioField\";\nimport { Dealer } from \"../types\";\n\ninterface DealerQuestionProps {\n name: string;\n text: string;\n}\n\ntype DealerQuestionPropsEnhanced = FormikProps & DealerQuestionProps;\n\nexport class DealerQuestion extends Component {\n public render() {\n const { name, text } = this.props;\n return (\n <>\n \n \n \n \n );\n }\n}\n","import { faExternalLinkAlt } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field } from \"formik\";\nimport React, { Component } from \"react\";\nimport { Col, Row } from \"reactstrap\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps,\n} from \"../../Forms/MultiSectionForm\";\nimport SelectField from \"../../Forms/SelectField\";\nimport SummaryRow, {\n ExternalLinkSummaryRow,\n} from \"../../shared/SummarySection/SummaryRow\";\nimport { Dealer } from \"../types\";\nimport CompaniesHouseSearchLink from \"./CompaniesHouseSearchLink\";\nimport { DealerQuestion } from \"./DealerQuestion\";\nimport FollowUpQuestions from \"./FollowUpQuestions\";\n\nconst fcaStatusList = [\"Full permissions\", \"Limited Permissions\"].map(\n (status) => ({ label: status, value: status })\n);\n\nexport const CompanyDetailsSummarySection = ({\n values,\n}: FormSectionSummaryProps) => {\n const isDealerSetupV2 = values.dealerSetupV2;\n const showFlags = {\n companiesHouseUrl: !isDealerSetupV2,\n fCAStatus: !isDealerSetupV2,\n fCAUrl: !isDealerSetupV2,\n netWorthFromCompaniesHouse: !isDealerSetupV2,\n };\n\n return (\n <>\n \n {showFlags.companiesHouseUrl && (\n \n )}\n \n \n {showFlags.fCAStatus && (\n \n )}\n {showFlags.fCAUrl && (\n \n )}\n {showFlags.netWorthFromCompaniesHouse && (\n \n )}\n \n \n \n );\n};\n\nclass CompanyDetailsSection extends Component> {\n public render() {\n const { values } = this.props;\n const isDealerSetupV2 = values.dealerSetupV2;\n const showFlags = {\n companiesHouseUrl: !isDealerSetupV2,\n fCAStatus: !isDealerSetupV2,\n fCAUrl: !isDealerSetupV2,\n netWorthFromCompaniesHouse: !isDealerSetupV2,\n };\n // console.log(\"CompanyDetailsSection.isDealerSetupV2: \" + isDealerSetupV2);\n\n return (\n <>\n \n \n \n {showFlags.companiesHouseUrl && (\n \n }\n component={FormInputField}\n />\n \n )}\n \n \n \n \n \n \n {showFlags.fCAStatus && (\n \n \n \n )}\n {showFlags.fCAUrl && (\n \n \n \n Search the FCA register{\" \"}\n \n \n \n \n \n }\n />\n \n )}\n {showFlags.netWorthFromCompaniesHouse && (\n \n \n \n )}\n \n \n \n {!isDealerSetupV2 && (\n \n \n \n

\n ICO register check has to be performed\n

\n

\n Please check if dealer is registered on data protection\n register.\n

\n

\n Follow the link to start the search (opens in a new window):{\" \"}\n \n Search the ICO register{\" \"}\n \n \n \n \n

\n \n
\n \n {!!this.props.values.isOnICORegister && (\n \n \n \n )}\n
\n )}\n {isDealerSetupV2 && (\n \n \n \n )}\n \n );\n }\n}\n\nexport default CompanyDetailsSection;\n","import React from \"react\";\nimport { Button, Col, Row } from \"reactstrap\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport dealerSetupQuestionnaireValidationSchema from \"../dealerSetupQuestionnaireValidationSchema\";\nimport { Dealer, DealerFormSectionName } from \"../types\";\n\nexport const CreateQuestionnaireSummarySection = () => (\n

Dealer setup questionnaire not completed

\n);\n\nconst CreateQuestionnaireSection = ({\n setFieldValue,\n validateForm,\n navigateToSection\n}: FormSectionProps) => (\n
\n

\n Create a dealer setup questionnaire for this dealer\n

\n \n \n {\n e.preventDefault();\n navigateToSection(DealerFormSectionName.HISTORIC_CHECK);\n setFieldValue(\n \"questionnaire\" as any,\n dealerSetupQuestionnaireValidationSchema.default(),\n false\n );\n setFieldValue(\n \"FORMSTATE_requiresQuestionnaire\" as any,\n true,\n false\n );\n setTimeout(() => {\n validateForm();\n }, 0);\n }}\n >\n Create a dealer setup questionnaire...\n \n \n \n
\n);\n\nexport default CreateQuestionnaireSection;\n","import { Field, FieldProps } from \"formik\";\nimport React, { Component } from \"react\";\nimport { Col, Row } from \"reactstrap\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport { Dealer } from \"../types\";\nimport { DealerQuestion } from \"./DealerQuestion\";\n\nclass CurrentSituationSection extends Component> {\n public render() {\n const { ...formik } = this.props;\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n );\n }\n}\n\nexport default CurrentSituationSection;\n","import { Field, FieldProps } from \"formik\";\nimport React from \"react\";\nimport NumberFormat from \"react-number-format\";\nimport { Col, Row } from \"reactstrap\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport ValidateBankAccountButton from \"../../Proposals/ProposalForm/ValidateBankAccountButton\";\nimport { Dealer } from \"../types\";\n\nclass DealerBankDetailsSection extends React.Component<\n FormSectionProps\n> {\n public render() {\n const bankDetails = this.props.values.bank;\n const invalidBankAccount = bankDetails.FORMSTATE_invalidBankAccount;\n const accountNotFound =\n !!invalidBankAccount &&\n bankDetails.accountNumber === invalidBankAccount.accountNumber &&\n bankDetails.sortCode === invalidBankAccount.sortCode;\n\n return (\n <>\n \n \n \n {({ field, form }: FieldProps) => {\n return (\n \n {\n const { formattedValue } = values;\n form.setFieldValue(field.name, formattedValue);\n }}\n onBlur={() => {\n form.setFieldTouched(field.name, true);\n }}\n />\n \n );\n }}\n \n \n \n \n \n \n {({ field, form }: FieldProps) => {\n return (\n \n {\n const { formattedValue } = values;\n form.setFieldValue(field.name, formattedValue);\n }}\n onBlur={() => {\n form.setFieldTouched(field.name, true);\n }}\n />\n \n );\n }}\n \n \n \n \n \n {\n [\"bank.accountNumber\", \"bank.sortCode\"].forEach((x) =>\n this.props.setFieldTouched(x as any, true, false)\n );\n return this.props.validateForm().then((errors) => {\n return (\n !errors.bank ||\n (!errors.bank.accountNumber && !errors.bank.sortCode)\n );\n });\n }}\n onBankAccountValidated={({\n isValid,\n bank,\n branch,\n accountNumber,\n sortCode,\n }) => {\n if (isValid) {\n this.props.setFieldValue(\"bank.bank\", bank || null);\n this.props.setFieldValue(\"bank.bankAddress\", branch || null);\n } else {\n this.props.setFieldValue(\n \"bank.FORMSTATE_invalidBankAccount\",\n { accountNumber, sortCode }\n );\n }\n }}\n />\n \n \n \n \n \n \n \n \n \n \n \n \n );\n }\n}\n\nexport default DealerBankDetailsSection;\n","import { Field, FieldProps, FormikProps } from \"formik\";\nimport React from \"react\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport AddressFormSection from \"../../AddressLookup/AddressFormSection\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport RadioField from \"../../Forms/RadioField\";\nimport DateSelectRow from \"../../Proposals/ProposalForm/DateSelectRow\";\nimport { Dealer, DealerContact } from \"../types\";\nimport FollowUpQuestions from \"./FollowUpQuestions\";\nimport TitleSelectField from \"../../Proposals/ProposalForm/TitleSelectField\";\n\ninterface DealerContactsDetailsSectionProps {\n index: number;\n}\n\nconst DealerContactsDetailsSection = ({\n index,\n ...formikProps\n}: DealerContactsDetailsSectionProps & FormikProps) => {\n const values = formikProps.values;\n const contact = values && values.contacts && values.contacts[index];\n const isDealerSetupV2 = values.dealerSetupV2;\n const showFlags = {\n isFCARegulatedPerson: !isDealerSetupV2,\n };\n // console.log(\"DealerContactsDetailsSection.isDealerSetupV2: \" + isDealerSetupV2);\n\n return (\n <>\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {showFlags.isFCARegulatedPerson && (\n \n \n \n \n \n )}\n \n \n \n \n \n {contact && !contact.isDirector && (\n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n );\n};\n\nexport default DealerContactsDetailsSection;\n","import { faChevronDown, faChevronUp } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { FieldArray } from \"formik\";\nimport React from \"react\";\nimport { Button } from \"reactstrap\";\nimport { getFullName } from \"../../../utils\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport dealerContactValidationSchema from \"../DealerContacts/dealerContactValidationSchema\";\nimport { Dealer, DealerContact } from \"../types\";\nimport DealerContactsDetailsSection from \"./DealerContactsDetailsSection\";\n\nconst ShortContactSummary = ({ contact }: { contact: DealerContact }) => {\n return (\n <>\n {contact.forename && contact.surname ? (\n

\n Name:{\" \"}\n {`${contact.title ? contact.title : \"\"} ${contact.forename} ${\n contact.surname\n }`}\n

\n ) : null}\n

\n {contact.mobile ? (\n Mobile: {contact.mobile}\n ) : null}\n {contact.telephone ? (\n Telephone: {contact.telephone}\n ) : null}\n

\n {contact.email ? (\n

Email: {contact.email}

\n ) : null}\n {contact.position || contact.isDirector ? (\n

\n Position: {contact.isDirector ? \"Director\" : contact.position}\n

\n ) : null}\n \n );\n};\n\nconst validateContactDetails = (contact: DealerContact) => {\n return !!(contact.forename && contact.surname);\n};\n\nclass DealerContactsSection extends React.Component<\n FormSectionProps,\n { isValidated: boolean; collapsedItems: number[] }\n> {\n constructor(props: FormSectionProps) {\n super(props);\n\n this.state = {\n isValidated: false,\n collapsedItems: []\n };\n\n const { contacts } = this.props.values;\n\n if (contacts.length > 1) {\n contacts.forEach((_, i) => {\n this.state.collapsedItems.push(i);\n });\n }\n }\n public render() {\n const { contacts } = this.props.values;\n const { errors, isSectionTouched } = this.props;\n\n return (\n \n {arrayHelpers => (\n
\n {contacts &&\n contacts.map((contact, i) => {\n const isOpen = this.state.collapsedItems.indexOf(i) === -1;\n const name = getFullName(contact);\n return (\n
\n this.collapseItem(i)\n : () => this.expandItem(i)\n }\n >\n {name ? name : `Contact ${i + 1}`}\n \n \n\n {isOpen ? (\n <>\n \n\n {i > 0 ? (\n arrayHelpers.remove(i)}\n >\n Remove this contact\n \n ) : null}\n \n ) : (\n {\n this.expandItem(i);\n }}\n >\n \n {!validateContactDetails(contact) ? (\n

\n Contact details section is incomplete\n

\n ) : null}\n
\n )}\n
\n );\n })}\n\n {\n arrayHelpers.push(dealerContactValidationSchema.default());\n this.collapseItem(contacts.length - 1);\n }}\n >\n Add another contact\n \n {isSectionTouched && errors.FORMSTATE_contactsError ? (\n

\n {errors.FORMSTATE_contactsError}\n

\n ) : null}\n \n )}\n
\n );\n }\n\n private collapseItem(i: number) {\n const array = this.state.collapsedItems.slice();\n if (array.indexOf(i) === -1) {\n array.push(i);\n\n this.setState({\n collapsedItems: array\n });\n }\n }\n\n private expandItem(i: number) {\n const array = this.state.collapsedItems.slice();\n array.splice(array.indexOf(i), 1);\n\n this.setState({\n collapsedItems: array\n });\n }\n}\n\nexport default DealerContactsSection;\n","import { Field } from \"formik\";\nimport gql from \"graphql-tag\";\nimport React, { FocusEvent, useEffect, useState } from \"react\";\nimport { useLazyQuery } from \"react-apollo\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport { getSingleLineAddress } from \"../../../utils\";\nimport AddressFormSection from \"../../AddressLookup/AddressFormSection\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps,\n} from \"../../Forms/MultiSectionForm\";\nimport SelectField from \"../../Forms/SelectField\";\nimport DateSelectRow from \"../../Proposals/ProposalForm/DateSelectRow\";\nimport SummaryRow, {\n DateSummaryRow,\n EmailSummaryRow,\n TelephoneSummaryRow,\n YesNoSummaryRow,\n} from \"../../shared/SummarySection/SummaryRow\";\nimport { Dealer } from \"../types\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { IsDealerSigned } from \"../dealerSetup\";\n\nconst assetList = [\"Car\", \"LCV\", \"Bike\", \"Car & LCV\", \"Car & Bike\", \"All\"].map(\n (asset) => {\n return { label: asset, value: asset };\n }\n);\n\nconst CHECK_DEALER_EXISTS = gql`\n query CheckDealerExists($input: DealerNameInput) {\n checkDealerExists(input: $input) {\n id\n name\n address {\n id\n postcode\n }\n }\n }\n`;\n\ninterface Address {\n postcode?: string;\n}\ninterface DuplicateDealer {\n id: string;\n name: string;\n address: Address;\n}\n\nexport const DealerDetailsSummarySection = ({\n values,\n}: FormSectionSummaryProps) => {\n const isDealerSetupV2 = values.dealerSetupV2;\n const showFlags = {\n assetClass: !isDealerSetupV2,\n fax: !isDealerSetupV2,\n isMannIslandDealer: !isDealerSetupV2,\n isMannIslandZList: !isDealerSetupV2,\n };\n\n return (\n <>\n \n \n {showFlags.assetClass && (\n \n )}\n \n \n \n \n {showFlags.fax && }\n \n \n \n {showFlags.isMannIslandDealer && (\n \n )}\n {showFlags.isMannIslandZList && (\n \n )}\n \n \n \n );\n};\n\nconst DealerDetailsFormSection_FunctionalComponent = (\n props: FormSectionProps\n) => {\n const { navigateToSection, populateModal, ...formikProps } = props;\n const { address, id } = props.values;\n const { handleBlur } = formikProps;\n const [checkDealerExists, { data, loading }] =\n useLazyQuery(CHECK_DEALER_EXISTS);\n // eslint-disable-next-line\n const [_duplicateDealers, setDuplicateDealers] = useState([]);\n\n const creatingNewDealer = !id;\n const isDealerSetupV2 = true;\n const showFlags = {\n assetClass: !isDealerSetupV2,\n fax: !isDealerSetupV2,\n isMannIslandDealer: !isDealerSetupV2,\n isMannIslandZList: !isDealerSetupV2,\n };\n\n // console.log(\"DealerDetailsFormSection_FunctionalComponent.isDealerSetupV2: \" + isDealerSetupV2);\n\n const { loggedInUser } = useLoggedInUser();\n\n useEffect(() => {\n if (loading) {\n return;\n }\n const dealersReturned =\n !!data?.checkDealerExists && !!data?.checkDealerExists.length;\n\n if (dealersReturned) {\n setDuplicateDealers((prevState) => {\n const match =\n JSON.stringify(prevState) === JSON.stringify(data.checkDealerExists);\n\n if (!match) {\n populateModal &&\n populateModal(\n data.checkDealerExists.map((dealer: DuplicateDealer) => {\n const {\n id,\n name,\n address: { postcode },\n } = dealer;\n return { id, name, postcode };\n })\n );\n return data.checkDealerExists;\n }\n });\n }\n }, [data, populateModal, loading]);\n\n return (\n <>\n \n ) => {\n handleBlur(event);\n const inputValue = event.currentTarget.value;\n if (inputValue.trim() && creatingNewDealer) {\n checkDealerExists({\n variables: { input: { name: inputValue } },\n });\n }\n }}\n />\n \n \n \n \n {showFlags.assetClass && (\n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n {showFlags.fax && (\n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n {showFlags.isMannIslandZList && !formikProps.values.isMannIslandZList ? (\n \n \n \n ) : null}\n {showFlags.isMannIslandDealer &&\n !formikProps.values.isMannIslandDealer ? (\n \n \n \n ) : null}\n \n \n \n \n \n \n \n );\n};\n\nexport default DealerDetailsFormSection_FunctionalComponent;\n","import { Field, FieldProps } from \"formik\";\nimport React, { Component } from \"react\";\n// tslint:disable-next-line:no-submodule-imports\nimport Creatable from \"react-select/creatable\";\nimport { Col, Row } from \"reactstrap\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport { Dealer } from \"../types\";\nimport CompaniesHouseSearchLink from \"./CompaniesHouseSearchLink\";\nimport { DealerQuestion } from \"./DealerQuestion\";\nimport FollowUpQuestions from \"./FollowUpQuestions\";\n\nconst leaseOptions = [\"Mortgage\", \"Owns\", \"Long Term Lease\"].map(lease => {\n return { label: lease, value: lease };\n});\n\nclass DealerInformationSection extends Component> {\n public render() {\n const { ...formik } = this.props;\n const { setFieldValue, setFieldTouched, validateForm } = formik;\n const {\n values: { questionnaire }\n } = this.props;\n\n if (!questionnaire) {\n return null;\n }\n\n return (\n <>\n \n\n \n \n \n \n {(fieldProps: FieldProps) => (\n \n {\n setFieldValue(\n fieldProps.field.name as any,\n option ? option.value : undefined,\n false\n );\n setFieldTouched(\n fieldProps.field.name as any,\n true,\n false\n );\n setTimeout(validateForm, 0);\n }}\n />\n \n )}\n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }\n />\n \n \n \n \n \n \n );\n }\n}\n\nexport default DealerInformationSection;\n","import { faArrowDown } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport classnames from \"classnames\";\nimport { FormikProps } from \"formik\";\nimport moment from \"moment\";\nimport React, { useState } from \"react\";\nimport { Alert, Col, Row } from \"reactstrap\";\nimport {\n getFullName,\n getSingleLineAddress,\n hasAddress,\n roundNumber,\n} from \"../../../utils\";\nimport { Address } from \"../../types\";\nimport useHtmlElementClass from \"../../useHtmlElementClass\";\nimport {\n Dealer,\n DealerBank,\n DealerContact,\n DealerProofResponse,\n DealerProofType,\n} from \"../types\";\nimport config from \"../../../config\";\nimport axios from \"axios\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\n\n//#region Helper components\n\nconst SummaryRowSection = ({\n title,\n subtitle,\n children,\n}: {\n title?: string;\n subtitle?: string;\n children: React.ReactNode;\n}) => {\n useHtmlElementClass(\"smooth-scroll\");\n return (\n
\n {title ?

{title}

: null}\n {subtitle ? (\n
{subtitle}
\n ) : null}\n {children}\n
\n );\n};\n\nconst SummaryRow = ({\n title,\n value,\n highlight,\n}: {\n title: string;\n value?: any;\n highlight?: boolean;\n}) =>\n value || value === 0 ? (\n \n \n

{title}

\n \n \n \n {value}\n

\n \n
\n ) : null;\n\nconst AddressRow = ({ address }: { address: Address }) =>\n hasAddress(address) ? (\n \n ) : null;\n\n//#endregion\n\n//#region Form fields check\n\nconst hasDealerDetails = (dealer: Dealer) => {\n return !!(\n dealer &&\n (dealer.name ||\n dealer.url ||\n dealer.email ||\n dealer.telephone ||\n dealer.mobile ||\n dealer.fax ||\n dealer.ccaNumber ||\n dealer.vatNumber ||\n dealer.established ||\n hasAddress(dealer.address))\n );\n};\n\nconst hasDealerPricingDetails = (dealer: Dealer) => {\n return !!(dealer && (dealer.averageBalance || dealer.monthlyVolume));\n};\n\nconst hasDealerProofs = (dealer: Dealer) => {\n return !!true;\n};\n\nconst hasBankDetails = (bank: DealerBank) => {\n return !!(\n bank &&\n (bank.bank ||\n bank.accountName ||\n bank.accountNumber ||\n bank.bankAddress ||\n bank.sortCode)\n );\n};\n\nconst hasContactDetails = (contact: DealerContact) => {\n return !!(\n contact &&\n (contact.title ||\n (contact.forename && contact.surname) ||\n contact.position ||\n contact.telephone ||\n contact.mobile ||\n contact.email)\n );\n};\n\n//#endregion\n\nconst DealerSummarySection = ({ values, errors }: FormikProps) => {\n const [proofsLoaded, setProofsLoaded] = useState(false);\n const [proofEnough, setProofEnough] = useState(false);\n const isDealerSetupV2 = values.dealerSetupV2;\n const showFlags = {\n declaration: !isDealerSetupV2,\n };\n const pt = Object.keys(DealerProofType) as Array<\n keyof typeof DealerProofType\n >;\n let loadingProofs = false;\n // console.log(\"DealerSummarySection.isDealerSetupV2: \" + isDealerSetupV2);\n\n const isProofEnough = (resp: DealerProofResponse): boolean => {\n let res = true; // Assume everything required is present and return false of that's not the case\n pt.map((proofType) => {\n let c = 0;\n if (resp && resp.documents) {\n resp?.documents.map((doc, d) => {\n if (\n doc.metadata &&\n doc.metadata.Proof &&\n doc.metadata.Proof === DealerProofType[proofType]\n ) {\n c++;\n }\n });\n }\n if (c === 0) {\n res = false;\n }\n return proofType;\n });\n return res;\n };\n\n const getFileInfo = (proofref: any) => {\n loadingProofs = true;\n return axios\n .get(\n `${config.API_URL}/api/dealersetup/proof/${encodeURIComponent(\n proofref\n )}`,\n { headers: { \"Cache-Control\": \"no-cache\" } }\n )\n .then((r: any) => {\n let dp = r?.data as DealerProofResponse;\n setProofEnough(isProofEnough(dp));\n setProofsLoaded(true);\n loadingProofs = false;\n })\n .catch((error: any) => {\n // tslint:disable-next-line:no-console\n console.error(\"Error in getFileInfo\", error);\n loadingProofs = false;\n });\n };\n\n if (!proofsLoaded) {\n getFileInfo(values.documentStorageRef);\n }\n\n return (\n
\n {!Object.keys(errors).length || Object.keys(errors).length === 0 ? (\n window.scrollTo(0, document.body.scrollHeight)}\n >\n \n Scroll down to review the details and save dealer\n \n ) : (\n \n More details are required before the dealer can be saved{\" \"}\n \n )}\n\n {hasDealerDetails(values) ? (\n \n \n \n \n \n \n \n \n \n \n \n \n ) : null}\n\n {hasBankDetails(values.bank) ? (\n \n \n \n \n \n \n \n ) : null}\n\n {values.contacts && hasContactDetails(values.contacts[0]) ? (\n \n {values.contacts.map((contact, i) =>\n hasContactDetails(contact) ? (\n \n \n \n \n \n \n \n ) : null\n )}\n \n ) : null}\n\n {hasDealerPricingDetails(values) ? (\n \n \n \n \n \n ) : null}\n\n {hasDealerProofs(values) ? (\n \n {!loadingProofs && proofEnough && (\n \n Sufficient proofs have been provided\n \n )}\n {!loadingProofs && !proofEnough && (\n \n Insufficient proofs provided. At least one of each type required\n \n )}\n {loadingProofs && }\n \n ) : null}\n\n {showFlags.declaration && (\n \n

Submission declaration

\n

\n By submitting this application, you are confirming that all due\n diligence checks have been completed to an acceptable standard, are\n confident that all information provided is accurate as at the point\n of submission and take full responsibility for the recommendation.\n

\n
\n )}\n
\n );\n};\n\nexport default DealerSummarySection;\n","import { Field, FieldProps } from \"formik\";\nimport React, { Component } from \"react\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport DateSelectRow from \"../../Proposals/ProposalForm/DateSelectRow\";\nimport { Dealer } from \"../types\";\nimport { DealerQuestion } from \"./DealerQuestion\";\nimport FollowUpQuestions from \"./FollowUpQuestions\";\n\nclass HistoricRelationshipCheckSection extends Component<\n FormSectionProps\n> {\n public render() {\n const { ...formik } = this.props;\n const {\n values: { questionnaire }\n } = this.props;\n\n if (!questionnaire) {\n return null;\n }\n\n return (\n <>\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n \n \n \n \n \n \n \n \n {({ field, form }: FieldProps) => (\n \n \n \n \n \n )}\n \n \n \n \n );\n }\n}\n\nexport default HistoricRelationshipCheckSection;\n","import React from \"react\";\nimport Select from \"react-select\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport { FormSectionProps } from \"../../Forms/MultiSectionForm\";\nimport { Dealer } from \"../types\";\nimport FollowUpQuestions from \"./FollowUpQuestions\";\n\nconst lenderOptions = [\n \"Alphera\",\n \"MotoNovo\",\n \"Paragon\",\n \"Mann Island\",\n \"Oodle\",\n \"Hitachi\",\n \"Close\",\n \"BNP\",\n \"Zopa\",\n \"JBR\",\n \"Shawbrook\",\n \"MoneyBarn\",\n \"Moneyway\",\n \"Advantage\",\n \"P & C\",\n]\n .sort()\n .map((lease) => ({ label: lease, value: lease }));\n\nconst ProductMixSection = (props: FormSectionProps) => (\n <>\n \n \n \n ({\n label: lease,\n value: lease,\n }))\n : []\n }\n isMulti={true}\n closeMenuOnSelect={false}\n title=\"Asset class\"\n autoFocus={false}\n options={lenderOptions}\n onChange={(options: any) => {\n const values = options ? options.map((opt: any) => opt.value) : [];\n props.setFieldValue(\"questionnaire.productSetupLenders\", values);\n }}\n />\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);\n\nexport default ProductMixSection;\n","import * as React from \"react\";\nimport {\n Button,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n Table,\n} from \"reactstrap\";\nimport { DuplicateDealerList } from \"./index\";\n\ninterface DuplicateDealerFoundModalProps {\n showModal: boolean;\n dealerList?: DuplicateDealerList | null;\n toggle: () => void;\n}\n\nexport const openInNewTab = (url: string): void => {\n const newWindow = window.open(url, \"_blank\", \"noopener,noreferrer\");\n if (newWindow) newWindow.opener = null;\n};\n\nconst DuplicateDealerFoundModal: React.SFC = ({\n showModal,\n dealerList,\n toggle,\n}: DuplicateDealerFoundModalProps) => {\n return (\n \n <>\n \n Similar dealer\n {dealerList && dealerList?.length > 1 ? \"s\" : \"\"} found\n \n \n Before creating a new dealer, check it doesn't already exist. Clicking\n one of the below dealers will open it in a new tab.\n \n \n \n \n \n \n \n \n \n \n {dealerList?.map((dealer) => {\n return (\n \n openInNewTab(\n `${window.location.origin}/dealers/${dealer.id}`\n )\n }\n >\n \n \n \n );\n })}\n \n
Dealer NamePost Code
{dealer.name}{dealer.postcode}
\n
\n \n \n \n \n \n );\n};\n\nexport default React.memo(DuplicateDealerFoundModal);\n","import React from \"react\";\nimport { Col, Row, InputGroupAddon, InputGroup } from \"reactstrap\";\nimport { useAccountManager } from \"../../AccountManagers/AccountManagerQuery\";\n// import DealerPricingSelect from \"../../DealerPricings/DealerPricingSelect\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps,\n} from \"../../Forms/MultiSectionForm\";\nimport SummaryRow from \"../../shared/SummarySection/SummaryRow\";\nimport { Dealer } from \"../types\";\nimport { Field, FieldProps } from \"formik\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport { roundNumber } from \"../../../utils\";\nimport NumberFormat from \"react-number-format\";\n\nexport const DealerPricingSummarySection = ({\n values,\n}: FormSectionSummaryProps) => {\n const { accountManager } = useAccountManager(values.accountManagerId);\n\n return accountManager ? (\n <>\n \n \n \n \n ) : null;\n};\n\nconst DealerPricingSection = (props: FormSectionProps) => {\n return (\n <>\n \n \n \n \n \n {({ form, field }: FieldProps) => (\n \n \n \n {\n const { formattedValue } = values;\n form.setFieldValue(field.name, formattedValue);\n }}\n onBlur={() => {\n form.setFieldTouched(field.name, true);\n }}\n />\n\n %\n \n \n \n )}\n \n \n \n \n \n \n );\n};\n\nexport default DealerPricingSection;\n","import React from \"react\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps,\n} from \"../../Forms/MultiSectionForm\";\nimport { Dealer } from \"../types\";\nimport * as uuid from \"uuid\";\nimport {\n DealerProofsContent,\n DealerProofsSummaryContent,\n} from \"../DraftDealers/DealerProofsContent\";\n\nexport const DealerProofsSummarySection = ({\n values,\n}: FormSectionSummaryProps) => {\n return (\n <>\n \n \n );\n};\n\nconst DealerProofsSection = (props: FormSectionProps) => {\n if (!props.values.documentStorageRef) {\n props.setFieldValue(\"documentStorageRef\", uuid.v4());\n }\n\n return (\n <>\n \n \n );\n};\n\nexport default DealerProofsSection;\n","import React from \"react\";\nimport { Col, Label, Row } from \"reactstrap\";\nimport Select, { ValueType } from \"react-select\";\nimport { useAccountManager } from \"../../AccountManagers/AccountManagerQuery\";\nimport {\n FormSectionProps,\n FormSectionSummaryProps,\n} from \"../../Forms/MultiSectionForm\";\nimport { Dealer } from \"../types\";\nimport { Field } from \"formik\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport RadioButtonsField from \"../../Forms/RadioButtonsField\";\nimport LendersListQuery from \"../DealerLenderList/LendersListQuery\";\n\nexport const LenderPackagesSummarySection = ({\n values,\n}: FormSectionSummaryProps) => {\n const { accountManager } = useAccountManager(values.accountManagerId);\n\n return accountManager ? (\n <>\n
N/A
\n \n ) : null;\n};\n\nconst sortByName = (a: any, b: any) =>\n a?.name?.toUpperCase() > b?.name?.toUpperCase() ? 1 : -1;\n\nexport const LenderPackagesSection = (props: FormSectionProps) => {\n const onPackageChange = (options: ValueType, am: any) => {\n console.log(\n \"Select changed: \" +\n JSON.stringify(options) +\n \", action: \" +\n JSON.stringify(am)\n );\n\n if (am.action === \"remove-value\") {\n // Single removal\n if (props.values.questionnaire.productSetupLenders) {\n let index = props.values.questionnaire.productSetupLenders?.indexOf(\n am?.removedValue.label\n );\n // console.log(\"removing: \" + index);\n if (index !== -1) {\n props.values.questionnaire.productSetupLenders?.splice(index, 1);\n props.values.pricing?.splice(index, 1);\n props.setFieldValue(\n \"questionnaire.productSetupLenders\",\n props.values.questionnaire.productSetupLenders\n );\n props.setFieldValue(\"pricing\", props.values.pricing);\n }\n }\n } else if (am.action === \"select-option\") {\n // Single addition (only add what's not already there)?\n let index = props.values.questionnaire.productSetupLenders?.indexOf(\n am?.option.label\n );\n if (index === -1) {\n const currL = props.values.questionnaire.productSetupLenders\n ? props.values.questionnaire.productSetupLenders\n : [];\n currL.push(am.option.label);\n props.setFieldValue(\"questionnaire.productSetupLenders\", currL);\n\n const currP = props.values.pricing ? props.values.pricing : [];\n currP.push({\n lender: am.option.label,\n lenderid: am.option.value,\n apr: 0,\n commission: 0,\n asmoney: 0,\n });\n props.setFieldValue(\"pricing\", currP);\n }\n } else {\n // Anything else e.g. clear all\n const values = options ? options.map((opt: any) => opt.label) : [];\n\n props.setFieldValue(\"questionnaire.productSetupLenders\", values);\n\n const pricing = values.map((opt: any) => ({\n lender: opt,\n lenderid: null,\n apr: 0,\n commission: 0,\n asmoney: 0,\n }));\n props.setFieldValue(\"pricing\", pricing);\n }\n // console.log(\"pricing: \" + JSON.stringify(props.values.pricing));\n };\n\n return (\n <>\n \n \n \n \n {({ data }) => {\n const lendersListOptions =\n data && data.lendersList\n ? data.lendersList.sort(sortByName).map((l) => ({\n label: l.name,\n value: l.id.toString(),\n }))\n : [];\n return (\n ({\n label: lease,\n value: lease,\n })\n )}\n isMulti={true}\n closeMenuOnSelect={false}\n title=\"Asset class\"\n autoFocus={false}\n options={lendersListOptions}\n onChange={onPackageChange}\n />\n );\n }}\n \n \n \n <>\n {(props.values.questionnaire?.productSetupLenders?.length || 0) > 0 && (\n \n \n {\"Lender\"}\n \n \n {\"APR\"}\n \n \n {\"Commission\"}\n \n \n {\"% or £?\"}\n \n \n )}\n \n <>\n {props.values.questionnaire.productSetupLenders?.map((el, index) => (\n \n \n {el}\n \n \n \n \n \n \n \n \n {\n props.setFieldValue(`pricing.${index}.commission`, 0);\n props.setFieldTouched(`pricing.${index}.commission`);\n }}\n />\n \n \n ))}\n \n \n );\n};\n","import {\n Formik,\n FormikProps,\n FormikTouched,\n InjectedFormikProps,\n} from \"formik\";\nimport { debounce } from \"lodash\";\nimport memoizeOne from \"memoize-one\";\nimport React from \"react\";\nimport { Prompt, RouteComponentProps, withRouter } from \"react-router\";\nimport { compose } from \"recompose\";\nimport AutoGeneratedFormSectionSummary from \"../../Forms/AutoGeneratedFormSectionSummary\";\nimport MultiSectionForm, {\n CreateOrUpdateMode,\n FormSectionInfo,\n FormSectionSummaryProps,\n SaveDraftProps,\n} from \"../../Forms/MultiSectionForm\";\nimport { LoggedInUserProps, withLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames, RecursivePartial, User, UserRoles } from \"../../types\";\nimport dealerValidationSchema from \"../dealerValidationSchema\";\nimport { DraftDealerFormData } from \"../DraftDealers/DraftDealerService\";\nimport { Dealer, DealerFormSectionName, DraftDealer } from \"../types\";\nimport AccountManagerSection, {\n AccountManagerSummarySection,\n} from \"./AccountManagerSection\";\nimport CompanyDetailsSection, {\n CompanyDetailsSummarySection,\n} from \"./CompanyDetailsSection\";\nimport CreateQuestionnnaireSection, {\n CreateQuestionnaireSummarySection,\n} from \"./CreateQuestionnaireSection\";\nimport CurrentSituationSection from \"./CurrentSituationSection\";\nimport DealerBankDetailsSection from \"./DealerBankDetailsSection\";\nimport DealerContactsSection from \"./DealerContactsSection\";\nimport DealerDetailsFormSection, {\n DealerDetailsSummarySection,\n} from \"./DealerDetailsFormSection\";\nimport DealerInformationSection from \"./DealerInformationSection\";\nimport DealerSummarySection from \"./DealerSummarySection\";\nimport HistoricRelationshipCheckSection from \"./HistoricRelationshipCheckSection\";\nimport ProductMixSection from \"./ProductMixSection\";\nimport DuplicateDealerFoundModal from \"./DuplicateDealerFoundModal\";\nimport DealerPricingSection, {\n DealerPricingSummarySection,\n} from \"./DealerPricingSection\";\nimport DealerProofsSection, {\n DealerProofsSummarySection,\n} from \"./DealerProofsSection\";\nimport {\n LenderPackagesSection,\n LenderPackagesSummarySection,\n} from \"./LenderPackagesSection\";\n\nexport interface DealerFormInitialValues {\n initialValues: Dealer;\n initialSection?: DealerFormSectionName;\n initialTouched?: FormikTouched;\n}\n\ninterface DealerFormProps extends DealerFormInitialValues {\n dealer?: RecursivePartial;\n draftDealerLastSaved?: string;\n saveDraft: (formData: DraftDealerFormData) => Promise;\n onSubmitDealer: (dealer: Dealer) => Promise;\n context?: ContextNames;\n canUpdate?: boolean;\n isDealerSetupV2?: boolean;\n}\n\ntype DealerFormPropsEnhanced = InjectedFormikProps<\n DealerFormProps & LoggedInUserProps & RouteComponentProps,\n Dealer\n>;\n\nexport type WatchFields = {\n [K in keyof Values]?: Values[K] extends object\n ? WatchFields\n : true;\n};\n\nconst DealerFormSections: FormSectionInfo[] = [\n {\n id: DealerFormSectionName.ACCOUNT_MANAGER,\n title: \"Account manager\",\n component: AccountManagerSection,\n summaryComponent: AccountManagerSummarySection,\n watchFields: {\n accountManagerId: true,\n },\n },\n {\n id: DealerFormSectionName.DEALER_DETAILS,\n title: \"Dealer details\",\n component: DealerDetailsFormSection,\n summaryComponent: DealerDetailsSummarySection,\n watchFields: {\n name: true,\n tradingStyle: true,\n assetClass: true,\n address: {\n line1: true,\n line2: true,\n line3: true,\n town: true,\n // county: true,\n postcode: true,\n countryId: true,\n telephone: true,\n },\n email: true,\n mobile: true,\n fax: true,\n established: true,\n franchised: true,\n stockFunding: true,\n isMultiQuote: true,\n isMannIslandDealer: true,\n isMannIslandZList: true,\n // isRateForRisk: true,\n },\n },\n {\n id: DealerFormSectionName.COMPANY_DETAILS,\n title: \"Company details\",\n component: CompanyDetailsSection,\n summaryComponent: CompanyDetailsSummarySection,\n watchFields: {\n url: true,\n // companiesHouseUrl: true,\n companyRegNumber: true,\n ccaNumber: true,\n // fCAStatus: true,\n // fCAUrl: true,\n // netWorthFromCompaniesHouse: true,\n vatNumber: true,\n isOnICORegister: true,\n icoNumber: true,\n },\n },\n {\n id: DealerFormSectionName.BANK_DETAILS,\n title: \"Bank details\",\n component: DealerBankDetailsSection,\n watchFields: {\n bank: {\n bank: true,\n accountNumber: true,\n accountName: true,\n sortCode: true,\n bankAddress: true,\n },\n },\n },\n {\n id: DealerFormSectionName.CREATE_QUESTIONNAIRE,\n title: \"Dealer setup questionnaire\",\n component: CreateQuestionnnaireSection,\n summaryComponent: CreateQuestionnaireSummarySection,\n watchFields: {},\n },\n {\n id: DealerFormSectionName.HISTORIC_CHECK,\n title: \"Previous relationship\",\n component: HistoricRelationshipCheckSection,\n summaryComponent: (props: FormSectionSummaryProps) => (\n \n ),\n watchFields: {\n questionnaire: {\n hasPreviousRelationship: true,\n datePreviousRelationshipClosed: true,\n reasonPreviousRelationshipClosed: true,\n issuesWithDealingAgain: true,\n highWriteOffsOrArrears: true,\n isOnLenderZList: true,\n employeeRelationshipWithEVC: true,\n employeeRelationshipPreviousDealer: true,\n employeeRelationshipPreviousDealerRelationship: true,\n relationshipAdditionalInformation: true,\n },\n },\n },\n {\n id: DealerFormSectionName.DEALER_INFORMATION,\n title: \"Dealer information\",\n component: DealerInformationSection,\n summaryComponent: (props: FormSectionSummaryProps) => (\n \n ),\n watchFields: {\n questionnaire: {\n longTermLeaseOnPremises: true,\n longTermLeaseOnPremisesDetails: true,\n numberOfVehiclesInStock: true,\n stockReview: true,\n isStockFinanceable: true,\n reasonNotFinanceable: true,\n isMileageWithinLenderPolicy: true,\n highestVehicleMileage: true,\n isAgeWithinUnderwritingPolicy: true,\n highestVehicleAge: true,\n sorStock: true,\n smartAndReasonable: true,\n hasForecourtAndSignage: true,\n reasonNoForecourtOrSignage: true,\n vehiclesPhotographedConsistently: true,\n advertisesSubprimeFinance: true,\n customersFreeToVisit: true,\n hasComplaintsProcess: true,\n complaintsProcessDetails: true,\n reputationConcerns: true,\n negativeReviewsOnWeb: true,\n negativeReviewsOnWebDetails: true,\n negativeReviewsOnSocialMedia: true,\n negativeReviewsOnSocialMediaDetails: true,\n negativeNews: true,\n negativeNewsDetails: true,\n hasGoodReputation: true,\n wasReferred: true,\n referredBy: true,\n positiveAndAppropriate: true,\n directorsAssociatedWithOtherCompanies: true,\n directorOtherCompanyName: true,\n directorOtherCompanyUrl: true,\n directorOtherCompanyRegNumber: true,\n },\n },\n },\n {\n id: DealerFormSectionName.CURRENT_SITUATION,\n title: \"Current situation\",\n component: CurrentSituationSection,\n summaryComponent: (props: FormSectionSummaryProps) => (\n \n ),\n watchFields: {\n questionnaire: {\n ultimateBeneficialOwners: true,\n approvedPersons: true,\n investors: true,\n otherInterestedParties: true,\n financeProviders: true,\n financeProvidersDuration: true,\n hasVisualShowroomFinance: true,\n whyDoesTheDealerWantToWorkWithEVC: true,\n },\n },\n },\n {\n id: DealerFormSectionName.CONTACTS,\n title: \"Directors and contacts\",\n subtitle:\n \"Must include at least one company director, proprietor or partner\",\n component: DealerContactsSection,\n watchFields: {\n contacts: [\n {\n title: true,\n forename: true,\n surname: true,\n position: true,\n telephone: true,\n mobile: true,\n email: true,\n notes: true,\n emailInclude: true,\n isDirector: true,\n directorDateOfBirth: true,\n isFCARegulatedPerson: true,\n homeAddress: {\n line1: true,\n line2: true,\n line3: true,\n town: true,\n // county: true,\n postcode: true,\n // countryId: true,\n },\n isMainContact: true,\n requestsDealerPortalUserAccount: true,\n isSAFTested: true,\n fax: true,\n sMS: true,\n },\n ],\n FORMSTATE_contactsError: true,\n },\n },\n {\n id: DealerFormSectionName.DEALER_PRICING,\n title: \"Dealer pricing\",\n component: DealerPricingSection,\n summaryComponent: DealerPricingSummarySection,\n watchFields: {\n averageBalance: true,\n agreedApr: true,\n monthlyVolume: true,\n },\n },\n {\n id: DealerFormSectionName.LENDER_PACKAGES,\n title: \"Lender packages\",\n component: LenderPackagesSection,\n summaryComponent: LenderPackagesSummarySection,\n watchFields: {\n questionnaire: {\n productSetupLenders: true,\n },\n },\n },\n {\n id: DealerFormSectionName.DEALER_PROOFS,\n title: \"Dealer proofs\",\n component: DealerProofsSection,\n summaryComponent: DealerProofsSummarySection,\n watchFields: {\n documentStorageRef: true,\n allProofsProvided: true,\n },\n },\n {\n id: DealerFormSectionName.PRODUCT_MIX,\n title: \"Product mix\",\n component: ProductMixSection,\n watchFields: {\n questionnaire: {\n productSetupLenders: true,\n productSetupPCP: true,\n productSetupLTVLoans: true,\n productSetupSubprime: true,\n productSetupVATAssist: true,\n productSetupZeroPercentSubsidy: true,\n },\n },\n },\n {\n id: DealerFormSectionName.SUMMARY,\n title: \"Summary\",\n component: DealerSummarySection,\n watchFields: {},\n },\n];\n\nexport interface DuplicateDealerList extends Array {}\ninterface DuplicateDealer {\n name: string;\n accountNumber: string;\n postcode: string;\n id: string;\n}\n\nclass DealerForm extends React.Component<\n DealerFormPropsEnhanced,\n {\n section?: string;\n savingDraft: boolean;\n showModal: boolean;\n isDealerSetupV2: boolean;\n duplicateDealerList: DuplicateDealerList;\n }\n> {\n /**\n * Field to store the formik setTouched function,\n * so it can be used to set the initial touched values in componentDidMount\n */\n private setTouched: any;\n\n constructor(props: DealerFormPropsEnhanced) {\n super(props);\n this.getSections = memoizeOne(this.getSections.bind(this));\n this.handleSaveDraft = debounce(this.handleSaveDraft.bind(this), 3000, {\n leading: true,\n });\n this.getDraftDealerValidationMessage =\n this.getDraftDealerValidationMessage.bind(this);\n this.handleSectionChanged = this.handleSectionChanged.bind(this);\n this.populateModal = this.populateModal.bind(this);\n this.toggleModal = this.toggleModal.bind(this);\n this.state = {\n section: this.props.initialSection,\n savingDraft: false,\n showModal: false,\n isDealerSetupV2: this.props.isDealerSetupV2 || true,\n duplicateDealerList: [],\n };\n }\n\n public render() {\n const {\n loggedInUser,\n onSubmitDealer,\n draftDealerLastSaved,\n initialValues,\n context,\n canUpdate,\n } = this.props;\n\n const {\n savingDraft,\n section: currentSection,\n isDealerSetupV2,\n showModal,\n } = this.state;\n // console.log(\"DealerForm.isDealerSetupV2: \" + this.state.isDealerSetupV2);\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n <>\n {\n onSubmitDealer(values).then(() => setSubmitting(false));\n }}\n validateOnChange={false}\n isInitialValid={({ dealer }: any) => !!(dealer && dealer.id)}\n validationSchema={dealerValidationSchema}\n validateOnBlur={true}\n >\n {(formikProps: FormikProps) => {\n this.setTouched = formikProps.setTouched;\n const create = !formikProps.values.id;\n\n const saveDraftProps: SaveDraftProps = {\n saveDraft: () => this.handleSaveDraft(formikProps),\n draftLastSaved: draftDealerLastSaved,\n savingDraft,\n draftValidationMessage: this.getDraftDealerValidationMessage(\n loggedInUser,\n formikProps.values\n ),\n };\n\n return (\n <>\n {create ? (\n

\n New dealer\n {formikProps.values.name ? (\n \n {\" \"}\n - {formikProps.values.name}\n \n ) : null}\n

\n ) : null}\n \n \n {create ? (\n \n ) : null}\n \n );\n }}\n \n \n );\n }\n\n public componentDidMount() {\n if (this.props.initialTouched && this.setTouched) {\n this.setTouched(this.props.initialTouched);\n }\n }\n\n public componentWillUnmount() {\n this.setTouched = undefined;\n }\n\n private handleSectionChanged(section: string) {\n this.setState({ section });\n }\n\n private populateModal = (listOfDealers: DuplicateDealerList) => {\n const match =\n JSON.stringify(this.state.duplicateDealerList) ===\n JSON.stringify(listOfDealers);\n if (!match) {\n this.setState({ duplicateDealerList: listOfDealers, showModal: true });\n }\n };\n\n private toggleModal = () =>\n this.setState({ showModal: !this.state.showModal });\n\n /** Indicates whether the draft dealer can be saved */\n private getDraftDealerValidationMessage(loggedInUser: User, values: Dealer) {\n const isAccountManager = loggedInUser.roles.includes(\n UserRoles.account_manager\n );\n\n if (!values) {\n return undefined;\n }\n\n const missingFields: string[] = [];\n\n if (!isAccountManager && !values.accountManagerId) {\n missingFields.push(\"account manager\");\n }\n\n if (!values.name) {\n missingFields.push(\"dealer name\");\n }\n\n if (missingFields.length) {\n return `Requires ${missingFields.join(\" and \")} to save as draft`;\n }\n\n return undefined;\n }\n\n /**\n * Save the current form state to the server as a draft.\n * Redirects to the draft dealer url if it is being created for the first time.\n */\n private handleSaveDraft({ values, errors, touched }: FormikProps) {\n const { saveDraft, history, initialValues, context } = this.props;\n const { section: currentSection } = this.state;\n\n const formData = {\n values,\n initialValues,\n errors,\n touched,\n currentSection,\n };\n\n this.setState({ savingDraft: true });\n\n return saveDraft(formData).then((result) => {\n if (result) {\n if (context === ContextNames.ACCOUNT_MANAGER) {\n history.push(\n `/accountmanagers/${\n result.accountManager &&\n encodeURIComponent(result.accountManager.id)\n }/dealers/drafts/${result.id}`\n );\n } else {\n history.push(`/dealers/drafts/${result.id}`);\n }\n }\n this.setState({ savingDraft: false });\n });\n }\n\n private getSections(\n loggedInUser: User,\n editMode: CreateOrUpdateMode,\n dealerId?: number,\n dealerSetupV2?: boolean,\n includeQuestionnaire?: boolean,\n includeBankDetails?: boolean,\n context?: ContextNames\n ): FormSectionInfo[] {\n const hideAccountMgrSection =\n loggedInUser.roles.includes(UserRoles.account_manager) ||\n context === ContextNames.ACCOUNT_MANAGER;\n const hideContactsSection = !!dealerId;\n const hideLendersSection = !!dealerId;\n\n return DealerFormSections.filter((section) => {\n if (section.id === DealerFormSectionName.ACCOUNT_MANAGER) {\n return !hideAccountMgrSection;\n }\n if (section.id === DealerFormSectionName.CONTACTS) {\n return !hideContactsSection;\n }\n if (section.id === DealerFormSectionName.LENDER_PACKAGES) {\n return !hideLendersSection;\n }\n\n if (\n [\n DealerFormSectionName.SUMMARY,\n DealerFormSectionName.DEALER_PROOFS,\n ].includes(section.id as any)\n ) {\n return editMode === CreateOrUpdateMode.CREATE;\n }\n\n if (section.id === DealerFormSectionName.BANK_DETAILS) {\n return includeBankDetails;\n }\n\n if (\n dealerSetupV2 &&\n [\n DealerFormSectionName.HISTORIC_CHECK,\n DealerFormSectionName.PRODUCT_MIX,\n DealerFormSectionName.DEALER_INFORMATION,\n // DealerFormSectionName.DEALER_PROOFS,\n DealerFormSectionName.CURRENT_SITUATION,\n DealerFormSectionName.CREATE_QUESTIONNAIRE,\n ].includes(section.id as any)\n ) {\n return false;\n } else {\n if (!includeQuestionnaire) {\n if (\n [\n DealerFormSectionName.HISTORIC_CHECK,\n DealerFormSectionName.PRODUCT_MIX,\n DealerFormSectionName.DEALER_INFORMATION,\n DealerFormSectionName.DEALER_PROOFS,\n DealerFormSectionName.CURRENT_SITUATION,\n ].includes(section.id as any)\n ) {\n return false;\n }\n } else if (section.id === DealerFormSectionName.CREATE_QUESTIONNAIRE) {\n return false;\n }\n }\n\n return true;\n });\n }\n}\n\nexport default compose(\n withRouter,\n withLoggedInUser\n)(DealerForm);\n","import axios from \"axios\";\nimport React, { useState } from \"react\";\nimport {\n Alert,\n Button,\n Col,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n Row,\n} from \"reactstrap\";\nimport { withAlerts } from \"../../Alerts/AlertsProvider\";\nimport { AlertsProps } from \"../../Alerts/types\";\nimport { useAuth0 } from \"../../Auth0Login/Auth0Provider\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { faSpinner } from \"@fortawesome/free-solid-svg-icons\";\n\ninterface ProofUploadFormProps {\n isOpen: boolean;\n toggle: () => void;\n url: string;\n header?: string;\n proofType?: string;\n proofRef?: string;\n onFileUploaded: (fileName: string) => void;\n}\n\nconst isSeparator = (value: string): boolean =>\n value === \"/\" || value === \"\\\\\" || value === \":\";\n\nconst getBase64 = (file: any) => {\n return new Promise((resolve) => {\n // let fileInfo;\n let baseURL = null;\n // Make new FileReader\n let reader = new FileReader();\n\n // Convert the file to base64 text\n reader.readAsDataURL(file);\n\n // on reader load somthing...\n reader.onload = () => {\n // Make a fileInfo Object\n // console.log(\"Called\", reader);\n baseURL = reader.result;\n // console.log(baseURL);\n resolve(baseURL);\n };\n // console.log(fileInfo);\n });\n};\n\nconst getExtension = (path: string): string => {\n for (let i = path.length - 1; i > -1; --i) {\n const value = path[i];\n if (value === \".\") {\n if (i > 1) {\n if (isSeparator(path[i - 1])) {\n return \"\";\n }\n return path.substring(i + 1);\n }\n return \"\";\n }\n if (isSeparator(value)) {\n return \"\";\n }\n }\n return \"\";\n};\n\nconst removeExtension = (filename: string): string => {\n let res = filename;\n const ext = getExtension(filename);\n if (filename.endsWith(\".\" + ext)) {\n res = filename.substring(0, filename.length - (ext.length + 1));\n }\n return res;\n};\n\nconst ProofUploadForm = ({\n url,\n header,\n proofType,\n proofRef,\n onFileUploaded,\n isOpen,\n toggle,\n addAlert,\n}: ProofUploadFormProps & AlertsProps) => {\n const [file, setFile] = useState(undefined);\n const [title, setTitle] = useState(\"\");\n const [uploading, setUploading] = useState(false);\n const maxMb = 10;\n const oneMb = 1048576;\n const maxBytes = maxMb * oneMb;\n const { getToken } = useAuth0();\n const handleSubmit = (e: any) => {\n e.preventDefault();\n e.stopPropagation();\n setUploading(true);\n\n if (!file || !(file.size <= maxBytes)) {\n return;\n }\n\n const ext = getExtension(file.name);\n\n let cTitle = title as string;\n if (!title || title === \"\") {\n cTitle = removeExtension(file.name as string);\n }\n\n const payload = {\n DealerProofRef: proofRef,\n Proof: proofType,\n Filename: file.name,\n Title: cTitle,\n Ext: ext,\n Base64: \"\",\n };\n\n let token = null;\n\n if (getToken) {\n (async () => {\n await getBase64(file)\n .then((result) => {\n const tmp = result as string;\n payload.Base64 = tmp.substring(tmp.indexOf(\",\") + 1);\n })\n .catch((err) => {});\n\n await getToken().then((value) => {\n token = value;\n\n return axios\n .post(url, payload, {\n headers: {\n \"content-type\": \"application/json\",\n authorization: `Bearer ${token}`,\n },\n })\n .catch((err) => {\n setUploading(false);\n addAlert({ message: \"Error uploading file to Eurodrive server\" });\n })\n .then(() => {\n setUploading(false);\n setFile(undefined);\n setTitle(\"\");\n onFileUploaded(file.name);\n toggle();\n });\n });\n })();\n }\n };\n\n const handleChange = (e: any) => {\n setFile(e.target.files[0]);\n setTitle(removeExtension(e.target.files[0].name));\n };\n\n return (\n \n \n {header ? header : \"Upload file\"}\n \n \n \n
\n setTitle(event.target.value)}\n />\n
\n \n
\n \n \n
\n \n \n
\n \n
\n {file?.size > maxBytes && (\n \n \n \n Files must not exceed {maxMb}Mb\n \n \n \n )}\n
\n \n \n maxBytes}\n >\n {uploading ? (\n <>\n Uploading{\" \"}\n \n \n ) : (\n Upload\n )}\n \n \n \n
\n );\n};\n\nexport default withAlerts(ProofUploadForm);\n","import React, { useState } from \"react\";\nimport { Col, Row, Button, DropdownItem, Alert } from \"reactstrap\";\nimport {\n DealerProofDocument,\n DealerProofResponse,\n DealerProofType,\n} from \"../types\";\nimport { canManageProposalFiles } from \"../../../utils\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport {\n IconDefinition,\n faCamera,\n faCreditCard,\n faPlus,\n faFileAlt,\n faTrash,\n faIdBadge,\n faSpinner,\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport config from \"../../../config\";\nimport axios from \"axios\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport ProofUploadForm from \"../DealerForm/ProofUploadForm\";\n// import * as uuid from \"uuid\";\n\nconst sortByDocumentProof = (a: DealerProofDocument, b: DealerProofDocument) =>\n a.metadata?.Proof > b.metadata?.Proof ? 1 : -1;\n\nconst sortByDocumentTitle = (a: DealerProofDocument, b: DealerProofDocument) =>\n a.title.toUpperCase() < b.title.toUpperCase() ? 1 : -1;\n\nexport const DealerProofsSummaryContent = ({\n storageRef,\n}: {\n storageRef?: string;\n}) => {\n const [state, setState] = useState<{\n proofsLoaded: boolean;\n proofEnough: boolean;\n proofs?: any;\n }>({\n proofsLoaded: false,\n proofEnough: false,\n proofs: null,\n });\n let loadingProofs = false;\n\n const getFileSummaryInfo = (proofref: any) => {\n loadingProofs = true;\n return axios\n .get(\n `${config.API_URL}/api/dealersetup/proof/${encodeURIComponent(\n proofref\n )}`,\n { headers: { \"Cache-Control\": \"no-cache\" } }\n )\n .then((r: any) => {\n // console.info(\"got: \", JSON.stringify(r));\n let dp = r?.data as DealerProofResponse;\n if (dp && dp.documents) {\n dp.documents.sort(sortByDocumentTitle).sort(sortByDocumentProof);\n }\n\n setState((s) => ({\n ...s,\n proofs: dp,\n proofsLoaded: true,\n }));\n loadingProofs = false;\n })\n .catch((error: any) => {\n // tslint:disable-next-line:no-console\n console.error(\"Error in getFileInfo2\", error);\n loadingProofs = false;\n });\n };\n\n if (!state.proofsLoaded) {\n getFileSummaryInfo(storageRef);\n }\n\n return true ? (\n <>\n \n {loadingProofs && (\n \n \n \n )}\n {!loadingProofs && (\n \n {state.proofs && (\n \n Browse All\n \n )}\n
\n \n )}\n
\n {(state.proofs as DealerProofResponse)?.documents?.map(\n (el: any, index: number) => (\n \n {el.metadata?.Proof}\n \n \n {el.title}\n \n \n \n )\n )}\n \n ) : null;\n};\n\nexport const DealerProofsContent = ({\n isDraft,\n storageRef,\n setFieldValueFunc,\n}: {\n isDraft?: boolean;\n storageRef?: string;\n setFieldValueFunc?: (field: string, value: any) => void;\n}) => {\n const [state, setState] = useState<{\n deleting: boolean;\n deletingIndex?: string | null;\n proofsLoaded: boolean;\n proofEnough: boolean;\n showModal: boolean;\n proofs?: any;\n proofType?: any;\n }>({\n deleting: false,\n deletingIndex: null,\n proofsLoaded: false,\n proofEnough: false,\n showModal: false,\n proofs: null,\n proofType: null,\n });\n let faIcons: IconDefinition[] = [\n faIdBadge,\n faFileAlt,\n faCreditCard,\n faCamera,\n ];\n\n const pt = Object.keys(DealerProofType) as Array<\n keyof typeof DealerProofType\n >;\n let loadingProofs = false;\n\n const { loggedInUser } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n const deleteProofFile = (proofref: any, uniqueId: string) => {\n setState((s) => ({ ...s, deleting: true, deletingIndex: uniqueId }));\n return axios\n .delete(\n `${config.API_URL}/api/dealersetup/proof/${proofref}/${uniqueId}`,\n {\n headers: { \"Cache-Control\": \"no-cache\" },\n }\n )\n .then((r: any) => {\n // console.error(\"deleteProofFile returned: \", JSON.stringify(r));\n getFileInfo(proofref);\n setState((s) => ({ ...s, deleting: false, deletingIndex: null }));\n })\n .catch((error: any) => {\n setState((s) => ({ ...s, deleting: false, deletingIndex: null }));\n // tslint:disable-next-line:no-console\n console.error(\"Error in deleteProofFile\", error);\n });\n };\n\n const onProofDelete = (ev: any) => {\n // console.log(\"onProofDelete: \" + JSON.stringify(ev));\n deleteProofFile(storageRef, ev);\n };\n\n const isProofEnough = (resp: DealerProofResponse): boolean => {\n let res = true; // Assume everything required is present and return false of that's not the case\n pt.map((proofType) => {\n let c = 0;\n if (resp && resp.documents) {\n resp?.documents.map((doc, d) => {\n if (\n doc.metadata &&\n doc.metadata.Proof &&\n doc.metadata.Proof === DealerProofType[proofType]\n ) {\n c++;\n }\n });\n }\n if (c === 0) {\n res = false;\n }\n return proofType;\n });\n return res;\n };\n\n const getFileInfo = (proofref: any) => {\n loadingProofs = true;\n return axios\n .get(\n `${config.API_URL}/api/dealersetup/proof/${encodeURIComponent(\n proofref\n )}`,\n { headers: { \"Cache-Control\": \"no-cache\" } }\n )\n .then((r: any) => {\n let dp = r?.data as DealerProofResponse;\n if (dp && dp.documents) {\n dp.documents.sort(sortByDocumentTitle).sort(sortByDocumentProof);\n }\n\n // console.error(\"getFileInfo returned: \", JSON.stringify(proofs));\n const ipe = isProofEnough(dp);\n if (isDraft && setFieldValueFunc) {\n setFieldValueFunc(\"allProofsProvided\", ipe);\n }\n setState((s) => ({\n ...s,\n proofs: dp,\n proofEnough: ipe,\n proofsLoaded: true,\n }));\n loadingProofs = false;\n })\n .catch((error: any) => {\n // tslint:disable-next-line:no-console\n console.error(\"Error in getFileInfo\", error);\n loadingProofs = false;\n });\n };\n\n const canEdit = canManageProposalFiles(loggedInUser);\n\n if (!state.proofsLoaded) {\n getFileInfo(storageRef);\n }\n\n return (\n <>\n {!loadingProofs && canEdit && (\n {\n getFileInfo(storageRef);\n }}\n isOpen={state.showModal}\n toggle={() =>\n setState((s) => ({ ...s, showModal: !state.showModal }))\n }\n />\n )}\n {!loadingProofs && canEdit && (\n \n {pt.map((el, index) => (\n \n
\n {canEdit && (\n {\n e.preventDefault();\n e.stopPropagation();\n setState((s) => ({\n ...s,\n showModal: true,\n proofType: DealerProofType[el],\n }));\n return false;\n }}\n >\n {DealerProofType[el]}{\" \"}\n \n \n )}\n
\n \n ))}\n
\n )}\n \n {loadingProofs && (\n \n \n \n )}\n {!loadingProofs && (\n \n {state.proofs && (\n \n Browse All\n \n )}\n
\n \n )}\n
\n {(state.proofs as DealerProofResponse)?.documents?.map(\n (el: any, index: number) => (\n \n {el.metadata?.Proof}\n \n \n {el.title}\n \n \n \n \n {(confirm) => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() => onProofDelete(el.uniqueId));\n }}\n >\n {\" \"}\n {state.deleting && state.deletingIndex === el.uniqueId ? (\n <>\n Deleting{\" \"}\n \n \n ) : (\n Delete\n )}\n \n )}\n \n \n \n )\n )}\n {isDraft && (\n \n \n \n \n \n )}\n \n \n {!loadingProofs && state.proofEnough && (\n \n Sufficient proofs have been provided\n \n )}\n {!loadingProofs && !state.proofEnough && (\n \n Insufficient proofs provided. At least one of each type required\n \n )}\n \n \n \n \n
\n \n
\n \n );\n};\n","import {\n faFile,\n faFileExcel,\n faFileImage,\n faFilePdf,\n faFileWord,\n IconDefinition\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport FileDownloadLink from \"../FileDownloadLink\";\n\ninterface FilesPanelProps {\n files: {\n url: string;\n name: string;\n extension: string;\n }[];\n}\n\nexport const iconLookup: { [key: string]: IconDefinition } = {\n \".xls\": faFileExcel,\n \".xlsx\": faFileExcel,\n \".doc\": faFileWord,\n \".docx\": faFileWord,\n \".pdf\": faFilePdf,\n \".jpg\": faFileImage,\n \".png\": faFileImage,\n \".jpeg\": faFileImage\n};\n\nconst FilesPanel = ({ files }: FilesPanelProps) => (\n
\n {files.map(({ name, url, extension }) => (\n
\n \n \n {name}\n \n
\n ))}\n
\n);\n\nexport default FilesPanel;\n","import '@babel/runtime/helpers/esm/objectWithoutProperties';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';\nimport _objectSpread from '@babel/runtime/helpers/esm/objectSpread';\nimport _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';\nimport _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';\nimport _inherits from '@babel/runtime/helpers/esm/inherits';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _defineProperty from '@babel/runtime/helpers/esm/defineProperty';\nimport React, { Component } from 'react';\nimport 'memoize-one';\nimport '@emotion/core';\nimport 'react-dom';\nimport 'prop-types';\nimport '@babel/runtime/helpers/esm/typeof';\nimport { f as cleanValue } from '../../dist/chunk-39d3fda8.browser.esm.js';\nimport '../../dist/chunk-80640036.browser.esm.js';\nimport { S as Select } from '../../dist/base/dist/react-select-cac0a5ae.browser.esm.js';\nimport '@emotion/css';\nimport '@babel/runtime/helpers/esm/taggedTemplateLiteral';\nimport 'react-input-autosize';\nimport { m as manageState } from '../../dist/chunk-b36baf1a.browser.esm.js';\n\nvar compareOption = function compareOption() {\n var inputValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var option = arguments.length > 1 ? arguments[1] : undefined;\n var candidate = String(inputValue).toLowerCase();\n var optionValue = String(option.value).toLowerCase();\n var optionLabel = String(option.label).toLowerCase();\n return optionValue === candidate || optionLabel === candidate;\n};\n\nvar builtins = {\n formatCreateLabel: function formatCreateLabel(inputValue) {\n return \"Create \\\"\".concat(inputValue, \"\\\"\");\n },\n isValidNewOption: function isValidNewOption(inputValue, selectValue, selectOptions) {\n return !(!inputValue || selectValue.some(function (option) {\n return compareOption(inputValue, option);\n }) || selectOptions.some(function (option) {\n return compareOption(inputValue, option);\n }));\n },\n getNewOptionData: function getNewOptionData(inputValue, optionLabel) {\n return {\n label: optionLabel,\n value: inputValue,\n __isNew__: true\n };\n }\n};\nvar defaultProps = _objectSpread({\n allowCreateWhileLoading: false,\n createOptionPosition: 'last'\n}, builtins);\nvar makeCreatableSelect = function makeCreatableSelect(SelectComponent) {\n var _class, _temp;\n\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inherits(Creatable, _Component);\n\n function Creatable(props) {\n var _this;\n\n _classCallCheck(this, Creatable);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Creatable).call(this, props));\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"select\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onChange\", function (newValue, actionMeta) {\n var _this$props = _this.props,\n getNewOptionData = _this$props.getNewOptionData,\n inputValue = _this$props.inputValue,\n isMulti = _this$props.isMulti,\n onChange = _this$props.onChange,\n onCreateOption = _this$props.onCreateOption,\n value = _this$props.value,\n name = _this$props.name;\n\n if (actionMeta.action !== 'select-option') {\n return onChange(newValue, actionMeta);\n }\n\n var newOption = _this.state.newOption;\n var valueArray = Array.isArray(newValue) ? newValue : [newValue];\n\n if (valueArray[valueArray.length - 1] === newOption) {\n if (onCreateOption) onCreateOption(inputValue);else {\n var newOptionData = getNewOptionData(inputValue, inputValue);\n var newActionMeta = {\n action: 'create-option',\n name: name\n };\n\n if (isMulti) {\n onChange([].concat(_toConsumableArray(cleanValue(value)), [newOptionData]), newActionMeta);\n } else {\n onChange(newOptionData, newActionMeta);\n }\n }\n return;\n }\n\n onChange(newValue, actionMeta);\n });\n\n var options = props.options || [];\n _this.state = {\n newOption: undefined,\n options: options\n };\n return _this;\n }\n\n _createClass(Creatable, [{\n key: \"UNSAFE_componentWillReceiveProps\",\n value: function UNSAFE_componentWillReceiveProps(nextProps) {\n var allowCreateWhileLoading = nextProps.allowCreateWhileLoading,\n createOptionPosition = nextProps.createOptionPosition,\n formatCreateLabel = nextProps.formatCreateLabel,\n getNewOptionData = nextProps.getNewOptionData,\n inputValue = nextProps.inputValue,\n isLoading = nextProps.isLoading,\n isValidNewOption = nextProps.isValidNewOption,\n value = nextProps.value;\n var options = nextProps.options || [];\n var newOption = this.state.newOption;\n\n if (isValidNewOption(inputValue, cleanValue(value), options)) {\n newOption = getNewOptionData(inputValue, formatCreateLabel(inputValue));\n } else {\n newOption = undefined;\n }\n\n this.setState({\n newOption: newOption,\n options: (allowCreateWhileLoading || !isLoading) && newOption ? createOptionPosition === 'first' ? [newOption].concat(_toConsumableArray(options)) : [].concat(_toConsumableArray(options), [newOption]) : options\n });\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.select.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.select.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var options = this.state.options;\n return React.createElement(SelectComponent, _extends({}, this.props, {\n ref: function ref(_ref) {\n _this2.select = _ref;\n },\n options: options,\n onChange: this.onChange\n }));\n }\n }]);\n\n return Creatable;\n }(Component), _defineProperty(_class, \"defaultProps\", defaultProps), _temp;\n}; // TODO: do this in package entrypoint\n\nvar SelectCreatable = makeCreatableSelect(Select);\nvar Creatable = manageState(SelectCreatable);\n\nexport default Creatable;\nexport { defaultProps, makeCreatableSelect };\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, FormGroup, Label, Row } from \"reactstrap\";\nimport AccountManagerSelect from \"../../AccountManagers/AccountManagerSelect\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { ContextNames } from \"../../types\";\nimport { DraftDealerSearchArgs } from \"../types\";\n\nconst DraftDealerListFilterPanel = ({\n values,\n setFieldValue,\n submitForm,\n context\n}: FormikProps & { context?: ContextNames }) => {\n const { loggedInUser, isAccountManager } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n <>\n {context !== ContextNames.ACCOUNT_MANAGER && !isAccountManager && (\n \n \n \n \n {\n setFieldValue(\"accountManagerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n )}\n \n );\n};\n\nexport default DraftDealerListFilterPanel;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation, MutationFunction, MutationResult } from \"react-apollo\";\n\ninterface DeleteDraftDealerData {\n success: boolean;\n}\n\ninterface DeleteDraftDealerVariables {\n id: number;\n}\n\nexport const DELETE_DRAFT_DEALER = gql`\n mutation DeleteDraftDealer($id: ID!) {\n deleteDraftDealer(id: $id) {\n success\n }\n }\n`;\n\nconst DeleteDraftDealerMutation = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction<\n DeleteDraftDealerData,\n DeleteDraftDealerVariables\n >,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport default DeleteDraftDealerMutation;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { DraftDealer } from \"../types\";\nimport DeleteDraftDealerMutation from \"./DeleteDraftDealerMutation\";\nimport { DRAFT_DEALER_LIST } from \"./DraftDealerListQuery\";\n\ninterface DeleteDraftDealerDropdownItemProps {\n draftDealer: DraftDealer;\n}\n\nconst DeleteDraftDealerDropdownItem = ({\n draftDealer: { id }\n}: DeleteDraftDealerDropdownItemProps) => (\n \n {confirm => (\n \n {mutation => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() =>\n mutation({\n variables: { id: id || 0 },\n refetchQueries: [\n {\n query: DRAFT_DEALER_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10\n }\n }\n }\n ]\n })\n );\n }}\n >\n Delete\n \n )}\n \n )}\n \n);\n\nexport default DeleteDraftDealerDropdownItem;\n","import classnames from \"classnames\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { Badge } from \"reactstrap\";\nimport DistanceInWordsText from \"../../Proposals/ProposalForm/DistanceInWordsText\";\nimport { ContextNames, UserRoles } from \"../../types\";\nimport { DraftDealerProps } from \"../types\";\n\nconst DraftDealerBadges = ({\n loggedInUser,\n draftDealer: { updated, accountManager },\n className,\n context\n}: DraftDealerProps & { className?: string }) => {\n const isAccountManager = loggedInUser.roles.includes(\n UserRoles.account_manager\n );\n\n return (\n
\n {!isAccountManager &&\n context !== ContextNames.ACCOUNT_MANAGER &&\n accountManager ? (\n {accountManager.name}\n ) : null}\n \n \n \n
\n );\n};\n\nexport default DraftDealerBadges;\n","import * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Col, Row } from \"reactstrap\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport { ContextNames } from \"../../types\";\nimport { DraftDealerProps } from \"../types\";\nimport DeleteDraftDealerDropdownItem from \"./DeleteDraftDealerDropdownItem\";\nimport DraftDealerBadges from \"./DraftDealerBadges\";\n\nconst DraftDealerListItem = ({\n loggedInUser,\n draftDealer,\n context\n}: DraftDealerProps) => {\n return (\n \n \n \n
\n

\n {draftDealer.name}\n

\n

\n {draftDealer.address}\n

\n
\n \n \n \n \n \n \n \n
\n \n );\n};\n\nexport const DraftDealerListItemLoadingPlaceholder = () => (\n
\n \n
\n);\n\nexport default DraftDealerListItem;\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport PagedList from \"../../PagedList\";\nimport { ContextNames } from \"../../types\";\nimport { DraftDealerSearchArgs } from \"../types\";\nimport DraftDealerListFilterPanel from \"./DraftDealerListFilterPanel\";\nimport DraftDealerListItem from \"./DraftDealerListItem\";\nimport { DRAFT_DEALER_LIST, DraftDealerListData } from \"./DraftDealerListQuery\";\n\nconst defaultSearchArgs = {\n page: 1,\n pageSize: 10\n};\n\nconst DraftDealerList = ({\n accountManagerId,\n context\n}: {\n accountManagerId?: string;\n context?: ContextNames;\n}) => {\n const { loggedInUser, isAccountManager } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n qs}\n mapValuesToQuerystring={args => args}\n defaultValues={defaultSearchArgs}\n fixedValues={{ accountManagerId }}\n filterPanel={\n context === ContextNames.ACCOUNT_MANAGER || isAccountManager\n ? undefined\n : DraftDealerListFilterPanel\n }\n context={context}\n >\n {(formikProps: FormikProps) => (\n \n data.loggedInUser?.draftDealers\n }\n listItemComponent={({ item }) => (\n \n )}\n />\n )}\n \n );\n};\n\nexport default DraftDealerList;\n","import * as React from \"react\";\nimport { useParams } from \"react-router\";\nimport { Container } from \"reactstrap\";\nimport { useAccountManager } from \"../../AccountManagers/AccountManagerQuery\";\nimport { AccountManager } from \"../../AccountManagers/types\";\nimport Breadcrumbs from \"../../Breadcrumbs\";\nimport { ContextNames } from \"../../types\";\nimport DraftDealerList from \"./DraftDealerList\";\n\nconst DraftDealerBreadcrumbs = ({\n accountManager: am\n}: {\n accountManager?: AccountManager;\n}) => {\n const breadcrumbs = am\n ? [\n {\n to: \"/\",\n title: \"Home\"\n },\n { to: \"/accountmanagers\", title: \"Account managers\" },\n {\n to: `/accountmanagers/${encodeURIComponent(am.id)}/dealers`,\n title: am.name\n },\n {\n to: `/accountmanagers/${encodeURIComponent(am.id)}/dealers/drafts`,\n title: \"Draft dealers\",\n active: true\n }\n ]\n : [\n {\n to: \"/\",\n title: \"Home\"\n },\n { to: \"/dealers\", title: \"Dealers\" },\n {\n to: \"/dealers/drafts\",\n title: \"Draft dealers\",\n active: true\n }\n ];\n\n return ;\n};\n\nconst DraftDealerListScene = () => {\n const params = useParams<{ accountManagerId?: string }>();\n\n const accountManagerId = params.accountManagerId\n ? decodeURIComponent(params.accountManagerId)\n : undefined;\n\n const { accountManager, loading } = useAccountManager(accountManagerId);\n\n if (loading) {\n return null;\n }\n\n return (\n \n \n

\n Draft dealers\n {accountManager && (\n <>\n {\" - \"}\n {accountManager.name}\n \n )}\n

\n \n
\n );\n};\n\nexport default DraftDealerListScene;\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport ModalForm from \"../../Forms/ModalForm\";\nimport { ContextNames } from \"../../types\";\nimport accountManagerValidationSchema from \"../accountManagerValidationSchema\";\nimport { AccountManager } from \"../types\";\nimport AccountManagerFormInner from \"./AccountManagerFormInner\";\nimport {\n cleanAccountManagerBeforeSubmit,\n useCreateOrUpdateAccountManager\n} from \"./CreateOrUpdateAccountManagerMutation\";\n\ninterface CreateAccountManagerModalProps {\n regionalSalesManagerId?: string;\n isOpen: boolean;\n toggle: () => void;\n context?: ContextNames;\n}\n\nconst CreateAccountManagerModal = ({\n isOpen,\n toggle,\n context,\n regionalSalesManagerId\n}: CreateAccountManagerModalProps) => {\n const createOrUpdateAccountManager = useCreateOrUpdateAccountManager();\n const history = useHistory();\n\n return (\n \n createOrUpdateAccountManager(\n cleanAccountManagerBeforeSubmit(values)\n ).then(result => {\n if (result?.data?.createOrUpdateAccountManager) {\n history.push(\n `/accountmanagers/${result.data.createOrUpdateAccountManager.id}`\n );\n }\n })\n }\n context={context}\n >\n {(props: FormikProps & { context?: ContextNames }) => (\n \n )}\n \n );\n};\n\nexport default CreateAccountManagerModal;\n","import { FormikProps } from \"formik\";\nimport * as React from \"react\";\nimport { Col, FormGroup, Label, Row } from \"reactstrap\";\nimport BooleanCheckboxField from \"../../Forms/BooleanCheckboxField\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport RegionalSalesManagerSelect from \"../../RegionalSalesManagers/RegionalSalesManagerSelect\";\nimport { ContextNames } from \"../../types\";\nimport { AccountManagerSearchArgs } from \"../types\";\n\nconst AccountManagerListFilterPanel = ({\n values,\n setFieldValue,\n submitForm,\n context\n}: FormikProps & { context?: ContextNames }) => {\n const { loggedInUser } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n <>\n {context !== ContextNames.REGIONAL_SALES_MANAGER && (\n \n \n \n \n {\n setFieldValue(\"regionalSalesManagerId\", id, false);\n submitForm();\n }}\n isClearable={true}\n />\n \n \n \n )}\n \n \n \n \n \n \n );\n};\n\nexport default AccountManagerListFilterPanel;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport { Mutation, MutationFunction, MutationResult } from \"react-apollo\";\n\ninterface DeleteAccountManagerData {\n success: boolean;\n}\n\ninterface DeleteAccountManagerVariables {\n id: string;\n}\n\nexport const DELETE_AM = gql`\n mutation DeleteAccountManager($id: ID!) {\n deleteAccountManager(id: $id) {\n success\n }\n }\n`;\n\nconst DeleteAccountManagerMutation = ({\n children\n}: {\n children: (\n mutationFunction: MutationFunction<\n DeleteAccountManagerData,\n DeleteAccountManagerVariables\n >,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport default DeleteAccountManagerMutation;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { Field, FieldProps } from \"formik\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { AccountManager } from \"../types\";\nimport { ACCOUNT_MANAGER_LIST } from \"./AccountManagerListQuery\";\nimport DeleteAccountManagerMutation from \"./DeleteAccountManagerMutation\";\n\ninterface DeleteAccountManagerDropdownItemProps {\n accountManager: AccountManager;\n}\n\nconst DeleteAccountManagerDropdownItem = ({\n accountManager: { id, name }\n}: DeleteAccountManagerDropdownItemProps) => (\n \n {({ form: { initialValues } }: FieldProps) => (\n \n {confirm => (\n \n {mutation => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n confirm(() =>\n mutation({\n variables: { id },\n refetchQueries: [\n {\n query: ACCOUNT_MANAGER_LIST,\n variables: {\n input: initialValues || {}\n }\n }\n ]\n })\n );\n }}\n >\n Delete\n \n )}\n \n )}\n \n )}\n \n);\n\nexport default DeleteAccountManagerDropdownItem;\n","import { faHome, faMap } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport * as React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Col, DropdownItem, Row } from \"reactstrap\";\nimport { canManageAccountManagers } from \"../../../utils\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport RouterDropdownItem from \"../../RouterDropdownItem\";\nimport AccountManagerBadges from \"../AccountManagerBadges\";\nimport { AccountManagerProps } from \"../AccountManagerQuery\";\nimport DeleteAccountManagerDropdownItem from \"./DeleteAccountManagerDropdownItem\";\n\nconst AccountManagerListItem = ({\n loggedInUser,\n accountManager\n}: AccountManagerProps) => (\n \n \n \n

\n \n {accountManager.name === \".\"\n ? accountManager.id\n : accountManager.name}\n \n

\n\n \n \n \n \n \n \n Map of dealers\n \n \n \n House dealer\n \n {canManageAccountManagers(loggedInUser) && (\n <>\n \n \n \n )}\n \n \n
\n \n);\n\nexport default AccountManagerListItem;\n","import { FormikProps } from \"formik\";\nimport React from \"react\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport {\n Button,\n DropdownItem,\n DropdownMenu,\n DropdownToggle,\n UncontrolledButtonDropdown\n} from \"reactstrap\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport PagedList from \"../../PagedList\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport CreateUserModal from \"../../Settings/Users/CreateUserModal\";\nimport { ContextNames, SearchResults, User, UserRoles } from \"../../types\";\nimport CreateAccountManagerModal from \"../AccountManagerForm/CreateAccountManagerModal\";\nimport { AccountManager, AccountManagerSearchArgs } from \"../types\";\nimport AccountManagerListFilterPanel from \"./AccountManagerListFilterPanel\";\nimport AccountManagerListItem from \"./AccountManagerListItem\";\nimport {\n ACCOUNT_MANAGER_LIST,\n AccountManagerListData\n} from \"./AccountManagerListQuery\";\n\nconst defaultSearchArgs: AccountManagerSearchArgs = {\n page: 1,\n pageSize: 10,\n includeSuspended: false\n};\n\nconst AccountManagerActionButtons = ({\n context,\n variables\n}: {\n variables?: AccountManagerSearchArgs;\n results?: SearchResults;\n loggedInUser?: User;\n context?: ContextNames;\n}) => {\n const { loggedInUser, checkCanCreate, checkCanRead } = useLoggedInUser();\n\n const [showCreateModal, setShowCreateModal] = React.useState(false);\n const [\n showCreateWithoutUserModal,\n setShowCreateWithoutUserModal\n ] = React.useState(false);\n\n const toggleCreateModal = React.useCallback(\n () => setShowCreateModal(!showCreateModal),\n [setShowCreateModal, showCreateModal]\n );\n\n const toggleCreateWithoutUserModal = React.useCallback(\n () => setShowCreateWithoutUserModal(!showCreateWithoutUserModal),\n [setShowCreateWithoutUserModal, showCreateWithoutUserModal]\n );\n\n const regionalSalesManagerId = variables?.regionalSalesManagerId;\n\n if (!loggedInUser) {\n return null;\n }\n\n return (\n
\n {checkCanCreate(PermissionModuleNames.AccountManagers) ? (\n <>\n \n \n \n \n \n New account manager\n \n \n New account manager (without linked user)\n \n \n \n \n \n \n ) : null}\n {context !== ContextNames.REGIONAL_SALES_MANAGER &&\n checkCanRead(PermissionModuleNames.AccountManagerActivity) ? (\n \n Account manager activity\n \n ) : null}\n
\n );\n};\n\nconst AccountManagerList = ({\n regionalSalesManagerId,\n context\n}: {\n regionalSalesManagerId?: string;\n context?: ContextNames;\n}) => {\n return (\n <>\n ({\n ...qs,\n hasIdentityProviderUserId:\n qs.hasIdentityProviderUserId === \"true\" || undefined,\n includeSuspended: qs.includeSuspended === \"true\" || undefined\n })}\n mapValuesToQuerystring={values => values}\n defaultValues={defaultSearchArgs}\n fixedValues={{ regionalSalesManagerId }}\n filterPanel={AccountManagerListFilterPanel}\n context={context}\n >\n {(formikProps: FormikProps) => (\n \n data.accountManagers\n }\n listItemComponent={({ item, loggedInUser }) => (\n \n )}\n actionButtonsComponent={AccountManagerActionButtons}\n context={context}\n />\n )}\n \n \n );\n};\n\nexport default AccountManagerList;\n","import * as React from \"react\";\nimport { useParams } from \"react-router\";\nimport { useAccountManager } from \"../AccountManagers/AccountManagerQuery\";\nimport { AccountManager } from \"../AccountManagers/types\";\nimport Breadcrumbs from \"../Breadcrumbs\";\n\nconst getBreadcrumbData = (\n accountManager?: AccountManager,\n draftDealerId?: number\n) => {\n let breadcrumbs = [{ to: \"/\", title: \"Home\" }];\n if (accountManager) {\n const accountManagerId = encodeURIComponent(accountManager.id);\n const amDealersPath = `/accountmanagers/${accountManagerId}/dealers`;\n\n breadcrumbs = [\n ...breadcrumbs,\n { to: \"/accountmanagers\", title: \"Account managers\" },\n {\n to: amDealersPath,\n title: accountManager.name\n }\n ];\n\n if (draftDealerId) {\n return [\n ...breadcrumbs,\n { to: `${amDealersPath}/drafts`, title: \"Draft dealers\" },\n {\n to: `${amDealersPath}/drafts/${draftDealerId}`,\n title: \"Create new dealer\",\n active: true\n }\n ];\n }\n return [\n ...breadcrumbs,\n {\n to: `${amDealersPath}/create`,\n title: \"New dealer\",\n active: true\n }\n ];\n }\n breadcrumbs = [...breadcrumbs, { to: \"/dealers\", title: \"Dealers\" }];\n if (draftDealerId) {\n return [\n ...breadcrumbs,\n { to: \"/dealers/drafts\", title: \"Draft dealers\" },\n {\n to: `/dealers/drafts/${draftDealerId}`,\n title: `New dealer`,\n active: true\n }\n ];\n }\n return [\n ...breadcrumbs,\n { to: \"/dealers/create\", title: \"New dealer\", active: true }\n ];\n};\n\nconst CreateDealerBreadcrumbs = () => {\n const params = useParams<{\n accountManagerId?: string;\n draftDealerId?: string;\n }>();\n const draftDealerId = params.draftDealerId\n ? parseInt(params.draftDealerId, 10)\n : undefined;\n\n const accountManagerId = params.accountManagerId\n ? decodeURIComponent(params.accountManagerId)\n : undefined;\n\n const { accountManager, loading } = useAccountManager(accountManagerId);\n\n if (loading) {\n return null;\n }\n\n return (\n \n );\n};\n\nexport default CreateDealerBreadcrumbs;\n","import gql from \"graphql-tag\";\nimport * as React from \"react\";\nimport {\n graphql,\n Mutation,\n MutationFunction,\n MutationResult,\n useMutation\n} from \"react-apollo\";\nimport { CompositeComponent } from \"../../types\";\nimport { DraftDealerFragment } from \"../fragments\";\nimport { DraftDealer } from \"../types\";\n\nexport interface DraftDealerData {\n createOrUpdateDraftDealer: DraftDealer;\n}\n\nexport interface DraftDealerVariables {\n input: DraftDealer;\n}\n\nexport const CREATE_OR_UPDATE_DRAFT_DEALER = gql`\n mutation CreateOrUpdateDraftDealer($input: DraftDealerInput) {\n createOrUpdateDraftDealer(input: $input) {\n ...DraftDealerFragment\n }\n }\n ${DraftDealerFragment}\n`;\n\nconst CreateOrUpdateDraftDealer = ({\n children\n}: {\n children: (\n mutateFn: MutationFunction,\n result: MutationResult\n ) => JSX.Element | null;\n}) => {children};\n\nexport interface CreateOrUpdateDraftDealerProps {\n createOrUpdateDraftDealer: (draftDealer: DraftDealer) => Promise;\n}\n\nexport const withCreateOrUpdateDraftDealer = (\n WrappedComponent: CompositeComponent\n) => {\n return graphql<\n TProps,\n DraftDealerVariables,\n {},\n CreateOrUpdateDraftDealerProps\n >(CREATE_OR_UPDATE_DRAFT_DEALER, {\n props: ({ mutate }) => ({\n createOrUpdateDraftDealer: draftDealer => {\n return mutate\n ? mutate({ variables: { input: draftDealer } })\n : Promise.reject(\"No mutation provided\");\n }\n })\n })(WrappedComponent);\n};\n\nexport const useCreateOrUpdateDraftDealer = () => {\n const [createOrUpdateDraftDealer] = useMutation<\n DraftDealerData,\n DraftDealerVariables\n >(CREATE_OR_UPDATE_DRAFT_DEALER);\n return createOrUpdateDraftDealer;\n};\n\nexport default CreateOrUpdateDraftDealer;\n","import { FormikErrors, FormikTouched } from \"formik\";\nimport { cloneDeep } from \"lodash\";\nimport * as React from \"react\";\nimport { MutationFunction } from \"react-apollo\";\nimport { cleanFormData, getSingleLineAddress } from \"../../../utils\";\nimport {\n hydrateTouchedData,\n resetFieldsWithErrors,\n serializeTouchedData,\n} from \"../../Forms/draftFormUtils\";\nimport { ContextNames } from \"../../types\";\nimport { DealerFormInitialValues } from \"../DealerForm\";\nimport { Dealer, DealerFormSectionName, DraftDealer } from \"../types\";\nimport CreateOrUpdateDraftDealerMutation, {\n DraftDealerData,\n DraftDealerVariables,\n} from \"./CreateOrUpdateDraftDealerMutation\";\nimport { DRAFT_DEALER_LIST } from \"./DraftDealerListQuery\";\nimport DraftDealerQuery from \"./DraftDealerQuery\";\n\ninterface DraftDealerServiceProps {\n draftDealer?: DraftDealer;\n draftDealerInitialValues?: DealerFormInitialValues;\n saveDraft: (formData: DraftDealerFormData) => Promise;\n loading?: boolean;\n}\n\ninterface DraftDealerServiceOuterProps {\n draftDealerId?: number;\n children: (props: DraftDealerServiceProps) => JSX.Element | null;\n context?: ContextNames;\n}\n\nexport interface DraftDealerFormData {\n values: Dealer;\n initialValues: Dealer;\n errors: FormikErrors;\n touched: FormikTouched;\n currentSection?: string;\n}\n\n/** Gets and saves draft proposals */\nclass DraftDealerService extends React.Component {\n public constructor(props: DraftDealerServiceOuterProps) {\n super(props);\n this.saveDraft = this.saveDraft.bind(this);\n }\n\n public render() {\n const { draftDealerId, children } = this.props;\n\n return (\n \n {({ draftDealer, loading }) => {\n let draftDealerInitialValues: DealerFormInitialValues;\n\n if (draftDealer) {\n let dealer: Dealer = JSON.parse(draftDealer.dealerJson);\n dealer = cleanFormData(dealer, {\n removeIdFields: true,\n });\n\n dealer.draftDealerId = draftDealer.id;\n\n draftDealerInitialValues = {\n initialTouched: hydrateTouchedData(draftDealer.touchedFields),\n initialSection:\n draftDealer.currentSection as DealerFormSectionName,\n initialValues: dealer,\n };\n }\n\n return (\n \n {(mutationFunction) =>\n children({\n draftDealer,\n draftDealerInitialValues,\n saveDraft: (formData) =>\n this.saveDraft(mutationFunction, formData, draftDealer),\n loading,\n })\n }\n \n );\n }}\n \n );\n }\n\n /** Saves the state of the proposal form to the server */\n private saveDraft(\n mutate: MutationFunction,\n formData: DraftDealerFormData,\n existing?: DraftDealer\n ) {\n const { context } = this.props;\n const dealer = this.cleanDraftDealer(formData);\n const touched = cloneDeep(formData.touched);\n\n const currentSection = formData.currentSection;\n\n const draftDealer: DraftDealer = {\n id: existing && existing.id,\n dealerJson: JSON.stringify(dealer),\n touchedFields: serializeTouchedData(touched),\n currentSection,\n name: dealer.name,\n address: getSingleLineAddress(dealer.address),\n accountManagerId: dealer.accountManagerId,\n };\n\n const accountManagerId =\n context === ContextNames.ACCOUNT_MANAGER\n ? draftDealer.accountManagerId\n : undefined;\n\n return mutate({\n variables: { input: draftDealer },\n refetchQueries: [\n {\n query: DRAFT_DEALER_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10,\n accountManagerId,\n },\n },\n },\n ],\n }).then(({ data }: any) => {\n const draft = data && data.createOrUpdateDraftDealer;\n\n if (!draft) {\n return;\n }\n\n return draft;\n });\n }\n\n /** Removes client only fields from the draft proposal object before submitting it to the server */\n private cleanDraftDealer(formData: DraftDealerFormData): Dealer {\n const { values, initialValues, errors } = formData;\n const dealer = cleanFormData(values, { removeIdFields: true });\n\n // Clean up properties which are not used on the server\n delete dealer.draftDealerId;\n\n // Remove properties which have validation errors, and reset them\n // to default values\n resetFieldsWithErrors(dealer, errors, initialValues);\n\n return dealer;\n }\n}\n\nexport default DraftDealerService;\n","import { FormikTouched } from \"formik\";\nimport { merge } from \"lodash\";\nimport React from \"react\";\nimport Helmet from \"react-helmet\";\nimport { useHistory, useParams } from \"react-router\";\nimport { Container } from \"reactstrap\";\nimport { cleanFormData, isAccountManager } from \"../../utils\";\nimport { useLoggedInUser } from \"../LoggedInUserQuery\";\nimport { ContextNames } from \"../types\";\nimport CreateDealerBreadcrumbs from \"./CreateDealerBreadcrumbs\";\nimport CreateDealerMutation from \"./CreateDealerMutation\";\nimport DealerForm from \"./DealerForm\";\nimport { DEALER_LIST } from \"./DealerList/DealerListQuery\";\nimport dealerSetupQuestionnaireValidationSchema from \"./dealerSetupQuestionnaireValidationSchema\";\nimport dealerValidationSchema from \"./dealerValidationSchema\";\nimport { DRAFT_DEALER_LIST } from \"./DraftDealers/DraftDealerListQuery\";\nimport DraftDealerService from \"./DraftDealers/DraftDealerService\";\nimport { DealerFragment } from \"./fragments\";\nimport { Dealer, DealerFormSectionName } from \"./types\";\n\ninterface CreateDealerSceneProps {\n requiresQuestionnaire?: boolean;\n}\n\nconst CreateDealerScene = ({\n requiresQuestionnaire = true,\n}: CreateDealerSceneProps) => {\n const { loggedInUser } = useLoggedInUser();\n const history = useHistory();\n const params = useParams<{\n accountManagerId?: string;\n draftDealerId?: string;\n }>();\n\n if (!loggedInUser) {\n return null;\n }\n\n const accountManagerId =\n isAccountManager(loggedInUser) && loggedInUser.accountManager?.id\n ? loggedInUser.accountManager.id\n : params.accountManagerId\n ? decodeURIComponent(params.accountManagerId)\n : undefined;\n\n const context = params.accountManagerId\n ? ContextNames.ACCOUNT_MANAGER\n : undefined;\n\n const draftDealerId = params.draftDealerId\n ? parseInt(params.draftDealerId, 10)\n : undefined;\n\n const dealer = dealerValidationSchema.default() as Dealer;\n return (\n \n \n\n \n\n \n {({\n draftDealer,\n draftDealerInitialValues,\n loading: draftDealerLoading,\n saveDraft,\n }) => {\n if (draftDealerId && draftDealerLoading) {\n return null;\n }\n\n let initialValues: Dealer = merge(\n {},\n dealerValidationSchema.default() as Dealer,\n {\n accountManagerId,\n questionnaire: dealerSetupQuestionnaireValidationSchema.default(),\n }\n );\n let initialSection: DealerFormSectionName | undefined;\n let initialTouched: FormikTouched | undefined;\n\n if (draftDealerInitialValues) {\n initialValues = merge(\n {},\n initialValues,\n draftDealerInitialValues.initialValues\n );\n initialSection = draftDealerInitialValues.initialSection;\n initialTouched = draftDealerInitialValues.initialTouched;\n }\n\n if (\n !requiresQuestionnaire ||\n (draftDealerInitialValues &&\n !draftDealerInitialValues?.initialValues?.questionnaire)\n ) {\n (initialValues as any).questionnaire = undefined;\n initialValues.FORMSTATE_requiresQuestionnaire = false;\n }\n\n return (\n \n {(mutation, { client }) => (\n <>\n {\n return mutation({\n variables: {\n input: cleanFormData(submitted),\n },\n refetchQueries: [\n {\n query: DEALER_LIST,\n variables: { input: { page: 1, pageSize: 10 } },\n },\n {\n query: DRAFT_DEALER_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10,\n accountManagerId:\n context === ContextNames.ACCOUNT_MANAGER\n ? accountManagerId\n : undefined,\n },\n },\n },\n ],\n }).then((result) => {\n if (result && result.data) {\n const created = result.data.createOrUpdateDealer;\n if (created) {\n client?.writeFragment({\n id: (created.id || \"\").toString(),\n fragment: DealerFragment,\n data: created,\n fragmentName: \"DealerFragment\",\n });\n history.push(`/dealers/${created.id}`);\n }\n }\n });\n }}\n />\n \n )}\n \n );\n }}\n \n \n );\n};\n\nexport const CreateDealerNoQuestionnaireScene = () => (\n \n);\n\nexport default CreateDealerScene;\n","import _objectSpread2 from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport ButtonDropdown from './ButtonDropdown';\nimport { omit } from './utils';\nvar omitKeys = ['defaultOpen'];\n\nvar UncontrolledButtonDropdown =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(UncontrolledButtonDropdown, _Component);\n\n function UncontrolledButtonDropdown(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n _this.state = {\n isOpen: props.defaultOpen || false\n };\n _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = UncontrolledButtonDropdown.prototype;\n\n _proto.toggle = function toggle() {\n this.setState({\n isOpen: !this.state.isOpen\n });\n };\n\n _proto.render = function render() {\n return React.createElement(ButtonDropdown, _extends({\n isOpen: this.state.isOpen,\n toggle: this.toggle\n }, omit(this.props, omitKeys)));\n };\n\n return UncontrolledButtonDropdown;\n}(Component);\n\nexport { UncontrolledButtonDropdown as default };\nUncontrolledButtonDropdown.propTypes = _objectSpread2({\n defaultOpen: PropTypes.bool\n}, ButtonDropdown.propTypes);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n className: PropTypes.string,\n cssModule: PropTypes.object,\n size: PropTypes.string,\n bordered: PropTypes.bool,\n borderless: PropTypes.bool,\n striped: PropTypes.bool,\n dark: PropTypes.bool,\n hover: PropTypes.bool,\n responsive: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n tag: tagPropType,\n responsiveTag: tagPropType,\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object])\n};\nvar defaultProps = {\n tag: 'table',\n responsiveTag: 'div'\n};\n\nvar Table = function Table(props) {\n var className = props.className,\n cssModule = props.cssModule,\n size = props.size,\n bordered = props.bordered,\n borderless = props.borderless,\n striped = props.striped,\n dark = props.dark,\n hover = props.hover,\n responsive = props.responsive,\n Tag = props.tag,\n ResponsiveTag = props.responsiveTag,\n innerRef = props.innerRef,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"size\", \"bordered\", \"borderless\", \"striped\", \"dark\", \"hover\", \"responsive\", \"tag\", \"responsiveTag\", \"innerRef\"]);\n\n var classes = mapToCssModules(classNames(className, 'table', size ? 'table-' + size : false, bordered ? 'table-bordered' : false, borderless ? 'table-borderless' : false, striped ? 'table-striped' : false, dark ? 'table-dark' : false, hover ? 'table-hover' : false), cssModule);\n var table = React.createElement(Tag, _extends({}, attributes, {\n ref: innerRef,\n className: classes\n }));\n\n if (responsive) {\n var responsiveClassName = mapToCssModules(responsive === true ? 'table-responsive' : \"table-responsive-\" + responsive, cssModule);\n return React.createElement(ResponsiveTag, {\n className: responsiveClassName\n }, table);\n }\n\n return table;\n};\n\nTable.propTypes = propTypes;\nTable.defaultProps = defaultProps;\nexport default Table;","import * as React from \"react\";\nimport Helmet from \"react-helmet\";\nimport { Container } from \"reactstrap\";\nimport Breadcrumbs from \"../../Breadcrumbs\";\nimport AccountManagerActivityList from \"./AccountManagerActivityList\";\n\nconst AccountManagerActivityListScene = () => {\n const breadcrumbs = [\n {\n to: \"/\",\n title: \"Home\"\n },\n { to: \"/accountmanagers\", title: \"Account managers\" },\n { to: \"/accountmanagers/activity\", title: \"Activity\", active: true }\n ];\n\n return (\n <>\n \n Account managers | Eurodrive\n \n \n \n

Acccount manager activity

\n \n
\n \n );\n};\n\nexport default AccountManagerActivityListScene;\n","import * as React from \"react\";\nimport Helmet from \"react-helmet\";\nimport { Container } from \"reactstrap\";\nimport Breadcrumbs from \"../Breadcrumbs\";\nimport AccountManagerList from \"./AccountManagerList\";\nimport { AccountManagerSearchArgs } from \"./types\";\n\ninterface AccountManagerListProps extends AccountManagerSearchArgs {\n updateSearchArgs: (args: AccountManagerSearchArgs) => void;\n}\n\nclass AccountManagerListScene extends React.Component<\n AccountManagerListProps,\n { inputBuffer?: string }\n> {\n public render() {\n const breadcrumbs = [\n {\n to: \"/\",\n title: \"Home\"\n },\n { to: \"/accountmanagers\", title: \"Account managers\", active: true }\n ];\n\n return (\n <>\n \n Account managers | Eurodrive\n \n \n \n

Account managers

\n \n
\n \n );\n }\n}\n\nexport default AccountManagerListScene;\n","import gql from \"graphql-tag\";\nimport { useQuery } from \"react-apollo\";\nimport { LoggedInUserFragment } from \"../../LoggedInUserQuery\";\nimport { SearchResults, User } from \"../../types\";\nimport {\n AccountManagerActualsFragment,\n AccountManagerActualsFragmentWithoutNetProfit,\n AccountManagerTargetsFragment,\n AccountManagerTargetsFragmentWithoutNetProfit,\n} from \"../fragments\";\nimport {\n AccountManagerTargets,\n AccountManagerTargetsSearchArgs,\n} from \"../types\";\n\nexport interface AccountManagerTargetsListData {\n loggedInUser: User;\n accountManager: {\n id: string;\n targetsList: SearchResults;\n };\n}\n\nexport const ACCOUNT_MANAGER_TARGETS_LIST_WITHOUT_NET_PROFIT = gql`\n query AccountManagerTargetsListQuery(\n $id: String!\n $input: AccountManagerTargetsSearchArgsInput\n ) {\n loggedInUser {\n ...LoggedInUserFragment\n }\n accountManager(id: $id) {\n id\n targetsList(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...AccountManagerTargetsFragment\n actuals {\n ...AccountManagerActualsFragment\n }\n }\n }\n }\n }\n }\n ${AccountManagerTargetsFragmentWithoutNetProfit}\n ${AccountManagerActualsFragmentWithoutNetProfit}\n ${LoggedInUserFragment}\n`;\nexport const ACCOUNT_MANAGER_TARGETS_LIST = gql`\n query AccountManagerTargetsListQuery(\n $id: String!\n $input: AccountManagerTargetsSearchArgsInput\n ) {\n loggedInUser {\n ...LoggedInUserFragment\n }\n accountManager(id: $id) {\n id\n targetsList(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...AccountManagerTargetsFragment\n actuals {\n ...AccountManagerActualsFragment\n }\n }\n }\n }\n }\n }\n ${AccountManagerTargetsFragment}\n ${AccountManagerActualsFragment}\n ${LoggedInUserFragment}\n`;\n\nexport const ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW_WITHOUT_NET_PROFIT = gql`\n query AccountManagerTargetsListQuery(\n $id: String!\n $input: AccountManagerTargetsSearchArgsInput\n ) {\n accountManager(id: $id) {\n id\n targetsList(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...AccountManagerTargetsFragment\n }\n }\n }\n }\n }\n ${AccountManagerTargetsFragment}\n`;\nexport const ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW = gql`\n query AccountManagerTargetsListQuery(\n $id: String!\n $input: AccountManagerTargetsSearchArgsInput\n ) {\n accountManager(id: $id) {\n id\n targetsList(input: $input) {\n pageInfo {\n hasMorePages\n totalResults\n page\n pageSize\n first\n last\n }\n edges {\n node {\n ...AccountManagerTargetsFragment\n }\n }\n }\n }\n }\n ${AccountManagerTargetsFragment}\n`;\n\n/** Gets the account manager targets with the highest date */\nexport const useLastAccountManagerTargets = (\n accountManagerId?: string,\n canViewNetProfit?: boolean\n) => {\n let targetListQuery = ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW_WITHOUT_NET_PROFIT;\n if (canViewNetProfit) {\n targetListQuery = ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW;\n }\n const { data, loading } = useQuery<\n AccountManagerTargetsListData,\n { id?: string; input: AccountManagerTargetsSearchArgs }\n >(targetListQuery, {\n variables: {\n id: accountManagerId,\n input: { page: 1, pageSize: 1, accountManagerId },\n },\n skip: !accountManagerId,\n });\n\n const targets = data?.accountManager?.targetsList?.edges?.map((t) => t.node);\n\n return { loading, target: targets?.length ? targets[0] : undefined };\n};\n","import React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport DealerList from \"../../Dealers/DealerList\";\nimport { ContextNames } from \"../../types\";\n\nconst AccountManagerDealersTabContent = ({\n match\n}: RouteComponentProps<{ accountManagerId: string; tab: string }>) => {\n const id = match.params.accountManagerId\n ? decodeURIComponent(match.params.accountManagerId)\n : undefined;\n\n return (\n \n );\n};\n\nexport default AccountManagerDealersTabContent;\n","import * as React from \"react\";\nimport config from \"../../../config\";\nimport { useRegionalSalesManager } from \"../../RegionalSalesManagers/RegionalSalesManagerQuery\";\nimport SummaryRow, {\n EmailSummaryRow\n} from \"../../shared/SummarySection/SummaryRow\";\nimport { AccountManager } from \"../types\";\n\ninterface AccountManagerFormSummaryProps {\n values: AccountManager;\n}\n\nconst AccountManagerFormSummary = ({\n values: {\n id,\n name,\n email,\n mobile,\n regionalSalesManagerId,\n autoConvertReference,\n suspended\n }\n}: AccountManagerFormSummaryProps) => {\n const { regionalSalesManager } = useRegionalSalesManager(\n regionalSalesManagerId\n );\n\n return (\n <>\n \n \n \n \n \n {regionalSalesManager ? (\n \n ) : null}\n \n );\n};\n\nexport default AccountManagerFormSummary;\n","import React from \"react\";\nimport { canManageAccountManagers } from \"../../../utils\";\nimport EditForm from \"../../Forms/EditForm\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport AccountManagerFormInner from \"../AccountManagerForm/AccountManagerFormInner\";\nimport AccountManagerFormSummary from \"../AccountManagerForm/AccountManagerFormSummary\";\nimport {\n cleanAccountManagerBeforeSubmit,\n useCreateOrUpdateAccountManager\n} from \"../AccountManagerForm/CreateOrUpdateAccountManagerMutation\";\nimport { useAccountManager } from \"../AccountManagerQuery\";\nimport accountManagerValidationSchema from \"../accountManagerValidationSchema\";\n\nconst AccountManagerEditForm = ({\n accountManagerId\n}: {\n accountManagerId?: string;\n}) => {\n const { loggedInUser } = useLoggedInUser();\n const { accountManager } = useAccountManager(accountManagerId);\n const createOrUpdateAccountManager = useCreateOrUpdateAccountManager();\n\n if (!accountManager || !loggedInUser) {\n return null;\n }\n\n const disableEditing = !canManageAccountManagers(loggedInUser);\n\n return (\n \n createOrUpdateAccountManager(\n cleanAccountManagerBeforeSubmit(formValues)\n )\n }\n validationSchema={accountManagerValidationSchema}\n >\n {formikProps => }\n \n );\n};\n\nexport default AccountManagerEditForm;\n","import React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport AccountManagerEditForm from \"../AccountManagerForm/AccountManagerEditForm\";\n\nconst AccountManagerDetailsTabContent = ({\n match\n}: RouteComponentProps<{ accountManagerId: string; tab: string }>) => {\n const id = match.params.accountManagerId\n ? decodeURIComponent(match.params.accountManagerId)\n : undefined;\n\n if (!id) {\n return null;\n }\n\n return ;\n};\n\nexport const UserAccountManagerDetailsTabContent = () => {\n const { loggedInUser } = useLoggedInUser();\n\n if (!loggedInUser) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport default AccountManagerDetailsTabContent;\n","import { faFolder, faFolderOpen } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport classnames from \"classnames\";\nimport { cloneDeep } from \"lodash\";\nimport * as React from \"react\";\n\nexport interface Folder {\n name: string;\n path: string;\n open: boolean;\n folders?: Folder[];\n}\n\ninterface FoldersPanelProps {\n rootFolderName: string;\n getSubFolders: (path?: string) => Promise;\n selectedFolder?: string;\n onSelectedFolderChanged: (path?: string) => void;\n}\n\ninterface FoldersPanelState {\n folderIndex: { [key: string]: Folder };\n}\n\nconst FolderList = ({\n indent,\n folders,\n selectedFolder,\n onSelectedFolderChanged\n}: {\n indent: number;\n folders?: Folder[];\n selectedFolder?: string;\n onSelectedFolderChanged: (path?: string) => void;\n className?: string;\n}) => {\n if (!folders) {\n return null;\n }\n\n return (\n <>\n {folders.map(({ name, path, folders: subFolders, open }) => {\n const selected = path === selectedFolder;\n return (\n \n {\n e.stopPropagation();\n onSelectedFolderChanged(path);\n }}\n >\n \n {name}\n \n {open && subFolders ? (\n \n ) : null}\n \n );\n })}\n \n );\n};\n\nclass FoldersPanel extends React.Component<\n FoldersPanelProps,\n FoldersPanelState\n> {\n public constructor(props: FoldersPanelProps) {\n super(props);\n\n this.getFoldersFromPath = this.getFoldersFromPath.bind(this);\n this.handleSelectFolder = this.handleSelectFolder.bind(this);\n this.addSubFolders = this.addSubFolders.bind(this);\n this.toggleOpenFolder = this.toggleOpenFolder.bind(this);\n\n this.state = {\n folderIndex: this.getFoldersFromPath(this.props.selectedFolder)\n };\n }\n\n public render() {\n const { selectedFolder } = this.props;\n const { folderIndex } = this.state;\n return (\n
\n \n
\n );\n }\n\n public componentDidMount() {\n const { getSubFolders, selectedFolder } = this.props;\n\n // Get subfolder when the component first loads\n getSubFolders(selectedFolder).then(folders =>\n this.addSubFolders(folders, selectedFolder)\n );\n }\n\n /**\n * Gets the lookup index for the chain of folders from the root folder to the current path\n */\n private getFoldersFromPath(path?: string): { [key: string]: Folder } {\n const rootFolder = {\n name: this.props.rootFolderName,\n path: \"\",\n open: true\n };\n const index: { [key: string]: Folder } = { \"\": rootFolder };\n const pathParts = (path || \"\").split(\"\\\\\").filter(x => !!x);\n\n // Add each of the child folders to the root folder\n pathParts.reduce((parent: Folder, name: string) => {\n const folder: Folder = {\n name,\n open: true,\n path: parent.path ? `${parent.path}\\\\${name}` : name\n };\n\n parent.folders = [folder];\n\n // Add the folder to the index\n index[folder.path] = folder;\n\n return folder;\n }, rootFolder);\n return index;\n }\n\n /** Adds subfolders to the parent folder at the specified path */\n private addSubFolders(folders: Folder[], parentPath?: string) {\n if (folders) {\n this.setState(state => {\n const closedFolders = folders.map(f => ({\n ...f,\n path:\n f.path && f.path.startsWith(\"\\\\\") ? f.path.substring(1) : f.path,\n open: false\n }));\n\n const folderIndex = cloneDeep(state.folderIndex);\n const parent = folderIndex[parentPath || \"\"];\n if (parent) {\n parent.folders = closedFolders;\n }\n\n closedFolders.forEach(f => {\n folderIndex[f.path] = f;\n });\n\n return { ...state, folderIndex };\n });\n }\n }\n\n private handleSelectFolder(path?: string) {\n const {\n onSelectedFolderChanged,\n getSubFolders,\n selectedFolder\n } = this.props;\n const { folderIndex } = this.state;\n\n const folder = folderIndex[path || \"\"];\n\n if (folder) {\n if (!folder.open || path === selectedFolder) {\n this.toggleOpenFolder(path);\n }\n\n // Get subfolders if necessary\n if (!folder.folders) {\n getSubFolders(path).then(folders => this.addSubFolders(folders, path));\n }\n }\n onSelectedFolderChanged(path);\n }\n\n /** Toggles the specified folder open or closed */\n private toggleOpenFolder(path?: string) {\n this.setState(state => {\n const folderIndex = cloneDeep(state.folderIndex);\n const folder = folderIndex[path || \"\"];\n\n folder.open = !folder.open;\n\n return { ...state, folderIndex };\n });\n }\n}\n\nexport default FoldersPanel;\n","import gql from \"graphql-tag\";\nimport React, { useState } from \"react\";\nimport { useApolloClient, useQuery } from \"react-apollo\";\nimport { Col, Row } from \"reactstrap\";\nimport config from \"../../../config\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport FilesPanel from \"../../NetworkFolders/FilesPanel\";\nimport FoldersPanel from \"../../NetworkFolders/FoldersPanel\";\nimport { AccountManager } from \"../types\";\n\ninterface AccountManagerNetworkFolderProps {\n accountManagerId: string;\n}\n\nconst ACCOUNT_MANAGER_FOLDERS_QUERY = gql`\n query AccountManagerFoldersQuery($id: String, $path: String) {\n accountManager(id: $id) {\n id\n networkFolder(path: $path) {\n name\n path\n folders {\n name\n path\n }\n }\n }\n }\n`;\n\nconst ACCOUNT_MANAGER_FILES_QUERY = gql`\n query AccountManagerFilesQuery($id: String, $path: String) {\n accountManager(id: $id) {\n id\n networkFolder(path: $path) {\n name\n path\n files {\n name\n path\n extension\n }\n }\n }\n }\n`;\n\nconst AccountManagerNetworkFolder = ({\n accountManagerId\n}: AccountManagerNetworkFolderProps) => {\n const client = useApolloClient();\n const [path, setPath] = useState(\"\");\n const { data, loading: filesLoading } = useQuery<\n { accountManager?: AccountManager },\n { id?: string; path?: string }\n >(ACCOUNT_MANAGER_FILES_QUERY, { variables: { id: accountManagerId, path } });\n\n const files = data?.accountManager?.networkFolder?.files?.map(\n ({ name, path: filePath, extension }: any) => ({\n url: `${\n config.API_URL\n }/api/files/accountmanagers?path=${encodeURIComponent(filePath)}`,\n name,\n extension\n })\n );\n\n return (\n \n \n {\n return client\n .query({\n query: ACCOUNT_MANAGER_FOLDERS_QUERY,\n variables: { id: accountManagerId, path: parentPath }\n })\n .then(\n ({ data: folderData }) =>\n folderData?.accountManager?.networkFolder?.folders\n );\n }}\n selectedFolder={path}\n onSelectedFolderChanged={setPath}\n />\n \n \n {filesLoading || !files ? (\n
\n \n
\n ) : (\n \n )}\n \n
\n );\n};\n\nexport default AccountManagerNetworkFolder;\n","import React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport AccountManagerNetworkFolder from \"../AccountManagerNetworkFolder\";\n\nconst AccountManagerFilesTabContent = ({\n match\n}: RouteComponentProps<{ accountManagerId: string; tab: string }>) => {\n const id = match.params.accountManagerId\n ? decodeURIComponent(match.params.accountManagerId)\n : undefined;\n\n if (!id) {\n return null;\n }\n\n return ;\n};\n\nexport const UserAccountManagerFilesTabContent = () => {\n const { loggedInUser } = useLoggedInUser();\n\n if (!loggedInUser) {\n return ;\n }\n\n if (!loggedInUser.accountManager?.id) {\n return null;\n }\n\n return (\n \n );\n};\n\nexport default AccountManagerFilesTabContent;\n","import React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport ProposalList from \"../../Proposals/ProposalList\";\nimport { ContextNames } from \"../../types\";\n\nconst AccountManagerProposalsTabContent = ({\n match\n}: RouteComponentProps<{ accountManagerId: string }>) => {\n const accountManagerId = match.params.accountManagerId\n ? decodeURIComponent(match.params.accountManagerId)\n : undefined;\n return (\n \n );\n};\n\nexport default AccountManagerProposalsTabContent;\n","import React from \"react\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport FullWidthTabHeaders, {\n TabHeaderProps\n} from \"../../Tabs/FullWidthTabHeaders\";\nimport { UserRoles } from \"../../types\";\n\nconst AccountManagerTabHeaders = () => {\n const {\n loggedInUser,\n isCaseManagementTeam,\n checkCanRead\n } = useLoggedInUser();\n\n if (!loggedInUser) {\n return null;\n }\n\n const showStats = !isCaseManagementTeam;\n\n let tabs: TabHeaderProps[] = [];\n\n showStats && tabs.push({ path: \"\", title: \"Overview\" });\n\n tabs.push({\n path: showStats ? \"details\" : \"\",\n title: \"Details\",\n collapse: showStats\n });\n\n showStats && tabs.push({ path: \"targets\", title: \"Targets\", collapse: true });\n\n if (\n !loggedInUser.roles.includes(UserRoles.dealer) &&\n !loggedInUser.roles.includes(UserRoles.account_manager)\n ) {\n tabs = [\n ...tabs,\n {\n path: \"dealers\",\n title: \"Dealers\",\n collapse: true\n },\n { path: \"proposals\", title: \"Proposals\", collapse: true }\n ];\n }\n\n if (checkCanRead(PermissionModuleNames.AccountManagerActivity)) {\n tabs.push({ path: \"activity\", title: \"Activity\", collapse: true });\n }\n\n if (showStats) {\n tabs = [...tabs, { path: \"files\", title: \"Files\", collapse: true }];\n }\n\n return ;\n};\n\nexport default AccountManagerTabHeaders;\n","import moment from \"moment\";\nimport * as Yup from \"yup\";\nimport { AccountManagerTargets } from \"../types\";\n\nconst accountManagerTargetsValidationSchema = Yup.object<\n AccountManagerTargets\n>().shape({\n id: Yup.string()\n .nullable(true)\n .default(undefined),\n startDate: Yup.date()\n .label(\"Month\")\n .nullable(true)\n .default(\n moment()\n .startOf(\"month\")\n .toISOString(true)\n )\n .required(\"Month is required\"),\n accountManagerId: Yup.string()\n .label(\"Account manager\")\n .required(\"Account manager is required\")\n .default(undefined),\n proposalsAccepted: Yup.number()\n .label(\"Proposals accepted\")\n .nullable(true)\n .default(undefined)\n .min(0),\n proposalsCreated: Yup.number()\n .label(\"Proposals created\")\n .nullable(true)\n .default(undefined)\n .required(\"Field is required\")\n .min(0),\n proposalsPaidout: Yup.number()\n .label(\"Proposals paid out\")\n .nullable(true)\n .default(undefined)\n .required(\"Field is required\")\n .min(0),\n netProfit: Yup.number()\n .nullable(true)\n .label(\"Net profit\")\n .default(undefined)\n .required(\"Field is required\")\n .min(0),\n turnover: Yup.number()\n .label(\"Turnover\")\n .nullable(true)\n .default(undefined)\n .required(\"Field is required\")\n .min(0),\n endDate: Yup.date()\n .nullable(true)\n .default(undefined),\n dealerCreated: Yup.number()\n .label(\"Dealers (props created)\")\n .nullable(true)\n .default(undefined)\n .required(\"Field is required\")\n .min(0),\n dealerPaidout: Yup.number()\n .label(\"Dealers (props paid out)\")\n .nullable(true)\n .default(undefined)\n .required(\"Field is required\")\n .min(0),\n dealerSetups: Yup.number()\n .label(\"Dealer set up\")\n .nullable(true)\n .default(undefined)\n .required(\"Field is required\")\n .min(0)\n});\n\nexport default accountManagerTargetsValidationSchema;\n","import gql from \"graphql-tag\";\nimport { useMutation } from \"react-apollo\";\nimport { AccountManagerTargetsFragment } from \"../fragments\";\nimport { AccountManagerTargets } from \"../types\";\n\ninterface AccountManagerTargetsData {\n createOrUpdateAccountManagerTargets: AccountManagerTargets;\n}\n\ninterface AccountManagerTargetsVariables {\n input: AccountManagerTargets;\n}\n\nexport const CREATE_OR_UPDATE_ACCOUNT_MANAGER_TARGETS = gql`\n mutation CreateOrUpdateAccountManagerTargets(\n $input: AccountManagerTargetsInput\n ) {\n createOrUpdateAccountManagerTargets(input: $input) {\n ...AccountManagerTargetsFragment\n }\n }\n ${AccountManagerTargetsFragment}\n`;\n\nexport const useCreateOrUpdateAccountManagerTargets = () => {\n const [createOrUpdateAccountManagerTargets] = useMutation<\n AccountManagerTargetsData,\n AccountManagerTargetsVariables\n >(CREATE_OR_UPDATE_ACCOUNT_MANAGER_TARGETS);\n\n return createOrUpdateAccountManagerTargets;\n};\n","import { Field, FieldProps, Formik } from \"formik\";\nimport { defaults, pick } from \"lodash\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport {\n Button,\n Form,\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n Row,\n} from \"reactstrap\";\nimport { cleanFormData } from \"../../../utils\";\nimport CustomDatePicker from \"../../CustomDatePicker\";\nimport FormGroupWrapper from \"../../Forms/FormGroupWrapper\";\nimport FormInputField from \"../../Forms/FormInputField\";\nimport {\n ACCOUNT_MANAGER_TARGETS_LIST,\n ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW,\n ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW_WITHOUT_NET_PROFIT,\n ACCOUNT_MANAGER_TARGETS_LIST_WITHOUT_NET_PROFIT,\n useLastAccountManagerTargets,\n} from \"../AccountManagerTargetsList/AccountManagerTargetsListQuery\";\nimport { useAccountManagerSingleTarget } from \"../AccountManagerTargetsSummary/AccountManagerTargetsQuery\";\nimport { AccountManagerTargets } from \"../types\";\nimport accountManagerTargetsValidationSchema from \"./accountManagerTargetsValidationSchema\";\nimport { useCreateOrUpdateAccountManagerTargets } from \"./CreateOrUpdateAccountManagerTargetsMutation\";\n\ninterface CreateOrUpdateAccountManagerTargetsModalProps {\n display: boolean;\n accountManagerId?: string;\n accountManagerTargetsId?: string;\n toggle: () => void;\n canViewNetProfit?: boolean;\n}\n\nconst CreateOrUpdateAccountManagerTargetsModal: React.SFC =\n ({\n display,\n accountManagerId,\n accountManagerTargetsId,\n toggle,\n canViewNetProfit,\n }: CreateOrUpdateAccountManagerTargetsModalProps) => {\n const { target, loading } = useAccountManagerSingleTarget(\n accountManagerTargetsId\n );\n const { target: mostRecentTarget, loading: loadingMostRecent } =\n useLastAccountManagerTargets(accountManagerId);\n\n const mutation = useCreateOrUpdateAccountManagerTargets();\n\n if (loading) {\n return null;\n }\n let accountManagerTargetsList =\n ACCOUNT_MANAGER_TARGETS_LIST_WITHOUT_NET_PROFIT;\n let accountManagerTargetsListShallow =\n ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW_WITHOUT_NET_PROFIT;\n\n if (canViewNetProfit) {\n accountManagerTargetsList = ACCOUNT_MANAGER_TARGETS_LIST;\n accountManagerTargetsListShallow = ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW;\n }\n\n return (\n \n {!loadingMostRecent ? (\n {\n toggle();\n const values = cleanFormData(rawValues);\n\n // Remove the account manager data from the payload\n delete values.accountManager;\n delete values.actuals;\n\n return mutation({\n variables: { input: { ...values } },\n refetchQueries: [\n {\n query: accountManagerTargetsList,\n variables: {\n id: accountManagerId,\n input: {\n page: 1,\n pageSize: 10,\n accountManagerId,\n },\n },\n },\n {\n query: accountManagerTargetsList,\n variables: {\n id: accountManagerId,\n input: {\n page: 2,\n pageSize: 10,\n accountManagerId,\n },\n },\n },\n {\n query: accountManagerTargetsListShallow,\n variables: {\n id: accountManagerId,\n input: {\n page: 1,\n pageSize: 1,\n accountManagerId,\n },\n },\n },\n ],\n });\n }}\n validationSchema={accountManagerTargetsValidationSchema}\n validateOnChange={true}\n >\n {(formikProps) => (\n {\n formikProps.handleSubmit(e);\n }}\n >\n \n {accountManagerTargetsId ? \"Edit targets\" : \"Add new targets\"}\n \n \n {mostRecentTarget && !accountManagerTargetsId ? (\n

\n Default values from{\" \"}\n {moment(mostRecentTarget.startDate).format(\"MMMM YYYY\")}{\" \"}\n targets\n

\n ) : null}\n \n {(fieldProps: FieldProps) => (\n \n {\n formikProps.setFieldValue(\n \"startDate\",\n moment(date).toISOString(true)\n );\n }}\n disabled={!!formikProps.values.id}\n />\n \n )}\n \n \n \n\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n )}\n \n ) : null}\n \n );\n };\n\nexport default CreateOrUpdateAccountManagerTargetsModal;\n","import { faTrash } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport gql from \"graphql-tag\";\nimport moment from \"moment\";\nimport * as React from \"react\";\nimport { Mutation } from \"react-apollo\";\nimport { DropdownItem } from \"reactstrap\";\nimport { ConfirmDialog } from \"../../Forms/ConfirmDialogProvider\";\nimport { ACCOUNT_MANAGER_TARGETS_LIST } from \"../AccountManagerTargetsList/AccountManagerTargetsListQuery\";\nimport { AccountManagerTargets } from \"../types\";\n\ninterface DeleteAccountManagerTargetsDropdownItemProps {\n accountManagerTargets: AccountManagerTargets;\n}\n\nconst DeleteAccountManagerTargetsDropdownItem = ({\n accountManagerTargets: { id, accountManager, startDate }\n}: DeleteAccountManagerTargetsDropdownItemProps) => {\n if (!id) {\n return null;\n }\n\n return (\n \n {confirm => (\n \n {(mutation: any) => (\n {\n e.preventDefault();\n e.stopPropagation();\n\n const accountManagerId = accountManager && accountManager.id;\n\n confirm(() =>\n mutation({\n variables: { id },\n refetchQueries: [\n {\n query: ACCOUNT_MANAGER_TARGETS_LIST,\n variables: {\n id: accountManagerId,\n input: {\n page: 1,\n pageSize: 10,\n accountManagerId\n }\n }\n },\n {\n query: ACCOUNT_MANAGER_TARGETS_LIST,\n variables: {\n id: accountManagerId,\n input: {\n page: 2,\n pageSize: 10,\n accountManagerId\n }\n }\n }\n ]\n })\n );\n }}\n >\n Delete\n \n )}\n \n )}\n \n );\n};\n\nexport default DeleteAccountManagerTargetsDropdownItem;\n","import { faEdit, faFileExcel } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport querystring from \"query-string\";\nimport * as React from \"react\";\nimport { DropdownItem } from \"reactstrap\";\nimport config from \"../../../config\";\nimport FileDownloadLink from \"../../FileDownloadLink\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport ActionsDropdown from \"../../PagedList/ActionsDropdown\";\nimport {\n PermissionActivityNames,\n PermissionModuleNames\n} from \"../../Permissions/types\";\nimport DeleteAccountManagerTargetsDropdownItem from \"../AccountManagerTargets/DeleteAccountManagerTargetsDropdownItem\";\nimport { AccountManagerTargets } from \"../types\";\n\nconst getQuerystringForReport = (targets: AccountManagerTargets) => {\n return querystring.stringify({\n accountManagerId: targets.accountManager && targets.accountManager.id,\n startDate: targets.startDate,\n endDate: targets.endDate\n });\n};\n\nconst AccountManagerTargetsListActionButtons = ({\n editAction,\n accountManagerTargets: targets,\n className\n}: {\n editAction: () => void;\n accountManagerTargets: AccountManagerTargets;\n className?: string;\n}) => {\n const {\n loading,\n checkCanUpdate,\n checkCanDelete,\n checkIsAuthorized\n } = useLoggedInUser();\n\n if (loading) {\n return null;\n }\n\n const canUpdate = checkCanUpdate(PermissionModuleNames.AccountManagerTargets);\n const canReadReport = checkIsAuthorized(\n PermissionModuleNames.AccountManagerTargets,\n PermissionActivityNames.ReadReport\n );\n const canDelete = checkCanDelete(PermissionModuleNames.AccountManagerTargets);\n\n return (\n \n {canUpdate ? (\n {\n e.preventDefault();\n e.stopPropagation();\n editAction();\n }}\n >\n Edit\n \n ) : null}\n {canReadReport ? (\n \n \n Download report\n \n ) : null}\n {canDelete ? (\n <>\n \n \n \n ) : null}\n \n );\n};\n\nexport default AccountManagerTargetsListActionButtons;\n","import moment from \"moment\";\nimport * as React from \"react\";\nimport {\n formatCurrency,\n formatToPercentage,\n canViewNetProfit,\n} from \"../../../utils\";\nimport { TargetStatsBoxProps } from \"../../Proposals/ProposalDealerOverview/TargetStatsBox\";\nimport { User } from \"../../types\";\nimport { AccountManagerTargets } from \"../types\";\nimport AccountManagerTargetsListActionButtons from \"./AccountManagerTargetsListActionButtons\";\n\ninterface AccountManagerTargetsProps {\n onClick: (accountManagerTargets: AccountManagerTargets) => void;\n loggedInUser?: User;\n accountManagerTargets: AccountManagerTargets;\n}\n\nconst defaultFormatter = (value?: number) => (value ? value.toString() : \"-\");\n\nconst TargetValues = ({ actual, target, ...props }: TargetStatsBoxProps) => {\n const percentage =\n (actual || actual === 0) && target\n ? formatToPercentage((actual / target) * 100)\n : \"\";\n const { formatter = defaultFormatter } = props;\n return (\n <>\n

{formatter(target)}

\n

\n {actual ? (\n <>\n {formatter(actual)} [{percentage}]\n \n ) : (\n \"-\"\n )}\n

\n \n );\n};\n\nconst TargetValuesRow = ({\n label,\n actual,\n target,\n ...props\n}: TargetStatsBoxProps) => {\n const percentage =\n (actual || actual === 0) && target\n ? formatToPercentage((actual / target) * 100)\n : \"\";\n const { formatter = defaultFormatter } = props;\n return (\n \n {label}\n {formatter(target)}\n \n {actual ? (\n <>\n {formatter(actual)} [{percentage}]\n \n ) : (\n \"-\"\n )}\n \n \n );\n};\n\n/** Get props to calculate average finance per paid out loan */\nconst getAverageBalanceProps = (\n targets: AccountManagerTargets\n): TargetStatsBoxProps => ({\n label: \"Avg balance\",\n target: targets.proposalsPaidout\n ? targets.turnover / targets.proposalsPaidout\n : undefined,\n actual:\n targets.actuals && targets.actuals.totalPaidOutCount\n ? (targets.actuals.totalFinance || 0) / targets.actuals.totalPaidOutCount\n : 0,\n formatter: formatCurrency,\n});\n\nconst AccountManagerListItem = React.memo(\n ({\n loggedInUser,\n onClick,\n accountManagerTargets: targets,\n }: AccountManagerTargetsProps) => {\n const showNetProfit = !!loggedInUser && canViewNetProfit(loggedInUser);\n return (\n onClick(targets)}>\n \n

\n {moment(targets.startDate).format(\"MMMM YYYY\")}\n

\n \n \n \n \n \n \n \n \n {showNetProfit && (\n \n )}\n \n \n \n \n \n \n
\n TargetActual
\n onClick(targets)}\n />\n \n \n \n \n \n \n \n {showNetProfit && (\n \n \n \n )}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n onClick(targets)}\n />\n \n \n );\n }\n);\n\nexport default AccountManagerListItem;\n","import { ApolloClient } from \"apollo-boost\";\nimport { FormikProps } from \"formik\";\nimport memoizeOne from \"memoize-one\";\nimport React from \"react\";\nimport { withApollo, WithApolloClient } from \"react-apollo\";\nimport { Button } from \"reactstrap\";\nimport { canManageTargets, canViewNetProfit } from \"../../../utils\";\nimport SearchForm from \"../../Forms/SearchForm\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport PagedList from \"../../PagedList\";\nimport CreateOrUpdateAccountManagerTargetsModal from \"../AccountManagerTargets/CreateOrUpdateAccountManagerTargetsModal\";\nimport { AccountManagerTargetsSearchArgs } from \"../types\";\nimport AccountManagerTargetsListItem from \"./AccountManagerTargetsListItem\";\nimport {\n ACCOUNT_MANAGER_TARGETS_LIST,\n ACCOUNT_MANAGER_TARGETS_LIST_WITHOUT_NET_PROFIT,\n ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW,\n ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW_WITHOUT_NET_PROFIT,\n AccountManagerTargetsListData,\n} from \"./AccountManagerTargetsListQuery\";\nimport \"./index.scss\";\n\nconst defaultSearchArgs = {\n page: 1,\n pageSize: 10,\n};\n\nconst TableWrapper = (props: any) => {\n const { children, loggedInUser } = props;\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {!!loggedInUser && canViewNetProfit(loggedInUser) && (\n \n )}\n \n \n \n \n \n \n \n {children}\n
\n Month\n Proposals createdProposals paid outNet profitTurnoverAvg balanceDealers activeDealers paid outDealer setups\n
\n );\n};\n\nconst LoadingPlaceholder = () => (\n \n \n \n \n \n);\n\nconst NoItemsPlaceholder = () => (\n \n No results found\n \n);\n\ninterface AccountManagerTargetsListProps {\n accountManagerId?: string;\n regionalSalesManagerId?: string;\n canViewNetProfit?: boolean;\n}\n\nconst preloadMostRecentTargets = memoizeOne(\n (accountManagerId: string, client: ApolloClient, query: any) => {\n client.query({\n query: query,\n variables: {\n id: accountManagerId,\n input: {\n page: 1,\n pageSize: 1,\n accountManagerId,\n },\n },\n });\n }\n);\n\nclass AccountManagerTargetsList extends React.Component<\n WithApolloClient,\n { showEditModal: boolean; selectedTargetId?: string }\n> {\n public constructor(props: WithApolloClient) {\n super(props);\n this.toggleEditModal = this.toggleEditModal.bind(this);\n this.state = { showEditModal: false };\n }\n\n public render() {\n const {\n accountManagerId,\n regionalSalesManagerId,\n client,\n canViewNetProfit,\n } = this.props;\n const { showEditModal, selectedTargetId } = this.state;\n\n let pagedListTargetsQuery = ACCOUNT_MANAGER_TARGETS_LIST_WITHOUT_NET_PROFIT;\n let mostRecentTargetsQuery =\n ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW_WITHOUT_NET_PROFIT;\n if (canViewNetProfit) {\n pagedListTargetsQuery = ACCOUNT_MANAGER_TARGETS_LIST;\n mostRecentTargetsQuery = ACCOUNT_MANAGER_TARGETS_LIST_SHALLOW;\n }\n accountManagerId &&\n preloadMostRecentTargets(\n accountManagerId,\n client,\n mostRecentTargetsQuery\n );\n\n return (\n <>\n ({\n ...qs,\n })}\n searchInput={null}\n mapValuesToQuerystring={(values) => values}\n defaultValues={defaultSearchArgs}\n fixedValues={{ accountManagerId, regionalSalesManagerId }}\n >\n {(formikProps: FormikProps) => (\n \n data.accountManager && data.accountManager.targetsList\n }\n listItemsContainer={TableWrapper}\n loadingPlaceholder={LoadingPlaceholder}\n noItemsPlaceholder={NoItemsPlaceholder}\n listItemComponent={({ item, loggedInUser }) => (\n {\n const canEdit =\n loggedInUser && canManageTargets(loggedInUser);\n\n if (canEdit) {\n this.setState({\n showEditModal: true,\n selectedTargetId: targets.id,\n });\n }\n }}\n />\n )}\n actionButtonsComponent={({ loggedInUser }) =>\n loggedInUser && canManageTargets(loggedInUser) ? (\n \n New targets\n \n ) : null\n }\n />\n )}\n \n \n \n );\n }\n\n private toggleEditModal() {\n this.setState((s) => ({\n showEditModal: !s.showEditModal,\n selectedTargetId: s.showEditModal ? s.selectedTargetId : undefined,\n }));\n }\n}\n\nexport default withApollo(\n AccountManagerTargetsList\n);\n","import React from \"react\";\nimport { RouteComponentProps } from \"react-router\";\nimport LoadingSpinner from \"../../LoadingSpinner\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport AccountManagerTargetsList from \"../AccountManagerTargetsList\";\n\nconst AccountManagerTargetsListTabContent = ({\n match,\n}: RouteComponentProps<{ accountManagerId: string; tab: string }>) => {\n const id = match.params.accountManagerId\n ? decodeURIComponent(match.params.accountManagerId)\n : undefined;\n\n const {\n isSuperUser,\n isRegionalSalesManager,\n isAccountManager,\n checkCanRead,\n } = useLoggedInUser();\n\n const canViewNetProfit =\n (isSuperUser || isRegionalSalesManager) &&\n checkCanRead(PermissionModuleNames.RegionalSalesManagers) &&\n !isAccountManager;\n\n return (\n \n );\n};\n\nexport const UserAccountManagerTargetsListTabContent = () => {\n const {\n isSuperUser,\n isRegionalSalesManager,\n isAccountManager,\n checkCanRead,\n loggedInUser,\n } = useLoggedInUser();\n\n const canViewNetProfit =\n (isSuperUser || isRegionalSalesManager) &&\n checkCanRead(PermissionModuleNames.RegionalSalesManagers) &&\n !isAccountManager;\n\n if (!loggedInUser) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport default AccountManagerTargetsListTabContent;\n","import { faHome, faMapMarked } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport classNames from \"classnames\";\nimport React, { useEffect } from \"react\";\nimport { useApolloClient } from \"react-apollo\";\nimport Helmet from \"react-helmet\";\nimport { Route, RouteComponentProps, Switch, useHistory } from \"react-router\";\nimport { Link as RouterLink } from \"react-router-dom\";\nimport { Alert, Button, Container } from \"reactstrap\";\nimport { canManageUsers } from \"../../../utils\";\nimport Breadcrumbs from \"../../Breadcrumbs\";\nimport { useCreateHouseDealer } from \"../../Dealers/CreateHouseDealer/CreateHouseDealerMutation\";\nimport { useLoggedInUser } from \"../../LoggedInUserQuery\";\nimport PageNotFound from \"../../PageNotFound\";\nimport { PermissionModuleNames } from \"../../Permissions/types\";\nimport { PROPOSAL_LIST } from \"../../Proposals/ProposalList/ProposalListQuery\";\nimport { GET_REGIONAL_SALES_MANAGER } from \"../../RegionalSalesManagers/RegionalSalesManagerQuery\";\nimport SceneLoadingSpinner from \"../../SceneLoadingSpinner\";\nimport { GET_USER } from \"../../Settings/Users/UserQuery\";\nimport TabContentContainer from \"../../Tabs/TabContentContainer\";\nimport { UserRoles } from \"../../types\";\nimport { ACCOUNT_MANAGER_ACTIVITIES_LIST } from \"../AccountManagerActivities/AccountManagerActivityList\";\nimport AccountManagerActivityTabContent, {\n UserAccountManagerActivityTabContent\n} from \"../AccountManagerActivities/AccountManagerActivityTabContent\";\nimport AccountManagerBadges from \"../AccountManagerBadges\";\nimport {\n useAccountManager,\n useLoggedInAccountManager\n} from \"../AccountManagerQuery\";\nimport { ACCOUNT_MANAGER_TARGETS_LIST } from \"../AccountManagerTargetsList/AccountManagerTargetsListQuery\";\nimport { AccountManager } from \"../types\";\nimport AccountManagerDealersTabContent from \"./AccountManagerDealersTabContent\";\nimport AccountManagerDetailsTabContent, {\n UserAccountManagerDetailsTabContent\n} from \"./AccountManagerDetailsTabContent\";\nimport AccountManagerFilesTabContent, {\n UserAccountManagerFilesTabContent\n} from \"./AccountManagerFilesTabContent\";\nimport AccountManagerProposalsTabContent from \"./AccountManagerProposalsTabContent\";\nimport AccountManagerTabHeaders from \"./AccountManagerTabHeaders\";\nimport AccountManagerTargetsListTabContent, {\n UserAccountManagerTargetsListTabContent\n} from \"./AccountManagerTargetsListTabContent\";\nimport AccountManagerTargetsTabContent, {\n UserAccountManagerTargetsTabContent\n} from \"./AccountManagerTargetsTabContent\";\n\ninterface AccountManagerSceneProps {\n accountManagerId: string;\n}\n\nconst CreateHouseDealerButton = ({\n accountManager\n}: {\n accountManager: AccountManager;\n}) => {\n const createHouseDealer = useCreateHouseDealer();\n const history = useHistory();\n\n return (\n \n createHouseDealer({ accountManagerId: accountManager.id }).then(\n result => {\n if (result?.data?.createHouseDealer) {\n history.push(`/dealers/${result.data.createHouseDealer.id}`);\n }\n }\n )\n }\n >\n Create a house dealer\n \n );\n};\n\nconst AccountManagerSceneInner = ({\n accountManager,\n url\n}: {\n accountManager?: AccountManager;\n url: string;\n}) => {\n const {\n loggedInUser,\n loading,\n isAccountManager,\n isRegionalSalesManager,\n isCaseManagementTeam,\n isSuperUser,\n checkCanRead\n } = useLoggedInUser();\n\n usePreloadedData(accountManager);\n\n if (loading || !loggedInUser || !accountManager) {\n return null;\n }\n\n const name =\n accountManager.name === \".\" ? accountManager.id : accountManager.name;\n\n const breadcrumbs = isAccountManager\n ? [\n { to: \"/\", title: \"Home\" },\n {\n to: \"/accountmanager\",\n title: name,\n active: true\n }\n ]\n : [\n { to: \"/\", title: \"Home\" },\n { to: \"/accountmanagers\", title: \"Account managers\" },\n {\n to: `/accountmanagers/${encodeURIComponent(accountManager.id)}`,\n title: name,\n active: true\n }\n ];\n\n return (\n <>\n \n \n \n

\n Account manager - {name}\n

\n
\n {!isAccountManager &&\n !isRegionalSalesManager &&\n checkCanRead(PermissionModuleNames.RegionalSalesManagers) && (\n

\n Regional manager:{\" \"}\n {accountManager.regionalSalesManager ? (\n \n {accountManager.regionalSalesManager.name}\n \n ) : (\n \"[not specified]\"\n )}\n

\n )}\n {canManageUsers(loggedInUser) && accountManager && (\n

\n User:{\" \"}\n {accountManager.user ? (\n \n {accountManager.user.username}\n \n ) : (\n \"[not linked to a user]\"\n )}\n

\n )}\n
\n \n
\n \n Map view\n \n \n House dealer\n \n
\n {!accountManager?.houseDealer?.id ? (\n \n {name} does not have a house dealer.\n {isSuperUser && (\n \n )}\n \n ) : null}\n
\n \n \n \n \n \n \n \n \n \n \n {isCaseManagementTeam ? (\n \n ) : (\n \n )}\n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nconst usePreloadedData = (accountManager?: AccountManager) => {\n const client = useApolloClient();\n const { loggedInUser, loading, checkCanRead } = useLoggedInUser();\n\n useEffect(() => {\n if (loading || !accountManager || !loggedInUser) {\n return;\n }\n\n const { user, regionalSalesManager, id } = accountManager;\n\n // Get the first page of proposals\n client.query({\n query: PROPOSAL_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10,\n status: [],\n q: \"\",\n accountManagerId: id\n }\n }\n });\n\n if (checkCanRead(PermissionModuleNames.AccountManagerActivity)) {\n client.query({\n query: ACCOUNT_MANAGER_ACTIVITIES_LIST,\n variables: {\n input: {\n page: 1,\n pageSize: 10,\n accountManagerId: id\n }\n }\n });\n }\n\n if (user) {\n client.query({\n query: GET_USER,\n variables: { id: user.id }\n });\n }\n\n if (regionalSalesManager) {\n client.query({\n query: GET_REGIONAL_SALES_MANAGER,\n variables: { id: regionalSalesManager.id }\n });\n }\n\n if (!loggedInUser.roles.includes(UserRoles.case_management_team)) {\n // Get the first page of targets and actuals\n client.query({\n query: ACCOUNT_MANAGER_TARGETS_LIST,\n variables: {\n id,\n input: { page: 1, pageSize: 10, accountManagerId: id }\n }\n });\n }\n });\n};\n\nconst AccountManagerScene = ({\n match\n}: RouteComponentProps) => {\n const accountManagerId =\n match.params.accountManagerId &&\n decodeURIComponent(match.params.accountManagerId);\n\n const { accountManager, loading } = useAccountManager(accountManagerId);\n\n if (loading) {\n return ;\n }\n\n if (!accountManager) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport const UserAccountManagerScene = ({ match }: RouteComponentProps) => {\n const { accountManager, loading } = useLoggedInAccountManager();\n\n if (loading || !accountManager) {\n return ;\n }\n\n if (!accountManager) {\n return ;\n }\n\n return (\n \n );\n};\n\nexport default AccountManagerScene;\n","import { UserAccountManagerScene } from \"./index\";\n\nexport default UserAccountManagerScene;\n","import * as React from \"react\";\nimport { Route, Switch } from \"react-router-dom\";\nimport CreateDealerScene from \"../Dealers/CreateDealerScene\";\nimport DraftDealerListScene from \"../Dealers/DraftDealers/DraftDealerListScene\";\nimport SceneLoadingSpinner from \"../SceneLoadingSpinner\";\nimport AccountManagerActivityListScene from \"./AccountManagerActivities/AccountManagerActivityListScene\";\nimport AccountManagerListScene from \"./AccountManagerListScene\";\nimport AccountManagerScene from \"./AccountManagerScene\";\nimport UserAccountManagerScene from \"./AccountManagerScene/UserAccountManagerScene\";\n\nconst DealerMapScene = React.lazy(() => import(\"../Dealers/DealerMapScene\"));\n\nconst AccountManagerRouter = () => {\n return (\n }>\n \n \n \n \n \n \n \n\n \n \n \n \n );\n};\n\nexport default AccountManagerRouter;\n","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { getHandlerArgs, isSupported, visibility } from './utils';\n\nvar PageVisibility = function (_React$Component) {\n _inherits(PageVisibility, _React$Component);\n\n function PageVisibility(props) {\n _classCallCheck(this, PageVisibility);\n\n var _this = _possibleConstructorReturn(this, (PageVisibility.__proto__ || Object.getPrototypeOf(PageVisibility)).call(this, props));\n\n _this.state = {\n isSupported: isSupported && visibility\n };\n return _this;\n }\n\n _createClass(PageVisibility, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n if (!this.state.isSupported) {\n return;\n }\n\n this.handleVisibilityChange = this.handleVisibilityChange.bind(this);\n document.addEventListener(visibility.event, this.handleVisibilityChange);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (!this.state.isSupported) {\n return;\n }\n document.removeEventListener(visibility.event, this.handleVisibilityChange);\n }\n }, {\n key: 'handleVisibilityChange',\n value: function handleVisibilityChange() {\n if (typeof this.props.onChange === 'function') {\n var _props;\n\n // propagate change to callback\n (_props = this.props).onChange.apply(_props, _toConsumableArray(getHandlerArgs()));\n }\n if (typeof this.props.children === 'function') {\n // we pass the props directly to the function as children\n this.forceUpdate();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n if (!this.props.children) {\n return null;\n }\n // function as children pattern support\n if (typeof this.props.children === 'function') {\n var _props2;\n\n if (!this.state.isSupported) {\n // don't pass any arguments if PageVisibility is not supported\n return this.props.children();\n }\n return (_props2 = this.props).children.apply(_props2, _toConsumableArray(getHandlerArgs()));\n }\n\n return React.Children.only(this.props.children);\n }\n }]);\n\n return PageVisibility;\n}(React.Component);\n\nPageVisibility.displayName = 'PageVisibility';\n\nPageVisibility.propTypes = {\n onChange: PropTypes.func,\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func])\n};\n\nexport default PageVisibility;","import PageVisibility from './PageVisibility';\nexport { default as usePageVisibility } from './usePageVisibility';\n\nexport default PageVisibility;"],"sourceRoot":""}