import DivaWebPlanner, { ArticleOptionValueView, AccessoireItemType, PlannerPaletteViewDataType, SummaryItem, PlannerElementData, DockingPoint, ArticleInfoType, CatalogPlannerArticleViewDataType, ShelfAccessoriesView, Grid, StaticRoomDataType, ViewPointDataType, SummaryPaletteItemType, DoorPlannerView, PriceFormat, ItemPaletteType, NotificationRule, WarningRule, PlannedArticleViewDataType, AdditionalGroupFilter, ContentItemTeaser } from '@crystaldesign/web-planner-logic';
import PlannerItems from './Steps/PlannerStep/PlannerItems';
import { BBoxType } from '@crystaldesign/diva-core';
import ConfiguratorStructureHandler from '../TabGroup/ConfiguratorStructureHandler';
import { AddElementParams, DeleteElementParams, ItemPalette, ItemPaletteFilterType, ItemPaletteGroup } from '../types';
import Planner2Dot0Palette from './Steps/Planner2Dot0Step/PlannerItems';
import SettingsState from '../States/UIState/Settings';
import UIState from '../States/UIState';
import ProductState from '../States/UIState/Product';
import { CheckoutConfig, ParamPlanPlannerElementInfo } from '@crystaldesign/web-planner-logic';
export default class PaletteViewHandler {
    private settingsState;
    private productState;
    private uiState;
    private configuratorStructureHandler;
    plannerItems: PlannerItems;
    planner2Dot0Items: Planner2Dot0Palette;
    private shelfItem;
    private specialItem;
    private accItems;
    private configSteps;
    private summaryItems;
    private staticRoomItems;
    private visitStepsHandler;
    private paletteWasLoadedFrom?;
    private notTotallyMatichingOPVs?;
    private filtersToCalc;
    private getState;
    private updateConfiguratorState;
    private updatePlannerMsgContainer;
    private getSelectedElementsArr;
    private getSelectedDockingPoint;
    private updateElementSelectionPlanner;
    private getElementById;
    private onCalculating;
    private actGroupedConfigSteps;
    private onClickConfiguratorSettingsForth;
    private getPlanningIsInCompleteOrEmpty;
    private divaWebPlanner;
    private scrollToTimeout;
    constructor(settingsState: SettingsState, productState: ProductState, uiState: UIState, configuratorStructureHandler: ConfiguratorStructureHandler, getState: any, updateConfiguratorState: any, getSelectedElementsArr: (forceSingleElement?: boolean) => PlannerElementData[], getSelectedDockingPoint: any, updateElementSelectionPlanner: any, getElementById: any, divaWebPlanner: DivaWebPlanner, onClickConfiguratorSettingsForth: () => void, getPlanningIsInCompleteOrEmpty: () => boolean);
    clickedOnPlannerPalette(item: CatalogPlannerArticleViewDataType, paletteId: number): Promise<void>;
    addPlannerElementExternal: (params: AddElementParams) => Promise<void>;
    deletePlannerElementExternal: (params: DeleteElementParams) => Promise<void>;
    addPlannerElement(item: CatalogPlannerArticleViewDataType, initparams?: {
        dockingPointInfos?: {
            targetElemIdToDock?: number;
            targetDockingPointId?: string | undefined;
        }[];
        svgJsonFormula?: string | undefined;
        partlistCodexToInit?: string;
    }, dontUpdateReplaceMode?: boolean): Promise<void>;
    checkPlanningReplaceModeAfterChange(updatePaletteData: boolean): void;
    /**
     * This function is called all when a Planner Element gets Deleted in th PlannerMode
     */
    deletePlannerElement(setId: string, elementId: number): Promise<void>;
    clickOnPlannerElementSwitch(item: CatalogPlannerArticleViewDataType): Promise<void>;
    setPlannerReplaceMode(val: boolean, updateCurPaletteData?: boolean): void;
    /**
     * This function is called when a element should be copied.
     * @param  setId the setId the element to copy belongs too
     * @param  elementId  The elementId that should be copied
     * @param   copyInfo  This objects hold information that is needed for copying. For example when copying an element in the box planner, the information in which direction it should be copied is important.
     */
    movePlannerElement: (setId: string, elementId: number, absoluteCopyIndex: {
        x: number;
        y: number;
    }) => Promise<void>;
    /**
     * This function is called when a element should be copied.
     * @param  setId the setId the element to copy belongs too
     * @param  elementId  The elementId that should be copied
     * @param   copyInfo  This objects hold information that is needed for copying. For example when copying an element in the box planner, the information in which direction it should be copied is important.
     */
    copyPlannerElement: (setId: string, elementId: number, copyInfo: ParamPlanPlannerElementInfo) => Promise<void>;
    clickedOnAccessoirePaletteWrapper(clickedAcc: AccessoireItemType, type: 'minus' | 'plus', forceWithOutSVG?: boolean): Promise<string | undefined>;
    clickedOnAccessoirePalette(clickedAcc: AccessoireItemType, type: 'minus' | 'plus', forceWithOutSVG?: boolean): Promise<string>;
    selectShelfAccessorie(articleCodex?: string, basketId?: string): Promise<void>;
    clickedOnShelfAccessorie(grids: Grid[], itemCodex?: string, basketId?: string, triggerUpdate?: boolean): Promise<void>;
    updateFreePlacesOnGrids(shelfId?: string, from?: string): Promise<void>;
    clickedOnConfigPalette(item: ArticleOptionValueView, from?: 'inputbox' | 'notification', paletteId?: number): Promise<void>;
    private updateBanner;
    manageNotifications(notifications: (NotificationRule | WarningRule)[], callback: () => void): void;
    private handleMultiselectCodex;
    onFreeTextLangChanged(lang: string, text: string, item: ArticleOptionValueView, paletteId: number): Promise<void>;
    private doDefineOptions;
    changeOnCheckoutConfig(myValues: {
        [optCodex: string]: string;
    }, targetArticles?: string[]): Promise<void>;
    onRangeClickChange(palette: ItemPalette, item: ArticleOptionValueView, value?: string, onSlide?: boolean): Promise<void>;
    clickedOnFavIcon(item: ArticleOptionValueView): Promise<void>;
    clickedOnSummaryPalette(item: SummaryItem): Promise<void>;
    clickedOnStaticRoomPalette(item: StaticRoomDataType, dontUpdateView?: boolean): Promise<void>;
    clickedOnStaticVPPalette(item: ViewPointDataType, dontUpdateView?: boolean): Promise<void>;
    clickAddAccessorieOnShelfPlanner(grid: Grid, cellIndex: number): Promise<void>;
    addAccessorieOnShelfPlannerView(gridIndex: number, cellIndex: number, parentBasketId: string): Promise<void>;
    deleteAccessorieOnShelfPlannerView(gridIndex: number, cellIndex: number, parentBasketId: string): Promise<void>;
    shelfItemMoved(grid: Grid, initialIndex: number, finalIndex: number): Promise<void>;
    clickDeleteAccessorieOnShelfPlanner(grid: Grid, cellIndex: number): Promise<void>;
    updatePlannerPaletteAfterElementSelectionChanged(plannerElements: PlannerElementData[], dp?: DockingPoint): void;
    updatePlanner2Dot0PaletteAfterElementSelectionChanged(plannerElements: PlannerElementData[], dp?: DockingPoint): void;
    private getSelectedElementForReplacement;
    private getSelectedElementBasketIdForReplacement;
    /**********************************Update Palette without calling Logic (Filter the Palette)*****************************/
    /**
     * this function is called when the search text was changed
     * @param e event for DOM
     */
    onSearchTextChanged(searchValue: string, paletteId: number): void;
    onTitleFavClick(paletteId: number): void;
    /**
     * this function is called when a Filter on the Palette was changed
     * @param e event for DOM
     */
    onSelectFilter(paletteId: number, codex: string, filterType: ItemPaletteFilterType): void;
    /**
     * takes the Filter of the specific Palette and filters its DataSource
     * @param paletteId palette Identifyer
     */
    private calcFilterItemPalette;
    /********************************* Update Palette -> Calling to Logic ***************************************************/
    /**
     * this functions calls the spesific loadPalette Function depending on the actState
     */
    updateCurPaletteData(wasNaviagtion: boolean, configStepKey?: string): Promise<void>;
    private updateContentItemAfterNavigation;
    /**
     * this Function loads plannerPaletteItems from logik
     */
    private loadPlannerItems;
    private loadPlanner2Dot0Items;
    private loadProducts;
    private loadPromoted;
    private loadStyleConsultantItems;
    /**
     * this Function loads AccessoiresItems from logik
     */
    private loadAccessoiresOfActArticles;
    /**
     * The function: gets all the ConfigSteps to Group then loads each of them from Logik
     * sets the TabGroup name
     * gets the Palette Infos (Element Legend in ConfigHeader)
     * if the TabGroup gets changed all the configsteps that are closed get reopened
     * if the TabGroup was already visited and no Configstep appears new all ConfigItems get set visited true.
     *
     * @param curConfigStepKey identyfier of ConfigStep
     */
    private loadConfigItemsOfTabGroup;
    /**
     * this Function loads SummaryItems from logik
     */
    private loadSummaryItems;
    /**
     * this Function loads StaticRoomListItems from logik
     */
    private loadStaticRoomListItems;
    private loadShelfPlannerItems;
    private loadDoorPlannerItems;
    /**
     * this function gets the Palette Infos From Logik
     * this includes which articles are active at the moment
     * which articles are selectable at the moment
     * and all the specific infos of each of these articles like (image, singlePrice, name, quantity, posNr)
     * @param curConfigStepKey identyfier of ConfigStep
     */
    private getUpdatePaletteinfos;
    /**
     * Updates all the Palette Infos once. This Funktion Is called just once when something changed.
     * It doesnt matter how many ConifgSteps there are Displayed
     * @param articleInfos  articleInfos contains SinglePrice nam Image etc.
     * @param doShowConfigSingle doShowConfigSingle is the ConfigSingle Checkbox visible
     * @param isConfigSingle is the ConfigSingle Checkbox value
     */
    updatePaletteInfos(articleInfos: {
        [posNr: number]: ArticleInfoType;
    }, doShowConfigSingle: boolean, isConfigSingle: boolean, bbox: BBoxType): void;
    articleInfoSelected(posNr: number): void;
    /**
     * this Function is called when the checkbox conifgsingle is clicked
     * Now we got to:
     * Update the Configstructure
     * Update the actConfigStep -> because it changes from BE_*BasketId* to BE_ALL or
     * Update the act Palette Items
     */
    configSingleIsChanged(): Promise<void>;
    /*********************************Palette Updates -> Are Comming From Logic*********************************** */
    /**
     * Updates the Article-List(on PLannerStep) with articles that are comming for logic
     * @param plannerItems articles
     */
    updateCatalogPlannerArticles(plannerItems: PlannerPaletteViewDataType, paletteId: number, isUpdate: boolean, type: ItemPaletteType, dockFilter: string, actStepName: string, stepKey: string): void;
    updateCatalogPlanner2Dot0Articles(catalogPlannerArticles: PlannedArticleViewDataType[], isUpdate?: boolean, onlySelectionChanged?: boolean, dp?: DockingPoint): void;
    elementOverviewSelectionChanged(selected: boolean, incompleteElement?: PlannedArticleViewDataType, selectedElement?: PlannedArticleViewDataType, mode?: 'add' | 'replace' | 'add_accessoire', scrollToSelected?: boolean, dp?: DockingPoint): void;
    private getPlanner2Dot0PaletteName;
    /**
     * Updates the Accessoire-List(on AccessoireStep)  with accessoires from the actArticle
     * @param accessoires accessorie Items
     */
    updateAccessoiresPalette(accessoires: AccessoireItemType[], accType?: 'ACC' | 'ACC_CONFIG'): void;
    private updateConfigStepsOfAccessoires;
    setSelectedShelfAccessoire(basketId?: string): void;
    updateConfigStepOfProduct(): void;
    /**
     * Updates all on one specific ConfigPalette (can be more than one!)
     * @param configItems selectable / Visible ConfigItems
     * @param actStepName Title of the ConfigPalette
     * @param paletteType Palette Template e.g: GAL for Gallery
     * @param filterType Filter Type e.g: RAL for Colorfilter
     * @param paletteId iD of the ConfigPalette
     */
    updateConfigItems(configStepKey: string, configItems: ArticleOptionValueView[], actStepName: string, paletteType: ItemPaletteType, filterType: string, paletteId: number, isUpdate: boolean, visible: boolean, stepInfo: string | undefined, isRenderedInAccessorieStep: boolean, isRenderedNotInSettingPalette: boolean, optionCodex: string, notTotallyMatichingOPVs?: boolean, selectedItems?: ArticleOptionValueView[], isMultiselect?: boolean, groupsDefaultClosed?: boolean, contentItemId?: string, conceptFilter?: AdditionalGroupFilter[], contentItemTeaser?: ContentItemTeaser, description?: string): void;
    /**
     * Updates the summary Items
     * @param summaryItems Items in the Summary
     */
    updateSummaryItems(ret: SummaryPaletteItemType[], articlePriceFormat?: PriceFormat, stepInfo?: string, checkoutConfig?: CheckoutConfig): void;
    updateStaticRoomListItems(roomListItems: StaticRoomDataType[], dontUpdateView?: boolean): void;
    updateShelfPlannerItems(paletteId: number, accessoires: ShelfAccessoriesView[], grids: Grid[], configStepKey: string, from: string): void;
    updateDoorPlannerItems(doorPlannerItems: DoorPlannerView[], configStepKey: string): void;
    /**
     * This Function renders spesific Items in one of the many possibe ItemPalettes. Its also handles the Title, Filters and a part of the Visit logic(first visible Steps get Visited here)
     * @param paletteType   decides which Template is Used for the Items
     * @param filterType    decides which and if a Filter is renderd in View
     * @param actStepName   title of step
     * @param paletteId     indication of ItemPalette
     * @param isUpdate      was the Palette loaded already bevore and it is just an Update (for example new selected element) -> filters dont need to be renderd again. if not it means Items and Filter wasnt here before
     * @param selectedItem  is the selected Item. Is used for example at textures to show the selected item next to the title
     */
    updateItemPalette(paletteType: ItemPaletteType, filterType: string, actStepName: string, paletteId: number, isUpdate: boolean, configStepKey: string, visible: boolean, stepInfo?: string | undefined, price?: string, quantity?: number, isRenderedInAccessorieStep?: boolean, isRenderedNotInSettingPalette?: boolean, optionCodex?: string, selectedElements?: ArticleOptionValueView[], isMultiselect?: boolean, groupsDefaultClosed?: boolean, contentItemId?: string, conceptFilter?: AdditionalGroupFilter[], contentItemTeaser?: ContentItemTeaser, description?: string): void;
    private setStepInfo;
    /**
     * this function defineds which groups are folded on initializiation
     * keep only one group open due to performance issues. But only when there are more than 150 items in total
     * @param paletteId
     * @returns
     */
    isGroupFolded(paletteId?: number, length?: number, groupsObj?: ItemPaletteGroup[]): boolean;
    /**
     *this function binds a listender for the FreeText Input event
     */
    bindListenerForTextBox: (paletteName: string, actStepName: string, item: ArticleOptionValueView) => Promise<void>;
    /**
     * this function checks if all Steps are rendered
     */
    private checkIfAllItemsAreRendered;
    private rerenderPaletteWithConfigSingeIfOPVsDontMatch;
    private resetConfigSingeIfOPVsMatchAgain;
    /**
     * the PaletteName can be "1","2" ... or "Header"
     * @param paletteId
     */
    private getPaletteNameOfPaletteId;
    getHidePaletteHeader(paletteId: number, visible: boolean, itemPalette: ItemPalette): boolean;
    /**
     * this functions get the spesific paletteItems depending on the actState and paletteId
     *
     * @param paletteId palette identifyer
     */
    private getCurItems;
    getRoomList(): StaticRoomDataType[] | ViewPointDataType[];
    getRoomViewList(): StaticRoomDataType[] | ViewPointDataType[];
    /**
     * this function scrolls to the Top of the ItemPalette
     */
    scrollToTopInItemPalette(smooth?: boolean): void;
    /**
     * this function gets the index of the Step by ConfigStepByPosNr waits till everything is rendered then calls scrollToConfigStep
     * @param posNr ConfigStepByPosNr of the step to which we have to scroll
     * @param withDelay if true waits 400 ms and then calls scrollToConfigStep
     */
    scrollToConfigStepByPosNr(posNr: number, withDelay: boolean): Promise<void>;
    /**
     * this function actually scrolls to the configStep in the View
     * @param step index of Step to which we have to scroll
     */
    scrollToConfigStep(step: number): void;
    /**
     * this function emptys the searchbar of an specific itemPalette
     * @param paletteId identifyer
     */
    private emptySearchBar;
    focusSearch(paletteId?: number): boolean;
    scrollToOPV(paletteId: number, codex: string, offset?: number): void;
    private scrollToFunction;
    /***********************************Weiterleitung zum VisitedHandler ************************************************/
    visitOptions(options: string[]): void;
    visitActVisibleSteps(): void;
    wereAllStepsVisited(): boolean;
    getFirstUnvisitedStepIndex(): number;
}
//# sourceMappingURL=PaletteViewHandler.d.ts.map