{"version":3,"sources":["webpack://fxsWidgets/../src/js/widgets/calendar-common/helpers/formatDate.js","webpack://fxsWidgets/../src/js/widgets/calendar-faq/actions/localizationActions.js","webpack://fxsWidgets/../src/js/widgets/calendar-faq/store.js","webpack://fxsWidgets/../src/js/widgets/calendar-faq/actions/faqActions.js","webpack://fxsWidgets/../src/js/widgets/calendar-faq/components/faqComponent.js","webpack://fxsWidgets/../src/js/widgets/calendar-faq/components/FaqContainer.js","webpack://fxsWidgets/../src/js/widgets/calendar-faq/actions/index.js","webpack://fxsWidgets/../src/js/widgets/calendar-faq/index.js","webpack://fxsWidgets/../src/js/widgets/calendar/constants/countryFilterOptions.js"],"names":["getOrdinalDay","day","translations","fetchLocalizations","_ref","store","storeCulture","getState","config","culture","toLowerCase","currentCulture","hasOwnProperty","catch","console","error","default","_x","apply","arguments","INITIAL_STATE","calendarApiUrl","CALENDAR_API_URL","eventId","eventDetails","isFetching","fetchError","data","upcoming","historical","convertCulture","input","Object","keys","includes","detailsReceived","response","setState","upcomingReceived","historicalReceived","detailsError","details","upcomingError","historicalError","FaqComponent","_Component","props","_this","_callSuper","state","eventDateFormatted","_inherits","key","value","_this2","getDateValuesGtm","Date","this","nextEventDate","then","r","name","forecastTranslation","country","faqWhenQuestion","faqWhenResponse","faqWhatQuestion","faqWhatResponse","nextConsensus","lastDeviation","nonExistantTranslation","unknownTranslation","faqWhenQuestionReplaced","replace","faqWhenResponseReplaced","weekday","month","hour","faqWhatQuestionReplaced","consensus","desviation","faqWhatResponseReplaced","h","class","concat","_ref2","renderFaq","Component","FaqContainer","_classCallCheck","fetchUpcomingData","fetchHistoricalData","fetchEventDateDetails","translate","dataIsAvailable","dir","NoDataWidgetError","message","renderItemFetching","getCountryNameByCountryCode","countryCode","ratioDeviation","dateUtc","connectWithTranslations","upcomingRequested","_store$getState$confi","url","cacheFetch","ok","json","values","status","err","historicalRequested","_store$getState$confi2","_store$getState$confi3","detailsRequested","CalendarFaqWidget","createCustomStore","createStore","Provider","COUNTRY_FILTER_OPTIONS","Country_All","Country_UnitedStates","Country_UnitedKingdom","Country_EuropeanMonetaryUnion","Country_Germany","Country_China","Country_Japan","Country_Canada","Country_Australia","Country_NewZealand","Country_Switzerland","Country_France","Country_Italy","Country_Spain","Country_Ukraine","Country_India","Country_Russia","Country_Turkey","Country_SouthAfrica","Country_Brazil","Country_SouthKorea","Country_Indonesia","Country_Singapore","Country_Mexico","Country_Sweden","Country_Norway","Country_Denmark","Country_Greece","Country_Portugal","Country_Ireland","Country_Austria","Country_Belgium","Country_Netherlands","Country_Finland","Country_CzechRepublic","Country_Poland","Country_Hungary","Country_Romania","Country_Chile","Country_Colombia","Country_Argentina","Country_Iceland","Country_HongKong","Country_Slovakia","Country_Israel","Country_SaudiArabia","Country_Vietnam","Country_Kuwait","Country_Egypt","Country_UnitedArabEmirates","Country_Qatar","Country_Thailand","getBasicCountries","countries","slice","getMajorCountries","getMinorCountries","code","find"],"mappings":"gHAAA,kCAAO,IAeMA,EAAgB,SAACC,GAC1B,OAAQA,GACJ,IAAK,MACD,MAAO,KACX,IAAK,MACD,MAAO,KACX,IAAK,MACD,MAAO,KACX,QACI,MAAO,KAEnB,C,+mJC1BaC,EAAe,CAC1B,GAAM,kBAAM,iCAAqE,EACjF,GAAM,kBAAM,iCAAqE,EACjF,GAAM,kBAAM,iCAAqE,EACjF,GAAM,kBAAM,iCAAqE,EACjF,GAAM,kBAAM,iCAAqE,EACjF,GAAM,kBAAM,iCAAqE,EACjF,GAAM,kBAAM,iCAAqE,EACjF,GAAM,kBAAM,iCAAqE,EACjF,SAAU,kBAAM,iCAA6E,EAC7F,QAAS,kBAAM,iCAA2E,EAC1F,GAAM,kBAAM,iCAAqE,EACjF,GAAM,kBAAM,iCAAqE,EACjF,GAAM,kBAAM,iCAAqE,EACjF,GAAM,kBAAM,iCAAqE,GAGtEC,EAAkB,e,EAAAC,G,EAAG,UAAOC,GACvC,IAAMC,EAAeD,EAAME,WAAWC,OAAOC,QACvCA,EAAUH,EA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kBAAmB,KACnBC,eAAgB,KAChBC,eAAgB,KAChBC,eAAgB,KAChBC,gBAAiB,KACjBC,eAAgB,KAChBC,iBAAkB,KAClBC,gBAAiB,KACjBC,gBAAiB,KACjBC,gBAAiB,KACjBC,oBAAqB,KACrBC,gBAAiB,KACjBC,sBAAuB,KACvBC,eAAgB,KAChBC,gBAAiB,KACjBC,gBAAiB,KACjBC,cAAe,KACfC,iBAAkB,KAClBC,kBAAmB,KACnBC,gBAAiB,KACjBC,iBAAkB,KAClBC,iBAAkB,KAClBC,eAAgB,KAChBC,oBAAqB,KACrBC,gBAAiB,KACjBC,eAAgB,KAChBC,cAAe,KACfC,2BAA4B,KAC5BC,cAAe,KACfC,iBAAkB,MAGhBC,EAAoB,SAACC,GACvB,OAAKA,EAEEA,EAAUC,MAAM,EAAG,GAFH,IAG3B,EAEMC,EAAoB,SAACF,GACvB,OAAKA,EAEEA,EAAUC,MAAM,EAAG,IAFH,IAG3B,EAEME,EAAoB,SAACH,GACvB,OAAKA,EAEEA,EAAUC,MAAM,IAFA,IAG3B,EAEM7E,EAA8B,SAACgF,GAEjC,OAAOnJ,OAAOC,KAAKwF,GAAwB2D,MAAK,SAAAhI,GAAG,OAAIqE,EAAuBrE,KAAS+H,CAAI,GAC/F,C","file":"calendar-faq.4abbba63eb66df77a295.js","sourcesContent":["export const getPostDateString = (date, culture) => {\r\n    if (date === undefined || date === null) {\r\n        return \"\";\r\n    }\r\n\r\n    var locale = culture.split('-')[0];\r\n    var month = new Intl.DateTimeFormat(locale, { month: 'long' }).format(date)\r\n    \r\n    var splittedDate = date.toString().split(\" \");\r\n    var splittedHours = splittedDate[4].split(\":\");\r\n    var eventDate = month + \" \" + splittedDate[2] + \", \" + splittedHours[0] + \":\" + splittedHours[1] + \" GMT\";\r\n\r\n    return eventDate;\r\n};\r\n\r\nexport const getOrdinalDay = (day) => {\r\n    switch (day) {\r\n        case \"one\":\r\n            return \"st\";\r\n        case \"two\":\r\n            return \"nd\";\r\n        case \"few\":\r\n            return \"rd\";\r\n        default:\r\n            return \"th\";\r\n    }\r\n};\r\n","export const translations = {\r\n  \"ar\": () => import(/*webpackChunkName: 'calendar-faq-t-ar'*/\"../translations/ar\"),\r\n  \"de\": () => import(/*webpackChunkName: 'calendar-faq-t-de'*/\"../translations/de\"),\r\n  \"en\": () => import(/*webpackChunkName: 'calendar-faq-t-en'*/\"../translations/en\"),\r\n  \"es\": () => import(/*webpackChunkName: 'calendar-faq-t-es'*/\"../translations/es\"),\r\n  \"fr\": () => import(/*webpackChunkName: 'calendar-faq-t-fr'*/\"../translations/fr\"),\r\n  \"id\": () => import(/*webpackChunkName: 'calendar-faq-t-id'*/\"../translations/id\"),\r\n  \"ru\": () => import(/*webpackChunkName: 'calendar-faq-t-ru'*/\"../translations/ru\"),\r\n  \"tr\": () => import(/*webpackChunkName: 'calendar-faq-t-tr'*/\"../translations/tr\"),\r\n  \"zh-cht\": () => import(/*webpackChunkName: 'calendar-faq-t-zh-cht'*/\"../translations/zh-cht\"),\r\n  \"zh-cn\": () => import(/*webpackChunkName: 'calendar-faq-t-zh-cn'*/\"../translations/zh-cn\"),\r\n  \"vi\": () => import(/*webpackChunkName: 'calendar-faq-t-vi'*/\"../translations/vi\"),\r\n  \"fa\": () => import(/*webpackChunkName: 'calendar-faq-t-fa'*/\"../translations/fa\"),\r\n  \"pt\": () => import(/*webpackChunkName: 'calendar-faq-t-pt'*/\"../translations/pt\"),\r\n  \"cs\": () => import(/*webpackChunkName: 'calendar-faq-t-cs'*/\"../translations/cs\"),\r\n}\r\n\r\nexport const fetchLocalizations = async (store) => {\r\n  const storeCulture = store.getState().config.culture\r\n  const culture = storeCulture ? storeCulture.toLowerCase() : 'en'\r\n\r\n  const currentCulture = translations.hasOwnProperty(culture) ? culture : 'en'\r\n\r\n  const fetchedTranslations = await translations[currentCulture]()\r\n    .catch(() => {\r\n      console.error('Could not fetch translations')\r\n      return null\r\n    })\r\n\r\n  return { translations: fetchedTranslations.default }\r\n}\r\n","import { createCustomStore } from \"../common/helpers/storeHelpers\";\r\nimport { translations } from \"./actions/localizationActions\";\r\n\r\nconst INITIAL_STATE = {\r\n    config: {\r\n        culture: \"\",\r\n        calendarApiUrl: CALENDAR_API_URL,\r\n        eventId: \"\",\r\n    },\r\n    eventDetails :{\r\n        isFetching: true,\r\n        fetchError: false,\r\n        data: null\r\n    },\r\n    upcoming : {\r\n        isFetching: true,\r\n        fetchError: false,\r\n        data: null\r\n    },\r\n    historical : {\r\n        isFetching: true,\r\n        fetchError: false,\r\n        data: null\r\n    }\r\n};\r\n\r\nconst convertCulture = (input) => {\r\n    const result =\r\n        input && Object.keys(translations).includes(input.toLowerCase())\r\n            ? input.toLowerCase()\r\n            : \"en\";\r\n    return result;\r\n};\r\n\r\nconst createStore = (props) => {\r\n    const result = createCustomStore(props, INITIAL_STATE, {\r\n        culture: convertCulture,\r\n    });\r\n    return result;\r\n};\r\n\r\nexport { createStore };\r\n","import { cacheFetch } from \"../../common/helpers/cacheFetchHelpers\";\r\n\r\nconst detailsRequested = (store) => {\r\n    store.setState({\r\n        eventDetails: { isFetching: true, fetchError: false, data: null },\r\n    });\r\n};\r\nconst upcomingRequested = (store) => {\r\n    store.setState({\r\n        upcoming: { isFetching: true, fetchError: false, data: null },\r\n    });\r\n};\r\nconst historicalRequested = (store) => {\r\n    store.setState({\r\n        historical: { isFetching: true, fetchError: false, data: null },\r\n    });\r\n};\r\nconst detailsReceived = (store, response) => {\r\n    store.setState({\r\n        eventDetails: {\r\n            isFetching: false,\r\n            fetchError: false,\r\n            data: response,\r\n        },\r\n    });\r\n};\r\nconst upcomingReceived = (store, response) => {\r\n    store.setState({\r\n        upcoming: {\r\n            isFetching: false,\r\n            fetchError: false,\r\n            data: response[0],\r\n        },\r\n    });\r\n};\r\nconst historicalReceived = (store, response) => {\r\n    store.setState({\r\n        historical: {\r\n            isFetching: false,\r\n            fetchError: false,\r\n            data: response[0],\r\n        },\r\n    });\r\n};\r\nconst detailsError = (store) => {\r\n    store.setState({\r\n        details: { isFetching: false, fetchError: true, data: null },\r\n    });\r\n};\r\nconst upcomingError = (store) => {\r\n    store.setState({\r\n        upcoming: { isFetching: false, fetchError: true, data: null },\r\n    });\r\n};\r\nconst historicalError = (store) => {\r\n    store.setState({\r\n        historical: { isFetching: false, fetchError: true, data: null },\r\n    });\r\n};\r\n\r\nexport const fetchUpcomingData = (store) => {\r\n    upcomingRequested(store);\r\n\r\n    const { calendarApiUrl, culture, eventId } = store.getState().config;\r\n    let url = `${calendarApiUrl}/${culture}/api/v1/events/${eventId}/upcoming?take=1`;\r\n\r\n  cacheFetch(url, false)\r\n        .then((response) => {\r\n            if (response.ok) {\r\n                response\r\n                    .json()\r\n                    .then((values) => upcomingReceived(store, values));\r\n            } else if (response.status === 404) {\r\n                upcomingReceived(store, []);\r\n                upcomingError(store);\r\n            } else {\r\n                upcomingError(store);\r\n            }\r\n        })\r\n        .catch((err) => {\r\n            console.error(err);\r\n            error(store);\r\n        });\r\n};\r\n\r\nexport const fetchHistoricalData = (store) => {\r\n    historicalRequested(store);\r\n\r\n    const { calendarApiUrl, culture, eventId } = store.getState().config;\r\n    let url = `${calendarApiUrl}/${culture}/api/v1/events/${eventId}/historical?take=1`;\r\n\r\n    cacheFetch(url, false)\r\n        .then((response) => {\r\n            if (response.ok) {\r\n                response\r\n                    .json()\r\n                    .then((values) => historicalReceived(store, values));\r\n            } else if (response.status === 404) {\r\n                historicalReceived(store, []);\r\n                historicalError(store);\r\n            } else {\r\n                historicalError(store);\r\n            }\r\n        })\r\n        .catch((err) => {\r\n            console.error(err);\r\n            error(store);\r\n        });\r\n};\r\n\r\nexport const fetchEventDateDetails = (store) => {\r\n    const { calendarApiUrl, culture, eventId } = store.getState().config;\r\n    detailsRequested(store);\r\n\r\n    let url = `${calendarApiUrl}/${culture}/api/v1/events/${eventId}`;\r\n\r\n    cacheFetch(url, false)\r\n        .then((response) => {\r\n            if (response.ok) {\r\n                response\r\n                    .json()\r\n                    .then((values) => detailsReceived(store, values));\r\n            } else if (response.status === 404) {\r\n                detailsReceived(store, []);\r\n                detailsError(store);\r\n            } else {\r\n                detailsError(store);\r\n            }\r\n        })\r\n        .catch((err) => {\r\n            console.error(err);\r\n            error(store);\r\n        });\r\n};\r\n","import { h, Component } from \"preact\";\r\nimport { getDateValuesGtm } from \"../../common/helpers/dateHelpers\";\r\n\r\nclass FaqComponent extends Component {\r\n    constructor(props) {\r\n        super(props);\r\n        this.state = { eventDateFormatted: \"\" };\r\n    }\r\n\r\n    componentDidMount() {\r\n        getDateValuesGtm(\r\n            new Date(this.props.nextEventDate),\r\n            this.props.culture\r\n        ).then((r) => {\r\n            this.setState({ eventDateFormatted: r });\r\n        });\r\n    }\r\n\r\n    renderFaq(\r\n        name,\r\n        forecastTranslation,\r\n        country,\r\n        faqWhenQuestion,\r\n        faqWhenResponse,\r\n        eventDateFormatted,\r\n        faqWhatQuestion,\r\n        faqWhatResponse,\r\n        nextConsensus,\r\n        lastDeviation,\r\n        nonExistantTranslation,\r\n        unknownTranslation\r\n    ) {\r\n        let faqWhenQuestionReplaced = faqWhenQuestion\r\n            .replace(\"{COUNTRY}\", country)\r\n            .replace(\"{EVENTNAME}\", name);\r\n\r\n        let faqWhenResponseReplaced = null;\r\n        if (eventDateFormatted !== null) {\r\n            faqWhenResponseReplaced = faqWhenResponse\r\n                .replace(\"{COUNTRY}\", country)\r\n                .replace(\"{EVENTNAME}\", name)\r\n                .replace(\"{WEEKDAY}\", eventDateFormatted.weekday)\r\n                .replace(\"{DAY}\", eventDateFormatted.day)\r\n                .replace(\"{MONTH}\", eventDateFormatted.month)\r\n                .replace(\"{TIME_NEXT_EVENTDATE}\", eventDateFormatted.hour);\r\n        }\r\n\r\n        let faqWhatQuestionReplaced = faqWhatQuestion\r\n            .replace(\"{COUNTRY}\", country)\r\n            .replace(\"{EVENTNAME}\", name);\r\n\r\n        let consensus = nextConsensus ? nextConsensus : unknownTranslation;\r\n        let desviation = lastDeviation ? lastDeviation : nonExistantTranslation;\r\n\r\n        let faqWhatResponseReplaced = faqWhatResponse\r\n            .replace(\"{COUNTRY}\", country)\r\n            .replace(\"{EVENTNAME}\", name)\r\n            .replace(\"{NEXT CONSENSUS}\", consensus)\r\n            .replace(\"{LAST DEVIATION}\", desviation);\r\n\r\n        return (\r\n            <div>\r\n                <h3 class=\"fxs_headline_highlight fxs_marginBase_bottom\">{`${country} ${name} ${forecastTranslation}`}</h3>\r\n                <div class=\"fxs_row\">\r\n                    <div class=\"fxs_col_50 fxs_col\">\r\n                        <h3 class=\"fxs_headline_small\">\r\n                            {faqWhenQuestionReplaced}\r\n                        </h3>\r\n                        <p class=\"fxs_entryPlain_txt\">\r\n                            {faqWhenResponseReplaced}\r\n                        </p>\r\n                    </div>\r\n                    <div class=\"fxs_col_50 fxs_col\">\r\n                        <h3 class=\"fxs_headline_small\">\r\n                            {faqWhatQuestionReplaced}\r\n                        </h3>\r\n                        <p class=\"fxs_entryPlain_txt\">\r\n                            {faqWhatResponseReplaced}\r\n                        </p>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        );\r\n    }\r\n\r\n    render(\r\n        {\r\n            name,\r\n            forecastTranslation,\r\n            country,\r\n            faqWhenQuestion,\r\n            faqWhenResponse,\r\n            faqWhatQuestion,\r\n            faqWhatResponse,\r\n            nextConsensus,\r\n            lastDeviation,\r\n            nonExistantTranslation,\r\n            unknownTranslation,\r\n        },\r\n        { eventDateFormatted }\r\n    ) {\r\n        {\r\n            return this.renderFaq(\r\n                name,\r\n                forecastTranslation,\r\n                country,\r\n                faqWhenQuestion,\r\n                faqWhenResponse,\r\n                eventDateFormatted,\r\n                faqWhatQuestion,\r\n                faqWhatResponse,\r\n                nextConsensus,\r\n                lastDeviation,\r\n                nonExistantTranslation,\r\n                unknownTranslation\r\n            );\r\n        }\r\n    }\r\n}\r\nexport default FaqComponent;\r\n","import { h, Component } from \"preact\";\r\nimport actions from \"../actions\";\r\nimport { connectWithTranslations } from \"../../common/helpers/translationsHelpers\";\r\nimport FaqComponent from \"./faqComponent\";\r\nimport { getCountryNameByCountryCode } from \"../../calendar/constants/countryFilterOptions\";\r\nimport NoDataWidgetError from \"../../common/components/NoDataWidgetError\";\r\n\r\nclass FaqContainer extends Component {\r\n    constructor(props) {\r\n        super(props);\r\n    }\r\n    componentDidMount() {\r\n        this.props.fetchUpcomingData();\r\n        this.props.fetchHistoricalData();\r\n        this.props.fetchEventDateDetails();\r\n        this.props.fetchLocalizations();\r\n    }\r\n\r\n    renderItemFetching() {\r\n        return (\r\n            <div>\r\n                <h3 class=\"fxs_headline_highlight fxs_marginBase_bottom fxs_bg_light_3_clr\">\r\n                    &nbsp;\r\n                </h3>\r\n                <div class=\"fxs_row\">\r\n                    <div class=\"fxs_col_50 fxs_col\">\r\n                        <h3 class=\"fxs_headline_small fxs_bg_light_3_clr\">&nbsp;</h3>\r\n                        <p class=\"fxs_entryPlain_txt fxs_bg_light_3_clr\">&nbsp;</p>\r\n                    </div>\r\n                    <div class=\"fxs_col_50 fxs_col\">\r\n                        <h3 class=\"fxs_headline_small fxs_bg_light_3_clr\">&nbsp;</h3>\r\n                        <p class=\"fxs_entryPlain_txt fxs_bg_light_3_clr\">&nbsp;</p>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        );\r\n    }\r\n\r\n    render(\r\n        { config, translate, translations, eventDetails, historical, upcoming },\r\n        { shouldShowFaq }\r\n    ) {\r\n        const isFetching =\r\n            eventDetails.isFetching ||\r\n            historical.isFetching ||\r\n            upcoming.isFetching;\r\n\r\n        const fetchError = eventDetails.fetchError ||\r\n            upcoming.fetchError ||\r\n            historical.fetchError;\r\n\r\n        const dataIsAvailable =\r\n            eventDetails.data !== null &&\r\n            historical.data !== null &&\r\n            upcoming.data !== null;\r\n\r\n        return (\r\n            <div\r\n                class=\"fxs_widget fxs_calendar_faq\"\r\n                dir={`${!!translate(\"IsRightToLeftOriented\") ? \"rtl\" : \"auto\"}`}\r\n            >\r\n                {!isFetching && !dataIsAvailable && !fetchError && (\r\n                    <NoDataWidgetError\r\n                        message={\r\n                            <p>\r\n                                {translate(\"NoDataWidgetErrorMessageLine1\")}\r\n                                <br />\r\n                                {translate(\"NoDataWidgetErrorMessageLine2\")}\r\n                            </p>\r\n                        }\r\n                    />\r\n                )}\r\n                {isFetching && this.renderItemFetching()}\r\n                {translations && !isFetching && (\r\n                    <FaqComponent\r\n                        name={eventDetails.data.name}\r\n                        forecastTranslation={translate(\"Forecast\")}\r\n                        country={translate(\r\n                            getCountryNameByCountryCode(\r\n                                eventDetails.data.countryCode\r\n                            )\r\n                        )}\r\n                        faqWhenQuestion={translate(\"FaqWhenQuestion\")}\r\n                        faqWhenResponse={translate(\"FaqWhenResponse\")}\r\n                        faqWhatQuestion={translate(\"FaqWhatQuestion\")}\r\n                        faqWhatResponse={translate(\"FaqWhatResponse\")}\r\n                        nonExistantTranslation={translate(\"Non_existant\")}\r\n                        unknownTranslation={translate(\"Unknown\")}\r\n                        lastDeviation={historical.data.ratioDeviation}\r\n                        nextConsensus={upcoming.data != null ? upcoming.data.consensus : null}\r\n                        nextEventDate={upcoming.data != null ? upcoming.data.dateUtc : null}\r\n                        culture={config.culture}\r\n                    ></FaqComponent>\r\n                )}\r\n            </div>\r\n        );\r\n    }\r\n}\r\n\r\nexport default connectWithTranslations(\r\n    \"config, eventDetails, historical, upcoming\",\r\n    actions\r\n)(FaqContainer);\r\n","import { fetchUpcomingData, fetchHistoricalData, fetchEventDateDetails } from './faqActions'\r\nimport { fetchLocalizations } from './localizationActions'\r\n\r\nexport default (store) => ({\r\n    fetchUpcomingData: (state) => fetchUpcomingData(store),\r\n    fetchHistoricalData : (state) => fetchHistoricalData(store),\r\n    fetchEventDateDetails : (state) => fetchEventDateDetails(store),\r\n    fetchLocalizations: (state) => fetchLocalizations(store)\r\n})\r\n","import { h, Component } from 'preact'\r\nimport { Provider } from 'unistore/preact'\r\nimport { createStore } from './store'\r\nimport FaqContainer from './components/FaqContainer'\r\n\r\n\r\nclass CalendarFaqWidget extends Component {\r\n    constructor(props) {\r\n        super(props)\r\n        this.store = createStore(props)\r\n    }\r\n\r\n    render(props) {\r\n        return (\r\n            <Provider store={this.store}>\r\n                <FaqContainer/>\r\n            </Provider>\r\n        )\r\n    }\r\n}\r\n\r\nexport default CalendarFaqWidget\r\n","const COUNTRY_FILTER_OPTIONS = {\r\n    Country_All: null,\r\n    Country_UnitedStates: \"US\",\r\n    Country_UnitedKingdom: \"UK\",\r\n    Country_EuropeanMonetaryUnion: \"EMU\",\r\n    Country_Germany: \"DE\",\r\n    Country_China: \"CN\",\r\n    Country_Japan: \"JP\",\r\n    Country_Canada: \"CA\",\r\n    Country_Australia: \"AU\",\r\n    Country_NewZealand: \"NZ\",\r\n\r\n    Country_Switzerland: \"CH\",\r\n    Country_France: \"FR\",\r\n    Country_Italy: \"IT\",\r\n    Country_Spain: \"ES\",\r\n\r\n    Country_Ukraine: \"UA\",\r\n\r\n    Country_India: \"IN\",\r\n    Country_Russia: \"RU\",\r\n    Country_Turkey: \"TR\",\r\n    Country_SouthAfrica: \"ZA\",\r\n    Country_Brazil: \"BR\",\r\n    Country_SouthKorea: \"KR\",\r\n    Country_Indonesia: \"ID\",\r\n    Country_Singapore: \"SG\",\r\n    Country_Mexico: \"MX\",\r\n    Country_Sweden: \"SE\",\r\n    Country_Norway: \"NO\",\r\n    Country_Denmark: \"DK\",\r\n    Country_Greece: \"GR\",\r\n    Country_Portugal: \"PT\",\r\n    Country_Ireland: \"IE\",\r\n    Country_Austria: \"AT\",\r\n    Country_Belgium: \"BE\",\r\n    Country_Netherlands: \"NL\",\r\n    Country_Finland: \"FI\",\r\n    Country_CzechRepublic: \"CZ\",\r\n    Country_Poland: \"PL\",\r\n    Country_Hungary: \"HU\",\r\n    Country_Romania: \"RO\",\r\n    Country_Chile: \"CL\",\r\n    Country_Colombia: \"CO\",\r\n    Country_Argentina: \"AR\",\r\n    Country_Iceland: \"IS\",\r\n    Country_HongKong: \"HK\",\r\n    Country_Slovakia: \"SK\",\r\n    Country_Israel: \"IL\",\r\n    Country_SaudiArabia: \"SA\",\r\n    Country_Vietnam: \"VN\",\r\n    Country_Kuwait: \"KW\",\r\n    Country_Egypt: \"EG\",\r\n    Country_UnitedArabEmirates: \"AE\",\r\n    Country_Qatar: \"QA\",\r\n    Country_Thailand: \"TH\",\r\n};\r\n\r\nconst getBasicCountries = (countries) => {\r\n    if (!countries) return null;\r\n\r\n    return countries.slice(0, 9);\r\n};\r\n\r\nconst getMajorCountries = (countries) => {\r\n    if (!countries) return null;\r\n\r\n    return countries.slice(0, 14);\r\n};\r\n\r\nconst getMinorCountries = (countries) => {\r\n    if (!countries) return null;\r\n\r\n    return countries.slice(14);\r\n};\r\n\r\nconst getCountryNameByCountryCode = (code) => {\r\n\r\n    return Object.keys(COUNTRY_FILTER_OPTIONS).find(key => COUNTRY_FILTER_OPTIONS[key] === code);\r\n}\r\n\r\nexport {\r\n    COUNTRY_FILTER_OPTIONS,\r\n    getBasicCountries,\r\n    getMajorCountries,\r\n    getMinorCountries,\r\n    getCountryNameByCountryCode,\r\n};\r\n"],"sourceRoot":""}