import{objectWithoutProperties as e,objectSpread2 as o}from"../../../_virtual/_rollupPluginBabelHelpers.js";import t from"react";import i from"classnames";import r from"../components/ComboboxOption/ComboboxOption.js";import n from"../components/ComboboxCategory/ComboboxCategory.js";import c from"../../Divider/Divider.js";import{COMBOBOX_DIVIDER_ITEM as a,COMBOBOX_CATEGORY_ITEM as l,COMBOBOX_OPTION_ITEM as s}from"../components/ComboboxConstants.js";import d from"./ComboboxHelpers.module.scss.js";var m=["type"];function p(e){return{type:a,height:17,id:"".concat(e.categoryId,"-divider")}}function u(e){return{height:32,type:l,category:e.categoryData,id:e.categoryId,withDivider:e.withDivider,className:e.className}}function g(e){var o=e.option,t=e.index;return{type:s,height:e.height,belongToCategory:!0,index:t,option:o,id:o.id||t,optionRenderer:e.optionRenderer,isActive:e.isActive,optionLineHeight:e.optionLineHeight,shouldScrollToSelectedItem:e.shouldScrollToSelectedItem,categoryId:e.categoryId}}function h(r){var n,c,p=r.item,u=r.style,g=r.optionEvents,h=r.optionRenderData,f=r.isVirtualized,C=p.type,x=e(p,m);switch(C){case a:c=y(x);break;case l:c=v(x),f||(n=d.sticky);break;case s:c=b(o(o(o({},x),g),h))}return t.createElement("div",{key:x.id,className:i(d.comboboxItemContainer,n),style:u},c)}function y(e){return t.createElement("div",{className:d.dividerContainer,style:{height:e.height}},t.createElement(c,{className:d.divider,key:e.id}))}function v(e){return t.createElement(n,{key:e.id,category:e.category,className:e.className})}function b(e){var o=e.index;return t.createElement(r,{index:o,key:e.id,option:e.option,optionRenderer:e.optionRenderer,scrollRef:e.scrollRef,isActive:e.activeItemIndex===o,visualFocus:o===e.visualFocusItemIndex,onOptionClick:e.onOptionClick,onOptionHover:e.onOptionEnter,onOptionLeave:e.onOptionLeave,optionLineHeight:e.optionLineHeight,belongToCategory:e.belongToCategory,shouldScrollWhenActive:e.shouldScrollToSelectedItem,forceUndoScrollNullCheck:e.forceUndoScrollNullCheck})}export{v as categoryItemRenderer,h as comboboxItemRenderer,u as createCategoryItemObject,p as createDividerItemObject,g as createOptionItemObject,y as dividerItemRenderer,b as optionItemRenderer};
