//
//  ModelMapping.swift
//  MVMCoreUI
//
//  Created by Scott Pfeil on 3/31/21.
//  Copyright © 2021 Verizon Wireless. All rights reserved.
//

import MVMCore

open class CoreUIModelMapping: ModelMapping {
    open override class func registerObjects() {
        super.registerObjects()
        registerMolecules()
        registerRules()
        registerActions()
        registerBehaviors()
        registerLabelAttributes()
    }
    
    open class func registerMolecules() {
        // MARK:- Stacks
        ModelRegistry.register(handler: MoleculeStackView.self, for: StackModel.self)
        ModelRegistry.register(handler: UnOrderedList.self, for: UnOrderedListModel.self)
        ModelRegistry.register(handler: NumberedList.self, for: NumberedListModel.self)
        
        // MARK:- Label
        ModelRegistry.register(handler: Label.self, for: LabelModel.self)
        
        // MARK:- TextView
        ModelRegistry.register(handler: TextViewEntryField.self, for: TextViewEntryFieldModel.self)
        
        // MARK:- Buttons
        ModelRegistry.register(handler: PillButton.self, for: ButtonModel.self)
        ModelRegistry.register(handler: TwoButtonView.self, for: TwoButtonViewModel.self)
        ModelRegistry.register(handler: ExternalLink.self, for: ExternalLinkModel.self)
        ModelRegistry.register(handler: Link.self, for: LinkModel.self)
        ModelRegistry.register(handler: CaretLink.self, for: CaretLinkModel.self)
        
        // MARK:- Entry Field
        ModelRegistry.register(handler: TextEntryField.self, for: TextEntryFieldModel.self)
        ModelRegistry.register(handler: MdnEntryField.self, for: MdnEntryFieldModel.self)
        ModelRegistry.register(handler: DigitEntryField.self, for: DigitEntryFieldModel.self)
        ModelRegistry.register(handler: ItemDropdownEntryField.self, for: ItemDropdownEntryFieldModel.self)
        ModelRegistry.register(handler: DateDropdownEntryField.self, for: DateDropdownEntryFieldModel.self)
        ModelRegistry.register(handler: MultiItemDropdownEntryField.self, for: MultiItemDropdownEntryFieldModel.self)
        
        // MARK:- Selectors
        ModelRegistry.register(handler: RadioButton.self, for: RadioButtonModel.self)
        ModelRegistry.register(handler: RadioBoxes.self, for: RadioBoxesModel.self)
        ModelRegistry.register(handler: Checkbox.self, for: CheckboxModel.self)
        ModelRegistry.register(handler: RadioSwatches.self, for: RadioSwatchesModel.self)
        ModelRegistry.register(handler: Tags.self, for: TagsModel.self)
        ModelRegistry.register(handler: Tag.self, for: TagModel.self)
        ModelRegistry.register(handler: Heart.self, for: HeartModel.self)
        ModelRegistry.register(handler: Stars.self, for: StarsModel.self)
        ModelRegistry.register(handler: Star.self, for: StarModel.self)
        
        // MARK:- Other Atoms
        ModelRegistry.register(handler: ProgressBar.self, for: ProgressBarModel.self)
        ModelRegistry.register(handler: MultiProgress.self, for: MultiProgressBarModel.self)
        ModelRegistry.register(handler: CaretView.self, for: CaretViewModel.self)
        ModelRegistry.register(handler: DashLine.self, for: DashLineModel.self)
        ModelRegistry.register(handler: LoadImageView.self, for: ImageViewModel.self)
        ModelRegistry.register(handler: Line.self, for: LineModel.self)
        ModelRegistry.register(handler: Wheel.self, for: WheelModel.self)
        ModelRegistry.register(handler: Toggle.self, for: ToggleModel.self)
        ModelRegistry.register(handler: CheckboxLabel.self, for: CheckboxLabelModel.self)
        ModelRegistry.register(handler: Arrow.self, for: ArrowModel.self)
        ModelRegistry.register(handler: RadioButtonLabel.self, for: RadioButtonLabelModel.self)
        ModelRegistry.register(handler: WebView.self, for: WebViewModel.self)
        ModelRegistry.register(handler: LoadingSpinner.self, for: LoadingSpinnerModel.self)
        ModelRegistry.register(handler: Video.self, for: VideoModel.self)
        
