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,QAAU3C,Q","sources":["webpack://bju-press/./src/modules/conditional-container/conditional-container.tsx?f7b3","webpack://bju-press/./lib/conditional-container/module-registration.js?92a4","webpack://bju-press/external var \"React\"?0d3b"],"sourcesContent":["//==============================================================================\r\n// Conditional Container\r\n//\r\n// Container module that can be disabled to hide child content.\r\n//==============================================================================\r\nimport * as React from 'react';\r\n\r\nimport { IConditionalContainerProps } from './conditional-container.props.autogenerated';\r\n\r\n//==============================================================================\r\n// CLASS DEFINITION\r\n//==============================================================================\r\n/**\r\n * ConditionalContainer component\r\n * @extends {React.PureComponent>}\r\n */\r\n//==============================================================================\r\nclass ConditionalContainer extends React.PureComponent> {\r\n\r\n //==========================================================================\r\n // PUBLIC METHODS\r\n //==========================================================================\r\n\r\n //------------------------------------------------------\r\n // Render function\r\n //------------------------------------------------------\r\n public render(): JSX.Element | null {\r\n return this._displayContent();\r\n }\r\n\r\n //==========================================================================\r\n // PRIVATE METHODS\r\n //==========================================================================\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _displayContent(): JSX.Element | null {\r\n const { config, slots } = this.props;\r\n const hasSlots = slots && slots.contentBlock && slots.contentBlock.length;\r\n\r\n const isEnabled = (config.enabled && this._isEnabled(config.startDate, config.endDate));\r\n\r\n if (isEnabled && hasSlots) {\r\n return (\r\n \r\n {this._renderSlotItems(slots.contentBlock)}\r\n \r\n );\r\n }\r\n\r\n // No slots, so there's nothing to do\r\n return null;\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _renderSlotItems(items: React.ReactNode[]): JSX.Element {\r\n return (\r\n \r\n {items.map((slot: React.ReactNode, index: number) => (\r\n \r\n {slot}\r\n \r\n ))}\r\n \r\n );\r\n }\r\n\r\n //------------------------------------------------------\r\n // Determine whether the current date is between the start\r\n // and end dates.\r\n //\r\n // Start and end dates are optional, so only check if they\r\n // are present and valid.\r\n //------------------------------------------------------\r\n private _isEnabled(startDate: string | undefined, endDate: string | undefined): boolean {\r\n const now = Date.now();\r\n\r\n // Check to see if we should disable based on the start date\r\n const start = startDate && new Date(startDate).getTime();\r\n if (start && !isNaN(start)) {\r\n if (now < start) {\r\n return false;\r\n }\r\n }\r\n\r\n // Check to see if we should disable based on the end date\r\n const end = endDate && new Date(endDate).getTime();\r\n if (end && !isNaN(end)) {\r\n const buffer = 1000 * 60 * 60 * 24; // 24 hours\r\n if (now > (end + buffer)) {\r\n return false;\r\n }\r\n }\r\n\r\n // We failed to fail out. Success!\r\n return true;\r\n }\r\n}\r\n\r\nexport default ConditionalContainer;\r\n","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['conditional-container'] = {\n c: () => require('partner/modules/conditional-container/conditional-container.tsx'),\n $type: 'containerModule',\n da: [],\n \n iNM: false,\n ns: '__local__',\n n: 'conditional-container',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/conditional-container'\n });\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };","module.exports = React;"],"names":["ConditionalContainer","React","render","this","_displayContent","config","slots","props","hasSlots","contentBlock","length","enabled","_isEnabled","startDate","endDate","_renderSlotItems","items","map","slot","index","key","now","Date","start","getTime","isNaN","end","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","window","__bindings__","_objectSpread","module","exports"],"sourceRoot":""}