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EAAE,mCAAgB,CAAC,kBAAkB,CAAC;YACpD,cAAc,EAAE,UAAC,KAAK,EAAE,OAAiC,IAAK,QAAC,YAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAA1D,CAA0D;SACzH,CAAC;QACF;;;;;;;;WAQG;QACH,eAAe,EAAE,mCAAgB,CAAC,2BAA2B,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;KAC9F,CAAC;IAEK,yBAAQ,GAAG;QAChB,8BAAc,CAAC;YACb,gBAAgB,EAAE,gBAAgB;SACnC,CAAC,CAAC;IACL,CAAC,CAAC;IAaJ,uBAAC;CAAA,CAnEqC,qBAAS,GAmE9C;AAnEY,4CAAgB;AAqE7B,+BAAc,CAAC,2BAA2B,CAAC,gBAAgB,CAAC,CAAC","file":"FacetsMobileMode__9f061b213793663de5ee.js","sourcesContent":["import { Component } from '../Base/Component';\nimport { ComponentOptions } from '../Base/ComponentOptions';\nimport { IComponentBindings } from '../Base/ComponentBindings';\nimport { exportGlobally } from '../../GlobalExports';\nimport { Utils } from '../../Core';\nimport { Initialization } from '../Base/Initialization';\n\nexport interface IFacetsMobileModeConstructor {\n new (element: HTMLElement, options: IFacetsMobileModeOptions, bindings: IComponentBindings): FacetsMobileMode;\n}\n\nexport interface IFacetsMobileModeOptions {\n breakpoint?: number;\n isModal?: boolean;\n displayOverlayWhileOpen?: boolean;\n preventScrolling?: boolean;\n scrollContainer?: HTMLElement;\n}\n\n/**\n * This component lets you customize the mobile responsive behavior of facets in your search interface.\n *\n * **Notes:**\n * - You can include this component anywhere under the root element of your search interface.\n * - You should only include this component once in your search interface.\n */\nexport class FacetsMobileMode extends Component {\n static ID = 'FacetsMobileMode';\n\n /**\n * @componentOptions\n */\n static options: IFacetsMobileModeOptions = {\n /**\n * The screen width (in number of pixels) at which facets should enter mobile responsive mode and be collapsed under a single button.\n *\n * **Default:** `800`\n */\n breakpoint: ComponentOptions.buildNumberOption(),\n /**\n * Whether to display the facets in a modal instead of a pop-up when the end user expands them in mobile responsive mode.\n * Set this option to `false` in order to keep the old behaviour.\n */\n isModal: ComponentOptions.buildBooleanOption({ defaultValue: true }),\n /**\n * Whether to display an overlay behind the facets when the end user expands them in mobile responsive mode.\n *\n * By default, the following behavior applies:\n * - `true` when [isModal]{@link FacetsMobileMode.options.isModal} is `false`\n * - `false` when [isModal]{@link FacetsMobileMode.options.isModal} is `true`\n */\n displayOverlayWhileOpen: ComponentOptions.buildBooleanOption({\n postProcessing: (value, options: IFacetsMobileModeOptions) => (Utils.isNullOrUndefined(value) ? !options.isModal : value)\n }),\n /**\n * Whether to disable vertical scrolling on the specified or resolved [`scrollContainer`]{@link FacetsMobileMode.options.scrollContainer} while facets are expanded in mobile responsive mode.\n *\n * By default, the following behavior applies:\n * - `true` when [isModal]{@link FacetsMobileMode.options.isModal} is `true`\n * - `false` when [isModal]{@link FacetsMobileMode.options.isModal} is `false`\n */\n preventScrolling: ComponentOptions.buildBooleanOption({\n postProcessing: (value, options: IFacetsMobileModeOptions) => (Utils.isNullOrUndefined(value) ? options.isModal : value)\n }),\n /**\n * The HTML element whose vertical scrolling should be locked while facets are expanded in mobile responsive mode.\n *\n * By default, the component tries to detect and use the first ancestor element whose CSS `overflow-y` attribute is set to `scroll`, starting from the `FacetsMobileMode`'s element itself. If no such element is found, the `document.body` element is used.\n *\n * Since this heuristic is not perfect, we strongly recommend that you manually set this option by explicitly specifying the desired CSS selector.\n *\n * **Example:** `data-scroll-container-selector='#someCssSelector'`\n */\n scrollContainer: ComponentOptions.buildChildHtmlElementOption({ depend: 'preventScrolling' })\n };\n\n static doExport = () => {\n exportGlobally({\n FacetsMobileMode: FacetsMobileMode\n });\n };\n\n public options: IFacetsMobileModeOptions;\n\n constructor(public element: HTMLElement, options?: IFacetsMobileModeOptions, bindings?: IComponentBindings) {\n super(element, FacetsMobileMode.ID, bindings);\n\n this.options = ComponentOptions.initComponentOptions(element, FacetsMobileMode, options);\n if (this.options.preventScrolling) {\n const scrollContainer = this.options.scrollContainer || this.searchInterface.element;\n this.options.scrollContainer = ComponentOptions.findParentScrollLockable(scrollContainer);\n }\n }\n}\n\nInitialization.registerAutoCreateComponent(FacetsMobileMode);\n\n\n\n// WEBPACK FOOTER //\n// ./src/ui/FacetsMobileMode/FacetsMobileMode.ts"],"sourceRoot":""}