        // MARK:- Horizontal Combination Molecules
        ModelRegistry.register(handler: StringAndMoleculeView.self, for: StringAndMoleculeModel.self)
        ModelRegistry.register(handler: ImageHeadlineBody.self, for: ImageHeadlineBodyModel.self)
        ModelRegistry.register(handler: Tabs.self, for: TabsModel.self)
        ModelRegistry.register(handler: TwoLinkView.self, for: TwoLinkViewModel.self)
        
        // MARK:- Vertical Combination Molecules
        ModelRegistry.register(handler: HeadlineBody.self, for: HeadlineBodyModel.self)
        ModelRegistry.register(handler: HeadLineBodyCaretLinkImage.self, for: HeadlineBodyCaretLinkImageModel.self)
        ModelRegistry.register(handler: EyebrowHeadlineBodyLink.self, for: EyebrowHeadlineBodyLinkModel.self)
        ModelRegistry.register(handler: HeadlineBodyLink.self, for: HeadlineBodyLinkModel.self)
        ModelRegistry.register(handler: HeadlineBodyButton.self, for: HeadlineBodyButtonModel.self)
        ModelRegistry.register(handler: BGImageHeadlineBodyButton.self, for: BGImageHeadlineBodyButtonModel.self)
        ModelRegistry.register(handler: ThreeHeadlineBodyLink.self, for: ThreeHeadlineBodyLinkModel.self)
        ModelRegistry.register(handler: ImageButton.self, for: ImageButtonModel.self)
        
        // MARK:- Left Right Molecules
        ModelRegistry.register(handler: CornerLabels.self, for: CornerLabelsModel.self)
        ModelRegistry.register(handler: LeftRightLabelView.self, for: LeftRightLabelModel.self)
        ModelRegistry.register(handler: LabelToggle.self, for: LabelToggleModel.self)
        ModelRegistry.register(handler: HeadlineBodyToggle.self, for: HeadlineBodyToggleModel.self)
        ModelRegistry.register(handler: HeadlineBodyLinkToggle.self, for: HeadlineBodyLinkToggleModel.self)
        ModelRegistry.register(handler: ActionDetailWithImage.self, for: ActionDetailWithImageModel.self)
        
        // MARK:- List items
        ModelRegistry.register(handler: MoleculeTableViewCell.self, for: MoleculeListItemModel.self)
        ModelRegistry.register(handler: DropDownFilterTableViewCell.self, for: DropDownListItemModel.self)
        ModelRegistry.register(handler: AccordionMoleculeTableViewCell.self, for: AccordionListItemModel.self)
        ModelRegistry.register(handler: TabsTableViewCell.self, for: TabsListItemModel.self)
        ModelRegistry.register(handler: ListProgressBarData.self, for: ListProgressBarDataModel.self)
        
        // MARK:- Other Items
        ModelRegistry.register(handler: MoleculeStackItem.self, for: MoleculeStackItemModel.self)
        ModelRegistry.register(handler: StackItem.self, for: StackItemModel.self)
        ModelRegistry.register(handler: MoleculeCollectionViewCell.self, for: MoleculeCollectionItemModel.self)
        ModelRegistry.register(handler: CarouselItem.self, for: CarouselItemModel.self)
        
        // MARK:- Other Container Molecules
        ModelRegistry.register(handler: MoleculeContainer.self, for: MoleculeContainerModel.self)
        ModelRegistry.register(handler: MoleculeHeaderView.self, for: MoleculeHeaderModel.self)
        ModelRegistry.register(handler: FooterView.self, for: FooterModel.self)
        ModelRegistry.register(handler: Scroller.self, for: ScrollerModel.self)
        ModelRegistry.register(handler: ModuleMolecule.self, for: ModuleMoleculeModel.self)
        ModelRegistry.register(handler: BGImageMolecule.self, for: BGImageMoleculeModel.self)
        ModelRegistry.register(handler: BGVideoImageMolecule.self, for: BGVideoImageMoleculeModel.self)
        ModelRegistry.register(handler: MoleculeSectionHeader.self, for: MoleculeSectionHeaderModel.self)
        ModelRegistry.register(handler: MoleculeSectionFooter.self, for: MoleculeSectionFooterModel.self)
        
        // MARK:- Other Molecules
        ModelRegistry.register(handler: DoughnutChartView.self, for: DoughnutChartModel.self)
        
        // Navigation Molecules
        ModelRegistry.register(NavigationItemModel.self)
        ModelRegistry.register(NavigationImageButtonModel.self)
        ModelRegistry.register(NavigationLabelButtonModel.self)

        // MARK:- Other Organisms
        ModelRegistry.register(handler: Carousel.self, for: CarouselModel.self)
        ModelRegistry.register(handler: BarsIndicatorView.self, for: BarsCarouselIndicatorModel.self)
        ModelRegistry.register(handler: NumericIndicatorView.self, for: NumericCarouselIndicatorModel.self)
        
        // MARK:- Designed List Items
        ModelRegistry.register(handler: ListLeftVariableIconWithRightCaret.self, for: ListLeftVariableIconWithRightCaretModel.self)
        ModelRegistry.register(handler: ListLeftVariableIconWithRightCaretBodyText.self, for: ListLeftVariableIconWithRightCaretBodyTextModel.self)
        ModelRegistry.register(handler: ListLeftVariableIconWithRightCaretAllTextLinks.self, for: ListLeftVariableIconWithRightCaretAllTextLinksModel.self)
        ModelRegistry.register(handler: ListLeftVariableCheckboxAllTextAndLinks.self, for: ListLeftVariableCheckboxAllTextAndLinksModel.self)
        ModelRegistry.register(handler: ListLeftVariableRadioButtonAndPaymentMethod.self, for: ListLeftVariableRadioButtonAndPaymentMethodModel.self)
        ModelRegistry.register(handler: ListLeftVariableRadioButtonBodyText.self, for: ListLeftVariableRadioButtonBodyTextModel.self)
        ModelRegistry.register(handler: ListLeftVariableRadioButtonAllTextAndLinks.self, for: ListLeftVariableRadioButtonAllTextAndLinksModel.self)
        ModelRegistry.register(handler: ListLeftVariableCheckboxBodyText.self, for: ListLeftVariableCheckboxBodyTextModel.self)
        ModelRegistry.register(handler: ListLeftVariableIconAllTextLinks.self, for: ListLeftVariableIconAllTextLinksModel.self)
        ModelRegistry.register(handler: ListLeftVariableNumberedListAllTextAndLinks.self, for: ListLeftVariableNumberedListAllTextAndLinksModel.self)
        ModelRegistry.register(handler: ListLeftVariableNumberedListBodyText.self, for: ListLeftVariableNumberedListBodyTextModel.self)
        ModelRegistry.register(handler: ListRVWheel.self, for: ListRVWheelModel.self)
        ModelRegistry.register(handler: ListRightVariablePayments.self, for: ListRightVariablePaymentsModel.self)
        ModelRegistry.register(handler: ListRightVariableTotalData.self, for: ListRightVariableTotalDataModel.self)
        ModelRegistry.register(handler: ListRightVariableTextLinkAllTextAndLinks.self, for: ListRightVariableTextLinkAllTextAndLinksModel.self)
        ModelRegistry.register(handler: ListRightVariableButtonAllTextAndLinks.self, for: ListRightVariableButtonAllTextAndLinksModel.self)
        ModelRegistry.register(handler: ListRightVariablePriceChangeBodyText.self, for: ListRightVariablePriceChangeBodyTextModel.self)
        ModelRegistry.register(handler: ListRightVariablePriceChangeAllTextAndLinks.self, for: ListRightVariablePriceChangeAllTextAndLinksModel.self)
        ModelRegistry.register(handler: ListRightVariableToggleAllTextAndLinks.self, for: ListRightVariableToggleAllTextAndLinksModel.self)
        ModelRegistry.register(handler: ListRightVariableRightCaretAllTextAndLinks.self, for: ListRightVariableRightCaretAllTextAndLinksModel.self)
        ModelRegistry.register(handler: ListOneColumnFullWidthTextAllTextAndLinks.self, for: ListOneColumnFullWidthTextAllTextAndLinksModel.self)
        ModelRegistry.register(handler: ListOneColumnFullWidthTextBodyText.self, for: ListOneColumnFullWidthTextBodyTextModel.self)
        ModelRegistry.register(handler: ListTwoColumnCompareChanges.self, for: ListTwoColumnCompareChangesModel.self)
        ModelRegistry.register(handler: ListTwoColumnPriceDetails.self, for: ListTwoColumnPriceDetailsModel.self)
        ModelRegistry.register(handler: ListTwoColumnPriceDescription.self, for: ListTwoColumnPriceDescriptionModel.self)
        ModelRegistry.register(handler: ListTwoColumnDropdownSelectors.self, for: ListTwoColumnDropdownSelectorsModel.self)
        ModelRegistry.register(handler: ListThreeColumnInternationalData.self, for: ListThreeColumnInternationalDataModel.self)
        ModelRegistry.register(handler: ListThreeColumnDataUsage.self, for: ListThreeColumnDataUsageModel.self)
        ModelRegistry.register(handler: ListThreeColumnBillChanges.self, for: ListThreeColumnBillChangesModel.self)
        ModelRegistry.register(handler: ListThreeColumnBillHistory.self, for: ListThreeColumnBillHistoryModel.self)
        ModelRegistry.register(handler: ListThreeColumnSpeedTest.self, for: ListThreeColumnSpeedTestModel.self)
        ModelRegistry.register(handler: ListFourColumnDataUsageListItem.self, for: ListFourColumnDataUsageListItemModel.self)
        ModelRegistry.register(handler: ListProgressBarThin.self, for: ListProgressBarThinModel.self)
        ModelRegistry.register(handler: ListStoreLocator.self, for: ListStoreLocatorModel.self)
        ModelRegistry.register(handler: ListStarRating.self, for: ListStarRatingModel.self)
        
        // MARK:- Designed Section Dividers
        ModelRegistry.register(handler: ListFourColumnDataUsageDivider.self, for: ListFourColumnDataUsageDividerModel.self)
        ModelRegistry.register(handler: ListThreeColumnPlanDataDivider.self, for: ListThreeColumnPlanDataDividerModel.self)
        ModelRegistry.register(handler: ListOneColumnTextWithWhitespaceDividerShort.self, for: ListOneColumnTextWithWhitespaceDividerShortModel.self)
        ModelRegistry.register(handler: ListOneColumnTextWithWhitespaceDividerTall.self, for: ListOneColumnTextWithWhitespaceDividerTallModel.self)
        ModelRegistry.register(handler: ListOneColumnFullWidthTextDividerSubsection.self, for: ListOneColumnFullWidthTextDividerSubsectionModel.self)
        ModelRegistry.register(handler: ListTwoColumnSubsectionDivider.self, for: ListTwoColumnSubsectionDividerModel.self)
        ModelRegistry.register(handler: ListThreeColumnInternationalDataDivider.self, for: ListThreeColumnInternationalDataDividerModel.self)
        ModelRegistry.register(handler: ListThreeColumnSpeedTestDivider.self, for: ListThreeColumnSpeedTestDividerModel.self)
        ModelRegistry.register(handler: ListThreeColumnBillChangesDivider.self, for: ListThreeColumnBillChangesDividerModel.self)
        ModelRegistry.register(handler: ListThreeColumnDataUsageDivider.self, for: ListThreeColumnDataUsageDividerModel.self)
        ModelRegistry.register(handler: ListThreeColumnBillHistoryDivider.self, for: ListThreeColumnBillHistoryDividerModel.self)
        
        // MARK:- Designed Headers
        ModelRegistry.register(handler: HeadersH1Button.self, for: HeadersH1ButtonModel.self)
        ModelRegistry.register(handler: HeadersH1LandingPageHeader.self, for: HeadersH1LandingPageHeaderModel.self)
        ModelRegistry.register(handler: HeadersH1NoButtonsBodyText.self, for: HeadersH1NoButtonsBodyTextModel.self)
        ModelRegistry.register(handler: HeadersH2NoButtonsBodyText.self, for: HeadersH2NoButtonsBodyTextModel.self)
        ModelRegistry.register(handler: HeadersH2TinyButton.self, for: HeadersH2TinyButtonModel.self)
        ModelRegistry.register(handler: HeadersH2Buttons.self, for: HeadersH2ButtonsModel.self)
        ModelRegistry.register(handler: HeadersH2PricingTwoRows.self, for: HeadersH2PricingTwoRowsModel.self)
        ModelRegistry.register(handler: HeadersH2Link.self, for: HeadersH2LinkModel.self)
        ModelRegistry.register(handler: HeadersH2CaretLink.self, for: HeadersH2CaretLinkModel.self)
        
        // MARK:- Device Items
        ModelRegistry.register(handler: ListDeviceComplexButtonMedium.self, for: ListDeviceComplexButtonMediumModel.self)
        ModelRegistry.register(handler: ListDeviceComplexButtonSmall.self, for: ListDeviceComplexButtonSmallModel.self)
        
        ModelRegistry.register(handler: ListDeviceComplexLinkSmall.self, for: ListDeviceComplexLinkSmallModel.self)
        ModelRegistry.register(handler: ListDeviceComplexLinkMedium.self, for: ListDeviceComplexLinkMediumModel.self)
        
        // MARK:- LockUps
        ModelRegistry.register(handler: LockUpsPlanNames.self, for: LockUpsPlanNamesModel.self)
        ModelRegistry.register(handler: LockupsPlanSMLXL.self, for: LockupsPlanSMLXLModel.self)
        
        // MARK: - Top Notifications
        ModelRegistry.register(handler: NotificationView.self, for: NotificationModel.self)
        ModelRegistry.register(handler: CollapsableNotification.self, for: CollapsableNotificationModel.self)
    }
    
    open class func registerLabelAttributes() {
        ModelRegistry.register(LabelAttributeFontModel.self)
        ModelRegistry.register(LabelAttributeColorModel.self)
        ModelRegistry.register(LabelAttributeImageModel.self)
        ModelRegistry.register(LabelAttributeUnderlineModel.self)
        ModelRegistry.register(LabelAttributeStrikeThroughModel.self)
        ModelRegistry.register(LabelAttributeActionModel.self)
    }
    
    open class func registerBehaviors() {
        ModelRegistry.register(handler: ScreenBrightnessModifierBehavior.self, for: ScreenBrightnessModifierBehaviorModel.self)
        ModelRegistry.register(handler: PageGetContactBehavior.self, for: PageGetContactBehaviorModel.self)
        ModelRegistry.register(handler: AddRemoveMoleculesBehavior.self, for: AddRemoveMoleculesBehaviorModel.self)
    }

    open override class func registerActions() {
        super.registerActions()
        ModelRegistry.register(ActionPopupModel.self)
        ModelRegistry.register(ActionAlertModel.self)
        ModelRegistry.register(ActionTopAlertModel.self)
        ModelRegistry.register(ActionCollapseNotificationModel.self)
        ModelRegistry.register(ActionOpenPanelModel.self)
        ModelRegistry.register(ActionTopNotificationModel.self)
    }
    
    open class func registerRules() {
        ModelRegistry.register(RuleRequiredModel.self)
        ModelRegistry.register(RuleAnyRequiredModel.self)
        ModelRegistry.register(RuleAnyValueChangedModel.self)
        ModelRegistry.register(RuleAllValueChangedModel.self)
        ModelRegistry.register(RuleEqualsModel.self)
        ModelRegistry.register(RuleEqualsIgnoreCaseModel.self)
        ModelRegistry.register(RuleRegexModel.self)
        ModelRegistry.register(EnableFormFieldEffectModel.self)
        ModelRegistry.register(DynamicRuleFormFieldEffectModel.self)
        ModelRegistry.register(DisableFormFieldEffectModel.self)
        ModelRegistry.register(HideFormFieldEffectModel.self)
        ModelRegistry.register(ClearFormFieldEffectModel.self)
    }
}
