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,EAAQ,cAAEolE,IAChD,OAAO,EAAAgB,QAAQl+E,OAAO,CACpBozE,MAAO,OAAF,QAAIhvE,KAAM84E,GAAkBoC,EAAexnE,MAC/C,EACL,CAEAsnE,eAAeiC,GAA6B,SAAEvpE,EAAQ,cAAEolE,EAAa,QAAEhgB,IACrE,MAAM6jB,EAAoBC,EAA6B,CAAElpE,WAAUolE,kBACnE,OAAI6D,EACK,EAAA7C,QAAQvyD,OAAOo1D,EAAkBvgF,GAAI,CAAE08D,YAEzC,EAAAghB,QAAQn2E,OAAO,OAAD,QAAGm1D,UAAS94D,KAAM84E,GAAkBoC,EAAexnE,IAC1E,C","sources":["../../../../hotel-center/packages/hotel-center-service/src/bulk-edit-params.js","../../../../hotel-center/packages/hotel-center-service/src/grid-option-utils.js","../../../../hotel-center/packages/hotel-center-service/index.js","../../../../hotel-center/packages/hotel-center-service/src/account-service.js","../../../../hotel-center/packages/hotel-center-service/src/bulk-edit-service.js","../../../../hotel-center/packages/hotel-center-shared/src/light-dismissible/light-dismissible.js","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/single-multiplier-view/view.js","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/bid-multipliers-view.js","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/check-in-day/view.js","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/device-type/view.js","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/length-of-stay/view.js","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/user-country/view.js","../../../../hotel-center/packages/hotel-center-shared/src/date-filter/projection-grid-date-filter.js","../../../../hotel-center/packages/hotel-center-shared/src/dropdown-search-selector/option.js","../../../../hotel-center/packages/hotel-center-shared/src/dropdown-search-selector/selector.js","../../../../hotel-center/packages/hotel-center-shared/src/dropdown-search-selector/pagination.js","../../../../hotel-center/packages/hotel-center-shared/src/dropdown-search-selector/search.js","../../../../hotel-center/packages/hotel-center-shared/src/dropdown-search-selector/dropdown-search-selector.js","../../../../hotel-center/packages/hotel-center-shared/src/instrumentation/schema.js","../../../../hotel-center/packages/hotel-center-shared/src/instrumentation/error-codes.js","../../../../hotel-center/packages/hotel-center-shared/src/instrumentation/setup.js","../../../../hotel-center/packages/hotel-center-shared/src/instrumentation/perf-timing.js","../../../../hotel-center/packages/hotel-center-shared/src/js-data-bhc/edm-bhc.js","../../../../hotel-center/packages/hotel-center-shared/src/js-data-bhc/js-data-extension.js","../../../../hotel-center/packages/hotel-center-shared/index.js","../../../../hotel-center/packages/hotel-center-shared/src/account-information-view/account-information-view.js","../../../../hotel-center/packages/hotel-center-shared/src/bid-cap-view/bid-cap-view.js","../../../../hotel-center/packages/hotel-center-shared/src/bid-strategy-view/bid-strategy-view.js","../../../../hotel-center/packages/hotel-center-shared/src/edit-panel-view/edit-panel-view.js","../../../../hotel-center/packages/hotel-center-shared/src/service/fetch-preference-config.js","../../../../hotel-center/packages/hotel-center-shared/src/hotel-group-information-view/information-view.js","../../../../hotel-center/packages/hotel-center-shared/src/hotel-group-model/hotel-group-model.js","../../../../hotel-center/packages/hotel-center-shared/src/hotel-model/hotel-model.js","../../../../hotel-center/packages/hotel-center-shared/src/instrumentation/index.js","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/user-country/user-country-service.js","../../../../hotel-center/packages/hotel-center-shared/src/sub-account-model/sub-account-model.js","../../../../hotel-center/packages/hotel-center-utils/src/bid-multiplier-utils.js","../../../../hotel-center/packages/hotel-center-utils/index.js","../../../../hotel-center/packages/hotel-center-utils/src/bid-utils.js","../../../../hotel-center/packages/hotel-center-utils/src/date-utils.js","../../../../hotel-center/packages/hotel-center-utils/src/inline-download-utils.js","../../hooks/src/use-did-update.js","../../hooks/src/use-constructor.js","../../hotel-adgroup-upsert/src/components/campaign-name.js","../../hotel-adgroup-upsert/src/components/adgroup-name.js","../../hotel-adgroup-upsert/src/components/base-bid.js","../../hotel-adgroup-upsert/src/components/adgroup-basic.js","../../hotel-adgroup-upsert/src/components/default-value.js","../../hotel-adgroup-upsert/src/get-targets-criterion.js","../../hotel-adgroup-upsert/src/util.js","../../hotel-adgroup-upsert/src/components/advanced-settings.js","../../hotel-adgroup-upsert/src/components/adgroup-targets.js","../../hotel-adgroup-upsert/src/components/title.js","../../hotel-adgroup-upsert/src/shared.js","../../hotel-adgroup-upsert/src/style.js","../../hotel-adgroup-upsert/src/creation.js","../../hotel-adgroup-upsert/src/settings.js","../../hotel-campaign-shared/i18n/keys.js","../../hotel-campaign-shared/i18n/column-chooser.js","../../hotel-campaign-shared/i18n/filter.js","../../hotel-campaign-shared/i18n/cron-format.js","../../hotel-campaign-shared/i18n/date-range.js","../../hotel-campaign-shared/i18n/inline-download.js","../../hotel-campaign-shared/i18n/inline-edit.js","../../hotel-campaign-upsert/src/components/bid-strategy/utility.js","../../hotel-campaign-upsert/src/components/bid-strategy/bid-strategy.js","../../hotel-campaign-upsert/src/components/budget/utility.js","../../hotel-campaign-upsert/src/components/budget/budget.js","../../hotel-campaign-upsert/src/components/default-value.js","../../hotel-campaign-upsert/src/components/campaign-basic.js","../../hotel-campaign-upsert/src/components/advanced-settings.js","../../hotel-campaign-upsert/src/components/campaign-targets.js","../../hotel-campaign-upsert/src/components/title.js","../../hotel-campaign-upsert/src/get-targets-criterion.js","../../hotel-campaign-upsert/src/util.js","../../hotel-campaign-upsert/src/shared.js","../../hotel-campaign-upsert/src/style.js","../../hotel-campaign-upsert/src/creation.js","../../hotel-campaign-upsert/src/settings.js","../../hotel-common-targets/src/components/shared.js","../../hotel-common-targets/src/advanced-booking-window-target-setting/utility.js","../../hotel-common-targets/src/length-of-stay-target-setting/utility.js","../../hotel-common-targets/src/check-in-date-target-setting/utility.js","../../hotel-common-targets/src/components/utility.js","../../hotel-common-targets/src/components/bid-adjustment.js","../../hotel-common-targets/src/components/common-textfield.js","../../hotel-common-targets/src/components/generate-column.js","../../hotel-common-targets/src/components/detail-list.js","../../hotel-common-targets/src/style.js","../../hotel-common-targets/src/grid-target-base.js","../../hotel-common-targets/src/advanced-booking-window-target-setting/basic-config.js","../../hotel-common-targets/src/advanced-booking-window-target-setting/index.js","../../hotel-common-targets/src/check-in-day-target-setting/basic-config.js","../../hotel-common-targets/src/check-in-day-target-setting/index.js","../../hotel-common-targets/src/user-set-dates-target-setting/basic-config.js","../../hotel-common-targets/src/user-set-dates-target-setting/index.js","../../hotel-common-targets/src/check-in-date-target-setting/basic-config.js","../../hotel-common-targets/src/check-in-date-target-setting/index.js","../../hotel-common-targets/src/length-of-stay-target-setting/basic-config.js","../../hotel-common-targets/src/length-of-stay-target-setting/index.js","../../hotel-common-targets/src/device-target-setting/basic-config.js","../../hotel-common-targets/src/device-target-setting/index.js","../../hotel-common-targets/src/location-target-setting/basic-config.js","../../hotel-common-targets/src/location-target-setting/grid.js","../../hotel-common-targets/src/location-target-setting/index.js","../../hotel-common-targets/src/location-target-setting/data-converter.js","../../hotel-common-upsert/src/components/shared.js","../../hotel-common-upsert/src/components/ad-schedule/ad-schedule.js","../../hotel-common-upsert/src/components/override-error.js","../../hotel-common-upsert/src/utility.js","../../hotel-common-upsert/src/components/audience-ads/utility.js","../../hotel-common-upsert/src/components/audience-ads/audience-ads.js","../../hotel-common-upsert/src/components/base-exclusions/base-exclusions.js","../../hotel-common-upsert/src/components/url-options/style.js","../../hotel-common-upsert/src/components/url-options/url-options.js","../../hotel-common-upsert/src/components/ad-format/ad-format.js","../../../../hotel-center/packages/hotel-center-shared/src/account-information-view/account-information-view-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/bid-cap-view/bid-cap-view-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/bid-multipliers-view-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/check-in-day/view-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/device-type/view-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/length-of-stay/view-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/single-multiplier-view/view-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/bid-multipliers-view/user-country/view-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/bid-strategy-view/bid-strategy-view-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/dropdown-search-selector/dropdown-search-selector-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/dropdown-search-selector/option-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/dropdown-search-selector/pagination-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/dropdown-search-selector/search-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/dropdown-search-selector/selector-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/edit-panel-view/edit-panel-view-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/hotel-group-information-view/information-template.pug","../../../../hotel-center/packages/hotel-center-shared/src/template/toolbar-template.pug","../../hotel-column-chooser/src/style.js","../../hotel-column-chooser/src/BackboneWrapper.js","../../hotel-column-chooser/src/ColumnChooser.tsx","../../hotel-column-chooser/src/RemoveDialog.tsx","../../hotel-column-chooser/src/useColumnChooser.tsx"],"sourcesContent":["import $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport { FilterEntity } from '@bingads-webui/filter-entity';\r\n\r\nexport const getBulkEditParams = ({ state }) => {\r\n if (!state) {\r\n return {};\r\n }\r\n const getDateRange = () => {\r\n try {\r\n const dateRange = state.get('$daterange');\r\n const startdate = (dateRange.start || dateRange.RangeStartDate).toISOString();\r\n const enddate = (dateRange.end || dateRange.RangeEndDate).toISOString();\r\n\r\n return `startdate=${startdate}&enddate=${enddate}`;\r\n } catch (e) {\r\n return '';\r\n }\r\n };\r\n\r\n const mergeStrFilter = (str1, str2) => {\r\n if (_.isEmpty(str1)) {\r\n return str2;\r\n }\r\n if (_.isEmpty(str2)) {\r\n return str1;\r\n }\r\n return [str1, str2].join(' and ');\r\n };\r\n\r\n const getQueryString = ({\r\n selectionCount,\r\n selectedIds,\r\n idAttribute,\r\n filter,\r\n customStrFilter,\r\n isPreview,\r\n }) => {\r\n const queryArray = [];\r\n let strFilter = '';\r\n\r\n // When preview, select ids on current page only.\r\n // selectionCount === selectedIds.length indicates cross page select all not checked\r\n if (isPreview || selectionCount <= selectedIds.length) {\r\n strFilter = _.chain(selectedIds)\r\n .map(id => `${idAttribute} eq '${id}'`)\r\n .join(' or ')\r\n .value();\r\n } else if (filter) {\r\n strFilter = new FilterEntity(filter.query, {\r\n entitySchema: _.result(filter, 'options.entitySchema'),\r\n odata: _.omit(filter.options, 'entitySchema'),\r\n }).odataV4();\r\n }\r\n strFilter = mergeStrFilter(strFilter, customStrFilter);\r\n if (!_.isEmpty(strFilter)) {\r\n strFilter = $.param({ $filter: `(${strFilter})` });\r\n }\r\n queryArray.push(strFilter);\r\n queryArray.push(getDateRange());\r\n\r\n return _.chain(queryArray)\r\n .compact()\r\n .join('&')\r\n .value();\r\n };\r\n\r\n\r\n const getDescription = (selectionCount) => {\r\n const description = {\r\n idsCount: selectionCount,\r\n };\r\n\r\n return JSON.stringify(description);\r\n };\r\n\r\n const bulkEditParams = ({\r\n selectionCount,\r\n selectedIds,\r\n idAttribute = 'Id',\r\n filter,\r\n customStrFilter,\r\n batchActions,\r\n entity,\r\n campaignId = null,\r\n adgroupId = null,\r\n isPreview,\r\n }) => ({\r\n BatchAction: batchActions,\r\n Description: getDescription(selectionCount),\r\n Entity: entity,\r\n Selection: {\r\n QueryString: getQueryString({\r\n selectionCount,\r\n selectedIds,\r\n idAttribute,\r\n filter,\r\n customStrFilter,\r\n isPreview,\r\n }),\r\n CampaignId: campaignId,\r\n AdGroupId: adgroupId,\r\n },\r\n });\r\n\r\n return {\r\n bulkEditParams,\r\n };\r\n};\r\n","export const getGridOptionUtils = ({ edm, state }) => {\r\n if (!edm || !state) {\r\n return {};\r\n }\r\n const getEntitySetInSubAccount = () => {\r\n const subAccountId = state.get('subAccount_id');\r\n\r\n if (subAccountId) {\r\n return edm.currentAccount.SubAccounts.$withKey(subAccountId);\r\n }\r\n return edm.currentAccount;\r\n };\r\n\r\n const getEntitySetByScope = (scope) => {\r\n if (scope === 'account') {\r\n return edm.currentAccount;\r\n } else if (scope === 'subAccount') {\r\n return getEntitySetInSubAccount();\r\n } else if (scope === 'hotelGroup') {\r\n const hotelDrillDown = state.get('hotelGroup_drillDown');\r\n\r\n if (hotelDrillDown && hotelDrillDown.hotelGroupId) {\r\n return edm.currentAccount\r\n .SubAccounts.$withKey(hotelDrillDown.subAccountId)\r\n .HotelGroups.$withKey(hotelDrillDown.hotelGroupId);\r\n }\r\n return getEntitySetInSubAccount();\r\n }\r\n return null;\r\n };\r\n\r\n // name indicate the entitySet name\r\n const getEntitySetByName = (name, scope = 'subAccount') => {\r\n if (name === 'subAccount') {\r\n return edm.currentAccount.SubAccounts;\r\n } else if (name === 'hotelGroup') {\r\n return getEntitySetByScope(scope).HotelGroups;\r\n } else if (name === 'hotel') {\r\n return getEntitySetByScope(scope).Hotels;\r\n }\r\n return edm.currentAccount;\r\n };\r\n\r\n const getUrlWithSubAccountState = () => {\r\n const subAccountId = state.get('subAccount_id');\r\n\r\n if (subAccountId && subAccountId !== '') {\r\n return `/Customers(:advertisercustomer_id)/Accounts(:account_id)/SubAccounts('${subAccountId}')/`;\r\n }\r\n return '/Customers(:advertisercustomer_id)/Accounts(:account_id)/';\r\n };\r\n\r\n const getUrlByName = (name) => {\r\n if (name === 'associations') {\r\n const url = getUrlWithSubAccountState();\r\n\r\n return `${url}Associations?`;\r\n }\r\n return '';\r\n };\r\n\r\n return {\r\n gridOptionUtils: {\r\n getUrlByName,\r\n getEntitySetByName,\r\n },\r\n };\r\n};\r\n","import { getAccountService } from './src/account-service';\r\nimport { getBulkEditParams } from './src/bulk-edit-params';\r\nimport { getBulkEditService } from './src/bulk-edit-service';\r\nimport { getGridOptionUtils } from './src/grid-option-utils';\r\n\r\nexport const getHotelCenterService = ({\r\n state, jsdata, edm, dataStore,\r\n} = {}) => ({\r\n ...getAccountService({ state, jsdata, edm }),\r\n ...getBulkEditParams({ state }),\r\n ...getBulkEditService({ dataStore }),\r\n ...getGridOptionUtils({ edm, state }),\r\n});\r\n","import Backbone from 'backbone';\r\nimport Promise from 'bluebird';\r\nimport _ from 'underscore';\r\n\r\nexport const getAccountService = ({ state, jsdata, edm }) => {\r\n if (!state || !jsdata || !edm) {\r\n return {};\r\n }\r\n /**\r\n * Class representing a AccountService for HotelCenter\r\n * @extends Backbone.Model\r\n */\r\n class AccountService extends Backbone.Model {\r\n fetchSubAccountAsync() {\r\n const currentSubAccountId = state.get('subAccount_id');\r\n const subAccountModel = state.get('subAccount_model');\r\n\r\n if (subAccountModel && subAccountModel.Id === currentSubAccountId) {\r\n return new Promise((resolve) => {\r\n resolve(subAccountModel);\r\n });\r\n } else if (currentSubAccountId && currentSubAccountId !== '') {\r\n // if the subAccountId don't equal to current subAccountId\r\n // fetch the new result\r\n return this.fetchSubAccountById(currentSubAccountId);\r\n }\r\n\r\n // when all subaccounts is selcted ,subaccount Id will be ''\r\n state.unset('subAccount_model');\r\n return new Promise((resolve) => {\r\n resolve(_.noop());\r\n });\r\n }\r\n\r\n fetchSubAccountById(subAccountId) {\r\n return jsdata.SubAccount\r\n .find(subAccountId, {\r\n entitySet: edm.currentAccount.SubAccounts,\r\n cacheResponse: false,\r\n bypassCache: true,\r\n })\r\n .then((subAccount) => {\r\n if (subAccount) {\r\n state.set('subAccount_model', subAccount);\r\n }\r\n\r\n return state.get('subAccount_model');\r\n });\r\n }\r\n }\r\n return {\r\n AccountService,\r\n };\r\n};\r\n","import _ from 'underscore';\r\n\r\nexport const getBulkEditService = ({ dataStore: DataStore }) => {\r\n if (!DataStore) {\r\n return {};\r\n }\r\n const pollStatus = (taskId, successCb, failedCb) => {\r\n DataStore.BulkEditSession.find(taskId, { cacheResponse: false }).then((response) => {\r\n successCb(response);\r\n })\r\n .catch(failedCb);\r\n };\r\n\r\n const processResponse = (completeCB, failedCB, progressCB, response) => {\r\n if (_.contains(['Completed', 'CompletedWithErrors'], response.Status)) {\r\n completeCB(response);\r\n } else if (_.contains(['Failed', 'Aborted', 'Expired'], response.Status)) {\r\n failedCB(response);\r\n } else { // task is inprogress or pending\r\n progressCB(response);\r\n setTimeout(\r\n _.partial(\r\n pollStatus,\r\n response.Id,\r\n _.partial(processResponse, completeCB, failedCB, progressCB),\r\n failedCB\r\n ),\r\n 500\r\n );\r\n }\r\n return response;\r\n };\r\n\r\n /*\r\n * @param {Object} options\r\n * @param {Object} options.params\r\n * @param {function} options.progressCB\r\n * @param {function} options.completeCB\r\n * @param {function} options.failedCB\r\n * @param {boolean} preview\r\n */\r\n const bulkEdit = ({\r\n params,\r\n completeCB = _.noop,\r\n failedCB = _.noop,\r\n progressCB = _.noop,\r\n }, preview = false) => {\r\n const process = preview ?\r\n _.identity :\r\n _.partial(processResponse, completeCB, failedCB, progressCB);\r\n const urlParameters = { $expand: 'BulkEditResults' };\r\n\r\n if (preview) {\r\n urlParameters.preview = true;\r\n }\r\n return DataStore.BulkEditSession\r\n .create(params, {\r\n urlParameters,\r\n cacheResponse: false,\r\n })\r\n .then(process)\r\n .catch(failedCB);\r\n };\r\n\r\n const save = options => bulkEdit(options);\r\n const preview = options => bulkEdit(options, true);\r\n\r\n return {\r\n bulkEditService: {\r\n save,\r\n preview,\r\n },\r\n };\r\n};\r\n","/* eslint-disable max-len */\r\n\r\nimport $ from 'jquery';\r\n\r\nlet isLightDismissibleInitialized = false;\r\n\r\n/*\r\n Light Dismissible controller can help the element to be light dismissed when clicked else where.\r\n Give the target grid class name of \"light-dismissible\" and importing this function should do the job.\r\n\r\n Currently, it works element that can be toggled with either \"hide\" or \"show\" class.\r\n\r\n NOTE: If the element that toggles the visibility is outside of the target light dismissible element,\r\n clicked the toggle button will invoke this function to dismiss the target.\r\n\r\n For this, give e.originalEvent.noDismiss to the target class name.\r\n*/\r\nexport default () => {\r\n if (!isLightDismissibleInitialized) {\r\n $(window).click((e) => {\r\n const $lightDismissibles = $('.light-dismissible');\r\n\r\n if ($lightDismissibles.length === 0) {\r\n return;\r\n }\r\n\r\n const clickedEl = $(e.target);\r\n\r\n $lightDismissibles.each((index) => {\r\n if (clickedEl.closest($lightDismissibles[index]).length === 0) {\r\n if (e.originalEvent && e.originalEvent.noDismiss) {\r\n if ($($lightDismissibles[index]).hasClass(e.originalEvent.noDismiss)) {\r\n return;\r\n }\r\n }\r\n\r\n if (!$($lightDismissibles[index]).hasClass('hide')) {\r\n $($lightDismissibles[index]).addClass('hide');\r\n }\r\n\r\n if ($($lightDismissibles[index]).hasClass('show')) {\r\n $($lightDismissibles[index]).removeClass('show');\r\n }\r\n }\r\n });\r\n });\r\n\r\n isLightDismissibleInitialized = true;\r\n }\r\n};\r\n","import _ from 'underscore';\r\nimport { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport { BackboneSchema as backboneSchema } from '@bingads-webui/backbone-schema';\r\nimport { InputControl } from '@bingads-webui/input-control';\r\nimport template from './view-template.pug';\r\n\r\nexport const getBidMultiplierView = ({ i18n, pageContext, multiplierSchema }) => {\r\n /**\r\n * Shared view for Hotel Ads Bid Multiplier\r\n * @extends DeterministicView\r\n */\r\n class BidMultiplierView extends DeterministicView {\r\n initialize(options) {\r\n const editStrategy = {\r\n increase: 'increase',\r\n decrease: 'decrease',\r\n };\r\n\r\n const strategy = options.strategy || editStrategy.increase;\r\n\r\n this.i18n = i18n;\r\n this.type = options.type;\r\n this.value = options.value;\r\n this.text = options.text;\r\n\r\n this.factorModel = this.initFactorInput('factor-input', strategy);\r\n\r\n this.setState({\r\n strategy,\r\n // getState will map '' and undefined to null\r\n // here just map null to _.noop() since there only have undefined check when setState\r\n // and also we show keep '0' work for clear situation\r\n factor: options.factor === null ? _.noop() : options.factor,\r\n });\r\n }\r\n\r\n get events() {\r\n return {\r\n 'change .select-strategy': ({ target }) => {\r\n this.setState({\r\n strategy: target.value,\r\n });\r\n },\r\n };\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n getState() {\r\n return {\r\n type: this.type,\r\n value: this.value,\r\n isValid: this.getChild('factor-input').getState().isValid,\r\n factor: this.getFactor(this.model.get('strategy'), this.factorModel.toJSON()),\r\n percentage: this.factorModel.toJSON() ? this.factorModel.toJSON().Factor : '',\r\n };\r\n }\r\n\r\n setState({\r\n strategy,\r\n factor,\r\n isUseParent,\r\n }) {\r\n if (!_.isUndefined(isUseParent)) {\r\n this.model.set({ isUseParent });\r\n this.getChild('factor-input').setState({ readonly: isUseParent });\r\n }\r\n\r\n if (strategy && strategy !== this.model.get('strategy')) {\r\n this.model.set({ strategy });\r\n this.factorModel = this.initFactorInput('factor-input', strategy);\r\n }\r\n\r\n if (!_.isUndefined(factor)) {\r\n // formatDecimal will ignore fraction by default\r\n const value = _.isNumber(factor) ? i18n.formatDecimal(\r\n factor,\r\n { minimumFractionDigits: 0, maximumFractionDigits: 1 }\r\n ) : factor;\r\n\r\n this.factorModel.set('Factor', value);\r\n this.getChild('factor-input').setState({ value });\r\n this.trigger('input-changed');\r\n }\r\n\r\n return this;\r\n }\r\n\r\n getFactor(editStrategy, factorModel) {\r\n const factor = factorModel.Factor;\r\n\r\n if (factor === null) {\r\n return _.noop();\r\n }\r\n let num = Number(factor) / 100;\r\n\r\n if (editStrategy === 'increase') {\r\n num += 1;\r\n } else {\r\n num = 1 - num;\r\n }\r\n // here we need to format decimal firstly to restrict the fraction from 1-3\r\n // mt only support fraction with 1-3\r\n // and we want to keep what user input instead of a fix fraction\r\n const formatDecimal =\r\n i18n.formatDecimal(num, { minimumFractionDigits: 1, maximumFractionDigits: 3 });\r\n // we need to parse decimal here since formatDecimal involve the locale information\r\n return i18n.parseDecimal(formatDecimal).toString();\r\n }\r\n\r\n initFactorInput(inputView, editStrategy) {\r\n const schema = multiplierSchema;\r\n\r\n if (editStrategy === 'increase') {\r\n _.extend(schema.properties.Factor, { minimum: 0, maximum: 1000 });\r\n } else {\r\n _.extend(schema.properties.Factor, { minimum: 0, maximum: 100 });\r\n }\r\n const FactorModel = backboneSchema(\r\n schema, i18n, ['Factor', '@odata.type'], null,\r\n {\r\n Factor: {\r\n validation: (validation) => {\r\n validation.decimalLength.decimalLength = 1; // eslint-disable-line\r\n return validation;\r\n },\r\n },\r\n }\r\n );\r\n\r\n const factorModel = new FactorModel();\r\n\r\n factorModel.set('Factor', '');\r\n\r\n const factorInput = new InputControl({\r\n entity: factorModel,\r\n field: 'Factor',\r\n addonText: pageContext.DecimalFormatter.percentSymbol,\r\n ariaLabel: i18n.getString('HotelCenter_Overview_Multipliers_Bids_Factor_Label'),\r\n });\r\n\r\n this.setChild(inputView, factorInput);\r\n\r\n return factorModel;\r\n }\r\n }\r\n\r\n return {\r\n BidMultiplierView,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport { getHotelCenterUtils } from '@bingads-webui-campaign/hotel-center-utils';\r\nimport template from './bid-multipliers-view-template.pug';\r\nimport { getUserCountryMultipliersView } from './user-country/view';\r\nimport { getDeviceTypeMultipliersView } from './device-type/view';\r\nimport { getCheckInDayMultipliersView } from './check-in-day/view';\r\nimport { getLengthOfStayMultipliersView } from './length-of-stay/view';\r\nimport { getBidMultiplierView } from './single-multiplier-view/view';\r\n\r\nexport const getBidMultipliersView = ({\r\n i18n, state: componentState, pageContext, multiplierSchema,\r\n}) => {\r\n if (!i18n || !componentState || !pageContext || !multiplierSchema) {\r\n return {};\r\n }\r\n const { bidMultiplierUtils } = getHotelCenterUtils({ i18n, state: componentState });\r\n const { getMultipliersState } = bidMultiplierUtils;\r\n const { CheckInDayMultipliersView } =\r\n getCheckInDayMultipliersView({\r\n i18n, state: componentState, pageContext, multiplierSchema,\r\n });\r\n const { DeviceTypeMultipliersView } =\r\n getDeviceTypeMultipliersView({\r\n i18n, state: componentState, pageContext, multiplierSchema,\r\n });\r\n const { LengthOfStayMultipliersView } =\r\n getLengthOfStayMultipliersView({\r\n i18n, state: componentState, pageContext, multiplierSchema,\r\n });\r\n const { BidMultiplierView } =\r\n getBidMultiplierView({ i18n, pageContext, multiplierSchema });\r\n const { UserCountryMultipliersView } =\r\n getUserCountryMultipliersView({\r\n i18n, state: componentState, pageContext, multiplierSchema,\r\n });\r\n /**\r\n * Shared view for Hotel Ads Bid Multipliers\r\n * @extends DeterministicView\r\n */\r\n const deviceTypes = ['Mobile', 'Tablet', 'Desktop'];\r\n const checkInDays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];\r\n\r\n class BidMultipliersView extends DeterministicView {\r\n initialize({\r\n showUseParent = true,\r\n isPayPerStay = false,\r\n isPayPerStayPhase2Pilot = false,\r\n }) {\r\n this.i18n = i18n;\r\n this.showUseParent = showUseParent;\r\n this.deviceTypeMultipliersView = new DeviceTypeMultipliersView();\r\n this.dateTypeMultipliersView = new DeviceTypeMultipliersView({\r\n listOfTypes: {\r\n Selected: 'HotelCenter_Overview_DateType_Multipliers_Selected_Label',\r\n Default: 'HotelCenter_Overview_DateType_Multipliers_Default_Label',\r\n },\r\n type: 'dateType',\r\n });\r\n this.isHotelPropertyPromotionAdEnabled =\r\n pageContext.Permissions.IsHotelPropertyPromotionAdEnabled;\r\n this.siteTypeMultipliersView = new DeviceTypeMultipliersView({\r\n listOfTypes: {\r\n LocalUniversal: 'HotelCenter_Overview_SiteType_Multipliers_Local_Universal_Label',\r\n MapResults: 'HotelCenter_Overview_SiteType_Multipliers_Map_Results_Label',\r\n ...(this.isHotelPropertyPromotionAdEnabled ? { PropertyPromotionAd: 'HotelCenter_Overview_SiteType_Multipliers_Property_PromotionAd_Label' } : {}),\r\n },\r\n type: 'siteType',\r\n });\r\n this.userCountryMultipliersView = new UserCountryMultipliersView();\r\n this.lengthOfStayMultipliersView = new LengthOfStayMultipliersView();\r\n this.advancedBookingMultipliersView = new LengthOfStayMultipliersView({\r\n minNumberOfNights: 0,\r\n maxNumberOfNights: 180,\r\n type: 'advancedBooking',\r\n });\r\n this.checkInDayMultipliersView = new CheckInDayMultipliersView();\r\n this.setChild('device-type-multipliers', this.deviceTypeMultipliersView);\r\n this.setChild('date-type-multipliers', this.dateTypeMultipliersView);\r\n this.setChild('site-type-multipliers', this.siteTypeMultipliersView);\r\n this.setChild('user-country-multipliers', this.userCountryMultipliersView);\r\n this.setChild('length-of-stay-multipliers', this.lengthOfStayMultipliersView);\r\n this.setChild('check-in-day-multipliers', this.checkInDayMultipliersView);\r\n this.setChild('advanced-booking-multipliers', this.advancedBookingMultipliersView);\r\n this.setState({\r\n selectedMultiplierType: 'deviceType',\r\n isPayPerStay,\r\n isPayPerStayPhase2Pilot,\r\n });\r\n this.setState({ errors: [] });\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .bid-multipliers-panel li': ({ target }) => {\r\n this.setState({\r\n selectedMultiplierType: target.dataset.type,\r\n });\r\n },\r\n 'click .bid-multipliers-use-parent input[type=checkbox]': ({ target }) => {\r\n const isUseParent = target.checked;\r\n\r\n this.setState({ isUseParent });\r\n this.trigger('update:isUseParent', isUseParent);\r\n },\r\n };\r\n }\r\n\r\n setState({\r\n selectedMultiplierType,\r\n bidMultipliers,\r\n isUseParent,\r\n errors,\r\n isPayPerStay,\r\n isPayPerStayPhase2Pilot,\r\n }) {\r\n if (!_.isUndefined(isPayPerStay)) {\r\n this.model.set({ isPayPerStay });\r\n }\r\n if (!_.isUndefined(isPayPerStayPhase2Pilot)) {\r\n this.model.set({ isPayPerStayPhase2Pilot });\r\n }\r\n\r\n if (!_.isUndefined(isUseParent)) {\r\n this.model.set({ isUseParent });\r\n this.getChild('device-type-multipliers').setState({ isUseParent });\r\n this.getChild('date-type-multipliers').setState({ isUseParent });\r\n this.getChild('site-type-multipliers').setState({ isUseParent });\r\n this.getChild('user-country-multipliers').setState({ isUseParent });\r\n this.getChild('check-in-day-multipliers').setState({ isUseParent });\r\n this.getChild('length-of-stay-multipliers').setState({ isUseParent });\r\n this.getChild('advanced-booking-multipliers').setState({ isUseParent });\r\n }\r\n if (selectedMultiplierType && !this.model.get('isUseParent')) {\r\n this.model.set({ selectedMultiplierType });\r\n }\r\n if (!_.isEmpty(bidMultipliers)) {\r\n // set deviceType\r\n this.getChild('device-type-multipliers').setState(bidMultipliers.deviceType);\r\n\r\n // set dateType\r\n this.getChild('date-type-multipliers').setState(bidMultipliers.dateType);\r\n\r\n // set siteType\r\n this.getChild('site-type-multipliers').setState(bidMultipliers.siteType);\r\n\r\n // set userCountry\r\n const state = this.userCountryMultipliersView\r\n .getSelectedCountriesMulti(bidMultipliers.userCountry || {});\r\n\r\n this.getChild('user-country-multipliers').setState(state);\r\n\r\n // set checkInDay\r\n this.getChild('check-in-day-multipliers').setState(bidMultipliers.checkInDay);\r\n\r\n // set lengthOfStay\r\n this.getChild('length-of-stay-multipliers').setState({ staySegments: bidMultipliers.lengthOfStay || [] });\r\n\r\n // set advancedBooking\r\n this.getChild('advanced-booking-multipliers').setState({ staySegments: bidMultipliers.advancedBooking || [] });\r\n\r\n this.model.set({ selectedMultiplierType: this.model.attributes.selectedMultiplierType });\r\n }\r\n\r\n if (errors) {\r\n this.model.set({ errors });\r\n }\r\n\r\n return this;\r\n }\r\n\r\n getBidMultipliers(bidMultipliers) {\r\n let res = [];\r\n\r\n _.each(bidMultipliers, (item) => {\r\n res = res.concat(item.bidMultipliers);\r\n });\r\n return res;\r\n }\r\n\r\n getState() {\r\n const isUseParent = this.model.get('isUseParent');\r\n const bidMultipliers = [];\r\n\r\n if (isUseParent) {\r\n return {\r\n isValid: true,\r\n bidMultipliers: [],\r\n };\r\n }\r\n\r\n bidMultipliers.push(this.getChild('device-type-multipliers').getState());\r\n bidMultipliers.push(this.getChild('date-type-multipliers').getState());\r\n bidMultipliers.push(this.getChild('site-type-multipliers').getState());\r\n bidMultipliers.push(this.getChild('user-country-multipliers').getState());\r\n bidMultipliers.push(this.getChild('check-in-day-multipliers').getState());\r\n bidMultipliers.push(this.getChild('length-of-stay-multipliers').getState());\r\n bidMultipliers.push(this.getChild('advanced-booking-multipliers').getState());\r\n const errors = _.chain(bidMultipliers)\r\n .pluck('errors')\r\n .flatten()\r\n .compact()\r\n .value();\r\n this.setState({ errors });\r\n\r\n if (_.findWhere(bidMultipliers, { isValid: false })) {\r\n return {\r\n isValid: false,\r\n bidMultipliers: _.noop(),\r\n };\r\n }\r\n\r\n return {\r\n isValid: true,\r\n bidMultipliers: this.getBidMultipliers(bidMultipliers),\r\n };\r\n }\r\n\r\n clean() {\r\n const state = this.getState();\r\n let bidMultipliers;\r\n\r\n if (state.isValid) {\r\n bidMultipliers = getMultipliersState(state.bidMultipliers, true);\r\n }\r\n\r\n // to set mobile as 0 to in case bid multipliers covered by its father node\r\n // when there is no data\r\n if (!bidMultipliers || (_.isEmpty(bidMultipliers.checkInDay) &&\r\n _.isEmpty(bidMultipliers.deviceType) &&\r\n _.isEmpty(bidMultipliers.lengthOfStay) &&\r\n _.isEmpty(bidMultipliers.userCountry) &&\r\n _.isEmpty(bidMultipliers.dateType) &&\r\n _.isEmpty(bidMultipliers.siteType) &&\r\n _.isEmpty(bidMultipliers.advancedBooking))) {\r\n _.extend(bidMultipliers, {\r\n deviceType: {\r\n Mobile: {\r\n factor: 0,\r\n },\r\n },\r\n });\r\n }\r\n\r\n this.setState({ bidMultipliers });\r\n }\r\n\r\n emptyDeviceTypeAndCheckInDay() {\r\n const bidMultipliers = {\r\n deviceType: _.reduce(deviceTypes, (memo, item) =>\r\n _.extend(memo, {\r\n [item]: { factor: '' },\r\n }), {}),\r\n checkInDay: _.reduce(checkInDays, (memo, item) =>\r\n _.extend(memo, {\r\n [item]: { factor: '' },\r\n }), {}),\r\n };\r\n\r\n this.setState({ bidMultipliers });\r\n }\r\n }\r\n\r\n return {\r\n BidMultipliersView,\r\n BidMultiplierView,\r\n UserCountryMultipliersView,\r\n DeviceTypeMultipliersView,\r\n CheckInDayMultipliersView,\r\n LengthOfStayMultipliersView,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport { getHotelCenterUtils } from '@bingads-webui-campaign/hotel-center-utils';\r\nimport template from './view-template.pug';\r\nimport { getBidMultiplierView } from '../single-multiplier-view/view';\r\n\r\nexport const getCheckInDayMultipliersView = ({\r\n i18n, state, pageContext, multiplierSchema,\r\n}) => {\r\n const { bidMultiplierUtils } = getHotelCenterUtils({ i18n, state });\r\n const { BidMultiplierView } = getBidMultiplierView({ i18n, pageContext, multiplierSchema });\r\n const {\r\n serializeBidMultipliers,\r\n weekDayMap,\r\n } = bidMultiplierUtils;\r\n\r\n /**\r\n * Shared view for Hotel Ads bid strategy setup section\r\n * @extends DeterministicView\r\n */\r\n\r\n class CheckInDayMultipliersView extends DeterministicView {\r\n initialize() {\r\n _.each(_.keys(weekDayMap), (key) => {\r\n this.setChild(`${key.toLowerCase()}-bid-multiplier`, this.getBidMultiplierView({\r\n value: key,\r\n text: i18n.getString(weekDayMap[key]),\r\n }));\r\n });\r\n }\r\n\r\n getBidMultiplierView(options) {\r\n const view = new BidMultiplierView({\r\n type: 'checkInDay',\r\n value: options.value,\r\n text: options.text,\r\n });\r\n\r\n return view;\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n getState() {\r\n const checkInDayMultipliersState = [];\r\n\r\n _.each(_.keys(weekDayMap), (key) => {\r\n checkInDayMultipliersState.push(this.getChild(`${key.toLowerCase()}-bid-multiplier`).getState());\r\n });\r\n\r\n if (_.findWhere(checkInDayMultipliersState, { isValid: false })) {\r\n return {\r\n isValid: false,\r\n bidMultipliers: _.noop(),\r\n };\r\n }\r\n\r\n return {\r\n isValid: true,\r\n bidMultipliers: serializeBidMultipliers(checkInDayMultipliersState),\r\n };\r\n }\r\n\r\n setState(options = {}) {\r\n const { isUseParent } = options;\r\n\r\n if (!_.isUndefined(isUseParent)) {\r\n _.each(_.keys(weekDayMap), (key) => {\r\n this.getChild(`${key.toLowerCase()}-bid-multiplier`).setState({ isUseParent });\r\n });\r\n }\r\n\r\n _.each(_.keys(weekDayMap), (key) => {\r\n if (options &&\r\n options[key] &&\r\n (options[key].strategy || !_.isUndefined(options[key].factor))) {\r\n this.getChild(`${key.toLowerCase()}-bid-multiplier`).setState({\r\n strategy: options[key].strategy,\r\n factor: options[key].factor,\r\n });\r\n }\r\n });\r\n\r\n return this;\r\n }\r\n }\r\n\r\n return {\r\n CheckInDayMultipliersView,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport { getHotelCenterUtils } from '@bingads-webui-campaign/hotel-center-utils';\r\nimport template from './view-template.pug';\r\nimport { getBidMultiplierView } from '../single-multiplier-view/view';\r\n\r\nexport const getDeviceTypeMultipliersView = ({\r\n i18n, state, pageContext, multiplierSchema,\r\n}) => {\r\n const { bidMultiplierUtils } = getHotelCenterUtils({ i18n, state });\r\n const { BidMultiplierView } = getBidMultiplierView({ i18n, pageContext, multiplierSchema });\r\n\r\n const { serializeBidMultipliers } = bidMultiplierUtils;\r\n\r\n /**\r\n * Shared view for Hotel Ads bid strategy setup section\r\n * @extends DeterministicView\r\n */\r\n\r\n const deviceTypeMap = {\r\n Mobile: 'HotelCenter_Overview_Multipliers_Bids_Mobile_Label',\r\n Tablet: 'HotelCenter_Overview_Multipliers_Bids_Tablet_Label',\r\n Desktop: 'HotelCenter_Overview_Multipliers_Bids_Desktop_Label',\r\n };\r\n\r\n class DeviceTypeMultipliersView extends DeterministicView {\r\n initialize(options) {\r\n this.listOfTypes = options.listOfTypes || deviceTypeMap;\r\n this.type = options.type || 'deviceType';\r\n\r\n _.each(this.listOfTypes, (i18nKey, type) => {\r\n this.setChild(`${type.toLowerCase()}-bid-multiplier`, this.getBidMultiplierView({\r\n value: type,\r\n text: i18n.getString(i18nKey),\r\n }));\r\n });\r\n }\r\n\r\n getBidMultiplierView(options) {\r\n const view = new BidMultiplierView({\r\n type: this.type,\r\n value: options.value,\r\n text: options.text,\r\n });\r\n\r\n return view;\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n getState() {\r\n const deviceMultipliersState = [];\r\n\r\n _.each(_.keys(this.listOfTypes), (key) => {\r\n deviceMultipliersState.push(this.getChild(`${key.toLowerCase()}-bid-multiplier`).getState());\r\n });\r\n\r\n if (_.findWhere(deviceMultipliersState, { isValid: false })) {\r\n return {\r\n isValid: false,\r\n bidMultipliers: _.noop(),\r\n };\r\n }\r\n\r\n return {\r\n isValid: true,\r\n bidMultipliers: serializeBidMultipliers(deviceMultipliersState),\r\n };\r\n }\r\n\r\n setState(options = {}) {\r\n const { isUseParent } = options;\r\n\r\n if (!_.isUndefined(isUseParent)) {\r\n _.each(_.keys(this.listOfTypes), (key) => {\r\n this.getChild(`${key.toLowerCase()}-bid-multiplier`).setState({ isUseParent });\r\n });\r\n }\r\n\r\n _.each(_.keys(this.listOfTypes), (key) => {\r\n if (options &&\r\n options[key] &&\r\n (options[key].strategy || !_.isUndefined(options[key].factor))) {\r\n this.getChild(`${key.toLowerCase()}-bid-multiplier`).setState({\r\n strategy: options[key].strategy,\r\n factor: options[key].factor,\r\n });\r\n }\r\n });\r\n\r\n return this;\r\n }\r\n }\r\n\r\n return {\r\n DeviceTypeMultipliersView,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport { BackboneSchema as backboneSchema } from '@bingads-webui/backbone-schema';\r\nimport { getHotelCenterUtils } from '@bingads-webui-campaign/hotel-center-utils';\r\nimport { InputControl } from '@bingads-webui/input-control';\r\nimport template from './view-template.pug';\r\nimport { getBidMultiplierView } from '../single-multiplier-view/view';\r\n\r\nexport const getLengthOfStayMultipliersView = ({\r\n i18n, state: componentState, pageContext, multiplierSchema,\r\n}) => {\r\n const { bidMultiplierUtils } = getHotelCenterUtils({ i18n, state: componentState });\r\n const { BidMultiplierView } = getBidMultiplierView({ i18n, pageContext, multiplierSchema });\r\n\r\n const {\r\n serializeBidMultipliers,\r\n formatStaySegments,\r\n } = bidMultiplierUtils;\r\n\r\n /**\r\n * Shared view for Hotel Ads length of stay bid multiplier\r\n * @extends DeterministicView\r\n */\r\n class LengthOfStayMultipliersView extends DeterministicView {\r\n initialize(options) {\r\n this.i18n = i18n;\r\n this.minNumberOfNights = _.isUndefined(options.minNumberOfNights) ?\r\n 1 : options.minNumberOfNights;\r\n this.maxNumberOfNights = options.maxNumberOfNights || 14;\r\n this.staySegments = [];\r\n this.nightsModel = this.initNightsInput('stay-nights-input');\r\n this.setState({\r\n staySegments: this.staySegments,\r\n });\r\n this.type = options.type || 'lengthOfStay';\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .add-new-query': () => {\r\n if (this.model.get('isUseParent')) {\r\n return;\r\n }\r\n this.addNewSegment();\r\n },\r\n 'click .mulitplier-query-remove .filter-query-remove__glyphicon': ({ target }) => {\r\n if (this.model.get('isUseParent')) {\r\n return;\r\n }\r\n this.removeSegment(target);\r\n },\r\n };\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n initNightsInput(inputView) {\r\n const schema = {\r\n name: 'NightsInput',\r\n type: 'object',\r\n properties: {\r\n MinimumNumberOfNights: {\r\n type: 'integer',\r\n minimum: this.minNumberOfNights,\r\n maximum: this.maxNumberOfNights,\r\n },\r\n },\r\n };\r\n const override = {\r\n MinimumNumberOfNights: {\r\n validation: (validators) => {\r\n const result = validators;\r\n\r\n if (_.has(result, 'decimalLength')) {\r\n result.decimalLength.message = i18n.getString('HotelCenter_Shared_Validation_Require_Integer');\r\n }\r\n return result;\r\n },\r\n },\r\n };\r\n const NightsModel = backboneSchema(schema, i18n, ['MinimumNumberOfNights', '@odata.type'], null, override);\r\n const addonText = this.type === 'lengthOfStay' ? i18n.getString('HotelCenter_Overview_LengthOfStay_Multipliers_InputNights_AddOn_Label') : i18n.getString('HotelCenter_Overview_AdvancedBooking_Multipliers_InputDays_AddOn_Label');\r\n\r\n const nightsModel = new NightsModel();\r\n const nightsInput = new InputControl({\r\n entity: nightsModel,\r\n field: 'MinimumNumberOfNights',\r\n addonText,\r\n });\r\n\r\n this.setChild(inputView, nightsInput);\r\n\r\n return nightsModel;\r\n }\r\n\r\n addNewSegment() {\r\n const state = this.getChild('stay-nights-input').getState();\r\n\r\n if (!state.isValid) {\r\n return;\r\n }\r\n const minNumberOfNights = this.nightsModel.toJSON().MinimumNumberOfNights;\r\n\r\n if (_.isUndefined(minNumberOfNights)) {\r\n return;\r\n }\r\n this.updateUserInputs();\r\n this.addSegmentByMinNumberOfNights(minNumberOfNights);\r\n this.setState({ staySegments: this.staySegments });\r\n }\r\n\r\n removeSegment(target) {\r\n this.updateUserInputs();\r\n this.removeSegmentByMinNumberOfNights(target.title);\r\n this.setState({ staySegments: this.staySegments });\r\n }\r\n\r\n addSegmentByMinNumberOfNights(minNumberOfNights) {\r\n const currentKey = minNumberOfNights.toString();\r\n const currentIndex = _.findIndex(this.staySegments, it => it.key === currentKey);\r\n const newSegment = {\r\n key: currentKey,\r\n factor: _.noop(),\r\n strategy: 'increase',\r\n };\r\n\r\n if (currentIndex > -1) {\r\n this.staySegments.splice(currentIndex, 1, newSegment);\r\n } else {\r\n this.staySegments.push(newSegment);\r\n }\r\n this.staySegments = _.sortBy(this.staySegments, segment => Number(segment.key));\r\n // advanced booking and length of stay share the same view\r\n const isLengthOfStay = this.type === 'lengthOfStay';\r\n\r\n this.staySegments = formatStaySegments(this.staySegments, isLengthOfStay);\r\n }\r\n\r\n removeSegmentByMinNumberOfNights(minNumberOfNights) {\r\n const currentKey = minNumberOfNights.toString();\r\n const currentSegment = _.findWhere(this.staySegments, { key: currentKey });\r\n\r\n this.staySegments = _.difference(this.staySegments, [currentSegment]);\r\n // advanced booking and length of stay share the same view\r\n const isLengthOfStay = this.type === 'lengthOfStay';\r\n\r\n this.staySegments = formatStaySegments(this.staySegments, isLengthOfStay);\r\n }\r\n\r\n setState({ staySegments, isUseParent }) {\r\n if (staySegments) {\r\n _.each(staySegments, (segment) => {\r\n const bidMultiplier = new BidMultiplierView({\r\n text: segment.value,\r\n value: segment.key,\r\n strategy: segment.strategy,\r\n factor: segment.factor,\r\n type: this.type,\r\n });\r\n\r\n this.setChild(`${segment.key}-bid-multiplier`, bidMultiplier);\r\n });\r\n this.staySegments = staySegments;\r\n this.model.set({ staySegments });\r\n this.model.trigger('change');\r\n }\r\n if (!_.isUndefined(isUseParent)) {\r\n this.model.set('isUseParent', isUseParent);\r\n this.getChild('stay-nights-input').setState({ readonly: isUseParent });\r\n _.each(this.staySegments, (segment) => {\r\n this.getChild(`${segment.key}-bid-multiplier`).setState({ isUseParent });\r\n });\r\n }\r\n return this;\r\n }\r\n\r\n updateUserInputs() {\r\n _.each(this.staySegments, (item) => {\r\n item.factor = this.getChild(`${item.key}-bid-multiplier`).getState().percentage; // eslint-disable-line\r\n });\r\n }\r\n\r\n getState() {\r\n const lengthOfStayMultipliersState = [];\r\n\r\n _.each(this.staySegments, (item) => {\r\n lengthOfStayMultipliersState.push(this.getChild(`${item.key}-bid-multiplier`).getState());\r\n });\r\n\r\n if (_.findWhere(lengthOfStayMultipliersState, { isValid: false })) {\r\n return {\r\n isValid: false,\r\n bidMultipliers: _.noop(),\r\n };\r\n }\r\n\r\n const bidMultipliers = serializeBidMultipliers(lengthOfStayMultipliersState);\r\n const stayFactors = _.pluck(bidMultipliers, 'Factor');\r\n let i = 0;\r\n let hasDuplicateMultipliers = false;\r\n\r\n while (i < stayFactors.length - 1) {\r\n if (stayFactors[i] === stayFactors[i + 1]) {\r\n hasDuplicateMultipliers = true;\r\n break;\r\n } else {\r\n i += 1;\r\n }\r\n }\r\n if (hasDuplicateMultipliers) {\r\n return {\r\n isValid: false,\r\n bidMultipliers: _.noop(),\r\n errors: [i18n.getString('HotelCenter_Overview_LengthOfStay_Multipliers_Duplicate')],\r\n };\r\n }\r\n\r\n return {\r\n isValid: true,\r\n bidMultipliers,\r\n };\r\n }\r\n }\r\n return {\r\n LengthOfStayMultipliersView,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport { getHotelCenterUtils } from '@bingads-webui-campaign/hotel-center-utils';\r\nimport template from './view-template.pug';\r\nimport { getBidMultiplierView } from '../single-multiplier-view/view';\r\n\r\nexport const getUserCountryMultipliersView = ({\r\n i18n, state, pageContext, multiplierSchema,\r\n}) => {\r\n const { bidMultiplierUtils } = getHotelCenterUtils({ i18n, state });\r\n const { BidMultiplierView } = getBidMultiplierView({ i18n, pageContext, multiplierSchema });\r\n const { serializeBidMultipliers } = bidMultiplierUtils;\r\n\r\n /**\r\n * Shared view for Hotel Ads User country bid multiplier\r\n * @extends DeterministicView\r\n */\r\n class UserCountryMultipliersView extends DeterministicView {\r\n initialize() {\r\n const countries = state.get('userCountries');\r\n\r\n this.i18n = i18n;\r\n this.selectedCountries = [];\r\n this.chooseCountry = countries.length > 0 ? countries[0].Key : '';\r\n this.restCountries = this.getRestCountries(countries, this.selectedCountries);\r\n this.setState({\r\n selectedCountries: this.selectedCountries,\r\n chooseCountry: this.chooseCountry,\r\n restCountries: this.restCountries,\r\n });\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .add-new-query': () => {\r\n if (this.model.get('isUseParent')) {\r\n return;\r\n }\r\n if (this.chooseCountry) {\r\n const chooseCountry = _.findWhere(this.restCountries, { Key: this.chooseCountry });\r\n\r\n this.updateUserInputs();\r\n this.selectedCountries.push(chooseCountry);\r\n this.restCountries = this.getRestCountries(this.restCountries, [chooseCountry]);\r\n if (this.restCountries.length > 0) {\r\n this.chooseCountry = this.restCountries[0].Key;\r\n } else {\r\n this.chooseCountry = '';\r\n }\r\n this.setState({\r\n selectedCountries: this.selectedCountries,\r\n restCountries: this.restCountries,\r\n chooseCountry: this.chooseCountry,\r\n });\r\n }\r\n },\r\n 'change .form-control.country-list': ({ target }) => {\r\n this.chooseCountry = target.value;\r\n this.setState({\r\n chooseCountry: this.chooseCountry,\r\n });\r\n },\r\n 'click .mulitplier-query-remove .filter-query-remove__glyphicon': ({ target }) => {\r\n if (this.model.get('isUseParent')) {\r\n return;\r\n }\r\n const removeCountry = _.findWhere(this.selectedCountries, { Key: target.title });\r\n\r\n this.restCountries.push(removeCountry);\r\n this.restCountries = _.sortBy(this.restCountries, 'Key');\r\n this.updateUserInputs();\r\n this.selectedCountries = this.getRestCountries(this.selectedCountries, [removeCountry]);\r\n this.setState({\r\n selectedCountries: this.selectedCountries,\r\n restCountries: this.restCountries,\r\n });\r\n },\r\n };\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n getSelectedCountriesMulti(bidMultipliers) {\r\n const countries = state.get('userCountries');\r\n\r\n this.selectedCountries = [];\r\n\r\n if (bidMultipliers) {\r\n _.each(_.keys(bidMultipliers), (key) => {\r\n const country = _.findWhere(countries, { Key: key });\r\n\r\n if (country) {\r\n this.selectedCountries.push(_.extend(country, {\r\n strategy: bidMultipliers[key].strategy,\r\n factor: bidMultipliers[key].factor,\r\n }));\r\n }\r\n });\r\n }\r\n this.restCountries = this.getRestCountries(countries, this.selectedCountries);\r\n this.chooseCountry = this.restCountries.length > 0 ? this.restCountries[0].Key : '';\r\n return {\r\n selectedCountries: this.selectedCountries,\r\n restCountries: this.restCountries,\r\n chooseCountry: this.chooseCountry,\r\n };\r\n }\r\n\r\n getRestCountries(countries, removeNodes) {\r\n let keys = _.map(removeNodes, (node) => {\r\n if (node) {\r\n return node.Key;\r\n }\r\n return '';\r\n });\r\n\r\n keys = _.difference(keys, ['']);\r\n\r\n return _.filter(countries, country => _.indexOf(keys, country.Key) === -1);\r\n }\r\n\r\n setState({\r\n selectedCountries, chooseCountry, restCountries, isUseParent,\r\n }) {\r\n if (chooseCountry) {\r\n this.chooseCountry = chooseCountry;\r\n this.model.set({ chooseCountry });\r\n }\r\n\r\n if (selectedCountries) {\r\n _.each(selectedCountries, (country) => {\r\n const bidMultiplier = new BidMultiplierView({\r\n text: country.Value,\r\n value: country.Key,\r\n strategy: country.strategy,\r\n factor: country.factor,\r\n type: 'userCountry',\r\n });\r\n\r\n this.setChild(`${country.Key}-bid-multiplier`, bidMultiplier);\r\n });\r\n this.selectedCountries = selectedCountries;\r\n this.model.set({ selectedCountries });\r\n this.model.trigger('change');\r\n }\r\n\r\n if (restCountries) {\r\n this.restCountries = restCountries;\r\n this.model.set({ restCountries });\r\n }\r\n\r\n if (!_.isUndefined(isUseParent)) {\r\n this.model.set({ isUseParent });\r\n _.each(this.selectedCountries, (item) => {\r\n this.getChild(`${item.Key}-bid-multiplier`).setState({ isUseParent });\r\n });\r\n }\r\n return this;\r\n }\r\n\r\n updateUserInputs() {\r\n _.each(this.selectedCountries, (item) => {\r\n item.factor = this.getChild(`${item.Key}-bid-multiplier`).getState().percentage; // eslint-disable-line\r\n });\r\n }\r\n\r\n getState() {\r\n const userCountryMultipliersState = [];\r\n\r\n _.each(this.selectedCountries, (item) => {\r\n userCountryMultipliersState.push(this.getChild(`${item.Key}-bid-multiplier`).getState());\r\n });\r\n\r\n if (_.findWhere(userCountryMultipliersState, { isValid: false })) {\r\n return {\r\n isValid: false,\r\n bidMultipliers: _.noop(),\r\n };\r\n }\r\n\r\n return {\r\n isValid: true,\r\n bidMultipliers: serializeBidMultipliers(userCountryMultipliersState),\r\n };\r\n }\r\n }\r\n return {\r\n UserCountryMultipliersView,\r\n };\r\n};\r\n","/* eslint-disable no-proto, no-param-reassign */\r\nimport Backbone from 'backbone';\r\nimport $ from 'jquery';\r\nimport _ from 'underscore';\r\nimport { DateFilter } from '@bingads-webui/date-filter';\r\nimport { getHotelCenterUtils } from '@bingads-webui-campaign/hotel-center-utils';\r\nimport { withoutTime } from '@bingads-webui/primitive-utilities';\r\nimport { RANGES } from '@bingads-webui/date-ranges';\r\n\r\nexport const getProjectionGridDateFilter = ({\r\n i18n: i18nDefault, pageContext, state, dateFilterPreferences,\r\n}) => {\r\n if (!i18nDefault || !pageContext || !state || !dateFilterPreferences) {\r\n return {};\r\n }\r\n const { dateUtils } = getHotelCenterUtils({ pageContext });\r\n const { setDateFilter } = dateFilterPreferences;\r\n const { account2local, local2account } = dateUtils;\r\n\r\n const includeRanges = ['custom', 'today', 'yesterday', 'thisWeekSunday', 'thisWeekMonday', 'lastSevenDays',\r\n 'lastWeekSunday', 'lastWeekMonday', 'lastFourteenDays', 'thisMonth', 'lastMonth', 'last30Days', 'allTime'];\r\n\r\n const formatAccountDate = date =>\r\n i18nDefault.formatDate(account2local(date), { raw: 'MM/dd/yyyy' });\r\n\r\n const formatUTCDateTime = (date) => {\r\n const strDate = i18nDefault.formatDate(account2local(date), { raw: 'yyyy-MM-ddTHH:mm:ss.sss', timeZone: 'GMT' });\r\n\r\n return `${strDate}Z`;\r\n };\r\n\r\n const ensureMinDate = (date, minDate) => {\r\n if (!_.isObject(date)) {\r\n date = new Date(date);\r\n }\r\n return minDate && (date < minDate) ? minDate : date;\r\n };\r\n\r\n const parseDate = dateString => i18nDefault.parseDate(dateString);\r\n\r\n const getDefaultRange = today => ({\r\n grain: 3,\r\n start: today,\r\n end: today,\r\n key: 'today',\r\n });\r\n\r\n const normalizeConfig = (config, gridName) => {\r\n const i18n = _.defaults({\r\n timeZone: null,\r\n __proto__: i18nDefault.__proto__,\r\n }, i18nDefault);\r\n\r\n // Normalize the config with default options\r\n return _.defaults(config, {\r\n i18n,\r\n isComparisonEnabled: true,\r\n enabledRangesPredicate: range => _.indexOf(includeRanges, range.key) !== -1,\r\n dateFormat: 'yMd',\r\n timeFormat: 'hm',\r\n get maxDate() {\r\n return config.maxDate || withoutTime(local2account(new Date()));\r\n },\r\n get defaultTimeRange() {\r\n const storedDateRangeKey = config.sharedInGrids === false ? `$daterange${gridName}` : '$daterange';\r\n const storedDateRange = state.get(storedDateRangeKey);\r\n\r\n if (_.result(storedDateRange, 'key') === RANGES.CUSTOM_TIME) {\r\n return {\r\n start: ensureMinDate(storedDateRange.start, config.minDate),\r\n end: ensureMinDate(storedDateRange.end, config.minDate),\r\n };\r\n }\r\n return _.noop();\r\n },\r\n });\r\n };\r\n\r\n const generateEndDateTime = (date, upToNowWhenToday) => {\r\n const now = local2account(new Date());\r\n const today = withoutTime(now);\r\n\r\n // if it is today, get the time for now\r\n if (date.valueOf() === today.valueOf() && upToNowWhenToday) {\r\n return now;\r\n }\r\n // if it is a past day, get the last time of that day\r\n const returnDate = new Date(date);\r\n\r\n returnDate.setHours(23, 59, 59, 999);\r\n return returnDate;\r\n };\r\n\r\n const formatDateRange = (odataTimeZone, dateRange, upToNowWhenToday) => _.result({\r\n UTC: () => {\r\n const end = dateRange.key === RANGES.CUSTOM_TIME ?\r\n dateRange.end :\r\n generateEndDateTime(dateRange.end, upToNowWhenToday);\r\n\r\n return {\r\n startDateTime: formatUTCDateTime(dateRange.start),\r\n endDateTime: formatUTCDateTime(end),\r\n };\r\n },\r\n Account: () => ({\r\n startDate: formatAccountDate(dateRange.start) ||\r\n formatAccountDate(parseDate(dateRange.RangeStartDate)),\r\n endDate: formatAccountDate(dateRange.end) ||\r\n formatAccountDate(parseDate(dateRange.RangeEndDate)),\r\n }),\r\n }, odataTimeZone);\r\n\r\n const addDateRangeToQueryParams = (queryParams, dateRange, { odataTimeZone = 'Account', upToNowWhenToday = true }) => {\r\n // need to format the date when generate from the preference odata api the first time\r\n if (dateRange.start && !_.isObject(dateRange.start) &&\r\n dateRange.end && !_.isObject(dateRange.end)) {\r\n dateRange.start = new Date(dateRange.start);\r\n dateRange.end = new Date(dateRange.end);\r\n }\r\n\r\n // Feeds use date time as date range while others use date\r\n const primaryRange = formatDateRange(odataTimeZone, dateRange, upToNowWhenToday);\r\n let query = _.defaults(primaryRange, queryParams.query);\r\n\r\n if (dateRange.compared) {\r\n query = _.defaults({\r\n comparisonStartDate: formatAccountDate(new Date(dateRange.compared.start)),\r\n comparisonEndDate: formatAccountDate(new Date(dateRange.compared.end)),\r\n }, query);\r\n } else {\r\n query = _.omit(query, 'comparisonStartDate', 'comparisonEndDate');\r\n }\r\n\r\n return _.defaults({\r\n query,\r\n }, queryParams);\r\n };\r\n\r\n const renderDateFilterView = (dateRange, dateFilter, dateFilterView) => {\r\n const today = withoutTime(local2account(new Date()));\r\n const container = $(dateFilter.container);\r\n const selection = _.extend({\r\n primaryRange: {\r\n grain: dateRange.grain,\r\n key: dateRange.key,\r\n start: ensureMinDate(dateRange.start, dateFilter.minDate),\r\n end: ensureMinDate(dateRange.end, dateFilter.minDate),\r\n },\r\n }, dateRange.compared ? {\r\n comparedRange: {\r\n key: dateRange.compared.key,\r\n },\r\n } : {});\r\n\r\n dateFilterView.setState({ today, selection });\r\n dateFilterView.render();\r\n container.append(dateFilterView.$el);\r\n };\r\n\r\n const setDateRange = ({\r\n name,\r\n dateFilter,\r\n dateRange,\r\n }) => {\r\n const { primaryRange, comparedRange } = dateRange;\r\n _.extend(primaryRange, { Rangelcid: pageContext.CurrentUser.Locale });\r\n const selectedDate = _.extend(primaryRange, {\r\n compared: comparedRange,\r\n });\r\n\r\n if (dateFilter.sharedInGrids === false) {\r\n setDateFilter(name, _.clone(dateRange));\r\n state.set(`$daterange${name}`, selectedDate);\r\n } else {\r\n setDateFilter('TravelShared', _.clone(dateRange));\r\n state.set('$daterange', selectedDate);\r\n }\r\n };\r\n\r\n const dateFilterPlugin = definePlugin =>\r\n definePlugin('dateFilter', ['gridView', 'dataSource', 'config'], (gridView, dataSource, { plugins, name } = {}) => {\r\n const dateFilter = _.result(plugins, 'dateFilter', {});\r\n const normalizedConfig = normalizeConfig(dateFilter, name);\r\n const dateFilterView = new DateFilter(normalizedConfig);\r\n const projectName = dateFilter.sharedInGrids === false ? `$daterange${name}` : '$daterange';\r\n const originalQuery = dataSource.query;\r\n\r\n // render date filter view in the initial function\r\n state.getPromise(projectName).then((initDateRange) => {\r\n let dateRange = initDateRange;\r\n\r\n // rewrite the date filter here to incase\r\n // preference setting saved some unenabled ranges\r\n if (!dateFilter.enabledRangesPredicate(dateRange)) {\r\n const today = withoutTime(local2account(new Date()));\r\n\r\n dateRange = getDefaultRange(today);\r\n setDateRange({\r\n name,\r\n dateFilter,\r\n dateRange:\r\n {\r\n primaryRange: _.omit(dateRange, 'compared'),\r\n comparedRange: dateRange.compared,\r\n },\r\n });\r\n }\r\n renderDateFilterView(dateRange, dateFilter, dateFilterView);\r\n });\r\n\r\n // wrap dateSource query to update data range\r\n dataSource.query = params => state.getPromise(projectName).then((dateRange) => {\r\n const queryParams = addDateRangeToQueryParams(params, dateRange, dateFilter);\r\n\r\n gridView.set({ queryParams });\r\n\r\n return originalQuery.call(dataSource, queryParams);\r\n });\r\n\r\n dateFilterView.on('date-range-selected', (dateRange) => {\r\n setDateRange({ name, dateFilter, dateRange });\r\n\r\n gridView.refresh(true);\r\n });\r\n return { events: _.extend({}, Backbone.Events) };\r\n });\r\n return {\r\n dateFilterPlugin,\r\n addDateRangeToQueryParams,\r\n };\r\n};\r\n","import { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport template from './option-template.pug';\r\n\r\nexport class Option extends DeterministicView {\r\n events() {\r\n return {\r\n 'click .dropdown-search-selector__option': () => {\r\n this.trigger('optionSelected', this.getState());\r\n },\r\n };\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n getState() {\r\n const {\r\n id,\r\n } = this.model.attributes;\r\n\r\n return {\r\n id,\r\n };\r\n }\r\n\r\n setState({\r\n id = '', value = '', isSelected = false, isDisabled = false,\r\n }) {\r\n this.model.set({\r\n id,\r\n value,\r\n isSelected,\r\n isDisabled,\r\n });\r\n\r\n return this;\r\n }\r\n}\r\n","import _ from 'underscore';\r\nimport { helpers, DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport template from './selector-template.pug';\r\nimport { Option } from './option';\r\n\r\nconst { updateView, ensureChildView } = helpers;\r\n\r\nexport class Selector extends DeterministicView {\r\n initialize({\r\n options = [],\r\n selectOption = {},\r\n nodataPlaceholder = '',\r\n }) {\r\n this.selectOption = selectOption;\r\n this.options = options;\r\n this.nodataPlaceholder = nodataPlaceholder;\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n getState() {\r\n const {\r\n options,\r\n } = this.model.attributes;\r\n\r\n return {\r\n options,\r\n };\r\n }\r\n\r\n setState({ options, selectOption }) {\r\n if (options) {\r\n this.selectOption = selectOption || this.selectOption;\r\n _.each(options, (option) => {\r\n const initialOption = this.selectOption.id === option.id ?\r\n { isSelected: true } :\r\n { isSelected: false };\r\n\r\n ensureChildView(this, `option-${option.id}`, Option, {}, {\r\n optionSelected: 'onOptionSelected',\r\n }).setState(_.extend(initialOption, option));\r\n });\r\n this.model.set({ options });\r\n }\r\n\r\n return this;\r\n }\r\n\r\n onOptionSelected({ id }) {\r\n if (this.selectOption && this.selectOption.id !== id) {\r\n const { options } = this.getState();\r\n\r\n this.selectOption = _.findWhere(options, { id });\r\n\r\n updateView(this, {\r\n options,\r\n });\r\n }\r\n this.trigger('optionSelected', this.selectOption);\r\n }\r\n}\r\n","import { DeterministicView, helpers } from '@bingads-webui/deterministic-view';\r\nimport template from './pagination-template.pug';\r\n\r\nconst { updateView } = helpers;\r\n\r\n\r\nexport class Pagination extends DeterministicView {\r\n initialize({\r\n i18n,\r\n currentPage = 1,\r\n pageSize = 10,\r\n totalCount = 0,\r\n }) {\r\n this.i18n = i18n;\r\n this.pageSize = pageSize;\r\n\r\n this.setState({\r\n currentPage,\r\n totalCount,\r\n });\r\n }\r\n\r\n events() {\r\n return {\r\n 'click .previous-page-button': () => {\r\n this.goToPreviousPage();\r\n },\r\n 'click .next-page-button': () => {\r\n this.goToNextPage();\r\n },\r\n };\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n getState() {\r\n const {\r\n currentPage,\r\n totalCount,\r\n } = this.model.attributes;\r\n\r\n return {\r\n currentPage,\r\n totalCount,\r\n };\r\n }\r\n\r\n goToPreviousPage() {\r\n let { currentPage } = this.getState();\r\n if (currentPage <= 1) {\r\n return;\r\n }\r\n currentPage -= 1;\r\n\r\n updateView(this, {\r\n currentPage,\r\n });\r\n this.trigger('pageChanged', currentPage);\r\n }\r\n\r\n goToNextPage() {\r\n let { currentPage, totalCount } = this.getState(); // eslint-disable-line\r\n if (totalCount && (currentPage * this.pageSize) >= totalCount) {\r\n return;\r\n }\r\n\r\n currentPage += 1;\r\n\r\n updateView(this, {\r\n currentPage,\r\n });\r\n this.trigger('pageChanged', currentPage);\r\n }\r\n}\r\n","import { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport template from './search-template.pug';\r\n\r\nexport class Search extends DeterministicView {\r\n initialize({\r\n placeholder = 'account name',\r\n searchResultsId = 'search-results',\r\n }) {\r\n this.placeholder = placeholder;\r\n this.searchResultsId = searchResultsId;\r\n }\r\n\r\n events() {\r\n return {\r\n 'click .dropdown-search-selector__search--submit': () => this.search(),\r\n 'input input#srch-term': () => this.onChange(),\r\n keypress: e => this.keyPress(e),\r\n };\r\n }\r\n\r\n keyPress(e) {\r\n if (e.keyCode === 13) {\r\n e.preventDefault();\r\n this.search();\r\n }\r\n }\r\n\r\n onChange() {\r\n this.trigger('searchChanged', this.$('#srch-term')[0].value);\r\n }\r\n\r\n search() {\r\n this.trigger('searchInvoked', this.$('#srch-term')[0].value);\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n}\r\n","import { DeterministicView, helpers } from '@bingads-webui/deterministic-view';\r\nimport Promise from 'bluebird';\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport { Selector } from './selector';\r\nimport { Pagination } from './pagination';\r\nimport { Search } from './search';\r\nimport { Option } from './option';\r\nimport template from './dropdown-search-selector-template.pug';\r\n\r\nconst { updateView, ensureChildView } = helpers;\r\n\r\nexport class DropdownSearchSelector extends DeterministicView {\r\n initialize({\r\n selectOption,\r\n placeholder,\r\n dataSource,\r\n pageSize = 10,\r\n i18n,\r\n customOptions = [],\r\n forceEnableSearch = false,\r\n invokeSearchOnChange = false, // invoke search on change\r\n nodataPlaceholder = '',\r\n isDisabled = false,\r\n }) {\r\n this.model.set({ selectOption: { id: '', value: '' } });\r\n this.model.set({ isDisabled });\r\n this.dataSource = dataSource;\r\n this.pageSize = pageSize;\r\n this.placeholder = placeholder;\r\n this.i18n = i18n;\r\n this.customOptions = customOptions;\r\n this.forceEnableSearch = forceEnableSearch;\r\n this.invokeSearchOnChange = invokeSearchOnChange;\r\n this.nodataPlaceholder = nodataPlaceholder;\r\n this.searchResultsId = _.uniqueId('search-results-');\r\n\r\n $(window).click((e) => {\r\n const clickedEl = $(e.target);\r\n const dropDown = this.$('.dropdown-search-selector__dropdown');\r\n\r\n if (clickedEl.closest(dropDown).length === 0 && dropDown.hasClass('open')) {\r\n this.toggle();\r\n }\r\n });\r\n this.viewLoadAsync(selectOption || { id: '', value: '' });\r\n }\r\n\r\n viewLoadAsync(selectOption = _.noop()) {\r\n return this.fetchData(this.dataSource, {\r\n pageNumber: 1,\r\n pageSize: this.pageSize,\r\n }).then((results) => {\r\n let { options } = results;\r\n\r\n if (results.totalCount > this.pageSize) {\r\n // enable search and pagination\r\n const { totalCount } = results;\r\n\r\n this.initialPaginationView(this.i18n, totalCount);\r\n this.initialSearchView(this.placeholder);\r\n options = options.slice(0, this.pageSize);\r\n } else {\r\n if (this.getChild('pagination-container')) {\r\n this.detachChild('pagination-container').remove();\r\n }\r\n\r\n if (this.forceEnableSearch) {\r\n this.initialSearchView(this.placeholder);\r\n } else if (this.getChild('search-container')) {\r\n this.detachChild('search-container').remove();\r\n }\r\n }\r\n\r\n // clean the search term\r\n if (this.getChild('search-container')) {\r\n this.$('#srch-term').val('');\r\n this.searchString = '';\r\n }\r\n if (selectOption) {\r\n this.setState({ selectOption });\r\n }\r\n\r\n if (this.customOptions) {\r\n _.each(this.customOptions, (option) => {\r\n option.id = option.id || option.value; // eslint-disable-line\r\n this.initialCustomOptionView(option, selectOption);\r\n });\r\n }\r\n this.setOptionView(options, selectOption);\r\n this.render();\r\n });\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .dropdown-toggle': () => {\r\n this.toggle();\r\n },\r\n };\r\n }\r\n\r\n fetchData(dataSource, params) {\r\n return new Promise((resolve) => {\r\n if (_.isFunction(dataSource)) {\r\n return resolve(dataSource(params));\r\n }\r\n return resolve({\r\n options: [],\r\n totalCount: 0,\r\n });\r\n });\r\n }\r\n\r\n onOptionSelected(selectOption) {\r\n updateView(this, {\r\n selectOption,\r\n });\r\n this.trigger('option-selected', selectOption);\r\n this.selectedId = selectOption.id;\r\n this.toggle();\r\n }\r\n\r\n toggle() {\r\n this.$('.dropdown-toggle').parent().toggleClass('open');\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n onSearchChanged(searchString) {\r\n if (this.invokeSearchOnChange) {\r\n this.onSearchInvoked(searchString);\r\n }\r\n }\r\n\r\n onSearchInvoked(searchString) {\r\n if (this.searchString !== searchString) {\r\n this.searchString = searchString;\r\n this.fetchData(this.dataSource, {\r\n searchString,\r\n pageNumber: 1,\r\n pageSize: this.pageSize,\r\n }).then((results) => {\r\n const { totalCount } = results;\r\n\r\n if (this.getChild('pagination-container')) {\r\n this.getChild('pagination-container').setState({\r\n currentPage: 1,\r\n totalCount,\r\n });\r\n }\r\n this.getChild('selector-container').setState({\r\n options: results.options,\r\n });\r\n });\r\n }\r\n }\r\n\r\n onPageChanged(currentPage) {\r\n this.fetchData(this.dataSource, {\r\n searchString: this.searchString,\r\n pageNumber: currentPage,\r\n pageSize: this.pageSize,\r\n }).then((results) => {\r\n const { totalCount } = results;\r\n\r\n if (this.getChild('pagination-container')) {\r\n this.getChild('pagination-container').setState({\r\n currentPage,\r\n totalCount,\r\n });\r\n }\r\n this.getChild('selector-container').setState({\r\n options: results.options,\r\n });\r\n });\r\n }\r\n\r\n initialSearchView(placeholder) {\r\n ensureChildView(this, 'search-container', Search, {\r\n placeholder,\r\n searchResultsId: this.searchResultsId,\r\n }, {\r\n searchInvoked: 'onSearchInvoked',\r\n searchChanged: 'onSearchChanged',\r\n });\r\n }\r\n\r\n initialPaginationView(i18n, totalCount) {\r\n ensureChildView(this, 'pagination-container', Pagination, { i18n, pageSize: this.pageSize, totalCount }, {\r\n pageChanged: 'onPageChanged',\r\n }).setState({\r\n totalCount,\r\n currentPage: 1,\r\n });\r\n }\r\n\r\n setOptionView(options, selectOption) {\r\n ensureChildView(this, 'selector-container', Selector, { options, selectOption, nodataPlaceholder: this.nodataPlaceholder }, {\r\n optionSelected: 'onOptionSelected',\r\n }).setState({ options, selectOption });\r\n }\r\n\r\n initialCustomOptionView(customOption, selectOption) {\r\n if (!customOption.onOptionSelected) {\r\n customOption.onOptionSelected = ({ id }) => { // eslint-disable-line\r\n const option = _.findWhere(this.customOptions, { id });\r\n\r\n this.onOptionSelected(option);\r\n };\r\n }\r\n ensureChildView(this, `${customOption.id}-container`, Option, {}, {\r\n optionSelected: ({ id }) => customOption.onOptionSelected({ id }),\r\n }).setState({\r\n id: customOption.id,\r\n value: customOption.value,\r\n isSelected: selectOption.id === customOption.id,\r\n });\r\n }\r\n}\r\n","export const schema = {\r\n scenario: [{\r\n name: 'subAccountSetup',\r\n value: 'HotelCenterSubAccountSetup',\r\n setting: {},\r\n activity: [\r\n {\r\n name: 'initializeWizard',\r\n value: 'InitializeWizard',\r\n }, {\r\n name: 'saveSubAccount',\r\n value: 'SaveSubAccount',\r\n }, {\r\n name: 'closeWizard',\r\n value: 'CloseWizard',\r\n },\r\n ],\r\n }, {\r\n name: 'subAccountBar',\r\n value: 'HotelCenterSubAccountBar',\r\n setting: {},\r\n activity: [\r\n {\r\n name: 'loadSubAccountInfo',\r\n value: 'LoadSubAccountInfo',\r\n }, {\r\n name: 'saveSubAccountBid',\r\n value: 'SaveSubAccountBid',\r\n }, {\r\n name: 'saveBidMultiplier',\r\n value: 'SaveBidMultiplier',\r\n },\r\n ],\r\n }, {\r\n name: 'overViewPage',\r\n value: 'HotelCenterOverViewPage',\r\n setting: {},\r\n activity: [\r\n {\r\n name: 'loadHotelGroupGrid',\r\n value: 'LoadHotelGroupGrid',\r\n }, {\r\n name: 'loadHotelIdGrid',\r\n value: 'LoadHotelIdGrid',\r\n }, {\r\n name: 'loadDeviceTypeGrid',\r\n value: 'LoadDeviceTypeGrid',\r\n }, {\r\n name: 'loadDateGrid',\r\n value: 'LoadDateGrid',\r\n }, {\r\n name: 'loadLengthOfStayGrid',\r\n value: 'LoadLengthOfStayGrid',\r\n }, {\r\n name: 'loadUserCountryGrid',\r\n value: 'LoadUserCountryGrid',\r\n }, {\r\n name: 'loadHotelCountryGrid',\r\n value: 'LoadHotelCountryGrid',\r\n }, {\r\n name: 'loadSlotTypeGrid',\r\n value: 'LoadSlotTypeGrid',\r\n }, {\r\n name: 'loadAdvancedBookingGrid',\r\n value: 'LoadAdvancedBookingGrid',\r\n }, {\r\n name: 'loadCheckinDayGrid',\r\n value: 'LoadCheckinDayGrid',\r\n }, {\r\n name: 'loadDateTypeGrid',\r\n value: 'LoadDateTypeGrid',\r\n }, {\r\n name: 'loadSiteTypeGrid',\r\n value: 'LoadSiteTypeGrid',\r\n }, {\r\n name: 'loadSubAccountGrid',\r\n value: 'LoadSubAccountGrid',\r\n }, {\r\n name: 'bulkEditHotelBid',\r\n value: 'BulkEditHotelBid',\r\n }, {\r\n name: 'bulkEditHotelMultiplier',\r\n value: 'BulkEditHotelMultiplier',\r\n }, {\r\n name: 'bulkEditIncreaseDecreaseBid',\r\n value: 'BulkEditIncreaseDecreaseBid',\r\n }, {\r\n name: 'inlineEditHotelBid',\r\n value: 'InlineEditHotelBid',\r\n }, {\r\n name: 'inlineEditHotelMultiplier',\r\n value: 'InlineEditHotelMultiplier',\r\n },\r\n ],\r\n }, {\r\n name: 'budgetPage',\r\n value: 'HotelCenterBudgetPage',\r\n setting: {},\r\n activity: [\r\n {\r\n name: 'initializePage',\r\n value: 'InitializePage',\r\n }, {\r\n name: 'saveBidCap',\r\n value: 'SaveBidCap',\r\n }, {\r\n name: 'saveBudget',\r\n value: 'SaveBudget',\r\n },\r\n ],\r\n }, {\r\n name: 'utilityPage',\r\n value: 'HotelCenterUtilityPage',\r\n setting: {},\r\n activity: [\r\n {\r\n name: 'loadFeedStatusGrid',\r\n value: 'LoadFeedStatusGrid',\r\n }, {\r\n name: 'downloadFeedStatusReport',\r\n value: 'DownloadFeedStatusReport',\r\n },\r\n ],\r\n }],\r\n};\r\n","// specify odata error codes that represent user errors\r\nexport const errorCodes = [\r\n 'BUDGETAMOUNTISABOVELIMIT',\r\n 'BUDGETAMOUNTISBELOWLIMIT',\r\n 'DEFAULTHOTELGROUPUPDATENOTALLOWED',\r\n 'MAXSUBACCOUNTLIMITATIONREACHED',\r\n 'ENTITYDOESNOTEXIST', // fix bug 3532459:400 error with error code EntityDoesNotExist\r\n];\r\n","import _ from 'underscore';\r\nimport { AriaListener } from '@bingads-webui/aria-listener';\r\nimport { ConsoleListener } from '@bingads-webui/console-listener';\r\nimport { InMemoryListener, InMemorySink } from '@bingads-webui/in-memory-listener';\r\nimport {\r\n getAriaConfig,\r\n campaignLogTableConfig,\r\n ContextProcessor,\r\n DebugProcessor,\r\n BasicFormatter,\r\n ApiFormatter,\r\n ConsoleFormatter,\r\n LogLevelFilter,\r\n ApiFilter,\r\n ConsoleFilter,\r\n OdataErrorMapper,\r\n isTestEnvironment,\r\n} from '@bingads-webui-campaign/instrumentation';\r\nimport { errorCodes } from './error-codes';\r\n\r\nexport const initSetup = ({ pageContext, config }) => {\r\n const getListeners = () => {\r\n const ariaConfig = getAriaConfig();\r\n const currentEnv = _.find(_.keys(ariaConfig.tokens), env => document.domain.indexOf(env) > -1);\r\n\r\n // init log formatters\r\n const basicFormatter = new BasicFormatter({\r\n applicationSystem: 'campaign',\r\n applicationSubSystem: 'hotelcenterui',\r\n });\r\n const apiFormatter = new ApiFormatter();\r\n const consoleFormatter = new ConsoleFormatter();\r\n\r\n // init log filters\r\n const logLevelFilter = new LogLevelFilter();\r\n const apiFilter = new ApiFilter();\r\n const consoleFilter = new ConsoleFilter();\r\n\r\n const ariaListener = new AriaListener({\r\n tenantToken: ariaConfig.tokens[currentEnv],\r\n flushInterval: ariaConfig.flushInterval,\r\n batchSize: ariaConfig.batchSize,\r\n logTableNames: campaignLogTableConfig.logTableNames,\r\n defaultLogCategory: campaignLogTableConfig.defaultLogCategory,\r\n formatters: {\r\n basicFormatter,\r\n apiFormatter,\r\n },\r\n filters: {\r\n logLevelFilter,\r\n apiFilter,\r\n },\r\n });\r\n\r\n ariaListener.init();\r\n ariaListener.registerForTeardown();\r\n\r\n const consoleListener = new ConsoleListener({\r\n filters: {\r\n consoleFilter,\r\n },\r\n formatters: {\r\n consoleFormatter,\r\n },\r\n });\r\n\r\n consoleListener.init();\r\n\r\n const listeners = {\r\n ariaListener,\r\n consoleListener,\r\n };\r\n\r\n if (isTestEnvironment(currentEnv)) {\r\n window.seleniumLogsSink = new InMemorySink({ maxSize: 100 });\r\n const inMemoryListener = new InMemoryListener({\r\n sink: window.seleniumLogsSink,\r\n formatters: {\r\n basicFormatter,\r\n apiFormatter,\r\n },\r\n filters: {\r\n logLevelFilter,\r\n apiFilter,\r\n },\r\n });\r\n\r\n inMemoryListener.init();\r\n\r\n _.extend(listeners, { inMemoryListener });\r\n }\r\n\r\n return listeners;\r\n };\r\n\r\n const getProcessors = () => {\r\n const contextProcessor = new ContextProcessor({ pageContext });\r\n const debugProcessor = new DebugProcessor({\r\n isDebugMode: (config && config.get('isDebugMode')) || window.BINGADS_DEBUG,\r\n });\r\n\r\n const processors = {\r\n contextProcessor,\r\n debugProcessor,\r\n };\r\n\r\n return processors;\r\n };\r\n\r\n const getErrorMappers = () => {\r\n const odataErrorMapper = new OdataErrorMapper(errorCodes);\r\n\r\n const errorMappers = {\r\n odataErrorMapper,\r\n };\r\n\r\n return errorMappers;\r\n };\r\n\r\n return {\r\n getErrorMappers,\r\n getProcessors,\r\n getListeners,\r\n };\r\n};\r\n","import _ from 'underscore';\r\nimport { AriaListener } from '@bingads-webui/aria-listener';\r\nimport { Instrumentation } from '@bingads-webui/instrumentation';\r\nimport { PerformanceTimingLogger } from '@bingads-webui/performance-timing-logger';\r\nimport {\r\n getAriaConfig,\r\n PerformanceLogsFilter,\r\n PerformanceLogsFormatter,\r\n ContextProcessor,\r\n DebugProcessor,\r\n PerfTimingProcessor,\r\n} from '@bingads-webui-campaign/instrumentation';\r\n\r\nexport const initPerfTiming = ({ pageContext, config }) => {\r\n const getListeners = () => {\r\n const ariaConfig = getAriaConfig();\r\n const currentEnv = _.find(_.keys(ariaConfig.tokens), env => document.domain.indexOf(env) > -1);\r\n\r\n // init log formatters\r\n const performanceLogsFormatter = new PerformanceLogsFormatter();\r\n\r\n // init log filters\r\n const performanceLogsFilter = new PerformanceLogsFilter();\r\n\r\n const ariaListener = new AriaListener({\r\n tenantToken: ariaConfig.tokens[currentEnv],\r\n flushInterval: ariaConfig.flushInterval,\r\n batchSize: ariaConfig.batchSize,\r\n logTableNames: {\r\n resourcetiming: {\r\n name: 'resourcetiming',\r\n },\r\n },\r\n defaultLogCategory: 'resourcetiming',\r\n formatters: {\r\n performanceLogsFormatter,\r\n },\r\n filters: {\r\n performanceLogsFilter,\r\n },\r\n });\r\n\r\n ariaListener.init();\r\n ariaListener.registerForTeardown();\r\n\r\n const listeners = {\r\n ariaListener,\r\n };\r\n\r\n return listeners;\r\n };\r\n\r\n const getProcessors = () => {\r\n const contextProcessor = new ContextProcessor({ pageContext });\r\n const debugProcessor = new DebugProcessor({\r\n isDebugMode: (config && config.get('isDebugMode')) || window.BINGADS_DEBUG,\r\n });\r\n const perfTimingProcessor = new PerfTimingProcessor({\r\n landingPageUrl: config.get('LandingPageUrl') || '',\r\n });\r\n\r\n const processors = {\r\n contextProcessor,\r\n debugProcessor,\r\n perfTimingProcessor,\r\n };\r\n\r\n return processors;\r\n };\r\n\r\n const instr = new Instrumentation({\r\n listeners: getListeners(),\r\n processors: getProcessors(),\r\n });\r\n\r\n const perfTimingLogger = new PerformanceTimingLogger({ instrumentation: instr });\r\n\r\n return {\r\n perfTimingLogger,\r\n getListeners,\r\n getProcessors,\r\n };\r\n};\r\n","import { EDM } from '@bingads-webui/edm-core-legacy';\r\nimport { jsdataPlugin } from '@bingads-webui/edm-js-data';\r\nimport { odataPlugin } from '@bingads-webui/edm-odata-legacy';\r\nimport { resIdsPlugin } from '@bingads-webui/edm-resource-identifiers-legacy';\r\nimport {\r\n defineConstProperty,\r\n defineComputedProperty,\r\n} from '@bingads-webui/reflection';\r\nimport _ from 'underscore';\r\nimport { getJsDataExtension } from './js-data-extension';\r\n\r\nexport const getEdmBhc = ({\r\n state, schemas, CustomerIdType, config,\r\n}) => {\r\n if (!state || !schemas || !CustomerIdType || !config) {\r\n return {};\r\n }\r\n const namespace = 'Microsoft.BingAds.Api.Model.Travel';\r\n const edm = new EDM({\r\n schemas,\r\n namespace,\r\n });\r\n const jsdataExtension = getJsDataExtension({ config, state });\r\n\r\n resIdsPlugin(edm);\r\n odataPlugin(edm, '');\r\n jsdataPlugin(edm);\r\n\r\n jsdataExtension(edm);\r\n\r\n // Define the root type\r\n // We only have a Customer entity set at the root\r\n const rootType = new edm.types.ComplexType({\r\n name: '$ROOT',\r\n properties: {\r\n Customers: { typeName: `${namespace}.TravelCustomer@COLL` },\r\n },\r\n });\r\n const root = new rootType.ResourceIdentifier();\r\n\r\n defineConstProperty(edm, 'root', root);\r\n\r\n const customerIdType = new CustomerIdType();\r\n\r\n defineConstProperty(edm, 'customerIdType', customerIdType);\r\n\r\n _.each({\r\n currentCustomer: {\r\n key: 'customer_id',\r\n parent: 'root',\r\n collection: 'Customers',\r\n },\r\n currentAccount: {\r\n key: 'account_id',\r\n parent: 'currentCustomer',\r\n collection: 'Accounts',\r\n },\r\n }, (dependencies, name) => {\r\n defineComputedProperty(edm, name, () => {\r\n let id = state.get(dependencies.key);\r\n const parent = edm[dependencies.parent];\r\n\r\n if (edm.customerIdType.useAdvertiserCustomerId && dependencies.parent === 'root' && state.get('advertisercustomer_id')) {\r\n id = state.get('advertisercustomer_id');\r\n }\r\n\r\n return parent && id ? parent[dependencies.collection].$withKey(Number(id)) : null;\r\n });\r\n });\r\n return { jsdataBhc: edm.jsdata.resources };\r\n};\r\n","import ODataAdapter from '@bingads-webui/js-data-odata';\r\n\r\nexport const getJsDataExtension = ({ config, state }) => (edm) => {\r\n const { store } = edm.jsdata;\r\n\r\n store.registerAdapter('odata', new ODataAdapter({\r\n ajaxOptions: {\r\n path: 'HotelCenter/V1',\r\n host: config.get('odata.url'),\r\n oDataToken: config.get('odata.token'),\r\n loginType: config.get('odata.loginType'),\r\n },\r\n state,\r\n }), { default: true });\r\n};\r\n","import lightDismissible from './src/light-dismissible/light-dismissible';\r\nimport toolbarTemplate from './src/template/toolbar-template.pug';\r\nimport { getAccountInformationView } from './src/account-information-view/account-information-view';\r\nimport { getBidCapView } from './src/bid-cap-view/bid-cap-view';\r\nimport { getBidStrategyView } from './src/bid-strategy-view/bid-strategy-view';\r\nimport { getBidMultipliersView } from './src/bid-multipliers-view/bid-multipliers-view';\r\nimport { getProjectionGridDateFilter } from './src/date-filter/projection-grid-date-filter';\r\nimport { DropdownSearchSelector } from './src/dropdown-search-selector/dropdown-search-selector';\r\nimport { getEditPanelView } from './src/edit-panel-view/edit-panel-view';\r\nimport { getFetchPreferenceConfig } from './src/service/fetch-preference-config';\r\nimport { getHotelGroupInformationView } from './src/hotel-group-information-view/information-view';\r\nimport { getHotelGroupModel } from './src/hotel-group-model/hotel-group-model';\r\nimport { getHotelModel } from './src/hotel-model/hotel-model';\r\nimport { getInstrumentation } from './src/instrumentation/index';\r\nimport { getEdmBhc } from './src/js-data-bhc/edm-bhc';\r\nimport { getUserCountryService } from './src/bid-multipliers-view/user-country/user-country-service';\r\nimport { getSubAccountModel } from './src/sub-account-model/sub-account-model';\r\n\r\nexport const getHotelCenterShared = ({\r\n pageContext, i18n, state, config, preferencesService, CustomerIdType,\r\n segmentationPreferences, jsdata, edm, dateFilterPreferences,\r\n fixedBidSchema, percentageBidSchema, payPerStayBidSchema, multiplierSchema,\r\n hotelGroupSchema, hotelSchema, subAccountSchema, schemas,\r\n} = {}) => ({\r\n DropdownSearchSelector,\r\n lightDismissible,\r\n toolbarTemplate,\r\n ...getAccountInformationView({ i18n }),\r\n ...getBidCapView({ i18n, config, fixedBidSchema }),\r\n ...getBidStrategyView({\r\n i18n, pageContext, config, fixedBidSchema, percentageBidSchema, payPerStayBidSchema,\r\n }),\r\n ...getBidMultipliersView({\r\n i18n, state, pageContext, multiplierSchema,\r\n }),\r\n ...getProjectionGridDateFilter({\r\n i18n, pageContext, state, dateFilterPreferences,\r\n }),\r\n ...getEditPanelView({ i18n }),\r\n ...getFetchPreferenceConfig({ state, preferencesService, segmentationPreferences }),\r\n ...getHotelGroupInformationView({ i18n }),\r\n ...getHotelGroupModel({\r\n i18n, hotelGroupSchema, state, jsdata, edm,\r\n }),\r\n ...getHotelModel({\r\n i18n, hotelSchema, jsdata, edm, state,\r\n }),\r\n ...getInstrumentation({ pageContext, config }),\r\n ...getEdmBhc({\r\n state, schemas, config, CustomerIdType,\r\n }),\r\n ...getUserCountryService({ state, i18n }),\r\n ...getSubAccountModel({\r\n state, i18n, subAccountSchema, jsdata, edm,\r\n }),\r\n});\r\n","import { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport template from './account-information-view-template.pug';\r\n\r\nexport const getAccountInformationView = ({ i18n }) => {\r\n if (!i18n) {\r\n return {};\r\n }\r\n /**\r\n * Class representing an account information view for HotelCenter\r\n * @extends View\r\n */\r\n class AccountInformationView extends DeterministicView {\r\n /**\r\n * Initializes AccountInformationView\r\n * Creates model and give default parameter for account information.\r\n * @returns { undefined }\r\n */\r\n initialize() {\r\n this.i18n = i18n;\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n }\r\n\r\n return {\r\n AccountInformationView,\r\n };\r\n};\r\n\r\n","import { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport { BackboneSchema as backboneSchema } from '@bingads-webui/backbone-schema';\r\nimport { InputControl } from '@bingads-webui/input-control';\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport template from './bid-cap-view-template.pug';\r\n\r\nexport const getBidCapView = ({ i18n, config, fixedBidSchema }) => {\r\n if (!i18n || !config || !fixedBidSchema) {\r\n return {};\r\n }\r\n /**\r\n * Shared view for Hotel Ads max bid setup section\r\n * @extends Backbone.View\r\n */\r\n class BidCapView extends DeterministicView {\r\n initialize() {\r\n this.selections = {\r\n empty: 'empty',\r\n cap: 'cap',\r\n };\r\n\r\n this.i18n = i18n;\r\n\r\n const FixedBidModel = backboneSchema(fixedBidSchema, i18n, ['Amount', '@odata.type']);\r\n\r\n this.fixedBidModel = new FixedBidModel();\r\n const maxBidInputControl = new InputControl({\r\n entity: this.fixedBidModel,\r\n field: 'Amount',\r\n addonText: config.get('AccountCurrencyCode'),\r\n });\r\n\r\n this.setChild('max-bid-input', maxBidInputControl);\r\n this.listenTo(maxBidInputControl, 'input-changed', () => {\r\n this.trigger('input-changed');\r\n });\r\n\r\n this.setState({ capSelection: this.selections.empty });\r\n\r\n this.on('rendered', () => {\r\n const capSelection = this.model.get('capSelection');\r\n if (capSelection === 'empty') {\r\n $('label.empty').focus();\r\n } else if (capSelection === 'cap') {\r\n $('label.bid-selection-label').focus();\r\n }\r\n }, this);\r\n }\r\n\r\n get events() {\r\n return {\r\n 'change .bid-cap-radio': ({ target }) => {\r\n this.setState({ capSelection: target.value });\r\n },\r\n };\r\n }\r\n\r\n setState(state) {\r\n if (_.has(state, 'capSelection')) {\r\n this.model.set('capSelection', state.capSelection);\r\n }\r\n\r\n if (_.has(state, 'maximumBid')) {\r\n this.fixedBidModel.parse(state.maximumBid);\r\n this.getChild('max-bid-input').setState({ value: this.fixedBidModel.get('Amount') });\r\n }\r\n\r\n this.trigger('input-changed');\r\n return this;\r\n }\r\n\r\n getState() {\r\n const inputState = this.getChild('max-bid-input').getState();\r\n const noCap = this.model.get('capSelection') === this.selections.empty;\r\n\r\n return {\r\n maximumBid: noCap ? null : this.fixedBidModel.toJSON(),\r\n isValid: noCap || inputState.isValid,\r\n };\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n }\r\n\r\n return {\r\n BidCapView,\r\n };\r\n};\r\n","import { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport { BackboneSchema as backboneSchema } from '@bingads-webui/backbone-schema';\r\nimport { InputControl } from '@bingads-webui/input-control';\r\nimport _ from 'underscore';\r\nimport $ from 'jquery';\r\nimport template from './bid-strategy-view-template.pug';\r\n\r\nexport const getBidStrategyView = ({\r\n i18n, pageContext, config, fixedBidSchema, percentageBidSchema, payPerStayBidSchema,\r\n}) => {\r\n if (!i18n || !pageContext || !config || !fixedBidSchema ||\r\n !percentageBidSchema || !payPerStayBidSchema) {\r\n return {};\r\n }\r\n /**\r\n * Shared view for Hotel Ads bid strategy setup section\r\n * @extends Backbone.View\r\n */\r\n class BidStrategyView extends DeterministicView {\r\n initialize(options) {\r\n this.strategy = {\r\n fixed: 'fixed',\r\n percentage: 'percentage',\r\n payperstay: 'payperstay',\r\n empty: 'empty',\r\n };\r\n\r\n this.currentTemplate = options.customTemplate || template;\r\n this.i18n = i18n;\r\n\r\n this.isAmountRequired = !_.result(options, 'allowEmptyStrategy', true);\r\n this.isPayPerStayEnabled = _.result(pageContext.Permissions.dynamic, 'PayPerStay', false);\r\n\r\n // todo: remove below readonly flags when DE limitation is resolved\r\n this.isReadonly = _.result(options, 'isReadonly', false);\r\n this.disabledAttr = this.isReadonly ? { disabled: 'disabled' } : {};\r\n this.isPPSReadOnly = this.isReadonly || !_.result(options, 'enablePPS', false);\r\n this.disabledPPSAttr = this.isPPSReadOnly ? { disabled: 'disabled' } : {};\r\n\r\n this.initFixedBidInput(this.isAmountRequired);\r\n this.initPercentageBidInput(this.isAmountRequired);\r\n this.initPayPerStayBidInput(this.isAmountRequired);\r\n\r\n this.setState({\r\n bidStrategy: options.strategy || this.strategy.fixed,\r\n bidAmount: options.bidAmount,\r\n });\r\n\r\n this.on('rendered', () => {\r\n const bidStrategy = this.model.get('bidStrategy');\r\n if (bidStrategy === this.strategy.fixed) {\r\n $('label.radio.fixed').focus();\r\n } else if (bidStrategy === this.strategy.percentage) {\r\n $('label.radio.percentage').focus();\r\n } else if (bidStrategy === this.strategy.payperstay) {\r\n $('label.radio.payperstay').focus();\r\n } else if (bidStrategy === this.strategy.empty) {\r\n $('label.radio.empty').focus();\r\n }\r\n }, this);\r\n }\r\n\r\n get events() {\r\n return {\r\n 'change .bid-strategy-radio': ({ target }) => {\r\n this.setState({ bidStrategy: target.value });\r\n },\r\n };\r\n }\r\n\r\n get template() {\r\n return this.currentTemplate;\r\n }\r\n\r\n get bidInput() {\r\n const { bidStrategy } = super.getState();\r\n\r\n return _.result({\r\n fixed: () => this.getChild('fixed-bid-input'),\r\n percentage: () => this.getChild('percentage-bid-input'),\r\n payperstay: () => this.getChild('payperstay-bid-input'),\r\n }, bidStrategy);\r\n }\r\n\r\n setState(props) {\r\n const { bidStrategy, bidAmount, showError } = props;\r\n\r\n // todo: remove below readonly flags when DE limitation is resolved\r\n this.isReadonly = _.result(props, 'isReadonly', this.isReadonly);\r\n this.disabledAttr = this.isReadonly ? { disabled: 'disabled' } : {};\r\n\r\n if (!_.isUndefined(bidStrategy)) {\r\n this.model.set({ bidStrategy });\r\n }\r\n\r\n if (!_.isUndefined(bidAmount)) {\r\n const value = i18n.formatDecimalToFixed(bidAmount);\r\n\r\n if (bidStrategy === this.strategy.fixed) {\r\n this.fixedBidModel.set('Amount', value);\r\n this.getChild('fixed-bid-input').setState({ value, readonly: this.isReadonly });\r\n } else if (bidStrategy === this.strategy.percentage) {\r\n this.percentageBidModel.set('Amount', value);\r\n this.getChild('percentage-bid-input').setState({ value, readonly: this.isReadonly });\r\n } else {\r\n this.payPerStayBidModel.set('Amount', value);\r\n this.getChild('payperstay-bid-input').setState({ value });\r\n }\r\n this.trigger('input-changed');\r\n }\r\n\r\n if (!_.isUndefined(showError)) {\r\n if (this.bidInput) {\r\n this.bidInput.setState({ showError });\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n getState() {\r\n switch (this.model.get('bidStrategy')) {\r\n case this.strategy.fixed:\r\n return {\r\n isValid: this.getChild('fixed-bid-input').getState().isValid,\r\n bid: this.fixedBidModel.toJSON(),\r\n };\r\n case this.strategy.percentage:\r\n return {\r\n isValid: this.getChild('percentage-bid-input').getState().isValid,\r\n bid: this.percentageBidModel.toJSON(),\r\n };\r\n case this.strategy.payperstay:\r\n return {\r\n isValid: this.getChild('payperstay-bid-input').getState().isValid,\r\n bid: this.payPerStayBidModel.toJSON(),\r\n };\r\n default:\r\n return {\r\n isValid: !this.isAmountRequired,\r\n bid: { Amount: null },\r\n };\r\n }\r\n }\r\n\r\n initFixedBidInput() {\r\n const FixedBidModel = backboneSchema(fixedBidSchema, i18n, ['Amount', '@odata.type']);\r\n\r\n this.fixedBidModel = new FixedBidModel();\r\n const fixedBidInput = new InputControl({\r\n entity: this.fixedBidModel,\r\n field: 'Amount',\r\n addonText: config.get('AccountCurrencyCode'),\r\n readonly: this.isReadonly,\r\n });\r\n\r\n this.setChild('fixed-bid-input', fixedBidInput);\r\n\r\n this.listenTo(fixedBidInput, 'input-changed', () => {\r\n this.trigger('input-changed');\r\n });\r\n }\r\n\r\n initPercentageBidInput() {\r\n const PercentageBidModel = backboneSchema(percentageBidSchema, i18n, ['Amount', '@odata.type']);\r\n\r\n this.percentageBidModel = new PercentageBidModel();\r\n const percentageBidInput = new InputControl({\r\n entity: this.percentageBidModel,\r\n field: 'Amount',\r\n addonText: pageContext.DecimalFormatter.percentSymbol,\r\n readonly: this.isReadonly,\r\n });\r\n\r\n this.setChild('percentage-bid-input', percentageBidInput);\r\n\r\n this.listenTo(percentageBidInput, 'input-changed', () => {\r\n this.trigger('input-changed');\r\n });\r\n }\r\n\r\n initPayPerStayBidInput() {\r\n const PayPerStayBidModel = backboneSchema(payPerStayBidSchema, i18n, ['Amount', '@odata.type']);\r\n\r\n this.payPerStayBidModel = new PayPerStayBidModel();\r\n const payPerStayBidInput = new InputControl({\r\n entity: this.payPerStayBidModel,\r\n field: 'Amount',\r\n addonText: pageContext.DecimalFormatter.percentSymbol,\r\n });\r\n\r\n this.setChild('payperstay-bid-input', payPerStayBidInput);\r\n\r\n this.listenTo(payPerStayBidInput, 'input-changed', () => {\r\n this.trigger('input-changed');\r\n });\r\n }\r\n }\r\n return {\r\n BidStrategyView,\r\n };\r\n};\r\n","import { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport template from './edit-panel-view-template.pug';\r\n\r\nexport const getEditPanelView = ({ i18n }) => {\r\n if (!i18n) {\r\n return {};\r\n }\r\n /**\r\n * Shared view for Hotel Ads edit panel\r\n * @extends DeterministicView\r\n */\r\n class EditPanelView extends DeterministicView {\r\n initialize() {\r\n this.i18n = i18n;\r\n this.model.set({ hasCleanButton: false });\r\n this.model.set({ isSaveButtonDisabled: false });\r\n }\r\n\r\n get template() {\r\n return template;\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click #Cancel': this.onCancel,\r\n 'click #Save': this.onSave,\r\n 'click #Clean': this.onClean,\r\n };\r\n }\r\n getState() {\r\n return {\r\n isSaveButtonDisabled: this.model.get('isSaveButtonDisabled'),\r\n hasCleanButton: this.model.get('hasCleanButton'),\r\n };\r\n }\r\n\r\n onCancel() {\r\n this.trigger('canceled');\r\n }\r\n\r\n onSave() {\r\n this.trigger('saved');\r\n }\r\n\r\n onClean() {\r\n this.trigger('cleaned');\r\n }\r\n }\r\n\r\n return {\r\n EditPanelView,\r\n };\r\n};\r\n","\r\nimport { isTimeRangeValid } from '@bingads-webui-campaign/segmentation-utilities';\r\nimport _ from 'underscore';\r\nimport Promise from 'bluebird';\r\n\r\nexport const getFetchPreferenceConfig =\r\n ({ state, preferencesService, segmentationPreferences }) => {\r\n if (!state || !preferencesService || !segmentationPreferences) {\r\n return {};\r\n }\r\n const { getSegPreference, getSegType } = segmentationPreferences;\r\n return {\r\n fetchPreferenceConfig: (gridConfig) => {\r\n const defaultPageSize = 20;\r\n const sortInfoKey = gridConfig.name;\r\n\r\n const p$stateManager = new Promise((resolve) => {\r\n preferencesService.default.initialize().then(() => {\r\n const { Data: { rowsPerPage: pageSize = defaultPageSize } } = preferencesService.default.findByName('WebApp.CampaignUI.grid') || { Data: {} };\r\n const { Data: { sortInfo: { orderby: orderbyInfo, sortableHeader } } } =\r\n preferencesService.default.findByName(`WebApp.CampaignUI.${sortInfoKey}`) || { Data: { sortInfo: {} } };\r\n\r\n resolve({ pageSize, orderbyInfo, sortableHeader });\r\n });\r\n });\r\n\r\n return Promise\r\n .all([p$stateManager, getSegPreference(gridConfig.name)])\r\n .spread(({ pageSize, orderbyInfo, sortableHeader }) => {\r\n gridConfig = _.defaults(gridConfig, {pageable: {}}); //eslint-disable-line\r\n gridConfig.pageable.pageSize = pageSize; //eslint-disable-line\r\n if (gridConfig.plugins && gridConfig.plugins.pagination) {\r\n gridConfig.plugins.pagination.pageSize = pageSize; //eslint-disable-line\r\n }\r\n if (gridConfig.plugins &&\r\n gridConfig.plugins.pagination &&\r\n gridConfig.plugins.pagination.pageSize) {\r\n gridConfig.plugins.pagination.pageSize = pageSize; //eslint-disable-line\r\n }\r\n\r\n const segType = getSegType(gridConfig.name);\r\n\r\n if (segType && segType.segmentationType !== 'None' && isTimeRangeValid(segType.segmentationType, state.get('$daterange'))) {\r\n gridConfig.dataSource.query.SegmentationTypes = segType.segmentationType; //eslint-disable-line\r\n }\r\n\r\n if (orderbyInfo && orderbyInfo.length > 0) {\r\n gridConfig.dataSource.orderby = orderbyInfo; //eslint-disable-line\r\n gridConfig.sortableHeader = _.pick(sortableHeader, 'name', 'directionIndex'); //eslint-disable-line\r\n }\r\n });\r\n },\r\n };\r\n };\r\n","import { DeterministicView } from '@bingads-webui/deterministic-view';\r\nimport template from './information-template.pug';\r\n\r\nexport const getHotelGroupInformationView = ({ i18n }) => {\r\n if (!i18n) {\r\n return {};\r\n }\r\n\r\n /**\r\n * Class representing an account information view for HotelCenter\r\n * @extends View\r\n */\r\n class HotelGroupInformationView extends DeterministicView {\r\n /**\r\n * Initializes AccountInformationView\r\n * Creates model and give default parameter for account information.\r\n * @returns { undefined }\r\n */\r\n initialize() {\r\n this.i18n = i18n;\r\n }\r\n get template() {\r\n return template;\r\n }\r\n\r\n get events() {\r\n return {\r\n 'click .glyphicon-arrow-left': this.onBack,\r\n 'click .hotel-group-information-remove__glyphicon': this.onRemove,\r\n };\r\n }\r\n\r\n onBack() {\r\n this.trigger('go-back');\r\n }\r\n\r\n onRemove() {\r\n this.trigger('remove-group-info');\r\n }\r\n }\r\n\r\n return {\r\n HotelGroupInformationView,\r\n };\r\n};\r\n","/* istanbul ignore file */\r\nimport _ from 'underscore';\r\nimport { BackboneSchema as backboneSchema } from '@bingads-webui/backbone-schema';\r\nimport { getHotelCenterService } from '@bingads-webui-campaign/hotel-center-service';\r\n\r\nexport const getHotelGroupModel = ({\r\n i18n, hotelGroupSchema, state, jsdata, edm,\r\n}) => {\r\n if (!i18n || !hotelGroupSchema || !state || !jsdata || !edm) {\r\n return {};\r\n }\r\n const { gridOptionUtils } = getHotelCenterService({ edm, state });\r\n // eslint-disable-next-line no-param-reassign\r\n hotelGroupSchema.properties.Name.required = true;\r\n const SchemaModel = backboneSchema(hotelGroupSchema, i18n, ['Name']);\r\n\r\n /**\r\n * HotelGroup backbone model based on hotelGroupSchema\r\n * @extends Backbone.Model\r\n */\r\n\r\n class HotelGroupModel extends SchemaModel {\r\n initialize(options = {}) {\r\n if (options.Id) {\r\n this.id = options.Id;\r\n }\r\n\r\n this.set('Name', options.Name);\r\n this.set('Id', options.Id);\r\n this.entitySet = options.entitySet || gridOptionUtils.getEntitySetByName('hotelGroup');\r\n }\r\n\r\n get idAttribute() {\r\n return 'Id';\r\n }\r\n\r\n toJSON() {\r\n const json = super.toJSON();\r\n\r\n this.attachNestedModels(json, ['BidSetting', 'Bid', 'BidMultipliers', 'Id']);\r\n\r\n return json;\r\n }\r\n\r\n sync(method, model, options) {\r\n const json = this.toJSON();\r\n\r\n switch (method) {\r\n case 'read':\r\n return jsdata.HotelGroup\r\n .find(this.get('Id'), {\r\n entitySet: this.entitySet,\r\n });\r\n case 'create':\r\n state.unset('subAccount_hotelGroupCount');\r\n return jsdata.HotelGroup.create(json, {\r\n cacheResponse: false,\r\n entitySet: this.entitySet,\r\n });\r\n case 'patch':\r\n case 'update':\r\n if (_.has(json, 'Bid') && json.Bid.Amount === null) {\r\n json.Bid = null; // if user didn't input Bid amout, pass null object to odata\r\n }\r\n return jsdata.HotelGroup.update(\r\n model.id,\r\n _.isEmpty(options.attrs) ? json : _.pick(json, options.attrs),\r\n {\r\n cacheResponse: false,\r\n entitySet: this.entitySet,\r\n }\r\n );\r\n case 'delete':\r\n state.unset('subAccount_hotelGroupCount');\r\n return jsdata.HotelGroup.destroy(model.id, {\r\n entitySet: this.entitySet,\r\n });\r\n default:\r\n throw new Error(`sync method ${method} is not supported`);\r\n }\r\n }\r\n\r\n attachNestedModels(json, fieldNames) {\r\n _.each(fieldNames, (field) => {\r\n if (this.has(field) || _.contains(this.changedAttributes(), 'BidSetting')) {\r\n json[field] = this.get(field); // eslint-disable-line\r\n }\r\n });\r\n }\r\n }\r\n\r\n return {\r\n HotelGroupModel,\r\n };\r\n};\r\n","/* istanbul ignore file */\r\nimport _ from 'underscore';\r\nimport { BackboneSchema as backboneSchema } from '@bingads-webui/backbone-schema';\r\nimport { getHotelCenterService } from '@bingads-webui-campaign/hotel-center-service';\r\n\r\nexport const getHotelModel = ({\r\n i18n, hotelSchema, jsdata, edm, state,\r\n}) => {\r\n if (!i18n || !hotelSchema || !state || !jsdata || !edm) {\r\n return {};\r\n }\r\n const SchemaModel = backboneSchema(hotelSchema, i18n, ['Id']);\r\n const { gridOptionUtils } = getHotelCenterService({ edm, state });\r\n /**\r\n * Hotel backbone model based on schema\r\n * @extends Backbone.Model\r\n */\r\n\r\n class HotelModel extends SchemaModel {\r\n initialize(options = {}) {\r\n this.set('Id', options.Id);\r\n this.entitySet = options.entitySet || gridOptionUtils.getEntitySetByName('hotel');\r\n }\r\n\r\n get idAttribute() {\r\n return 'Id';\r\n }\r\n\r\n toJSON() {\r\n const json = super.toJSON();\r\n\r\n this.attachNestedModels(json, ['Bid', 'BidMultipliers', 'Name']);\r\n\r\n return json;\r\n }\r\n\r\n sync(method, model, options) {\r\n const json = model.toJSON();\r\n\r\n switch (method) {\r\n case 'read':\r\n return jsdata.Hotel\r\n .find(this.get('Id'), {\r\n entitySet: this.entitySet,\r\n });\r\n case 'create':\r\n return jsdata.Hotel.create(json, {\r\n cacheResponse: false,\r\n entitySet: this.entitySet,\r\n });\r\n case 'patch':\r\n case 'update':\r\n if (_.has(json, 'Bid') && json.Bid.Amount === null) {\r\n json.Bid = null; // if user didn't input Bid amout, pass null object to odata\r\n }\r\n\r\n return jsdata.Hotel.update(\r\n model.get('Id'),\r\n _.isEmpty(options.attrs) ? json : _.pick(json, options.attrs),\r\n {\r\n cacheResponse: false,\r\n entitySet: this.entitySet,\r\n }\r\n );\r\n default:\r\n throw new Error(`sync method ${method} is not supported`);\r\n }\r\n }\r\n\r\n attachNestedModels(json, fieldNames) {\r\n _.each(fieldNames, (field) => {\r\n if (this.has(field) || _.contains(this.changedAttributes(), 'MaximumBid')) {\r\n json[field] = this.get(field); // eslint-disable-line\r\n }\r\n });\r\n }\r\n }\r\n\r\n return {\r\n HotelModel,\r\n };\r\n};\r\n","import $ from 'jquery';\r\nimport { Instrumentation } from '@bingads-webui/instrumentation';\r\nimport { AjaxStub, AjaxEventHandler, ErrorStub } from '@bingads-webui/instrumentation-stubs';\r\nimport { isInternalUrl } from '@bingads-webui/url-util';\r\nimport { schema } from './schema';\r\nimport { initSetup } from './setup';\r\nimport { initPerfTiming } from './perf-timing';\r\n\r\nexport const getInstrumentation = ({\r\n pageContext, config,\r\n}) => {\r\n if (!pageContext || !config) {\r\n return {};\r\n }\r\n const { getListeners, getProcessors, getErrorMappers } = initSetup({\r\n pageContext, config,\r\n });\r\n const { perfTimingLogger } = initPerfTiming({\r\n pageContext, config,\r\n });\r\n const init = () => {\r\n const instrumentConfig = {\r\n listeners: getListeners(),\r\n processors: getProcessors(),\r\n };\r\n\r\n const instr = new Instrumentation(instrumentConfig);\r\n\r\n instr.addScenario(schema);\r\n return instr;\r\n };\r\n\r\n const stub = (instrumentation) => {\r\n const stubOptions = {\r\n objectsToStub: [$],\r\n };\r\n\r\n const errorMappers = getErrorMappers();\r\n const shouldAddHeaders = ajaxContext => isInternalUrl(ajaxContext.url);\r\n const eventHandler = new AjaxEventHandler({ errorMappers, shouldAddHeaders });\r\n\r\n const ajaxStub = new AjaxStub({\r\n stubOptions,\r\n eventHandler,\r\n instrumentation,\r\n });\r\n\r\n const errorStub = new ErrorStub({\r\n instrumentation,\r\n });\r\n\r\n ajaxStub.init();\r\n errorStub.init();\r\n };\r\n\r\n // init instrumentation\r\n const instrumentation = init();\r\n\r\n // init log stubs\r\n stub(instrumentation);\r\n\r\n // init performance timing logger\r\n perfTimingLogger.init();\r\n\r\n return {\r\n instrumentation,\r\n };\r\n};\r\n\r\n","import _ from 'underscore';\r\n\r\nexport const getUserCountryService = ({ state, i18n }) => {\r\n if (!state || !i18n) {\r\n return {};\r\n }\r\n const countryCodes = ['AL', 'AQ', 'DZ', 'AS', 'AD', 'AO', 'AG', 'AR', 'AU', 'AT', 'BS', 'BD', 'BB', 'BE', 'BM', 'BT', 'BO', 'BW', 'BR', 'BZ', 'SB', 'VG', 'BN', 'BG', 'MM', 'BI', 'BY', 'KH', 'CM', 'CA', 'CV', 'KY', 'CF', 'LK', 'TD', 'CL', 'CN', 'TW', 'CX', 'CC', 'CO', 'YT', 'CG', 'CD', 'CK', 'CR', 'HR', 'CZ', 'BJ', 'DK', 'DM', 'DO', 'EC', 'SV', 'GQ', 'ET', 'ER', 'EE', 'FO', 'FK', 'FI', 'FR', 'GF', 'PF', 'DJ', 'GA', 'GM', 'DE', 'GH', 'GI', 'KI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GN', 'GY', 'HT', 'VA', 'HN', 'HU', 'IS', 'IN', 'ID', 'IE', 'IT', 'CI', 'JM', 'JP', 'KZ', 'KE', 'KR', 'KG', 'LA', 'LS', 'LV', 'LR', 'LY', 'LI', 'LT', 'LU', 'MG', 'MW', 'MY', 'MV', 'ML', 'MT', 'MQ', 'MR', 'MU', 'MX', 'MC', 'MN', 'MD', 'MS', 'MA', 'MZ', 'NA', 'NR', 'NP', 'NL', 'AN', 'AW', 'NC', 'VU', 'NZ', 'NI', 'NE', 'NG', 'NF', 'NO', 'MP', 'FM', 'MH', 'PW', 'PK', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'GW', 'PR', 'RE', 'RU', 'RW', 'AI', 'SM', 'ST', 'SN', 'SC', 'SL', 'SG', 'SK', 'VN', 'SI', 'ZA', 'ZW', 'ES', 'SR', 'SZ', 'SE', 'CH', 'TJ', 'TH', 'TG', 'TK', 'TO', 'TT', 'TR', 'TM', 'TC', 'UG', 'MK', 'EG', 'GB', 'TZ', 'US', 'BF', 'UY', 'UZ', 'WF', 'WS', 'ZM', 'BA', 'FJ', 'HK', 'MO', 'VE', 'AZ', 'BH', 'AM', 'CY', 'GE', 'IL', 'JO', 'KW', 'LB', 'OM', 'QA', 'SA', 'AE', 'YE', 'PS', 'AF', 'TL', 'NU', 'RO', 'SO', 'KM', 'TN', 'IQ', 'SH', 'KN', 'LC', 'PM', 'VC', 'TV', 'UA', 'VI', 'RS', 'ME'];\r\n\r\n const getCountriesAndSetState = () => {\r\n if (state.get('userCountries')) {\r\n return;\r\n }\r\n\r\n const countries = _.map(countryCodes, code => ({\r\n Key: code,\r\n Value: i18n.getString(`UserCountry_${code}`) || code,\r\n })).sort((a, b) => ((a.Value > b.Value) ? 1 : -1));\r\n\r\n state.set('userCountries', countries);\r\n };\r\n\r\n const userCountryService = {\r\n getCountriesAndSetState,\r\n };\r\n\r\n return {\r\n userCountryService,\r\n };\r\n};\r\n","/* istanbul ignore file */\r\nimport { BackboneSchema as backboneSchema } from '@bingads-webui/backbone-schema';\r\nimport { getHotelCenterService } from '@bingads-webui-campaign/hotel-center-service';\r\nimport _ from 'underscore';\r\n\r\nexport const getSubAccountModel = ({\r\n state, i18n, subAccountSchema, jsdata, edm,\r\n}) => {\r\n if (!i18n || !subAccountSchema || !state || !jsdata || !edm) {\r\n return {};\r\n }\r\n const { AccountService } = getHotelCenterService({ state, jsdata, edm });\r\n // eslint-disable-next-line no-param-reassign\r\n subAccountSchema.properties.Name.required = true;\r\n const SchemaModel = backboneSchema(subAccountSchema, i18n, ['Name']);\r\n\r\n /**\r\n * Sub account backbone model based on schema\r\n * @extends Backbone.Model\r\n */\r\n\r\n class SubAccountModel extends SchemaModel {\r\n initialize(options = {}) {\r\n if (options.Id) {\r\n this.id = options.Id;\r\n }\r\n }\r\n\r\n get idAttribute() {\r\n return 'Id';\r\n }\r\n\r\n toJSON() {\r\n const json = super.toJSON();\r\n\r\n this.attachNestedModels(json, ['DailyBudget', 'MaximumBid', 'Bid', 'BidMultipliers', 'HotelAssociationCount']);\r\n\r\n return json;\r\n }\r\n\r\n sync(method, model, options) {\r\n const json = model.toJSON();\r\n\r\n this.accountService = new AccountService();\r\n\r\n switch (method) {\r\n case 'read':\r\n return this.accountService.fetchSubAccountAsync()\r\n .then((subAccount) => {\r\n // For V1, there is only one fixed account with one sub-account\r\n if (subAccount) {\r\n this.parse(subAccount);\r\n this.set('Id', subAccount.Id);\r\n\r\n // to do [rayduan]: add support for nested models in backbone-model\r\n this.set('DailyBudget', subAccount.DailyBudget);\r\n this.set('MaximumBid', subAccount.MaximumBid);\r\n this.set('Bid', subAccount.Bid);\r\n this.set('BidMultipliers', subAccount.BidMultipliers);\r\n this.set('HotelAssociationCount', subAccount.HotelAssociationCount);\r\n }\r\n });\r\n case 'create':\r\n return jsdata.SubAccount.create(json, { cacheResponse: false });\r\n case 'patch':\r\n case 'update':\r\n {\r\n if (_.has(json, 'Bid') && json.Bid.Amount === null) {\r\n json.Bid = null; // if user didn't input Bid amout, pass null object to odata\r\n }\r\n const updatedId = model.get('Id') || model.id;\r\n const subAccountModel = state.get('subAccount_model');\r\n\r\n // if the updated subaccount Id equal current global subaccount model in state\r\n // updated the status for subaccout model\r\n if (subAccountModel && subAccountModel.Id === updatedId) {\r\n state.unset('subAccount_model');\r\n }\r\n return jsdata.SubAccount.update(\r\n updatedId,\r\n _.isEmpty(options.attrs) ? json : _.pick(json, options.attrs),\r\n { cacheResponse: false }\r\n );\r\n }\r\n case 'delete':\r\n return jsdata.SubAccount.destroy(model.id, {\r\n entitySet: this.entitySet,\r\n });\r\n default:\r\n throw new Error(`sync method ${method} is not supported`);\r\n }\r\n }\r\n\r\n attachNestedModels(json, fieldNames) {\r\n _.each(fieldNames, (field) => {\r\n if (this.has(field) || _.contains(this.changedAttributes(), 'MaximumBid')) {\r\n json[field] = this.get(field); // eslint-disable-line\r\n }\r\n });\r\n }\r\n }\r\n\r\n return {\r\n SubAccountModel,\r\n };\r\n};\r\n","import _ from 'underscore';\r\n\r\nexport const getBidMultiplierUtils = ({ i18n, state }) => {\r\n if (!i18n || !state) {\r\n return {};\r\n }\r\n const weekDayMap = {\r\n Monday: 'WeekDay_2',\r\n Tuesday: 'WeekDay_3',\r\n Wednesday: 'WeekDay_4',\r\n Thursday: 'WeekDay_5',\r\n Friday: 'WeekDay_6',\r\n Saturday: 'WeekDay_7',\r\n Sunday: 'WeekDay_1',\r\n };\r\n\r\n const getSegmentText = (minNight, maxNight, isLengthOfStay) => {\r\n if (maxNight) {\r\n const segment = maxNight === minNight ? minNight : `${minNight}-${maxNight}`;\r\n const segmentLabel = isLengthOfStay ? i18n.getString('HotelCenter_Overview_LengthOfStay_Multipliers_NightsSegment_Label') : i18n.getString('HotelCenter_Overview_AdvancedBooking_Multipliers_DaysSegment_Label');\r\n\r\n return segmentLabel.replace(/\\{0\\}/g, segment);\r\n }\r\n // current node is the last one\r\n const addOnText = isLengthOfStay ? i18n.getString('HotelCenter_Overview_LengthOfStay_Multipliers_InputNights_AddOn_Label') : i18n.getString('HotelCenter_Overview_AdvancedBooking_Multipliers_InputDays_AddOn_Label');\r\n\r\n return `${minNight} ${addOnText}`;\r\n };\r\n\r\n const formatStaySegments = (staySegments, isLengthOfStay) => {\r\n const res = [];\r\n const { length } = staySegments;\r\n let maxNight;\r\n let sortedStaySegments = staySegments;\r\n\r\n if (length > 1) {\r\n sortedStaySegments = _.sortBy(staySegments, item => Number(item.key));\r\n }\r\n\r\n for (let i = 0; i < length; i += 1) {\r\n if (i === length - 1) {\r\n maxNight = _.noop();\r\n } else {\r\n maxNight = (Number(sortedStaySegments[i + 1].key) - 1).toString();\r\n }\r\n res.push({\r\n key: sortedStaySegments[i].key,\r\n factor: sortedStaySegments[i].factor,\r\n value: getSegmentText(sortedStaySegments[i].key, maxNight, isLengthOfStay),\r\n strategy: sortedStaySegments[i].strategy,\r\n });\r\n }\r\n\r\n return res;\r\n };\r\n\r\n // only for lengh of stay and advanced booking mulipliers\r\n const formatDaysAndNightsMultipliers = (bidMultipliers, isLengthOfStay) => {\r\n const staySegments = [];\r\n\r\n _.each(bidMultipliers, (multiplier) => {\r\n staySegments.push({\r\n key: multiplier.key,\r\n factor: Math.abs(multiplier.percentage),\r\n strategy: multiplier.percentage >= 0 ? 'increase' : 'decrease',\r\n });\r\n });\r\n return formatStaySegments(staySegments, isLengthOfStay);\r\n };\r\n\r\n const deserializeBidMultipliers = (bidMultipliers) => {\r\n const res = {\r\n deviceType: [],\r\n dateType: [],\r\n siteType: [],\r\n userCountry: [],\r\n checkInDay: [],\r\n lengthOfStay: [],\r\n advancedBooking: [],\r\n };\r\n\r\n if (!bidMultipliers || bidMultipliers.length === 0) {\r\n return res;\r\n }\r\n _.each(bidMultipliers, (item) => {\r\n const multiplierFactor = item.Factor;\r\n let percentage = Number(multiplierFactor) * 100;\r\n\r\n percentage = parseFloat(percentage - 100).toFixed(2);\r\n\r\n if (item['@odata.type'] === '#Model.DeviceMultiplier') {\r\n _.each(item.DeviceTypes, (deviceType) => {\r\n res.deviceType.push({ deviceType, percentage });\r\n });\r\n } else if (item['@odata.type'] === '#Model.DateTypeMultiplier') {\r\n res.dateType.push({ dateType: item.DateType, percentage });\r\n } else if (item['@odata.type'] === '#Model.SiteMultiplier') {\r\n _.each(item.Sites, (siteType) => {\r\n res.siteType.push({ siteType, percentage });\r\n });\r\n } else if (item['@odata.type'] === '#Model.UserCountryMultiplier') {\r\n _.each(item.Countries, (country) => {\r\n res.userCountry.push({ country, percentage });\r\n });\r\n } else if (item['@odata.type'] === '#Model.CheckinDayOfWeekMultiplier') {\r\n _.each(item.DaysOfWeek, (dayOfWeek) => {\r\n res.checkInDay.push({ dayOfWeek, percentage });\r\n });\r\n } else if (item['@odata.type'] === '#Model.LengthOfStayMultiplier') {\r\n res.lengthOfStay.push({ key: item.MinimumNumberOfNights.toString(), percentage });\r\n } else if (item['@odata.type'] === '#Model.AdvanceBookingWindowMultiplier') {\r\n res.advancedBooking.push({ key: item.MinimumNumberOfDays.toString(), percentage });\r\n }\r\n });\r\n if (res.lengthOfStay.length > 0) {\r\n res.lengthOfStay = formatDaysAndNightsMultipliers(res.lengthOfStay, true);\r\n }\r\n if (res.advancedBooking.length > 0) {\r\n res.advancedBooking = formatDaysAndNightsMultipliers(res.advancedBooking, false);\r\n }\r\n\r\n return res;\r\n };\r\n\r\n const getMultipliersState = (input, resetFactor = false) => {\r\n const bidMultipliers = deserializeBidMultipliers(input);\r\n\r\n return _.mapObject(bidMultipliers, (multipliers, key) => {\r\n if (key === 'lengthOfStay' || key === 'advancedBooking') {\r\n if (resetFactor) {\r\n return _.map(multipliers, multiplier =>\r\n _.defaults({\r\n factor: 0,\r\n }, multiplier));\r\n }\r\n return multipliers;\r\n }\r\n const multipliersState = {};\r\n\r\n _.each(multipliers, (multiplier) => {\r\n const name = multiplier.deviceType || multiplier.dateType ||\r\n multiplier.siteType || multiplier.country || multiplier.dayOfWeek;\r\n const percentage = resetFactor ? 0 : multiplier.percentage;\r\n\r\n _.extend(multipliersState, {\r\n [name]: {\r\n strategy: percentage >= 0 ? 'increase' : 'decrease',\r\n factor: Math.abs(percentage),\r\n },\r\n });\r\n });\r\n return multipliersState;\r\n });\r\n };\r\n\r\n const bidMultiplierTextFormat = (name, percentage) => i18n.getString('HotelCenter_SubAccountBar_Device_Type_Multiplier_Format').replace(/\\{0\\}/g, name).replace(/\\{1\\}/g, percentage > 0 ? `+${percentage}` : percentage);\r\n\r\n const getDeviceTypeMultipliersText = (deviceTypeMultipliers) => {\r\n const deviceTypeMap = {\r\n Mobile: i18n.getString('HotelCenter_Overview_Multipliers_Bids_Mobile_Label'),\r\n Tablet: i18n.getString('HotelCenter_Overview_Multipliers_Bids_Tablet_Label'),\r\n Desktop: i18n.getString('HotelCenter_Overview_Multipliers_Bids_Desktop_Label'),\r\n };\r\n const deviceMultipliersText = _.map(deviceTypeMultipliers, (deviceTypeMultiplier) => {\r\n const { percentage } = deviceTypeMultiplier;\r\n const name = deviceTypeMap[deviceTypeMultiplier.deviceType];\r\n\r\n return bidMultiplierTextFormat(name, percentage);\r\n }).join(', ');\r\n\r\n return `${i18n.getString('HotelCenter_Overview_DeviceType_Multipliers_Label')}: ${deviceMultipliersText}`;\r\n };\r\n\r\n const getSiteTypeMultipliersText = (siteTypeMultipliers) => {\r\n const siteTypeMap = {\r\n LocalUniversal: i18n.getString('HotelCenter_Overview_SiteType_Multipliers_Local_Universal_Label'),\r\n MapResults: i18n.getString('HotelCenter_Overview_SiteType_Multipliers_Map_Results_Label'),\r\n PropertyPromotionAd: i18n.getString('HotelCenter_Overview_SiteType_Multipliers_Property_PromotionAd_Label'),\r\n };\r\n const siteMultipliersText = _.map(siteTypeMultipliers, (siteTypeMultiplier) => {\r\n const { percentage } = siteTypeMultiplier;\r\n const name = siteTypeMap[siteTypeMultiplier.siteType];\r\n\r\n return bidMultiplierTextFormat(name, percentage);\r\n }).join(', ');\r\n\r\n return `${i18n.getString('HotelCenter_Overview_SiteType_Multipliers_Label')}: ${siteMultipliersText}`;\r\n };\r\n\r\n const getDateTypeMultipliersText = (dateTypeMultipliers) => {\r\n const dateTypeMap = {\r\n Selected: i18n.getString('HotelCenter_Overview_DateType_Multipliers_Selected_Label'),\r\n Default: i18n.getString('HotelCenter_Overview_DateType_Multipliers_Default_Label'),\r\n };\r\n const dateTypeMultipliersText = _.map(dateTypeMultipliers, (dateTypeMultiplier) => {\r\n const { percentage } = dateTypeMultiplier;\r\n const name = dateTypeMap[dateTypeMultiplier.dateType];\r\n\r\n return bidMultiplierTextFormat(name, percentage);\r\n }).join(', ');\r\n\r\n return `${i18n.getString('HotelCenter_Overview_DateType_Multipliers_Label')}: ${dateTypeMultipliersText}`;\r\n };\r\n\r\n const getUserCountriesMultipliersText = (userCountryMultipliers) => {\r\n const userCountryMultipliersText = _.map(userCountryMultipliers, (userCountryMultiplier) => {\r\n const { percentage } = userCountryMultiplier;\r\n const countries = state.get('userCountries');\r\n const country = _.chain(countries)\r\n .findWhere({ Key: userCountryMultiplier.country })\r\n .result('Value', userCountryMultiplier.country)\r\n .value();\r\n\r\n return bidMultiplierTextFormat(country, percentage);\r\n }).join(', ');\r\n\r\n const res = `${i18n.getString('HotelCenter_Overview_UserCountry_Multipliers_Label')}: ${userCountryMultipliersText}`;\r\n\r\n return res;\r\n };\r\n\r\n const getCheckInDayMultipliersText = (checkInDayMultipliers) => {\r\n const checkInDayMultipliersText = _.map(checkInDayMultipliers, (checkInDayMultiplier) => {\r\n const { percentage } = checkInDayMultiplier;\r\n const name = i18n.getString(weekDayMap[checkInDayMultiplier.dayOfWeek]);\r\n\r\n return bidMultiplierTextFormat(name, percentage);\r\n }).join(', ');\r\n const res = `${i18n.getString('HotelCenter_Overview_CheckinDay_Multipliers_Label')}: ${checkInDayMultipliersText}`;\r\n\r\n return res;\r\n };\r\n\r\n const getLengthOfStayMultipliersText = (lengthOfStayMultipliers) => {\r\n const lengthOfStayMultipliersText = _.map(lengthOfStayMultipliers, (lengthOfStayMultiplier) => {\r\n const percentage = lengthOfStayMultiplier.factor;\r\n const name = lengthOfStayMultiplier.value;\r\n\r\n return bidMultiplierTextFormat(name, percentage);\r\n }).join(', ');\r\n\r\n const res = `${i18n.getString('HotelCenter_Overview_LengthOfStay_Multipliers_Label')}: ${lengthOfStayMultipliersText}`;\r\n\r\n return res;\r\n };\r\n\r\n\r\n const getMultipliersText = (input, hasPreLabel = true, defaultText = '') => {\r\n const res = [];\r\n\r\n if (_.isEmpty(input)) {\r\n return defaultText;\r\n }\r\n const bidMultipliers = deserializeBidMultipliers(input);\r\n\r\n // generate device type multipliers text\r\n if (bidMultipliers.deviceType.length !== 0) {\r\n res.push(i18n.getString('HotelCenter_Overview_DeviceType_Multipliers_Label_Short'));\r\n }\r\n\r\n // generate user country multipliers text\r\n if (bidMultipliers.userCountry.length !== 0) {\r\n res.push(i18n.getString('HotelCenter_Overview_UserCountry_Multipliers_Label_Short'));\r\n }\r\n\r\n // generate check in day multipliers text\r\n if (bidMultipliers.checkInDay.length !== 0) {\r\n res.push(i18n.getString('HotelCenter_Overview_CheckinDay_Multipliers_Label_Short'));\r\n }\r\n\r\n // generate length of stay multipliers text\r\n if (bidMultipliers.lengthOfStay.length !== 0) {\r\n res.push(i18n.getString('HotelCenter_Overview_LengthOfStay_Multipliers_Label_Short'));\r\n }\r\n\r\n // generate advanced booking multipliers text\r\n if (bidMultipliers.advancedBooking.length !== 0) {\r\n res.push(i18n.getString('HotelCenter_Overview_AdvancedBooking_Multipliers_Label_Short'));\r\n }\r\n\r\n // generate date type multipliers text\r\n if (bidMultipliers.dateType.length !== 0) {\r\n res.push(i18n.getString('HotelCenter_Overview_DateType_Multipliers_Label_Short'));\r\n }\r\n\r\n // generate site type multipliers text\r\n if (bidMultipliers.siteType.length !== 0) {\r\n res.push(i18n.getString('HotelCenter_Overview_SiteType_Multipliers_Label_Short'));\r\n }\r\n\r\n if (res.length === 0) {\r\n return '';\r\n }\r\n return hasPreLabel ? `${i18n.getString('HotelCenter_Overview_Multipliers_PreLabel')}${res.join(', ')}` : res.join(', ');\r\n };\r\n\r\n const getMultipliersDetailText = (input, defaultText = '') => {\r\n if (_.isEmpty(input)) {\r\n return defaultText;\r\n }\r\n const bidMultipliers = deserializeBidMultipliers(input);\r\n\r\n const convert2text = {\r\n deviceType: getDeviceTypeMultipliersText,\r\n dateType: getDateTypeMultipliersText,\r\n siteType: getSiteTypeMultipliersText,\r\n userCountry: getUserCountriesMultipliersText,\r\n checkInDay: getCheckInDayMultipliersText,\r\n lengthOfStay: getLengthOfStayMultipliersText,\r\n };\r\n\r\n return _.chain(bidMultipliers)\r\n .map((value, key) => {\r\n if (_.isFunction(convert2text[key]) && !_.isEmpty(value)) {\r\n return convert2text[key](value);\r\n }\r\n return null;\r\n })\r\n .compact()\r\n .join(';')\r\n .value();\r\n };\r\n\r\n const addDeviceTypeBidMultipliers = bidMultiplier => (_.isUndefined(bidMultiplier.factor) ? {} : {\r\n DeviceTypes: [bidMultiplier.value],\r\n Factor: bidMultiplier.factor,\r\n '@odata.type': '#Model.DeviceMultiplier',\r\n });\r\n\r\n const addDateTypeBidMultipliers = bidMultiplier => (_.isUndefined(bidMultiplier.factor) ? {} : {\r\n DateType: bidMultiplier.value,\r\n Factor: bidMultiplier.factor,\r\n '@odata.type': '#Model.DateTypeMultiplier',\r\n });\r\n\r\n\r\n const addSiteTypeBidMultipliers = bidMultiplier => (_.isUndefined(bidMultiplier.factor) ? {} : {\r\n Sites: [bidMultiplier.value],\r\n Factor: bidMultiplier.factor,\r\n '@odata.type': '#Model.SiteMultiplier',\r\n });\r\n\r\n const addUserCountryBidMultipliers = bidMultiplier =>\r\n (_.isUndefined(bidMultiplier.factor) ? {} : {\r\n Countries: [bidMultiplier.value],\r\n Factor: bidMultiplier.factor,\r\n '@odata.type': '#Model.UserCountryMultiplier',\r\n });\r\n\r\n const addCheckInDayBidMultipliers = bidMultiplier =>\r\n (_.isUndefined(bidMultiplier.factor) ? {} : {\r\n DaysOfWeek: [bidMultiplier.value],\r\n Factor: bidMultiplier.factor,\r\n '@odata.type': '#Model.CheckinDayOfWeekMultiplier',\r\n });\r\n\r\n const addLengthOfStayBidMultipliers = bidMultiplier =>\r\n (_.isUndefined(bidMultiplier.factor) ? {} : {\r\n MinimumNumberOfNights: Number(bidMultiplier.value),\r\n Factor: bidMultiplier.factor,\r\n '@odata.type': '#Model.LengthOfStayMultiplier',\r\n });\r\n\r\n const addAdvancedBookingBidMultipliers = bidMultiplier =>\r\n (_.isUndefined(bidMultiplier.factor) ? {} : {\r\n MinimumNumberOfDays: Number(bidMultiplier.value),\r\n Factor: bidMultiplier.factor,\r\n '@odata.type': '#Model.AdvanceBookingWindowMultiplier',\r\n });\r\n\r\n const serializeBidMultipliers = (bidMultipliers) => {\r\n const res = [];\r\n\r\n _.each(bidMultipliers, (bidMultiplier) => {\r\n if (bidMultiplier.type === 'deviceType') {\r\n res.push(addDeviceTypeBidMultipliers(bidMultiplier));\r\n } else if (bidMultiplier.type === 'dateType') {\r\n res.push(addDateTypeBidMultipliers(bidMultiplier));\r\n } else if (bidMultiplier.type === 'siteType') {\r\n res.push(addSiteTypeBidMultipliers(bidMultiplier));\r\n } else if (bidMultiplier.type === 'userCountry') {\r\n res.push(addUserCountryBidMultipliers(bidMultiplier));\r\n } else if (bidMultiplier.type === 'checkInDay') {\r\n res.push(addCheckInDayBidMultipliers(bidMultiplier));\r\n } else if (bidMultiplier.type === 'lengthOfStay') {\r\n res.push(addLengthOfStayBidMultipliers(bidMultiplier));\r\n } else if (bidMultiplier.type === 'advancedBooking') {\r\n res.push(addAdvancedBookingBidMultipliers(bidMultiplier));\r\n }\r\n });\r\n\r\n return _.filter(res, item => !_.isEmpty(item));\r\n };\r\n\r\n return {\r\n bidMultiplierUtils: {\r\n weekDayMap,\r\n formatStaySegments,\r\n getMultipliersState,\r\n serializeBidMultipliers,\r\n getMultipliersDetailText,\r\n getMultipliersText,\r\n },\r\n };\r\n};\r\n\r\n","import { getBidUtils } from './src/bid-utils';\r\nimport { getDateUtils } from './src/date-utils';\r\nimport { getBidMultiplierUtils } from './src/bid-multiplier-utils';\r\nimport { getInlineDownloadUtils } from './src/inline-download-utils';\r\n\r\nexport const getHotelCenterUtils = ({ pageContext, i18n, state } = {}) => ({\r\n ...getBidUtils({ pageContext, i18n }),\r\n ...getDateUtils({ pageContext }),\r\n ...getBidMultiplierUtils({ i18n, state }),\r\n ...getInlineDownloadUtils(),\r\n});\r\n","import _ from 'underscore';\r\n\r\nexport const getBidUtils = ({ i18n, pageContext }) => {\r\n if (!i18n || !pageContext) {\r\n return {};\r\n }\r\n const getText = (jsonValue, defaultText = '') => {\r\n if (_.isNull(jsonValue) || jsonValue.Amount < 0) {\r\n return defaultText;\r\n }\r\n const amount = i18n.formatDecimalToFixed(jsonValue.Amount);\r\n const addonText = _.result({\r\n '#Model.FixedBid': pageContext.AccountCurrencyCode,\r\n '#Model.PercentageBid': pageContext.DecimalFormatter.percentSymbol,\r\n }, jsonValue['@odata.type'], pageContext.AccountCurrencyCode);\r\n\r\n return [amount, addonText].join(' ');\r\n };\r\n\r\n return {\r\n bidUtils: {\r\n getText,\r\n },\r\n };\r\n};\r\n","export const getDateUtils = ({ pageContext }) => {\r\n if (!pageContext) {\r\n return {};\r\n }\r\n\r\n const accountTimeZoneOffsetMinutes = pageContext.UtcOffsetHours * 60;\r\n const localTimeZoneOffsetMinutes = (new Date()).getTimezoneOffset();\r\n const totalOffset = (localTimeZoneOffsetMinutes + accountTimeZoneOffsetMinutes) * 60000;\r\n\r\n\r\n const local2account = date =>\r\n new Date(date.getTime() + totalOffset);\r\n\r\n const account2local = date =>\r\n new Date(date.getTime() - totalOffset);\r\n\r\n return {\r\n dateUtils: {\r\n local2account,\r\n account2local,\r\n },\r\n };\r\n};\r\n\r\n","import _ from 'underscore';\r\n\r\nexport const getInlineDownloadUtils = () => {\r\n const processReportRuleForHotelCenterBIDimensionRow = ReportRule => _.defaults({\r\n SaveReport: true,\r\n Selection: _.defaults({\r\n '@odata.type': '#Model.DimensionReportSelection',\r\n Type: 'VerticalPerformance',\r\n }, ReportRule.Selection),\r\n }, ReportRule);\r\n\r\n const processReportRuleForHotelCenterBookingRow = ReportRule => _.defaults({\r\n SaveReport: true,\r\n Selection: _.defaults({\r\n '@odata.type': '#Model.DimensionReportSelection',\r\n Type: 'VerticalBookingDetails',\r\n }, ReportRule.Selection),\r\n }, ReportRule);\r\n\r\n return {\r\n inlineDownloadUtils: {\r\n processReportRuleForHotelCenterBIDimensionRow,\r\n processReportRuleForHotelCenterBookingRow,\r\n },\r\n };\r\n};\r\n\r\n","import { useRef, useEffect } from 'react';\r\n\r\nexport function useDidUpdate(callback, deps) {\r\n const isMounted = useRef();\r\n\r\n useEffect(() => {\r\n if (!isMounted.current) {\r\n // do componentDidMount logic\r\n isMounted.current = true;\r\n } else {\r\n // do componentDidUpdate logic\r\n callback();\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, deps);\r\n}\r\n","import { useState } from 'react';\r\n\r\nexport function useConstructor(callback) {\r\n const [v, setV] = useState(() => callback());\r\n return [v, setV];\r\n}\r\n","\r\nimport React, { useContext } from 'react';\r\nimport classnames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { Label } from '@bingads-webui-react/fabric-control';\r\n\r\nconst getStyles = () => ({\r\n CampaignName: {\r\n },\r\n});\r\n\r\nexport const CampaignName = React.memo((props) => {\r\n const {\r\n campaignName,\r\n } = props;\r\n const i18n = useContext(I18nContext);\r\n const classes = useDefaultStyles(getStyles);\r\n return (\r\n
\r\n \r\n
\r\n {campaignName}\r\n
\r\n
);\r\n});\r\n\r\nCampaignName.propTypes = {\r\n campaignName: PropTypes.string.isRequired,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport classnames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\nimport { TextField } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { globalErrorMsg, isAdFormatValid } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { withVerticalAlignCenterSpan, Errors, getNameErrorMsg, ErrorString, validateName, checkShouldShowError, checkShouldShowErrors } from '@bingads-webui-campaign-react/wizard-shared-components';\r\n\r\nconst maxLength = 256;\r\nexport const isAdgroupNameValid = name => validateName({ name, maxLength }) == null;\r\n\r\nexport const getAdGroupNameErrorMessage = (name, adFormat) => {\r\n if (checkShouldShowErrors(name)) {\r\n return globalErrorMsg;\r\n }\r\n if (!isAdgroupNameValid(name.value)) {\r\n if (checkShouldShowError(name)) {\r\n return globalErrorMsg;\r\n }\r\n }\r\n if (!isAdFormatValid(adFormat)) {\r\n if (checkShouldShowError(adFormat)) {\r\n return globalErrorMsg;\r\n }\r\n }\r\n return '';\r\n};\r\n\r\nexport const defaultName = undefined;\r\n\r\nexport const AdgroupName = React.memo((props) => {\r\n const {\r\n adgroupName,\r\n setAdgroupName,\r\n } = props;\r\n const i18n = useContext(I18nContext);\r\n const adgroupNameText = i18n.getString(_TL_('Ad group name'));\r\n const error = getNameErrorMsg({ code: validateName({ name: adgroupName.value, maxLength }), i18n, maxLength });\r\n const shouldShowError = checkShouldShowError(adgroupName);\r\n return (\r\n
\r\n ())}\r\n onChange={(e, value) => {\r\n setAdgroupName({\r\n value,\r\n isDirty: true,\r\n });\r\n }}\r\n styles={{ fieldGroup: { width: 461, marginTop: '8px' } }}\r\n />\r\n {shouldShowError && error && }\r\n {checkShouldShowErrors(adgroupName) && x.message)} />}\r\n
\r\n );\r\n});\r\n\r\nAdgroupName.propTypes = {\r\n adgroupName: PropTypes.string,\r\n setAdgroupName: PropTypes.func.isRequired,\r\n};\r\n\r\nAdgroupName.defaultProps = {\r\n adgroupName: undefined,\r\n};\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useContext, Fragment } from 'react';\r\nimport classnames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport { TextField, Label, Stack } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport appConfig from '@bingads-webui-component-legacy/config/index';\r\nimport { getBidErrorMsg, validateNumber, getAccountCurrencyCode, globalErrorMsg, bidStrategyOptionKeys, Disclaimer } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { ErrorString, checkShouldShowError, } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nexport const bidFields = {\r\n commissionRate: 'commissionRate',\r\n percentCpcBid: 'percentCpcBid',\r\n searchBid: 'searchBid',\r\n};\r\n\r\nexport const getBaseBidMinMax = ({ bidStrategyType, serverContext }) => {\r\n const min = (serverContext && serverContext.KeywordBidRange && serverContext.KeywordBidRange.FloorValue) || 0.01;\r\n const max = (serverContext && serverContext.KeywordBidRange && serverContext.KeywordBidRange.CeilingValue) || 1000;\r\n // align the range with search ad group campaign as MT create it with the same flow.\r\n switch (bidStrategyType) {\r\n case bidStrategyOptionKeys.Commission:\r\n return { min: appConfig.get('KeywordCommissionRateRange') && appConfig.get('KeywordCommissionRateRange').FloorValue, max: appConfig.get('KeywordCommissionRateRange') && appConfig.get('KeywordCommissionRateRange').CeilingValue };\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return { min: appConfig.get('KeywordPercentCpcBidRange') && appConfig.get('KeywordPercentCpcBidRange').FloorValue, max: appConfig.get('KeywordPercentCpcBidRange') && appConfig.get('KeywordPercentCpcBidRange').CeilingValue };\r\n case bidStrategyOptionKeys.ManualCpc:\r\n default:\r\n return { min, max };\r\n }\r\n};\r\n\r\nexport const validateBaseBid = ({\r\n baseBid, bidStrategyType, min, max,\r\n}) => {\r\n switch (bidStrategyType) {\r\n case bidStrategyOptionKeys.Commission:\r\n return validateNumber({\r\n value: baseBid.commissionRate, min, max, notRequired: true, digitLength: 2, notIncludeMin: true,\r\n });\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return validateNumber({\r\n value: baseBid.percentCpcBid, min, max, digitLength: 2, notIncludeMin: true,\r\n });\r\n case bidStrategyOptionKeys.ManualCpc:\r\n default:\r\n return validateNumber({\r\n value: baseBid.searchBid, min, max, digitLength: 2,\r\n });\r\n }\r\n};\r\n\r\nexport const isBaseBidValid = ({ baseBid, bidStrategyType, serverContext }) => validateBaseBid({ baseBid, bidStrategyType, ...getBaseBidMinMax({ bidStrategyType, serverContext }) }) == null;\r\nexport const getBaseBidErrorMessage = ({ baseBid, bidStrategy, serverContext }) => {\r\n const bidStrategyType = bidStrategy && bidStrategy.option;\r\n if (!isBaseBidValid({ baseBid, bidStrategyType, serverContext }) && checkShouldShowError(baseBid)) {\r\n return globalErrorMsg;\r\n }\r\n return '';\r\n};\r\n\r\nexport const getBaseBidTitleDetails = (i18n, baseBid, bidStrategy, accountCurrencyCode) => {\r\n const bidStrategyType = bidStrategy && bidStrategy.option;\r\n switch (bidStrategyType) {\r\n case bidStrategyOptionKeys.Commission:\r\n return `${i18n.getString(_TL_('Commission rate: '))}${baseBid.commissionRate || bidStrategy.Commission || ''}%`;\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return `${i18n.getString(_TL_('Percent bid: '))}${baseBid.percentCpcBid || ''}%`;\r\n case bidStrategyOptionKeys.ManualCpc:\r\n default:\r\n return `${i18n.getString(_TL_('Bid: '))}${baseBid.searchBid || ''} ${accountCurrencyCode}`;\r\n }\r\n};\r\n\r\nconst getStyles = () => ({\r\n baseBid: {\r\n '& .subtitle': {\r\n marginBottom: '28px',\r\n fontSize: '20px',\r\n },\r\n '& .dashline': {\r\n borderBottom: '1px solid',\r\n width: '100%',\r\n margin: '24px 0',\r\n },\r\n '& .alert': {\r\n marginTop: '8px',\r\n },\r\n },\r\n});\r\n\r\nconst BidOrPercent = (props) => {\r\n const {\r\n title,\r\n field,\r\n baseBid,\r\n setBaseBid,\r\n childPart,\r\n } = props;\r\n return (\r\n \r\n \r\n \r\n {\r\n setBaseBid({\r\n [field]: value,\r\n isDirty: true,\r\n });\r\n }}\r\n styles={{ fieldGroup: { width: 110 } }}\r\n className={field}\r\n />\r\n {childPart()}\r\n \r\n \r\n );\r\n};\r\n\r\nBidOrPercent.propTypes = {\r\n baseBid: PropTypes.shape({}),\r\n setBaseBid: PropTypes.func.isRequired,\r\n title: PropTypes.string.isRequired,\r\n field: PropTypes.string.isRequired,\r\n childPart: PropTypes.func.isRequired,\r\n};\r\n\r\nBidOrPercent.defaultProps = {\r\n baseBid: {\r\n value: undefined,\r\n isDirty: false,\r\n },\r\n};\r\n\r\nconst CampaignBidInput = (props) => {\r\n const i18n = useContext(I18nContext);\r\n const {\r\n bidStrategy,\r\n } = props;\r\n const bidStrategyType = bidStrategy && bidStrategy.option;\r\n switch (bidStrategyType) {\r\n case bidStrategyOptionKeys.Commission:\r\n return (\r\n
\r\n \r\n
\r\n {`${bidStrategy.Commission}%`}\r\n
\r\n
\r\n );\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\n\r\nCampaignBidInput.propTypes = {\r\n bidStrategy: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nCampaignBidInput.defaultProps = {\r\n};\r\n\r\n\r\nconst BidInput = (props) => {\r\n const i18n = useContext(I18nContext);\r\n const serverContext = useContext(ServerContext);\r\n const accountCurrencyCode = getAccountCurrencyCode(serverContext);\r\n const {\r\n baseBid,\r\n setBaseBid,\r\n bidStrategyType,\r\n } = props;\r\n switch (bidStrategyType) {\r\n case bidStrategyOptionKeys.Commission:\r\n return (\r\n (%)\r\n }\r\n />);\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return (\r\n (%)\r\n }\r\n />);\r\n case bidStrategyOptionKeys.ManualCpc:\r\n default:\r\n return (\r\n ({i18n.getString(_TL_('{{item}}'), { item: accountCurrencyCode })})\r\n }\r\n />);\r\n }\r\n};\r\n\r\nBidInput.propTypes = {\r\n baseBid: PropTypes.shape({}),\r\n setBaseBid: PropTypes.func.isRequired,\r\n bidStrategyType: PropTypes.string.isRequired,\r\n};\r\n\r\nBidInput.defaultProps = {\r\n baseBid: {\r\n value: undefined,\r\n isDirty: false,\r\n },\r\n};\r\n\r\n\r\nexport const BaseBid = React.memo((props) => {\r\n const {\r\n baseBid,\r\n setBaseBid,\r\n bidStrategy,\r\n } = props;\r\n const bidStrategyType = bidStrategy && bidStrategy.option;\r\n const i18n = useContext(I18nContext);\r\n const serverContext = useContext(ServerContext);\r\n const minMax = getBaseBidMinMax({ bidStrategyType, serverContext });\r\n const error = getBidErrorMsg({\r\n code: validateBaseBid({ baseBid, bidStrategyType, ...minMax }),\r\n i18n,\r\n ...minMax,\r\n isPercent: bidStrategyType === bidStrategyOptionKeys.PercentCpc || bidStrategyType === bidStrategyOptionKeys.Commission,\r\n });\r\n const shouldShowError = checkShouldShowError(baseBid);\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n return (\r\n
\r\n \r\n
\r\n \r\n
\r\n {shouldShowError && error && }\r\n {(bidStrategyType === bidStrategyOptionKeys.Commission) && }\r\n
\r\n );\r\n});\r\n\r\nBaseBid.propTypes = {\r\n baseBid: PropTypes.shape({}),\r\n setBaseBid: PropTypes.func.isRequired,\r\n bidStrategy: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nBaseBid.defaultProps = {\r\n baseBid: {\r\n searchBid: undefined,\r\n percentCpcBid: undefined,\r\n commissionRate: undefined,\r\n isDirty: false,\r\n },\r\n};\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, { useState, useContext } from 'react';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport classnames from 'classnames';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { usePatch, getAccountCurrencyCode, AdFormat } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { Collapse, TextTitle } from '@bingads-webui-campaign/wizard-jumbo-card';\r\nimport { Link, Stack } from '@bingads-webui-react/fabric-control';\r\nimport { CampaignName } from './campaign-name';\r\nimport { AdgroupName, getAdGroupNameErrorMessage } from './adgroup-name';\r\nimport { BaseBid, getBaseBidErrorMessage, getBaseBidTitleDetails } from './base-bid';\r\n\r\nconst getStyles = () => ({\r\n AdgroupBasic: {\r\n '& .section ~ .section': {\r\n marginTop: '32px',\r\n },\r\n },\r\n});\r\n\r\n\r\nexport const AdgroupBasic = (props) => {\r\n const {\r\n adgroup,\r\n bidStrategy,\r\n campaignName,\r\n patchAdgroup,\r\n scenario,\r\n permissions,\r\n } = props;\r\n const i18n = useContext(I18nContext);\r\n const classes = useDefaultStyles(getStyles);\r\n const setAdgroupName = usePatch(patchAdgroup, 'name');\r\n const setAdFormat = usePatch(patchAdgroup, 'adFormat');\r\n const setBaseBid = usePatch(patchAdgroup, 'baseBid');\r\n\r\n const allPanelItems = ['adGroup', 'bidTargets'];\r\n const [activeKeys, setActiveKeys] = useState(allPanelItems);\r\n const onCollapseAll = () => {\r\n if (activeKeys.length) {\r\n setActiveKeys([]);\r\n } else {\r\n setActiveKeys(allPanelItems);\r\n }\r\n };\r\n\r\n const getAdGroupTitleDetail = () => {\r\n const details = [];\r\n if (adgroup.name.value) {\r\n details.push(`${i18n.getString(_TL_('Ad group name'))}: ${adgroup.name.value}`);\r\n }\r\n if (adgroup.adFormat) {\r\n const entries = ['HPA', 'PPA'];\r\n const adFormatValue = _.compact(entries.map((entry) => { if (adgroup.adFormat[entry]) { return entry; } return false; })).join(', ');\r\n if (adFormatValue) {\r\n const IsRenameHotelToLodgingEnabled = permissions && permissions.dynamic && permissions.dynamic.IsRenameHotelToLodgingEnabled;\r\n const detailsString = IsRenameHotelToLodgingEnabled ? `${i18n.getString(_TL_('Property ad format'))}: ${adFormatValue}` : `${i18n.getString(_TL_('Hotel ad format'))}: ${adFormatValue}`;\r\n details.push(detailsString);\r\n }\r\n }\r\n return details.join(', ');\r\n };\r\n const serverContext = useContext(ServerContext);\r\n const accountCurrencyCode = getAccountCurrencyCode(serverContext);\r\n\r\n return (\r\n
\r\n \r\n {activeKeys.length ? i18n.getString(_TL_('Collapse all')) : i18n.getString(_TL_('Expand all'))}\r\n \r\n \r\n }\r\n error={getAdGroupNameErrorMessage(adgroup.name, adgroup.adFormat)}\r\n >\r\n \r\n \r\n \r\n \r\n }\r\n error={getBaseBidErrorMessage({ baseBid: adgroup.baseBid, bidStrategy, serverContext })}\r\n >\r\n \r\n \r\n \r\n
);\r\n};\r\n\r\nAdgroupBasic.propTypes = {\r\n campaignName: PropTypes.string.isRequired,\r\n adgroup: PropTypes.shape({}),\r\n patchAdgroup: PropTypes.func.isRequired,\r\n scenario: PropTypes.string.isRequired,\r\n bidStrategy: PropTypes.shape({}).isRequired,\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.shape({\r\n IsRenameHotelToLodgingEnabled: PropTypes.bool,\r\n }),\r\n }),\r\n};\r\n\r\nAdgroupBasic.defaultProps = {\r\n adgroup: {},\r\n permissions: {\r\n dynamic: {\r\n IsRenameHotelToLodgingEnabled: false,\r\n },\r\n },\r\n};\r\n","import {\r\n deviceDefaultSetting,\r\n advancedBookingDefaultSetting,\r\n checkinDayDefaultSetting,\r\n userSetDatesDefaultSetting,\r\n checkinDateDefaultSetting,\r\n lengthOfStayDefaultSetting,\r\n defaultLocationData,\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\nimport { audienceAdsOptionKeys, defaultAdFormat } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { defaultName } from './adgroup-name';\r\n\r\nconst fields = {\r\n name: 'name',\r\n adFormat: 'adFormat',\r\n baseBid: 'baseBid',\r\n urlOptions: 'urlOptions',\r\n device: 'device',\r\n ABW: 'ABW',\r\n checkinDay: 'checkinDay',\r\n lengthOfStay: 'lengthOfStay',\r\n checkinDate: 'checkinDate',\r\n userSetDates: 'userSetDates',\r\n location: 'location',\r\n adSchedule: 'adSchedule',\r\n audienceAds: 'audienceAds',\r\n};\r\n\r\nconst {\r\n name,\r\n adFormat,\r\n baseBid,\r\n urlOptions,\r\n device,\r\n location,\r\n adSchedule,\r\n ABW,\r\n checkinDay,\r\n lengthOfStay,\r\n checkinDate,\r\n userSetDates,\r\n audienceAds,\r\n} = fields;\r\n\r\nexport const fieldsToCheck = [name, adFormat, adSchedule, audienceAds, location, baseBid, urlOptions, device, ABW, checkinDay, lengthOfStay, checkinDate, userSetDates];\r\n\r\nexport const defaultAdgroupBasicData = {\r\n name: {\r\n value: defaultName,\r\n },\r\n adSchedule: {\r\n useParentLevel: true,\r\n },\r\n dayTimeRanges: [],\r\n AdDistribution: 'BingYahooAndSearchPartners',\r\n adFormat: defaultAdFormat,\r\n baseBid: { value: '1.00' },\r\n exclusions: {},\r\n urlOptions: {},\r\n audienceAds: {\r\n parentLevelSettings: { option: audienceAdsOptionKeys.Increase, value: 0 },\r\n currentLevelSettings: { option: audienceAdsOptionKeys.Increase, value: 0 },\r\n useParentLevel: true,\r\n },\r\n location: {\r\n ...defaultLocationData,\r\n useParentLevel: true,\r\n },\r\n device: {\r\n parentLevelSettings: [...deviceDefaultSetting],\r\n currentLevelSettings: [...deviceDefaultSetting],\r\n useParentLevel: true,\r\n },\r\n ABW: {\r\n parentLevelSettings: [],\r\n currentLevelSettings: [...advancedBookingDefaultSetting],\r\n useParentLevel: true,\r\n },\r\n checkinDay: {\r\n parentLevelSettings: [...checkinDayDefaultSetting],\r\n currentLevelSettings: [...checkinDayDefaultSetting],\r\n useParentLevel: true,\r\n },\r\n userSetDates: {\r\n parentLevelSettings: [...userSetDatesDefaultSetting],\r\n currentLevelSettings: [...userSetDatesDefaultSetting],\r\n useParentLevel: true,\r\n },\r\n checkinDate: {\r\n parentLevelSettings: [],\r\n currentLevelSettings: [...checkinDateDefaultSetting],\r\n useParentLevel: true,\r\n },\r\n lengthOfStay: {\r\n parentLevelSettings: [],\r\n currentLevelSettings: [...lengthOfStayDefaultSetting],\r\n useParentLevel: true,\r\n },\r\n};\r\n","import _ from 'underscore';\r\nimport moment from 'moment';\r\nimport {\r\n converODataObjectToDeviceState, converODataObjectToABWState, converODataObjectToLengthOfStayState, converODataObjectToCheckinDayState, converODataObjectToCheckinDateState, converODataObjectToUserSetDatesState,\r\n getCampaignTargetsCriterions, getAdGroupTargetsCriterions,\r\n updateDeviceByResponse, updateABWByResponse, updateCheckinDayByResponse, updateLengthOfStayByResponse, updateCheckinDateByResponse, updateUserSetDatesByResponse,\r\n} from '@bingads-webui-campaign/hotel-common-upsert';\r\n\r\n\r\n/* eslint-disable no-plusplus */\r\nfunction commonConvertTargetStateToTargetSchema({\r\n campaign, adgroup, target, CriterionType, targetCriterion,\r\n}) {\r\n const { useParentLevel } = target;\r\n const currentLevelSettings = [...target.currentLevelSettings];\r\n let newCurrentLevelSettings = [];\r\n const targetSchema = [];\r\n if (useParentLevel) {\r\n for (let i = 0; i < currentLevelSettings.length; i++) {\r\n const item = { ...currentLevelSettings[i] };\r\n if (item.Id) {\r\n item.Status = 'Deleted';\r\n newCurrentLevelSettings.push(item);\r\n } else {\r\n currentLevelSettings.splice(i, 1);\r\n i--;\r\n }\r\n }\r\n } else {\r\n newCurrentLevelSettings = currentLevelSettings;\r\n }\r\n newCurrentLevelSettings.sort(a => (a.Status === 'Deleted' ? -1 : 1)); // Place the deleted item in front of the array\r\n const parentParams = {};\r\n if (adgroup.Id) {\r\n parentParams.AdGroup = { Id: adgroup.Id };\r\n } else {\r\n parentParams.AdGroupName = adgroup.name.value;\r\n }\r\n parentParams.CampaignName = campaign.Name;\r\n for (let i = 0; i < newCurrentLevelSettings.length; i++) {\r\n const item = newCurrentLevelSettings[i];\r\n if (item) {\r\n targetSchema.push({\r\n Id: item.Id,\r\n CriterionType,\r\n ...parentParams,\r\n Status: item.Status,\r\n Criterion: {\r\n BidAdjustment: item.bidAdjustmentDropdown === 'Increase by' ? item.bidAdjustmentInput - 0 : -(item.bidAdjustmentInput - 0),\r\n Type: CriterionType,\r\n ...targetCriterion(item),\r\n },\r\n });\r\n }\r\n }\r\n return { targetSchema, currentLevelSettings: newCurrentLevelSettings };\r\n}\r\n\r\nexport const convertDeviceStateToDeviceSchema = (adgroup, campaign, initTargets) => {\r\n const DeviceMap = {\r\n Tablet: 'Tablets',\r\n Computer: 'Computers',\r\n Smartphone: 'Smartphones',\r\n };\r\n const currentDeviceSchema = commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n adgroup,\r\n target: adgroup.device,\r\n CriterionType: 'Device',\r\n targetCriterion(item) {\r\n return { DeviceCriterion: { DeviceName: DeviceMap[item.device] } };\r\n },\r\n });\r\n let currentDeviceSchemaResult = [];\r\n if (!_.isEqual(initTargets, currentDeviceSchema.currentLevelSettings)) {\r\n currentDeviceSchemaResult = currentDeviceSchema.targetSchema;\r\n }\r\n return currentDeviceSchemaResult;\r\n};\r\n\r\nexport const convertABWStateToABWSchema = (adgroup, campaign, initTargets) => {\r\n const currentABWSchema = commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n adgroup,\r\n target: adgroup.ABW,\r\n CriterionType: 'AdvanceBookingWindow',\r\n targetCriterion(item) {\r\n return { AdvanceBookingWindowCriterion: { MinDays: item.minimumDays, MaxDays: item.maximumDays } };\r\n },\r\n });\r\n let currentABWSchemaResult = [];\r\n if (!_.isEqual(initTargets, currentABWSchema.currentLevelSettings)) {\r\n currentABWSchemaResult = currentABWSchema.targetSchema;\r\n }\r\n return currentABWSchemaResult;\r\n};\r\n\r\nexport const convertCheckInDayStateToCheckInDaySchema = (adgroup, campaign, initTargets) => {\r\n const currentCheckinDaySchema = commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n adgroup,\r\n target: adgroup.checkinDay,\r\n CriterionType: 'CheckInDay',\r\n targetCriterion(item) {\r\n return { CheckInDayCriterion: { CheckInDay: item.day } };\r\n },\r\n });\r\n let currentCheckinDaySchemaResult = [];\r\n if (!_.isEqual(initTargets, currentCheckinDaySchema.currentLevelSettings)) {\r\n currentCheckinDaySchemaResult = currentCheckinDaySchema.targetSchema;\r\n }\r\n return currentCheckinDaySchemaResult;\r\n};\r\n\r\nexport const convertLengthofStayStateToLengthofStaySchema = (adgroup, campaign, initTargets) => {\r\n const currentLengthOfStaySchema = commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n adgroup,\r\n target: adgroup.lengthOfStay,\r\n CriterionType: 'LengthofStay',\r\n targetCriterion(item) {\r\n return { LengthofStayCriterion: { MinNights: item.minimumNumber, MaxNights: item.maximumNumber } };\r\n },\r\n });\r\n let currentLengthofStaySchemaResult = [];\r\n if (!_.isEqual(initTargets, currentLengthOfStaySchema.currentLevelSettings)) {\r\n currentLengthofStaySchemaResult = currentLengthOfStaySchema.targetSchema;\r\n }\r\n return currentLengthofStaySchemaResult;\r\n};\r\n\r\nexport const convertCheckInDateStateToCheckInDateSchema = (adgroup, campaign, initTargets) => {\r\n const currentCheckinDateSchema = commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n adgroup,\r\n target: adgroup.checkinDate,\r\n CriterionType: 'CheckInDate',\r\n targetCriterion(item) {\r\n return { CheckInDateCriterion: { StartDate: moment(item.startDate).format('yyyy-MM-DD'), EndDate: moment(item.endDate).format('yyyy-MM-DD') } };\r\n },\r\n });\r\n let currentCheckinDateSchemaResult = [];\r\n if (!_.isEqual(initTargets, currentCheckinDateSchema.currentLevelSettings)) {\r\n currentCheckinDateSchemaResult = currentCheckinDateSchema.targetSchema;\r\n }\r\n return currentCheckinDateSchemaResult;\r\n};\r\n\r\nexport const convertUserSetDatesStateToUserSetDatesSchema = (adgroup, campaign, initTargets) => {\r\n const UserSetDatesMap = {\r\n 'Selected date': 'UserSelection',\r\n 'Default date': 'DefaultSelection',\r\n };\r\n\r\n const currentUserSetDatesSchema = commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n adgroup,\r\n target: adgroup.userSetDates,\r\n CriterionType: 'DateSelectionType',\r\n targetCriterion(item) {\r\n return { DateSelectionTypeCriterion: { HotelDateSelectionType: UserSetDatesMap[item.dates] } };\r\n },\r\n });\r\n let currentUserSetDatesSchemaResult = [];\r\n if (!_.isEqual(initTargets, currentUserSetDatesSchema.currentLevelSettings)) {\r\n currentUserSetDatesSchemaResult = currentUserSetDatesSchema.targetSchema;\r\n }\r\n return currentUserSetDatesSchemaResult;\r\n};\r\n\r\n\r\nexport const renderAdGroupTargets = (cid, aid, campaignId, adGroupId, patchAdgroup, adgroup, context) => {\r\n const getCampaignDeviceCriterionsPromise = getCampaignTargetsCriterions({\r\n type: \"isof(Criterion,'Model.DeviceCriterion')\", cid, aid, campaignId,\r\n });\r\n\r\n if (adGroupId) {\r\n const adgroupTargetsPromises = [];\r\n const getAdGroupDeviceCriterionsPromise = getAdGroupTargetsCriterions({\r\n type: \"isof(Criterion,'Model.DeviceCriterion')\", cid, aid, campaignId, adGroupId,\r\n });\r\n adgroupTargetsPromises.push(Promise.all([getCampaignDeviceCriterionsPromise, getAdGroupDeviceCriterionsPromise]).then(([campaignTargets, adGroupTargets]) => {\r\n const deviceCriterion = converODataObjectToDeviceState(adGroupTargets);\r\n context.setState(prev => ({ initTargets: { ...prev.initTargets, device: adGroupTargets.length > 0 ? deviceCriterion : [] } }));\r\n patchAdgroup('device', {\r\n parentLevelSettings: converODataObjectToDeviceState(campaignTargets),\r\n currentLevelSettings: deviceCriterion,\r\n useParentLevel: adGroupTargets.length === 0,\r\n reset: true,\r\n });\r\n }));\r\n\r\n\r\n const getAdGroupABWCriterionsPromise = getAdGroupTargetsCriterions({\r\n type: \"isof(Criterion,'Model.AdvanceBookingWindowCriterion')\", cid, aid, campaignId, adGroupId,\r\n });\r\n adgroupTargetsPromises.push(Promise.all([getAdGroupABWCriterionsPromise]).then(([adGroupTargets]) => {\r\n const ABWCriterion = converODataObjectToABWState(adGroupTargets);\r\n context.setState(prev => ({ initTargets: { ...prev.initTargets, ABW: adGroupTargets.length > 0 ? ABWCriterion : [] } }));\r\n if (adGroupTargets.length > 0) {\r\n patchAdgroup('ABW', {\r\n ...adgroup.ABW,\r\n currentLevelSettings: ABWCriterion,\r\n useParentLevel: adGroupTargets.length === 0,\r\n reset: true,\r\n });\r\n }\r\n }));\r\n\r\n\r\n const getAdGroupLengthOfStayCriterionsPromise = getAdGroupTargetsCriterions({\r\n type: \"isof(Criterion,'Model.LengthOfStayCriterion')\", cid, aid, campaignId, adGroupId,\r\n });\r\n adgroupTargetsPromises.push(Promise.all([getAdGroupLengthOfStayCriterionsPromise]).then(([adGroupTargets]) => {\r\n const lengthOfStayCriterion = converODataObjectToLengthOfStayState(adGroupTargets);\r\n context.setState(prev => ({ initTargets: { ...prev.initTargets, lengthOfStay: adGroupTargets.length > 0 ? lengthOfStayCriterion : [] } }));\r\n if (adGroupTargets.length > 0) {\r\n patchAdgroup('lengthOfStay', {\r\n ...adgroup.lengthOfStay,\r\n currentLevelSettings: lengthOfStayCriterion,\r\n useParentLevel: adGroupTargets.length === 0,\r\n reset: true,\r\n });\r\n }\r\n }));\r\n\r\n\r\n const getAdGroupCheckinDayCriterionsPromise = getAdGroupTargetsCriterions({\r\n type: \"isof(Criterion,'Model.CheckInDayCriterion')\", cid, aid, campaignId, adGroupId,\r\n });\r\n adgroupTargetsPromises.push(Promise.all([getAdGroupCheckinDayCriterionsPromise]).then(([adGroupTargets]) => {\r\n const checkinDayCriterion = converODataObjectToCheckinDayState(adGroupTargets);\r\n context.setState(prev => ({ initTargets: { ...prev.initTargets, checkinDay: adGroupTargets.length > 0 ? checkinDayCriterion : [] } }));\r\n if (adGroupTargets.length > 0) {\r\n patchAdgroup('checkinDay', {\r\n ...adgroup.checkinDay,\r\n currentLevelSettings: checkinDayCriterion,\r\n useParentLevel: adGroupTargets.length === 0,\r\n reset: true,\r\n });\r\n }\r\n }));\r\n\r\n\r\n const getAdGroupCheckinDateCriterionsPromise = getAdGroupTargetsCriterions({\r\n type: \"isof(Criterion,'Model.CheckInDateCriterion')\", cid, aid, campaignId, adGroupId,\r\n });\r\n adgroupTargetsPromises.push(Promise.all([getAdGroupCheckinDateCriterionsPromise]).then(([adGroupTargets]) => {\r\n const checkinDateCriterion = converODataObjectToCheckinDateState(adGroupTargets);\r\n context.setState(prev => ({ initTargets: { ...prev.initTargets, checkinDate: adGroupTargets.length > 0 ? checkinDateCriterion : [] } }));\r\n if (adGroupTargets.length > 0) {\r\n patchAdgroup('checkinDate', {\r\n ...adgroup.checkinDate,\r\n currentLevelSettings: checkinDateCriterion,\r\n useParentLevel: adGroupTargets.length === 0,\r\n reset: true,\r\n });\r\n }\r\n }));\r\n\r\n\r\n const getAdGroupUserSetDatesCriterionsPromise = getAdGroupTargetsCriterions({\r\n type: \"isof(Criterion,'Model.DateSelectionTypeCriterion')\", cid, aid, campaignId, adGroupId,\r\n });\r\n adgroupTargetsPromises.push(Promise.all([getAdGroupUserSetDatesCriterionsPromise]).then(([adGroupTargets]) => {\r\n const userSetDatesCriterion = converODataObjectToUserSetDatesState(adGroupTargets);\r\n context.setState(prev => ({ initTargets: { ...prev.initTargets, userSetDates: adGroupTargets.length > 0 ? userSetDatesCriterion : [] } }));\r\n patchAdgroup('userSetDates', {\r\n ...adgroup.userSetDates,\r\n currentLevelSettings: userSetDatesCriterion,\r\n useParentLevel: adGroupTargets.length === 0,\r\n reset: true,\r\n });\r\n }));\r\n return Promise.all(adgroupTargetsPromises);\r\n }\r\n return Promise.all([getCampaignDeviceCriterionsPromise]).then(([campaignTargets]) => {\r\n context.setState(prev => ({ initTargets: { ...prev.initTargets, device: [] } }));\r\n patchAdgroup('device', {\r\n ...adgroup.device,\r\n parentLevelSettings: converODataObjectToDeviceState(campaignTargets),\r\n reset: true,\r\n });\r\n });\r\n};\r\n\r\n\r\nexport const updateAllTargets = (resources, context) => {\r\n const DeviceCriterion = [];\r\n const ServerDeviceCriterion = [];\r\n const ABWCriterion = [];\r\n const ServerABWCriterion = [];\r\n const CheckinDayCriterion = [];\r\n const ServerCheckinDayCriterion = [];\r\n const LengthOfStayCriterion = [];\r\n const ServerLengthOfStayCriterion = [];\r\n const CheckinDateCriterion = [];\r\n const ServerCheckinDateCriterion = [];\r\n const UserSetDatesCriterion = [];\r\n const ServerUserSetDatesCriterion = [];\r\n _.each(resources, (criterion) => {\r\n switch (criterion.CriterionType) {\r\n case 'Device':\r\n case 'OriginalDevice':\r\n DeviceCriterion.push(criterion);\r\n if (!criterion.errors) {\r\n ServerDeviceCriterion.push(criterion);\r\n }\r\n break;\r\n case 'AdvanceBookingWindow':\r\n ABWCriterion.push(criterion);\r\n if (!criterion.errors) {\r\n ServerABWCriterion.push(criterion);\r\n }\r\n break;\r\n case 'CheckInDay':\r\n CheckinDayCriterion.push(criterion);\r\n if (!criterion.errors) {\r\n ServerCheckinDayCriterion.push(criterion);\r\n }\r\n break;\r\n case 'LengthofStay':\r\n LengthOfStayCriterion.push(criterion);\r\n if (!criterion.errors) {\r\n ServerLengthOfStayCriterion.push(criterion);\r\n }\r\n break;\r\n case 'CheckInDate':\r\n CheckinDateCriterion.push(criterion);\r\n if (!criterion.errors) {\r\n ServerCheckinDateCriterion.push(criterion);\r\n }\r\n break;\r\n case 'DateSelectionType':\r\n UserSetDatesCriterion.push(criterion);\r\n if (!criterion.errors) {\r\n ServerUserSetDatesCriterion.push(criterion);\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n const currentCriterionMap = {};\r\n if (DeviceCriterion.length > 0) {\r\n updateDeviceByResponse(DeviceCriterion, context.state.adgroup.device, context.patchAdgroup);\r\n }\r\n if (ServerDeviceCriterion.length > 0) {\r\n const currentDeviceCriterion = updateDeviceByResponse(ServerDeviceCriterion, context.state.adgroup.device);\r\n currentCriterionMap.device = currentDeviceCriterion;\r\n }\r\n if (ABWCriterion.length > 0) {\r\n updateABWByResponse(ABWCriterion, context.state.adgroup.ABW, context.patchAdgroup);\r\n }\r\n if (ServerABWCriterion.length > 0) {\r\n const currentABWCriterion = updateABWByResponse(ServerABWCriterion, context.state.adgroup.ABW);\r\n currentCriterionMap.ABW = currentABWCriterion;\r\n }\r\n if (CheckinDayCriterion.length > 0) {\r\n updateCheckinDayByResponse(CheckinDayCriterion, context.state.adgroup.checkinDay, context.patchAdgroup);\r\n }\r\n if (ServerCheckinDayCriterion.length > 0) {\r\n const currentCheckinDayCriterion = updateCheckinDayByResponse(ServerCheckinDayCriterion, context.state.adgroup.checkinDay);\r\n currentCriterionMap.checkinDay = currentCheckinDayCriterion;\r\n }\r\n if (LengthOfStayCriterion.length > 0) {\r\n updateLengthOfStayByResponse(LengthOfStayCriterion, context.state.adgroup.lengthOfStay, context.patchAdgroup);\r\n }\r\n if (ServerLengthOfStayCriterion.length > 0) {\r\n const currentLengthOfStayCriterion = updateLengthOfStayByResponse(ServerLengthOfStayCriterion, context.state.adgroup.lengthOfStay);\r\n currentCriterionMap.lengthOfStay = currentLengthOfStayCriterion;\r\n }\r\n if (CheckinDateCriterion.length > 0) {\r\n updateCheckinDateByResponse(CheckinDateCriterion, context.state.adgroup.checkinDate, context.patchAdgroup);\r\n }\r\n if (ServerCheckinDateCriterion.length > 0) {\r\n const currentCheckinDateCriterion = updateCheckinDateByResponse(ServerCheckinDateCriterion, context.state.adgroup.checkinDate);\r\n currentCriterionMap.checkinDate = currentCheckinDateCriterion;\r\n }\r\n if (UserSetDatesCriterion.length > 0) {\r\n updateUserSetDatesByResponse(UserSetDatesCriterion, context.state.adgroup.userSetDates, context.patchAdgroup);\r\n }\r\n if (ServerUserSetDatesCriterion.length > 0) {\r\n const currentUserSetDatesCriterion = updateUserSetDatesByResponse(ServerUserSetDatesCriterion, context.state.adgroup.userSetDates);\r\n currentCriterionMap.userSetDates = currentUserSetDatesCriterion;\r\n }\r\n context.setState(prev => ({\r\n initTargets: {\r\n ...prev.initTargets,\r\n ...currentCriterionMap,\r\n },\r\n }));\r\n};\r\n","import decimal from '@bingads-webui-component-legacy/humanize/decimal';\r\nimport {\r\n isDeviceTargetValid,\r\n isABWTargetValid,\r\n isCheckinDayTargetValid,\r\n isLengthOfStayTargetValid,\r\n isCheckinDateTargetValid,\r\n isUserSetDatesTargetValid,\r\n isLocationValid,\r\n notifyTargetsShowError,\r\n convertIntentOption,\r\n compareAndProcessLocations,\r\n physicalIntentOptions\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\nimport {\r\n isAdFormatValid,\r\n bidStrategyOptionKeys,\r\n collectCriterions,\r\n getAudienceAds,\r\n isAudienceAdsValid\r\n} from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport {\r\n convertDeviceStateToDeviceSchema,\r\n convertABWStateToABWSchema,\r\n convertCheckInDayStateToCheckInDaySchema,\r\n convertLengthofStayStateToLengthofStaySchema,\r\n convertCheckInDateStateToCheckInDateSchema,\r\n convertUserSetDatesStateToUserSetDatesSchema\r\n} from './get-targets-criterion';\r\nimport { fieldsToCheck } from './components';\r\nimport { isBaseBidValid } from './components/base-bid';\r\nimport { isAdgroupNameValid } from './components/adgroup-name';\r\n\r\nexport function getUnSupportedBidAdjustmentFeatures(CampaignBidStrategyType) {\r\n switch (CampaignBidStrategyType) {\r\n case 'Commission':\r\n return ['location', 'adSchedule', 'device', 'ABW', 'checkinDay', 'lengthOfStay', 'checkinDate', 'userSetDates'];\r\n default:\r\n return ['location', 'adSchedule'];\r\n }\r\n}\r\n\r\nexport function isUnSupported(feature, unSupportedFeatures, callback) {\r\n if (unSupportedFeatures.includes(feature)) {\r\n return true;\r\n }\r\n return callback();\r\n}\r\n\r\nfunction getAdSchedule(adgroup, campaign) {\r\n const targets = adgroup.adScheduleData;\r\n return targets.map((criterion) => {\r\n if (adgroup.Id) {\r\n return {\r\n ...criterion,\r\n AdGroup: {\r\n Id: adgroup.Id,\r\n },\r\n };\r\n }\r\n return {\r\n ...criterion,\r\n CampaignName: campaign.Name,\r\n AdGroupName: adgroup.name.value,\r\n };\r\n });\r\n}\r\n\r\nfunction setParent(targets, adgroup, campaign) {\r\n return targets.map((criterion) => {\r\n if (adgroup.Id) {\r\n return {\r\n ...criterion,\r\n AdGroup: {\r\n Id: adgroup.Id,\r\n },\r\n };\r\n }\r\n return {\r\n ...criterion,\r\n CampaignName: campaign.Name,\r\n AdGroupName: adgroup.name.value,\r\n };\r\n });\r\n}\r\n\r\nfunction convertLocationStateToLocationSchema(location, adgroup, campaign) {\r\n const {\r\n useParentLevel,\r\n currentLevelSettings,\r\n } = location;\r\n\r\n const {\r\n currentLocations,\r\n initLocations,\r\n } = currentLevelSettings;\r\n\r\n const noLocations = useParentLevel === true || (currentLocations == null || currentLocations.length === 0);\r\n let finalLocations = [];\r\n const intent = {\r\n Id: location.currentLevelSettings.intentId,\r\n CriterionType: 'LocationIntentCriterion',\r\n Criterion: {\r\n Type: 'LocationIntentCriterion',\r\n LocationIntentCriterion: {\r\n IntentOption: convertIntentOption(location.currentLevelSettings),\r\n },\r\n },\r\n };\r\n\r\n if (noLocations) {\r\n finalLocations = [];\r\n intent.Criterion.LocationIntentCriterion.IntentOption = physicalIntentOptions.PeopleInOrSearchingForOrViewingPages;\r\n } else {\r\n finalLocations = currentLocations;\r\n }\r\n\r\n finalLocations = compareAndProcessLocations(initLocations, finalLocations);\r\n\r\n finalLocations = finalLocations.concat([intent]);\r\n\r\n finalLocations = setParent(finalLocations, adgroup, campaign);\r\n\r\n return finalLocations;\r\n}\r\n\r\n\r\nfunction getHotelAdGroupType(adgroup) {\r\n const HotelAdGroupType = [];\r\n const { adFormat } = adgroup;\r\n if (adFormat.HPA) {\r\n HotelAdGroupType.push('HotelAd');\r\n }\r\n if (adFormat.PPA) {\r\n HotelAdGroupType.push('PropertyAd');\r\n }\r\n return HotelAdGroupType;\r\n}\r\n\r\nexport function getAdGroupBid(baseBid, bidStrategyType) {\r\n switch (bidStrategyType) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n return {\r\n SearchBid: baseBid.searchBid && decimal.fromLocalToFloat(baseBid.searchBid),\r\n };\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return {\r\n AdGroupPercentCpcBid: baseBid.percentCpcBid && decimal.fromLocalToFloat(baseBid.percentCpcBid),\r\n };\r\n case bidStrategyOptionKeys.Commission:\r\n return {\r\n AdGroupCommissionRate: baseBid.commissionRate && decimal.fromLocalToFloat(baseBid.commissionRate),\r\n };\r\n default:\r\n return {\r\n SearchBid: baseBid.searchBid && decimal.fromLocalToFloat(baseBid.searchBid),\r\n };\r\n }\r\n}\r\n\r\nfunction getAdScheduleUseSearcherTimeZone(adgroup) {\r\n const { AdScheduleUseSearcherTimeZone } = adgroup;\r\n return { AdScheduleUseSearcherTimeZone };\r\n}\r\n\r\nexport function convertAdgroupStateToAdgroupJSONSchemaData(adgroup, campaign, initTargets) {\r\n const {\r\n device: initDevice, ABW: initABW, checkinDay: initCheckinDay, lengthOfStay: initLengthOfStay, checkinDate: initCheckinDate, userSetDates: initUserSetDates,\r\n } = initTargets;\r\n const adScheduleUseSearcherTimeZone = getAdScheduleUseSearcherTimeZone(adgroup);\r\n const deviceSettings = convertDeviceStateToDeviceSchema(adgroup, campaign, initDevice);\r\n const ABWSettings = convertABWStateToABWSchema(adgroup, campaign, initABW);\r\n const checkinDaySettings = convertCheckInDayStateToCheckInDaySchema(adgroup, campaign, initCheckinDay);\r\n const lengthOfStaySettings = convertLengthofStayStateToLengthofStaySchema(adgroup, campaign, initLengthOfStay);\r\n const checkinDateSettings = convertCheckInDateStateToCheckInDateSchema(adgroup, campaign, initCheckinDate);\r\n const userSetDatesSettings = convertUserSetDatesStateToUserSetDatesSchema(adgroup, campaign, initUserSetDates);\r\n const locationTargets = convertLocationStateToLocationSchema(adgroup.location, adgroup, campaign);\r\n const adschedules = getAdSchedule(adgroup, campaign);\r\n const audienceAds = getAudienceAds(adgroup.audienceAds);\r\n const unSupportedFeatures = getUnSupportedBidAdjustmentFeatures(campaign.BiddingScheme.Type);\r\n\r\n // could reference mt-entity-tapi or client-data package\r\n const jsonSchemaData = {\r\n Name: adgroup.name.value,\r\n ...adScheduleUseSearcherTimeZone,\r\n ...audienceAds,\r\n Campaign: { Id: campaign.Id },\r\n CampaignName: campaign.Name,\r\n BiddingScheme: {\r\n Type: 'InheritFromParent',\r\n },\r\n ...getAdGroupBid(adgroup.baseBid, campaign.BiddingScheme.Type),\r\n AdGroupType: 'HotelAds',\r\n HotelAdGroupType: getHotelAdGroupType(adgroup),\r\n ...adgroup.dateSettings,\r\n ...adgroup.netWorkOptions,\r\n TrackingUrlTemplate: adgroup.urlOptions.TrackingUrlTemplate,\r\n FinalUrlSuffix: adgroup.urlOptions.FinalUrlSuffix,\r\n UrlCustomParameters: adgroup.urlOptions.UrlCustomParameters,\r\n AdGroupCriterions: [ // new targetings waiting for api\r\n ...collectCriterions('adSchedule', unSupportedFeatures, adschedules),\r\n ...collectCriterions('device', unSupportedFeatures, deviceSettings),\r\n ...collectCriterions('ABW', unSupportedFeatures, ABWSettings),\r\n ...collectCriterions('checkinDay', unSupportedFeatures, checkinDaySettings),\r\n ...collectCriterions('lengthOfStay', unSupportedFeatures, lengthOfStaySettings),\r\n ...collectCriterions('checkinDate', unSupportedFeatures, checkinDateSettings),\r\n ...collectCriterions('userSetDates', unSupportedFeatures, userSetDatesSettings),\r\n ...collectCriterions('location', unSupportedFeatures, locationTargets),\r\n ],\r\n };\r\n\r\n if (adgroup.Id) {\r\n return {\r\n Id: adgroup.Id,\r\n ...jsonSchemaData,\r\n };\r\n }\r\n return {\r\n Status: 'Active',\r\n ...jsonSchemaData,\r\n };\r\n}\r\n\r\nexport function validateAdGroupState(adgroup, serverContext, bidStrategyType, patchAdgroup, patchErrMsg) {\r\n notifyTargetsShowError(adgroup, patchAdgroup);\r\n\r\n const unSupportedFeatures = getUnSupportedBidAdjustmentFeatures(bidStrategyType);\r\n return {\r\n name: isAdgroupNameValid(adgroup.name.value),\r\n adFormat: isAdFormatValid(adgroup.adFormat),\r\n baseBid: isBaseBidValid({ baseBid: adgroup.baseBid, bidStrategyType, serverContext }),\r\n audienceAds: isAudienceAdsValid(adgroup.audienceAds),\r\n device: isUnSupported('device', unSupportedFeatures, () => (adgroup.device.useParentLevel ? true : isDeviceTargetValid(adgroup.device.currentLevelSettings, patchErrMsg))),\r\n ABW: isUnSupported('ABW', unSupportedFeatures, () => (adgroup.ABW.useParentLevel ? true : isABWTargetValid(adgroup.ABW.currentLevelSettings, patchErrMsg))),\r\n checkinDay: isUnSupported('checkinDay', unSupportedFeatures, () => (adgroup.checkinDay.useParentLevel ? true : isCheckinDayTargetValid(adgroup.checkinDay.currentLevelSettings, patchErrMsg))),\r\n lengthOfStay: isUnSupported('lengthOfStay', unSupportedFeatures, () => (adgroup.lengthOfStay.useParentLevel ? true : isLengthOfStayTargetValid(adgroup.lengthOfStay.currentLevelSettings, patchErrMsg))),\r\n checkinDate: isUnSupported('checkinDate', unSupportedFeatures, () => (adgroup.checkinDate.useParentLevel ? true : isCheckinDateTargetValid(adgroup.checkinDate.currentLevelSettings, patchErrMsg))),\r\n userSetDates: isUnSupported('userSetDates', unSupportedFeatures, () => (adgroup.userSetDates.useParentLevel ? true : isUserSetDatesTargetValid(adgroup.userSetDates.currentLevelSettings, patchErrMsg))),\r\n location: isUnSupported('location', unSupportedFeatures, () => isLocationValid(adgroup.location)),\r\n };\r\n}\r\n\r\nexport function generateDataToInvalidState(validationData, adgroup) {\r\n let data = { ...adgroup };\r\n fieldsToCheck.forEach((field) => {\r\n if (validationData[field] === false) {\r\n data = {\r\n ...data,\r\n [field]: {\r\n ...data[field],\r\n isInvalid: true,\r\n },\r\n };\r\n }\r\n });\r\n return data;\r\n}\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport _ from 'underscore';\r\nimport classnames from 'classnames';\r\nimport { Link, Label, Stack } from '@bingads-webui-react/fabric-control';\r\nimport PropTypes from 'prop-types';\r\nimport React, { useContext, useMemo, useState, useEffect } from 'react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { AdSchedule, AudienceAds, BaseExclusion, UrlOptions, usePatch, isAudienceAdsValid,\r\n getUrlOptionsDetails, getExclusionsDetails, globalErrorMsg, getAudienceAdsDetails } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { AdDistribution } from '@bingads-webui-campaign/ad-distribution';\r\nimport { checkShouldShowError, getAdScheduleDetails } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { useCurrentCampaign, useCurrentAdGroup } from '@bingads-webui-campaign-react/use-current-scope-entity';\r\nimport { Collapse, ToggleTitle, TextTitle } from '@bingads-webui-campaign/wizard-jumbo-card';\r\nimport { getUnSupportedBidAdjustmentFeatures } from '../util';\r\n\r\nconst getStyles = () =>\r\n ({\r\n advancedSettingsSection: {\r\n marginTop: '19px',\r\n '& .displayNone': {\r\n display: 'none',\r\n },\r\n '& .expandedImage:before, .expanderImage:before': {\r\n marginRight: '12px',\r\n },\r\n '& .urloptions-wraper': {\r\n '& h5.control-label': {\r\n display: 'none',\r\n },\r\n },\r\n },\r\n advancedSettingsContainer: {\r\n },\r\n });\r\n\r\nfunction getAdDistributionOption(adgroup) {\r\n return {\r\n AdDistribution: adgroup.AdDistribution,\r\n Medium: adgroup.Medium,\r\n Languages: ['All'],\r\n campaignType: 'hotel',\r\n };\r\n}\r\n\r\nfunction getAdScheduleOption(campaign, adgroup) {\r\n const model = {\r\n dayTimeRanges: adgroup.dayTimeRanges,\r\n timeZone: adgroup.TimeZone,\r\n adScheduleUseSearcherTimeZone: adgroup.AdScheduleUseSearcherTimeZone,\r\n startDate: adgroup.StartDate,\r\n endDate: adgroup.EndDate,\r\n adGroupStatus: adgroup.Status,\r\n };\r\n return {\r\n model,\r\n level: 'adgroup',\r\n campaignDayTimeRanges: campaign && campaign.dayTimeRanges,\r\n showDateSettings: true,\r\n hideAdScheduleBidAdjustments: true,\r\n campaignAdScheduleUseSearcherTimeZone: campaign && campaign.AdScheduleUseSearcherTimeZone,\r\n };\r\n}\r\n\r\nexport const AdvancedSettings = (props) => {\r\n const {\r\n scenario,\r\n errMsg,\r\n patchErrMsg,\r\n getAdScheduleView,\r\n setAdScheduleView,\r\n setAdDistributionView,\r\n getAdDistributionView,\r\n setUrlOptionsView,\r\n setSiteExclusionView,\r\n patchAdgroup,\r\n adgroup,\r\n campaign,\r\n getUrlOptionsValues,\r\n getExclusionsValues,\r\n advancedSettinsApiErrors,\r\n isDataFetched,\r\n } = props;\r\n\r\n const i18n = useContext(I18nContext);\r\n const classes = useDefaultStyles(getStyles);\r\n const currentCampaign = useCurrentCampaign();\r\n const currentAdgroup = useCurrentAdGroup();\r\n const campaignId = currentCampaign ? currentCampaign.Id : null;\r\n const adgroupId = currentAdgroup ? currentAdgroup.Id : null;\r\n\r\n const campaignBidStrategyType = campaign && campaign.bidStrategy && campaign.bidStrategy.option;\r\n // We still need to support start & end date in the adSchedule view\r\n const unSupportedFeatures = getUnSupportedBidAdjustmentFeatures(campaignBidStrategyType).filter(x => x !== 'adSchedule');\r\n const allPanelItems = _.reject(['adSchedule', 'adDistribution', 'audienceAds', 'urlOptions', 'baseExclusion'], x => unSupportedFeatures.includes(x));\r\n const [activeKeys, setActiveKeys] = useState(_.reject(['adSchedule', 'audienceAds', 'adDistribution'], x => unSupportedFeatures.includes(x)));\r\n\r\n useEffect(() => {\r\n const hasApiErrorKeys = Object.keys(advancedSettinsApiErrors);\r\n const needToExpandKeys = [];\r\n allPanelItems.forEach((key) => {\r\n if (hasApiErrorKeys.includes(key) && advancedSettinsApiErrors[key] && advancedSettinsApiErrors[key].length) {\r\n patchErrMsg(key, globalErrorMsg);\r\n needToExpandKeys.push(key);\r\n }\r\n });\r\n setActiveKeys(activeKeys.concat(needToExpandKeys));\r\n }, [advancedSettinsApiErrors]);\r\n\r\n const onCollapseAll = () => {\r\n if (activeKeys.length) {\r\n setActiveKeys([]);\r\n } else {\r\n setActiveKeys(allPanelItems);\r\n }\r\n };\r\n\r\n const setAdSchedule = usePatch(patchAdgroup, 'adSchedule');\r\n const setAudienceAds = usePatch(patchAdgroup, 'audienceAds');\r\n\r\n const {\r\n adSchedule,\r\n audienceAds,\r\n } = adgroup;\r\n // Turn off --- you set nothing, you use default settings 0 0 0\r\n // Turn on --- you override 0 0 0\r\n const onChangeToggle = (fn, key, value) => {\r\n fn({ ...adgroup[key], useParentLevel: !value });\r\n };\r\n\r\n const adScheduleTitle = ( {\r\n onChangeToggle(setAdSchedule, 'adSchedule', value);\r\n const adScheduleView = getAdScheduleView();\r\n if (adScheduleView) {\r\n adScheduleView.koModel.useCampaignSettingsChecked(!value);\r\n }\r\n }}\r\n />);\r\n\r\n // After collecting the needed data, need to ensure the view is created once.\r\n const adScheduleOption = useMemo(\r\n () => (getAdScheduleOption(campaign, adgroup)),\r\n [campaign.dayTimeRanges, adgroup.dayTimeRanges, campaign.AdScheduleUseSearcherTimeZone, adgroup.adScheduleUseSearcherTimeZone]\r\n );\r\n\r\n\r\n const audienceAdsTitle =\r\n ( { onChangeToggle(setAudienceAds, 'audienceAds', value); }}\r\n />);\r\n\r\n\r\n const adDistributionOption = useMemo(\r\n () => getAdDistributionOption(adgroup),\r\n [adgroup.AdDistribution, adgroup.Medium]\r\n );\r\n\r\n const setUrlOptionsActiveCallback = () => { patchAdgroup('urlOptions', getUrlOptionsValues()); };\r\n const setExclusionsActiveCallback = () => { patchAdgroup('exclusions', getExclusionsValues()); };\r\n\r\n return (\r\n
\r\n
\r\n \r\n \r\n {activeKeys.length ? i18n.getString(_TL_('Collapse all')) : i18n.getString(_TL_('Expand all'))}\r\n \r\n \r\n {isDataFetched &&\r\n \r\n \r\n }\r\n \r\n \r\n \r\n {\r\n const view = getAdDistributionView();\r\n return view ? view.getTranslatedOption() : '';\r\n })()}\r\n />}\r\n error={errMsg.adDistribution}\r\n >\r\n \r\n \r\n {\r\n scenario === 'settings' &&\r\n } error={errMsg.urlOptions} setActiveCallback={setUrlOptionsActiveCallback}>\r\n \r\n \r\n }\r\n {\r\n scenario === 'settings' &&\r\n } error={errMsg.baseExclusion} setActiveCallback={setExclusionsActiveCallback}>\r\n \r\n \r\n }\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nAdvancedSettings.propTypes = {\r\n isDataFetched: PropTypes.string.isRequired,\r\n scenario: PropTypes.string.isRequired,\r\n errMsg: PropTypes.shape({}),\r\n patchErrMsg: PropTypes.func.isRequired,\r\n campaign: PropTypes.shape({}).isRequired,\r\n adgroup: PropTypes.shape({}).isRequired,\r\n patchAdgroup: PropTypes.func.isRequired,\r\n setAdScheduleView: PropTypes.func.isRequired,\r\n setAdDistributionView: PropTypes.func.isRequired,\r\n getAdDistributionView: PropTypes.func.isRequired,\r\n setUrlOptionsView: PropTypes.func.isRequired,\r\n setSiteExclusionView: PropTypes.func.isRequired,\r\n getAdScheduleView: PropTypes.func.isRequired,\r\n getUrlOptionsValues: PropTypes.func.isRequired,\r\n getExclusionsValues: PropTypes.func.isRequired,\r\n advancedSettinsApiErrors: PropTypes.shape({}),\r\n};\r\nAdvancedSettings.defaultProps = {\r\n errMsg: {},\r\n advancedSettinsApiErrors: {},\r\n};\r\n\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\n/* eslint-disable no-plusplus */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, { useState, useContext, useEffect } from 'react';\r\nimport _ from 'underscore';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { usePatch,\r\n getGridTargetTitleDetails,\r\n getLocationTargetErrorMessage,\r\n getLocationTargetTitleDetails,\r\n globalErrorMsg, } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { ErrorString } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { Collapse, ToggleTitle } from '@bingads-webui-campaign/wizard-jumbo-card';\r\nimport { Link, Stack, DefaultButton } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport {\r\n AdvancedBookingWindowTargetSetting,\r\n CheckinDayTargetSetting,\r\n UserSetDatesTargetSetting,\r\n CheckinDateTargetSetting,\r\n LengthOfStayTargetSetting,\r\n DeviceTargetSetting,\r\n LocationTargetSetting,\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\n\r\nimport { getUnSupportedBidAdjustmentFeatures } from '../util';\r\nimport { defaultAdgroupBasicData } from './default-value';\r\n\r\nconst getStyles = () => ({\r\n AdgroupTargets: {\r\n marginTop: '40px',\r\n },\r\n title: {\r\n fontWeight: 600,\r\n fontSize: '20px',\r\n },\r\n subtitle: {\r\n marginBottom: '16px',\r\n fontSize: '20px',\r\n },\r\n mt33: {\r\n marginTop: '33px',\r\n },\r\n});\r\n\r\n\r\nexport const AdgroupTargets = (props) => {\r\n const {\r\n adgroup,\r\n campaign,\r\n errMsg,\r\n patchAdgroup,\r\n patchErrMsg,\r\n targetsApiErrors,\r\n patchTargetsApiErrMsg,\r\n } = props;\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n const i18n = useContext(I18nContext);\r\n const serverContext = useContext(ServerContext);\r\n\r\n const campaignBidStrategyType = campaign && campaign.bidStrategy && campaign.bidStrategy.option;\r\n const unSupportedFeatures = getUnSupportedBidAdjustmentFeatures(campaignBidStrategyType);\r\n\r\n const allPanelItems = _.reject(['location', 'device', 'ABW', 'checkinDay', 'lengthOfStay', 'checkinDate', 'userSetDates'], x => unSupportedFeatures.includes(x));\r\n\r\n const [activeKeys, setActiveKeys] = useState(_.reject(['location', 'device'], x => unSupportedFeatures.includes(x)));\r\n useEffect(() => {\r\n const hasApiErrorKeys = Object.keys(targetsApiErrors);\r\n const needToExpandKeys = [];\r\n allPanelItems.forEach((key) => {\r\n if (hasApiErrorKeys.includes(key) && targetsApiErrors[key] && targetsApiErrors[key].length) {\r\n patchErrMsg(key, globalErrorMsg);\r\n needToExpandKeys.push(key);\r\n }\r\n });\r\n setActiveKeys(activeKeys.concat(needToExpandKeys));\r\n }, [targetsApiErrors]);\r\n\r\n const onCollapseAll = () => {\r\n if (activeKeys.length) {\r\n setActiveKeys([]);\r\n } else {\r\n setActiveKeys(allPanelItems);\r\n }\r\n };\r\n\r\n const setLocation = usePatch(patchAdgroup, 'location');\r\n const setDevice = usePatch(patchAdgroup, 'device');\r\n const setABW = usePatch(patchAdgroup, 'ABW');\r\n const setCheckinDay = usePatch(patchAdgroup, 'checkinDay');\r\n const setUserSetDates = usePatch(patchAdgroup, 'userSetDates');\r\n const setCheckinDate = usePatch(patchAdgroup, 'checkinDate');\r\n const setLengthOfStay = usePatch(patchAdgroup, 'lengthOfStay');\r\n\r\n const {\r\n device, ABW, checkinDay, lengthOfStay, checkinDate, userSetDates, location,\r\n } = adgroup;\r\n\r\n const {\r\n device: { currentLevelSettings: deviceDefaultCurrentLevelSettings },\r\n ABW: { currentLevelSettings: ABWDefaultCurrentLevelSettings },\r\n checkinDay: { currentLevelSettings: checkinDayDefaultCurrentLevelSettings },\r\n lengthOfStay: { currentLevelSettings: lengthOfStayDefaultCurrentLevelSettings },\r\n checkinDate: { currentLevelSettings: checkinDateDefaultCurrentLevelSettings },\r\n userSetDates: { currentLevelSettings: userSetDatesDefaultCurrentLevelSettings },\r\n } = defaultAdgroupBasicData;\r\n\r\n // Turn off --- you set nothing, you use default settings inherited from campaign\r\n // Turn on --- you override the campaign settings\r\n const onChangeToggle = (fn, key, value) => {\r\n fn({ ...adgroup[key], useParentLevel: !value });\r\n };\r\n\r\n const resetTarget = (setFn, targetData, targetDefaultCurrentLevelSettings, targetName) => {\r\n let tempCurrentLevelSettings = [...targetData.currentLevelSettings];\r\n for (let i = 0; i < tempCurrentLevelSettings.length; i++) {\r\n if (tempCurrentLevelSettings[i]) {\r\n const tempId = tempCurrentLevelSettings[i].Id;\r\n const tempObj = { ...targetDefaultCurrentLevelSettings[i] };\r\n if (tempCurrentLevelSettings[i].Id) {\r\n tempCurrentLevelSettings[i] = tempObj;\r\n tempCurrentLevelSettings[i].Id = tempId;\r\n tempCurrentLevelSettings[i].Status = 'Deleted';\r\n } else {\r\n tempCurrentLevelSettings.splice(i, 1);\r\n i--;\r\n }\r\n }\r\n }\r\n tempCurrentLevelSettings = targetDefaultCurrentLevelSettings.concat(tempCurrentLevelSettings);\r\n setFn({ ...targetData, currentLevelSettings: tempCurrentLevelSettings, reset: true });\r\n patchTargetsApiErrMsg(targetName, []);\r\n };\r\n\r\n const locationTitle = ( {\r\n const isTargetEverywhere = adgroup.location.currentLevelSettings.currentLocations == null ||\r\n adgroup.location.currentLevelSettings.currentLocations.length === 0;\r\n if (adgroup.location.useParentLevel === true &&\r\n isTargetEverywhere) {\r\n const campaignLocations = _.deepClone(location.parentLevelSettings.currentLocations);\r\n _.map(campaignLocations, (campaignLocation) => {\r\n const target = campaignLocation;\r\n target.Campaign = null;\r\n delete target.Id;\r\n return target;\r\n });\r\n setLocation({\r\n ...adgroup.location,\r\n currentLevelSettings: {\r\n ...adgroup.location.currentLevelSettings,\r\n currentLocations: campaignLocations,\r\n peopleInLocation: true,\r\n peopleSearchingForLocation: true,\r\n },\r\n useParentLevel: false,\r\n bidMode: true,\r\n errors: undefined,\r\n });\r\n } else if (adgroup.location.useParentLevel === true) {\r\n setLocation({\r\n ...adgroup.location,\r\n useParentLevel: false,\r\n bidMode: true,\r\n errors: undefined,\r\n });\r\n } else {\r\n setLocation({\r\n ...adgroup.location,\r\n useParentLevel: !value,\r\n errors: undefined,\r\n });\r\n }\r\n }}\r\n />);\r\n\r\n const formatDateValue = value => i18n.formatDate(value, { raw: serverContext.CurrentUser.CultureDateTimeFormat.ShortDatePattern });\r\n const deviceTitle = { onChangeToggle(setDevice, 'device', value); }} />;\r\n const abwTitle = { onChangeToggle(setABW, 'ABW', value); }} />;\r\n const checkinDayTitle = { onChangeToggle(setCheckinDay, 'checkinDay', value); }} />;\r\n const lengthOfStayTitle = { onChangeToggle(setLengthOfStay, 'lengthOfStay', value); }} />;\r\n const checkinDateTitle = { onChangeToggle(setCheckinDate, 'checkinDate', value); }} />;\r\n const userSetDatesTitle = { onChangeToggle(setUserSetDates, 'userSetDates', value); }} />;\r\n\r\n return allPanelItems.length <= 0 ? null : (\r\n
\r\n
\r\n
\r\n {i18n.getString(_TL_('Ad group targets'))}\r\n
\r\n \r\n {i18n.getString(_TL_('Who do you want to target for this ad group? You can select any combination of the criteria below. '))}\r\n {activeKeys.length ? i18n.getString(_TL_('Collapse all')) : i18n.getString(_TL_('Expand all'))}\r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n {!device.useParentLevel && targetsApiErrors.device && targetsApiErrors.device.map(item => ())}\r\n \r\n { resetTarget(setDevice, device, deviceDefaultCurrentLevelSettings, 'device'); }} />\r\n \r\n \r\n \r\n \r\n {!ABW.useParentLevel && targetsApiErrors.ABW && targetsApiErrors.ABW.map(item => ())}\r\n \r\n { resetTarget(setABW, ABW, ABWDefaultCurrentLevelSettings, 'ABW'); }} />\r\n \r\n \r\n \r\n \r\n {!checkinDay.useParentLevel && targetsApiErrors.checkinDay && targetsApiErrors.checkinDay.map(item => ())}\r\n \r\n { resetTarget(setCheckinDay, checkinDay, checkinDayDefaultCurrentLevelSettings, 'checkinDay'); }} />\r\n \r\n \r\n \r\n \r\n {!lengthOfStay.useParentLevel && targetsApiErrors.lengthOfStay && targetsApiErrors.lengthOfStay.map(item => ())}\r\n \r\n { resetTarget(setLengthOfStay, lengthOfStay, lengthOfStayDefaultCurrentLevelSettings, 'lengthOfStay'); }} />\r\n \r\n \r\n \r\n \r\n {!checkinDate.useParentLevel && targetsApiErrors.checkinDate && targetsApiErrors.checkinDate.map(item => ())}\r\n \r\n { resetTarget(setCheckinDate, checkinDate, checkinDateDefaultCurrentLevelSettings, 'checkinDate'); }} />\r\n \r\n \r\n \r\n \r\n {!userSetDates.useParentLevel && targetsApiErrors.userSetDates && targetsApiErrors.userSetDates.map(item => ())}\r\n \r\n { resetTarget(setUserSetDates, userSetDates, userSetDatesDefaultCurrentLevelSettings, 'userSetDates'); }} />\r\n \r\n \r\n \r\n
);\r\n};\r\n\r\nAdgroupTargets.propTypes = {\r\n adgroup: PropTypes.shape({}),\r\n campaign: PropTypes.shape({}).isRequired,\r\n errMsg: PropTypes.shape({}),\r\n patchAdgroup: PropTypes.func.isRequired,\r\n patchErrMsg: PropTypes.func.isRequired,\r\n scope: PropTypes.shape({\r\n values: PropTypes.shape({\r\n cid: PropTypes.number.isRequired,\r\n aid: PropTypes.number.isRequired,\r\n campaignId: PropTypes.number,\r\n }).isRequired,\r\n }).isRequired,\r\n targetsApiErrors: PropTypes.shape({}),\r\n patchTargetsApiErrMsg: PropTypes.func,\r\n};\r\n\r\nAdgroupTargets.defaultProps = {\r\n adgroup: {},\r\n errMsg: {},\r\n targetsApiErrors: {},\r\n patchTargetsApiErrMsg() {},\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\n\r\nconst getStyles = () => ({\r\n AdGroupTitle: {\r\n marginTop: '16px',\r\n '& .title': {\r\n fontWeight: 600,\r\n },\r\n '& .subtitle': {\r\n marginBottom: '16px',\r\n },\r\n '& .title, .subtitle': {\r\n fontSize: '20px',\r\n },\r\n '& .description': {\r\n },\r\n },\r\n});\r\n\r\nexport const Title = ({ permissions }) => {\r\n const i18n = useContext(I18nContext);\r\n const IsRenameHotelToLodgingEnabled = permissions && permissions.dynamic && permissions.dynamic.IsRenameHotelToLodgingEnabled;\r\n const classes = useDefaultStyles(getStyles);\r\n return (\r\n
\r\n
\r\n {IsRenameHotelToLodgingEnabled ? i18n.getString(_TL_('Create a property ad group')) : i18n.getString(_TL_('Create a hotel ad group'))}\r\n
\r\n
);\r\n};\r\nTitle.propTypes = {\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.shape({\r\n IsRenameHotelToLodgingEnabled: PropTypes.bool,\r\n }),\r\n }),\r\n};\r\n\r\nTitle.defaultProps = {\r\n permissions: {\r\n dynamic: {\r\n IsRenameHotelToLodgingEnabled: false,\r\n },\r\n },\r\n};\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\n/* eslint-disable no-param-reassign */\r\n/* eslint-disable react/prefer-stateless-function */\r\nimport React from 'react';\r\nimport classnames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport { perfMarkerPropTypes } from '@bingads-webui/performance-marker';\r\nimport { PrimaryButton, DefaultButton } from '@bingads-webui-react/fabric-control';\r\nimport { UiBlocker } from '@bingads-webui-react/ui-blocker';\r\nimport * as i18nErrors from '@bingads-webui-component-legacy/api-errors-campaign/index';\r\nimport {\r\n globalErrorMsg, bidStrategyOptionKeys,\r\n getCampaignTargetsCriterions, getAdGroupTargetsCriterions, getCampaignData, getAdGroupData, handleApiErrors, clearSubViewApiErrors, scrollToErrors,\r\n invalidateCache, subscribeUrlOptions, subscribeSiteExclusion, mergeAdGroupStateWithErrors, showWarning, createDefaultHotelGroup, audienceAdsOptionKeys,\r\n send, sendErrors,\r\n} from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { Errors, modelToViewModelDayTimeTargets, locationTargetsOptionKeys } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport {\r\n parseLocationTargets\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\nimport instrumentation from '@bingads-webui-campaign-legacy/instrumentation/index';\r\nimport { edmCampaign } from '@bingads-webui/edm-campaign';\r\nimport { getRoutePathById } from '@bingads-webui-campaign-react/with-site-map';\r\nimport exclusionRepository from '@bingads-webui-campaign-legacy/advanced-settings/util/exclusion-repository';\r\nimport { AdgroupBasic, defaultAdgroupBasicData, AdvancedSettings, AdgroupTargets, fieldsToCheck, Title } from './components';\r\nimport { convertAdgroupStateToAdgroupJSONSchemaData, validateAdGroupState, generateDataToInvalidState } from './util';\r\nimport { renderAdGroupTargets, updateAllTargets } from './get-targets-criterion';\r\n\r\nexport const scenarios = {\r\n settings: 'settings',\r\n creation: 'creation',\r\n};\r\n\r\nexport const HotelAdGroupBase = class HotelAdGroupBase extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.isCreation = this.props.scenario === scenarios.creation;\r\n this.initializeTheInstrumentation();\r\n\r\n this.state = {\r\n adgroup: {\r\n ...defaultAdgroupBasicData,\r\n },\r\n campaign: {\r\n },\r\n initTargets: {},\r\n isLoading: true,\r\n isDataFetched: false,\r\n errMsg: {},\r\n adgroupApiErrors: [],\r\n targetsApiErrors: {},\r\n advancedSettinsApiErrors: {},\r\n };\r\n this.subViews = {};\r\n this.adScheduleView = undefined;\r\n this.adDistributionView = undefined;\r\n this.siteExclusionView = undefined;\r\n this.urlOptionsView = undefined;\r\n this.defaultHotelGroupCreated = props.scenario === scenarios.settings;\r\n this.setAdScheduleView = (view) => {\r\n this.adScheduleView = view;\r\n this.adScheduleView.koModel.hasErrors.subscribe((x) => {\r\n if (x) {\r\n this.patchErrMsg('adSchedule', globalErrorMsg);\r\n return;\r\n }\r\n this.patchErrMsg('adSchedule', '');\r\n });\r\n };\r\n this.setAdDistributionView = (view) => { this.adDistributionView = view; };\r\n this.getAdDistributionView = () => this.adDistributionView;\r\n this.setSiteExclusionView = (view) => { this.siteExclusionView = view; subscribeSiteExclusion(this); };\r\n this.setUrlOptionsView = (view) => {\r\n this.urlOptionsView = view;\r\n this.subViews.urlOptionsView = view;\r\n subscribeUrlOptions(this, globalErrorMsg);\r\n };\r\n const adgroupEDM = edmCampaign.types.resolve('Model.AdGroup');\r\n this.adgroupResource = new adgroupEDM.ResourceIdentifier();\r\n }\r\n\r\n // eslint-disable-next-line react/sort-comp\r\n handleCreateOrUpdateSuccess = (response, resolve) => {\r\n const {\r\n scope,\r\n siteMap,\r\n } = this.props;\r\n if (this.isCreation) {\r\n const adGroupId = this.getCreatedAdGroupId(response);\r\n send(this.activity, 'adgroup_creation_succeeded', { adGroupId });\r\n this.createDefaultHotelGroupAfterAdGroupCreation(response, () => {\r\n send(this.activity, 'all_succeeded');\r\n this.durationActivity.stopSignal('completed');\r\n scope.save(getRoutePathById(siteMap, 'adgroups'));\r\n }).finally(() => resolve(true));\r\n } else {\r\n send(this.activity, 'adgroup_update_succeeded');\r\n // we backfill advanced settings models here, so we have correct model if the saveExtensions call fails.\r\n this.updateResponseData({ entity: response }, resolve);\r\n\r\n if (this.isExclusionsUpdated()) {\r\n this.saveExtensions().then(() => {\r\n send(this.activity, 'all_succeeded');\r\n this.durationActivity.stopSignal('completed');\r\n scope.remove('adGroupId');\r\n scope.save('/campaign/vnext/adgroups');\r\n });\r\n } else {\r\n send(this.activity, 'all_succeeded');\r\n this.durationActivity.stopSignal('completed');\r\n scope.remove('adGroupId');\r\n scope.save('/campaign/vnext/adgroups');\r\n }\r\n }\r\n };\r\n\r\n getCreatedAdGroupId = (response) => {\r\n let entity = response;\r\n if (response && response.entity) {\r\n // eslint-disable-next-line prefer-destructuring\r\n entity = response.entity;\r\n }\r\n return entity.Id;\r\n };\r\n\r\n scrollAndShowWarning() {\r\n this.removeWarningInterval = showWarning('adgroup', this.props.i18n, this.removeWarningInterval);\r\n scrollToErrors('adgroup');\r\n }\r\n\r\n createDefaultHotelGroupAfterAdGroupCreation = (response, callback) => {\r\n if (!this.defaultHotelGroupCreated) {\r\n const adGroupId = this.getCreatedAdGroupId(response);\r\n\r\n if (adGroupId) {\r\n const {\r\n cid,\r\n aid,\r\n campaignId,\r\n } = this.props.scope.values;\r\n let bid = 0.05;\r\n let type = 'FixedBid';\r\n const {\r\n bidStrategy,\r\n } = this.state.campaign;\r\n const {\r\n baseBid,\r\n } = this.state.adgroup;\r\n switch (bidStrategy.option) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n bid = baseBid.searchBid;\r\n type = 'FixedBid';\r\n break;\r\n case bidStrategyOptionKeys.PercentCpc:\r\n bid = baseBid.percentCpcBid;\r\n type = 'RateBid';\r\n break;\r\n case bidStrategyOptionKeys.Commission:\r\n bid = baseBid.commissionRate;\r\n if (bid == null || bid.length === 0) {\r\n bid = bidStrategy.Commission;\r\n }\r\n type = 'RateBid';\r\n break;\r\n default:\r\n bid = 0.05;\r\n type = 'FixedBid';\r\n break;\r\n }\r\n return createDefaultHotelGroup(cid, aid, campaignId, adGroupId, type, bid).then(() => {\r\n send(this.activity, 'hotel_group_creation_succeeded');\r\n this.defaultHotelGroupCreated = true;\r\n if (callback) {\r\n callback();\r\n }\r\n }).catch((res) => {\r\n send(this.activity, 'hotel_group_creation_failed');\r\n sendErrors(this.activity, 'hotel_group_creation_error', res);\r\n // TODO: should not get here.\r\n let errors;\r\n if (res.errors) {\r\n errors = i18nErrors.getODataErrors(res.errors);\r\n }\r\n if (errors && errors.length) {\r\n this.setState(prevState => ({\r\n adgroupApiErrors: prevState.adgroupApiErrors.concat(errors),\r\n }));\r\n this.scrollAndShowWarning();\r\n }\r\n });\r\n }\r\n }\r\n return new Promise((resolve) => {\r\n if (callback) {\r\n callback();\r\n }\r\n resolve(true);\r\n });\r\n };\r\n\r\n handleCreateOrUpdateError = (response, resolve) => {\r\n if (this.isCreation) {\r\n send(this.activity, 'adgroup_creation_failed');\r\n sendErrors(this.activity, 'adgroup_creation_error', response);\r\n } else {\r\n send(this.activity, 'adgroup_update_failed');\r\n sendErrors(this.activity, 'adgroup_update_error', response);\r\n }\r\n const allApiErrors = handleApiErrors(response, this.props.i18n, this.subViews, 'adgroup');\r\n this.setState(prevState => ({\r\n adgroup: {\r\n ...mergeAdGroupStateWithErrors(prevState.adgroup, allApiErrors),\r\n },\r\n adgroupApiErrors: allApiErrors.entityApiErrors.General || [],\r\n targetsApiErrors: allApiErrors.targetsApiErrors,\r\n advancedSettinsApiErrors: allApiErrors.advancedSettinsApiErrors,\r\n }));\r\n this.updateResponseData(response, resolve); // we backfill models here\r\n };\r\n\r\n createOrUpdateAdgroup = (data) => {\r\n const createOrUpdateCall = this.isCreation ? this.adgroupResource.bulkCreate.bind(this.adgroupResource) : this.adgroupResource.bulkUpdate.bind(this.adgroupResource);\r\n return new Promise(resolve => createOrUpdateCall(data)\r\n .then(response => this.handleCreateOrUpdateSuccess(response, resolve))\r\n .catch(response => this.handleCreateOrUpdateError(response, resolve)));\r\n };\r\n\r\n getCurrentCampaign() {\r\n const {\r\n currentCampaign,\r\n } = this.props;\r\n return currentCampaign;\r\n }\r\n\r\n validate = () => {\r\n const {\r\n serverContext,\r\n } = this.props;\r\n const campaignBidStrategyType = this.state.campaign && this.state.campaign.bidStrategy && this.state.campaign.bidStrategy.option;\r\n let validationData = validateAdGroupState(this.state.adgroup, serverContext, campaignBidStrategyType, this.patchAdgroup, this.patchErrMsg);\r\n validationData = Object.assign(\r\n validationData,\r\n { urlOptions: this.urlOptionsView ? this.urlOptionsView.validate() : true },\r\n { adSchedule: this.adScheduleView ? this.adScheduleView.validate() : true }\r\n );\r\n const isValid = fieldsToCheck.every(x => validationData[x] === true);\r\n\r\n if (isValid !== true) {\r\n this.setState(prevState => ({\r\n adgroup: {\r\n ...generateDataToInvalidState(validationData, prevState.adgroup),\r\n },\r\n }));\r\n }\r\n return isValid;\r\n };\r\n\r\n fetchCampaignDayTimeCriterions(cid, aid, campaignId) {\r\n const getCampaignDayTimeCriterionsPromise = getCampaignTargetsCriterions({\r\n type: \"isof(Criterion,'Model.DayTimeCriterion')\", cid, aid, campaignId,\r\n });\r\n return Promise.all([getCampaignDayTimeCriterionsPromise]).then(([rawCampaignDayTimeRanges]) => {\r\n const campaignDayTimeRanges = modelToViewModelDayTimeTargets(rawCampaignDayTimeRanges);\r\n this.setState(prevState => ({\r\n campaign: { ...prevState.campaign, dayTimeRanges: campaignDayTimeRanges },\r\n }));\r\n });\r\n }\r\n\r\n fetchCampaignLocationCriterions(cid, aid, campaignId) {\r\n const getCampaignLocationCriterionsPromise = getCampaignTargetsCriterions({\r\n type: \"isof(Criterion,'Model.LocationCriterion') or isof(Criterion,'Model.RadiusCriterion') or isof(Criterion,'Model.LocationIntentCriterion')\", cid, aid, campaignId,\r\n });\r\n return Promise.all([getCampaignLocationCriterionsPromise]).then(([rawCampaignLocations]) => {\r\n const {\r\n locations: campaignLocations,\r\n } = parseLocationTargets(rawCampaignLocations, 'campaign', campaignId);\r\n this.setState(prevState => ({\r\n adgroup: {\r\n ...prevState.adgroup,\r\n location: {\r\n ...prevState.adgroup.location,\r\n parentLevelSettings: {\r\n initLocations: campaignLocations,\r\n currentLocations: campaignLocations,\r\n },\r\n bidMode: true,\r\n },\r\n },\r\n }));\r\n });\r\n }\r\n\r\n fetchDayTimeCriterions(cid, aid, campaignId, adGroupId) {\r\n const getCampaignDayTimeCriterionsPromise = getCampaignTargetsCriterions({\r\n type: \"isof(Criterion,'Model.DayTimeCriterion')\", cid, aid, campaignId,\r\n });\r\n const getAdGroupDayTimeCriterionsPromise = getAdGroupTargetsCriterions({\r\n type: \"isof(Criterion,'Model.DayTimeCriterion')\", cid, aid, campaignId, adGroupId,\r\n });\r\n return Promise.all([getCampaignDayTimeCriterionsPromise, getAdGroupDayTimeCriterionsPromise]).then(([rawCampaignDayTimeRanges, rawAdGroupDayTimeRanges]) => {\r\n const campaignDayTimeRanges = modelToViewModelDayTimeTargets(rawCampaignDayTimeRanges);\r\n const adGroupDayTimeRanges = modelToViewModelDayTimeTargets(rawAdGroupDayTimeRanges);\r\n this.setState(prevState => ({\r\n campaign: { ...prevState.campaign, dayTimeRanges: campaignDayTimeRanges },\r\n adgroup: { ...prevState.adgroup, dayTimeRanges: adGroupDayTimeRanges, adSchedule: { useParentLevel: _.isEmpty(adGroupDayTimeRanges) } },\r\n }));\r\n });\r\n }\r\n\r\n syncAdGroupLocationCriterions(cid, aid, campaignId, adGroupId) {\r\n invalidateCache('Model.AdGroupCriterion');\r\n const getAdGroupLocationCriterionsPromise = getAdGroupTargetsCriterions({\r\n type: \"isof(Criterion,'Model.LocationCriterion') or isof(Criterion,'Model.RadiusCriterion')\", cid, aid, campaignId, adGroupId,\r\n });\r\n return getAdGroupLocationCriterionsPromise.then((rawLocations) => {\r\n const {\r\n locations,\r\n } = parseLocationTargets(rawLocations, 'campaign', campaignId);\r\n this.setState(prevState => ({\r\n adgroup: {\r\n ...prevState.adgroup,\r\n location: {\r\n ...prevState.adgroup.location,\r\n currentLevelSettings: {\r\n ...prevState.adgroup.location.currentLevelSettings,\r\n initLocations: locations,\r\n },\r\n },\r\n },\r\n }));\r\n });\r\n }\r\n\r\n fetchLocationCriterions(cid, aid, campaignId, adGroupId) {\r\n const getCampaignLocationCriterionsPromise = getCampaignTargetsCriterions({\r\n type: \"isof(Criterion,'Model.LocationCriterion') or isof(Criterion,'Model.RadiusCriterion') or isof(Criterion,'Model.LocationIntentCriterion')\", cid, aid, campaignId,\r\n });\r\n const getAdGroupLocationCriterionsPromise = getAdGroupTargetsCriterions({\r\n type: \"isof(Criterion,'Model.LocationCriterion') or isof(Criterion,'Model.RadiusCriterion') or isof(Criterion,'Model.LocationIntentCriterion')\", cid, aid, campaignId, adGroupId,\r\n });\r\n return Promise.all([getCampaignLocationCriterionsPromise, getAdGroupLocationCriterionsPromise]).then(([rawCampaignLocations, rawAdGroupLocations]) => {\r\n const {\r\n locations: campaignLocations,\r\n } = parseLocationTargets(rawCampaignLocations, 'campaign', campaignId);\r\n const {\r\n locations: adGroupLocations,\r\n intentId,\r\n intentOption,\r\n } = parseLocationTargets(rawAdGroupLocations, 'adgroup', adGroupId);\r\n const targetOption = campaignLocations.length ? locationTargetsOptionKeys.specific : locationTargetsOptionKeys.everywhere;\r\n this.patchAdgroup('location', {\r\n parentLevelSettings: {\r\n initLocations: campaignLocations,\r\n currentLocations: campaignLocations,\r\n targetOption,\r\n },\r\n currentLevelSettings: {\r\n initLocations: adGroupLocations,\r\n currentLocations: adGroupLocations,\r\n intentId,\r\n intentOption,\r\n },\r\n bidMode: true,\r\n useParentLevel: adGroupLocations.length === 0,\r\n });\r\n });\r\n }\r\n\r\n fetchCampaignAdGroupData(cid, aid, campaignId, adGroupId) {\r\n const getCampaignDataPromise = getCampaignData(cid, aid, campaignId);\r\n const getAdGroupDataPromise = getAdGroupData(cid, aid, campaignId, adGroupId);\r\n\r\n return Promise.all([getCampaignDataPromise, getAdGroupDataPromise]).then(([CampaignData, AdGroupData]) => {\r\n const {\r\n useParentLevel = true,\r\n currentLevelSettings: currentAdGroupSettings = { option: audienceAdsOptionKeys.Increase, value: 0 },\r\n } = AdGroupData.audienceAds;\r\n const {\r\n currentLevelSettings: currentCampaignSettings = { option: audienceAdsOptionKeys.Increase, value: 0 },\r\n } = CampaignData.audienceAds;\r\n const currentLevelSettings = useParentLevel ?\r\n currentCampaignSettings : currentAdGroupSettings;\r\n\r\n const audienceAds = {\r\n currentLevelSettings,\r\n parentLevelSettings: currentCampaignSettings,\r\n useParentLevel,\r\n };\r\n this.setState(prevState => ({\r\n campaign: { ...prevState.campaign, ...CampaignData },\r\n adgroup: { ...prevState.adgroup, ...AdGroupData, audienceAds },\r\n }));\r\n });\r\n }\r\n\r\n fetchCampaignData(cid, aid, campaignId) {\r\n const getCampaignDataPromise = getCampaignData(cid, aid, campaignId);\r\n\r\n return Promise.all([getCampaignDataPromise]).then(([CampaignData]) => {\r\n const {\r\n currentLevelSettings: currentCampaignSettings = { option: audienceAdsOptionKeys.Increase, value: 0 },\r\n } = CampaignData.audienceAds;\r\n this.setState(prevState => ({\r\n campaign: { ...prevState.campaign, ...CampaignData },\r\n adgroup: {\r\n ...prevState.adgroup,\r\n audienceAds: {\r\n currentLevelSettings: currentCampaignSettings,\r\n parentLevelSettings: currentCampaignSettings,\r\n useParentLevel: true,\r\n },\r\n },\r\n }));\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.perfMarker.willFetchData();\r\n\r\n const {\r\n scenario,\r\n } = this.props;\r\n\r\n if (scenario === scenarios.creation) {\r\n const {\r\n cid,\r\n aid,\r\n campaignId,\r\n } = this.props.scope.values;\r\n\r\n Promise.all([\r\n renderAdGroupTargets(cid, aid, campaignId, undefined, this.patchAdgroup, this.state.adgroup, this),\r\n this.fetchCampaignData(cid, aid, campaignId),\r\n this.fetchCampaignLocationCriterions(cid, aid, campaignId),\r\n this.fetchCampaignDayTimeCriterions(cid, aid, campaignId),\r\n ]).finally(() => {\r\n this.perfMarker.willRender();\r\n this.setState(() => ({ isLoading: false, isDataFetched: true }));\r\n });\r\n\r\n this.handlePopState = () => {\r\n this.cancel();\r\n };\r\n\r\n window.addEventListener('popstate', this.handlePopState);\r\n } else if (scenario === scenarios.settings) {\r\n const {\r\n cid,\r\n aid,\r\n campaignId,\r\n adGroupId,\r\n } = this.props.scope.values;\r\n\r\n Promise.all([\r\n renderAdGroupTargets(cid, aid, campaignId, adGroupId, this.patchAdgroup, this.state.adgroup, this),\r\n this.fetchCampaignAdGroupData(cid, aid, campaignId, adGroupId),\r\n this.fetchLocationCriterions(cid, aid, campaignId, adGroupId),\r\n this.fetchDayTimeCriterions(cid, aid, campaignId, adGroupId),\r\n ]).finally(() => {\r\n this.perfMarker.willRender();\r\n this.setState(() => ({ isLoading: false, isDataFetched: true }));\r\n });\r\n }\r\n }\r\n\r\n componentDidUpdate() {\r\n if (this.state.isLoading === false && this.state.isDataFetched === true && this.perfMarker.isDone === false) {\r\n this.durationActivity.startSignal();\r\n this.perfMarker.done();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.activity.stop();\r\n if (this.state.adgroup && this.state.adgroup.Id) {\r\n invalidateCache('Model.AdGroup', [this.state.adgroup.Id]);\r\n }\r\n if (this.removeWarningInterval) {\r\n this.removeWarningInterval();\r\n }\r\n if (this.adScheduleView) {\r\n this.adScheduleView.undelegateEvents().off().remove();\r\n }\r\n if (this.isCreation) {\r\n window.removeEventListener('popstate', this.handlePopState);\r\n }\r\n }\r\n\r\n getAdScheduleValues = () => {\r\n const deletedDayTimeCb = (deletedDayTimeCriterions) => {\r\n _.each(deletedDayTimeCriterions, (criterion) => {\r\n criterion.Status = 'Deleted';\r\n });\r\n };\r\n\r\n return this.adScheduleView ? this.adScheduleView.getValues(deletedDayTimeCb) : [];\r\n };\r\n\r\n getUrlOptionsValues = () => {\r\n const urlOptionsData = this.urlOptionsView ? this.urlOptionsView.toObject() : {};\r\n\r\n if (_.isEmpty(urlOptionsData.TrackingUrlTemplate)) {\r\n urlOptionsData.TrackingUrlTemplate = null;\r\n }\r\n if (_.isEmpty(urlOptionsData.UrlCustomParameters)) {\r\n urlOptionsData.UrlCustomParameters = null;\r\n }\r\n return urlOptionsData;\r\n };\r\n\r\n getExclusionsValues = () => {\r\n const siteExclusionData = this.siteExclusionView ? this.siteExclusionView.getValues() : {};\r\n const ExcludedSites = siteExclusionData;\r\n return { ExcludedSites };\r\n };\r\n\r\n getValues = () => {\r\n const values = {\r\n ...this.state.adgroup,\r\n adScheduleData: this.getAdScheduleValues(),\r\n dateSettings: this.adScheduleView ? this.adScheduleView.getDateSettings() : {},\r\n netWorkOptions: this.adDistributionView ? this.adDistributionView.toObject() : {},\r\n urlOptions: this.getUrlOptionsValues(),\r\n };\r\n\r\n if (this.adScheduleView && this.adScheduleView.getAdScheduleUseSearcherTimeZone) {\r\n values.AdScheduleUseSearcherTimeZone = this.adScheduleView.getAdScheduleUseSearcherTimeZone();\r\n }\r\n\r\n return values;\r\n };\r\n\r\n initializeTheInstrumentation = () => {\r\n if (this.isCreation) {\r\n const scenario = instrumentation.hotelAdGroupCreation.create();\r\n\r\n this.activity = scenario.hotelAdGroupCreation.create();\r\n // duration activity, from user could edit & all successeed/completed\r\n this.durationActivity = scenario.duration.create();\r\n this.perfMarker = this.props.perfMarker.createChild('HotelAdGroupBaseCreation');\r\n } else {\r\n const scenario = instrumentation.hotelAdGroupSettings.create();\r\n\r\n this.activity = scenario.hotelAdGroupSettings.create();\r\n this.durationActivity = scenario.duration.create();\r\n this.perfMarker = this.props.perfMarker.createChild('HotelAdGroupBaseSettings');\r\n }\r\n // the component life time\r\n this.activity.start();\r\n send(this.activity, 'enter_page');\r\n\r\n this.perfMarker.willInit();\r\n };\r\n\r\n syncAdGroupLocationCriterionsPromise = (payload) => {\r\n const {\r\n cid,\r\n aid,\r\n campaignId,\r\n adGroupId,\r\n } = this.props.scope.values;\r\n if (adGroupId) {\r\n return this.syncAdGroupLocationCriterions(cid, aid, campaignId, adGroupId);\r\n } else if (payload && payload.entity && payload.entity.Id) {\r\n return this.syncAdGroupLocationCriterions(cid, aid, campaignId, payload.entity.Id);\r\n } else if (payload && payload.Id) {\r\n return this.syncAdGroupLocationCriterions(cid, aid, campaignId, payload.Id);\r\n }\r\n return Promise.resolve(true);\r\n };\r\n\r\n updateResponseData = (payload, resolve) => {\r\n if (!payload) {\r\n resolve(true);\r\n return;\r\n }\r\n // Fill back the data to the view;\r\n if (payload.entity && payload.entity.Id) { this.patchAdgroup('Id', payload.entity.Id); }\r\n const resourceName = 'AdGroupCriterions';\r\n\r\n if (this.adScheduleView) {\r\n this.adScheduleView.backFillItems(payload.entity ? payload : { entity: payload });\r\n if (payload.entity && payload.errors) {\r\n this.adScheduleView.handleErrors(payload);\r\n }\r\n }\r\n\r\n let resources = [];\r\n if (_.has(payload, 'entity') && _.has(payload.entity, resourceName)) {\r\n resources = payload.entity[resourceName];\r\n } else if (_.has(payload, resourceName)) {\r\n resources = payload[resourceName];\r\n }\r\n updateAllTargets(resources, this);\r\n\r\n if (payload && payload.errors) {\r\n this.removeWarningInterval = showWarning('adgroup', this.props.i18n, this.removeWarningInterval);\r\n }\r\n\r\n Promise.all([this.syncAdGroupLocationCriterionsPromise(payload), this.createDefaultHotelGroupAfterAdGroupCreation(payload)])\r\n .finally(() => resolve(true));\r\n };\r\n\r\n isExclusionsUpdated() {\r\n if (!this.siteExclusionView) {\r\n return false;\r\n }\r\n const siteExclusionsUpdated = this.siteExclusionView &&\r\n !_.isEqual(this.siteExclusionView.options.exclusions, this.siteExclusionView.getValues());\r\n return siteExclusionsUpdated;\r\n }\r\n\r\n saveExtensions() {\r\n const { campaignId, adGroupId } = this.props.scope.values;\r\n const data = {\r\n AdGroupId: adGroupId,\r\n CampaignId: campaignId,\r\n AdvancedSettings: {\r\n ...this.getExclusionsValues(),\r\n },\r\n };\r\n const that = this;\r\n return exclusionRepository.saveExtensions(data, 'adgroup')\r\n .then(() => {\r\n send(this.activity, 'adgroup_extensions_update_succeeded');\r\n that.siteExclusionView.clearApiErrors();\r\n that.patchErrMsg('baseExclusion', '');\r\n this.patchAdvancedSettinsApiErrors('baseExclusion', []);\r\n })\r\n .catch((response) => {\r\n send(this.activity, 'adgroup_extensions_update_failed');\r\n if (response.NegativeSitesResult || response.NegativeIPsResult) {\r\n const { NegativeSitesResult: siteErrors, NegativeIPsResult: ipErrors } = response;\r\n if (siteErrors || ipErrors) {\r\n if (that.siteExclusionView && siteErrors) {\r\n that.siteExclusionView.showErrors(siteErrors);\r\n }\r\n that.patchErrMsg('baseExclusion', globalErrorMsg);\r\n this.patchAdvancedSettinsApiErrors('baseExclusion', [{ siteErrors }]);\r\n scrollToErrors('adgroup');\r\n } else {\r\n that.siteExclusionView.clearApiErrors();\r\n that.patchErrMsg('baseExclusion', '');\r\n this.patchAdvancedSettinsApiErrors('baseExclusion', []);\r\n }\r\n // eslint-disable-next-line no-throw-literal\r\n throw 'exclusion error';\r\n }\r\n });\r\n }\r\n\r\n clearAllApiErrors() {\r\n clearSubViewApiErrors(this.subViews);\r\n this.setState(prev => ({\r\n targetsApiErrors: {},\r\n advancedSettinsApiErrors: { baseExclusions: prev.advancedSettinsApiErrors.baseExclusions },\r\n }));\r\n }\r\n\r\n save = () => {\r\n send(this.activity, 'save_clicked');\r\n // If something is wrong, you want show error message in the titlebar, you can patchErrMsg like below.\r\n // this.patchErrMsg('campaign', '*Required field'); // The two parameters are the key of Collapse.Panel, and the error message displayed.\r\n const isValid = this.validate();\r\n\r\n if (isValid) {\r\n const data = this.getValues();\r\n this.setState(() => ({ isLoading: true }));\r\n // TODO: which campaign (from props or api calls), should we use?\r\n const createOrUpdatePromise = this.createOrUpdateAdgroup(convertAdgroupStateToAdgroupJSONSchemaData(data, this.getCurrentCampaign(), this.state.initTargets));\r\n createOrUpdatePromise.finally(() => this.setState(() => ({ isLoading: false })));\r\n } else {\r\n scrollToErrors('adgroup');\r\n }\r\n };\r\n\r\n cancel = () => {\r\n send(this.activity, 'cancel_clicked');\r\n this.durationActivity.stopSignal('canceled');\r\n const {\r\n scope,\r\n siteMap,\r\n } = this.props;\r\n scope.save(getRoutePathById(siteMap, 'adgroups'));\r\n };\r\n\r\n patchAdgroup = (key, value) => {\r\n this.setState(prevState => ({\r\n adgroup: {\r\n ...prevState.adgroup,\r\n [key]: value,\r\n },\r\n }));\r\n };\r\n patchErrMsg = (key, value) => {\r\n this.setState(prevState => ({\r\n errMsg: {\r\n ...prevState.errMsg,\r\n [key]: value,\r\n },\r\n }));\r\n };\r\n patchTargetsApiErrMsg = (key, value) => {\r\n this.setState(prevState => ({\r\n targetsApiErrors: {\r\n ...prevState.targetsApiErrors,\r\n [key]: value,\r\n },\r\n }));\r\n };\r\n patchAdvancedSettinsApiErrors = (key, value) => {\r\n this.setState(prevState => ({\r\n advancedSettinsApiErrors: {\r\n ...prevState.advancedSettinsApiErrors,\r\n [key]: value,\r\n },\r\n }));\r\n };\r\n render() {\r\n const {\r\n classes,\r\n i18n,\r\n scenario,\r\n currentCampaign,\r\n } = this.props;\r\n\r\n const campaignName = currentCampaign && currentCampaign.Name;\r\n const campaignBidStrategy = this.state.campaign && this.state.campaign.bidStrategy;\r\n\r\n return (\r\n { if (!_.isEmpty(this.state.adgroupApiErrors)) { _.delay(() => this.setState(() => ({ adgroupApiErrors: [] })), 200); } }}\r\n >\r\n \r\n
\r\n {this.isCreation && }\r\n <Errors errors={!_.isEmpty(this.state.adgroupApiErrors) && this.state.adgroupApiErrors.map(x => x.message)} />\r\n <AdgroupBasic\r\n campaignName={campaignName}\r\n patchAdgroup={this.patchAdgroup}\r\n adgroup={this.state.adgroup}\r\n bidStrategy={campaignBidStrategy}\r\n scenario={scenario}\r\n permissions={this.props.permissions}\r\n />\r\n <AdvancedSettings\r\n campaign={this.state.campaign}\r\n adgroup={this.state.adgroup}\r\n patchAdgroup={this.patchAdgroup}\r\n setAdScheduleView={this.setAdScheduleView}\r\n getAdScheduleView={() => this.adScheduleView}\r\n setAdDistributionView={this.setAdDistributionView}\r\n getAdDistributionView={this.getAdDistributionView}\r\n setSiteExclusionView={this.setSiteExclusionView}\r\n setUrlOptionsView={this.setUrlOptionsView}\r\n scenario={scenario}\r\n errMsg={this.state.errMsg}\r\n patchErrMsg={this.patchErrMsg}\r\n getUrlOptionsValues={this.getUrlOptionsValues}\r\n getExclusionsValues={this.getExclusionsValues}\r\n advancedSettinsApiErrors={this.state.advancedSettinsApiErrors}\r\n isDataFetched={this.state.isDataFetched}\r\n />\r\n <AdgroupTargets\r\n patchAdgroup={this.patchAdgroup}\r\n adgroup={this.state.adgroup}\r\n campaign={this.state.campaign}\r\n errMsg={this.state.errMsg}\r\n patchErrMsg={this.patchErrMsg}\r\n scope={this.props.scope}\r\n targetsApiErrors={this.state.targetsApiErrors}\r\n patchTargetsApiErrMsg={this.patchTargetsApiErrMsg}\r\n />\r\n <div className=\"dashline\" />\r\n <PrimaryButton text={i18n.getString(_TL_('Save'))} onClick={this.save} />\r\n <DefaultButton className=\"cancel-btn\" text={i18n.getString(_TL_('Cancel'))} onClick={this.cancel} />\r\n </div>\r\n </UiBlocker>\r\n </div>\r\n );\r\n }\r\n};\r\n\r\nHotelAdGroupBase.propTypes = {\r\n currentCampaign: PropTypes.shape({}).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func,\r\n }).isRequired,\r\n classes: PropTypes.shape({}).isRequired,\r\n scenario: PropTypes.string,\r\n scope: PropTypes.shape({\r\n values: PropTypes.shape({\r\n cid: PropTypes.number.isRequired,\r\n aid: PropTypes.number.isRequired,\r\n campaignId: PropTypes.number,\r\n adGroupId: PropTypes.number,\r\n }).isRequired,\r\n }).isRequired,\r\n siteMap: PropTypes.shape([]).isRequired,\r\n perfMarker: perfMarkerPropTypes.isRequired,\r\n serverContext: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nHotelAdGroupBase.defaultProps = {\r\n scenario: scenarios.creation,\r\n};\r\n","import { helpbuttonStyle, convertToLocalStyle, glyphIconStyle, getBlockerStyle, spinnerKeyframe } from '@bingads-webui-campaign-react/common-styles';\r\nimport { creationCommonStyle } from '@bingads-webui-campaign-react/campaign-adgroup-settings-shared-styles';\r\n\r\nexport const sharedStyles = core => ({\r\n hotelAdGroupBase: {\r\n padding: '32px 32px 48px 24px',\r\n minWidth: '1032px',\r\n backgroundColor: `${core && core.palette && core.palette.neutralLighterAlt}`,\r\n '& .helpbutton': helpbuttonStyle(core)['.helpbutton'],\r\n '& .helpbutton::before': helpbuttonStyle(core)['.helpbutton::before'],\r\n ...convertToLocalStyle(glyphIconStyle(core)),\r\n ...creationCommonStyle(core),\r\n '& .dashline': {\r\n borderBottom: `1px solid ${core && core.palette && core.palette.neutralLight}`,\r\n width: '100%',\r\n margin: '24px 0 16px 0',\r\n },\r\n '& span': {\r\n verticalAlign: 'unset',\r\n },\r\n '& .jumbo-card-control-all-btn': {\r\n color: '#323230',\r\n },\r\n '& .campaign-rate-bid': {\r\n marginBottom: '16px',\r\n },\r\n '& .hotel-ad-format label': {\r\n display: 'inherit',\r\n },\r\n '& .intent-target': {\r\n marginTop: '8px',\r\n },\r\n '& .cancel-btn': {\r\n marginLeft: '8px',\r\n },\r\n '& .react-block-ui': {\r\n '& > div:last-child > div > div': {\r\n backgroundColor: 'unset',\r\n },\r\n '& > div:last-child': {\r\n alignItems: 'center',\r\n backgroundColor: 'rgba(256, 256, 256, 0.5)',\r\n color: core.palette.themePrimary,\r\n display: 'flex',\r\n outline: 'none',\r\n padding: 10,\r\n '& .blocker-text': {\r\n fontWeight: 'normal',\r\n top: '23.5px',\r\n display: 'inline-block',\r\n position: 'absolute',\r\n },\r\n '& .blocker-image': {\r\n ...getBlockerStyle(28, core.palette),\r\n display: 'inline-block',\r\n },\r\n },\r\n },\r\n '& table tbody .col-sm-9': {\r\n width: 'unset',\r\n paddingLeft: 'unset',\r\n },\r\n '& table tbody .item-label.schedule-item-label.form-control-static': {\r\n fontWeight: '600',\r\n color: '#323130',\r\n paddingTop: '10px',\r\n display: 'block',\r\n },\r\n '& table tbody .radio .col-sm-3': {\r\n width: 'unset',\r\n },\r\n '& table tbody .radio .col-sm-9': {\r\n paddingLeft: '8px',\r\n },\r\n '& table tbody .col-sm-9 input.k-input.form-control': {\r\n width: '100px !important',\r\n },\r\n '& .adschedule-targets-container .ba-backbone-instance-wrapper .advanced-scheduling-grid .ad-scheduling-panel table tr:nth-child(3) td .radio-inline:nth-child(2)': {\r\n top: 'unset',\r\n },\r\n '& .form-horizontal table tbody .radio': {\r\n paddingTop: 'unset',\r\n },\r\n '& .scheduling-grid .advanced-scheduling-grid': {\r\n marginTop: '16px',\r\n },\r\n '& #ad-schedule-use-campaign-settings': {\r\n display: 'none',\r\n },\r\n '& .adschedule-targets-container .toggle-campaign-settings-switch.form-control-static[data-bind]': {\r\n display: 'none',\r\n },\r\n '& .hotel-adgroup-shared': {\r\n width: '62.5%',\r\n minWidth: '968px',\r\n },\r\n '& .location-target-options .specific-location-targets-editor': {\r\n marginLeft: 'unset',\r\n },\r\n '& .location-target-options label': {\r\n display: 'inherit',\r\n },\r\n '& .intent-target-options label': {\r\n display: 'inherit',\r\n },\r\n '& .adGroup': {\r\n '& .collapse-content.content-show': {\r\n marginTop: '-4px',\r\n marginLeft: '-4px',\r\n '& .campaign-name': {\r\n marginTop: '4px',\r\n marginLeft: '4px',\r\n },\r\n '& .adgroup-name': {\r\n marginLeft: '4px',\r\n },\r\n '& .hotel-ad-format': {\r\n marginLeft: '4px',\r\n marginBottom: '4px',\r\n },\r\n },\r\n },\r\n },\r\n '@global': {\r\n '.floating-banner.warnFloatingBanner': {\r\n bottom: 'unset',\r\n top: '10%',\r\n background: '#A80000',\r\n '& .iconba, [role=\"alert\"], [role=\"button\"]': {\r\n color: 'white',\r\n },\r\n },\r\n '.app-shell .app-content-body div.settings-page': {\r\n overflow: 'visible',\r\n },\r\n '.app-shell .app-content-container-col': {\r\n backgroundColor: `${core && core.palette && core.palette.neutralLighterAlt}`,\r\n '& .ba-content-footer, .back-to-campaign': {\r\n minWidth: '1032px',\r\n },\r\n },\r\n ...spinnerKeyframe,\r\n },\r\n});\r\n","import { compose } from 'underscore';\r\nimport React from 'react';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { withI18nConsumer } from '@bingads-webui-react/i18n-context';\r\nimport { mergeStyles } from '@bingads-webui-campaign-react/common-styles';\r\nimport { HotelAdGroupBase, scenarios } from './shared';\r\nimport { sharedStyles } from './style';\r\n\r\nconst getStyles = (_, theme) => ({\r\n ...mergeStyles(\r\n { theme },\r\n sharedStyles\r\n ),\r\n});\r\n\r\nexport const HotelAdGroupCreation = compose(\r\n withI18nConsumer,\r\n WrappedComponent => withDefaultStyles(WrappedComponent, getStyles)\r\n)(props => (<HotelAdGroupBase {...props} scenario={scenarios.creation} />));\r\n","import { compose } from 'underscore';\r\nimport React from 'react';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { withI18nConsumer } from '@bingads-webui-react/i18n-context';\r\nimport { mergeStyles } from '@bingads-webui-campaign-react/common-styles';\r\nimport { HotelAdGroupBase, scenarios } from './shared';\r\nimport { sharedStyles } from './style';\r\n\r\nconst getStyles = (_, theme) => ({\r\n ...mergeStyles(\r\n { theme },\r\n sharedStyles\r\n ),\r\n});\r\n\r\nexport const HotelAdGroupSettings = compose(\r\n withI18nConsumer,\r\n WrappedComponent => withDefaultStyles(WrappedComponent, getStyles)\r\n)(props => (<HotelAdGroupBase {...props} scenario={scenarios.settings} />));\r\n","import { validationLocalization } from '@bingads-webui-campaign-react/smart-i18n';\r\nimport { columnChooser } from './column-chooser';\r\nimport { filter } from './filter';\r\nimport { CronFormat } from './cron-format';\r\nimport { dateRange } from './date-range';\r\nimport { inlineDownload } from './inline-download';\r\nimport { inlineEdit } from './inline-edit';\r\n\r\nexport const legacyKeys = [\r\n validationLocalization, columnChooser, filter, CronFormat, dateRange, inlineDownload, inlineEdit];\r\n","export const columnChooser = {\r\n ColumnChooser_Header: _TL_('Modify columns'),\r\n ColumnChooser_SubHeader: _TL_(''),\r\n ColumnChooser_AvailableColumnsHeader: _TL_('Available columns'),\r\n ColumnChooser_SelectedColumnsHeader: _TL_('Selected columns (drag and drop to reorder)'),\r\n ColumnChooser_SelectedColumnsHeader_TopHalf: _TL_('Selected rows'),\r\n ColumnChooser_SelectedColumnsHeader_BottomHalf: _TL_('Selected columns'),\r\n ColumnChooser_SaveColumnDescription: _TL_('Save this set of columns'),\r\n ColumnChooser_Apply: _TL_('Apply'),\r\n ColumnChooser_Cancel: _TL_('Cancel'),\r\n ColumnChooser_Add: _TL_('Add'),\r\n ColumnChooser_Added: _TL_('Added'),\r\n ColumnChooser_Remove: _TL_('Remove'),\r\n ColumnChooser_AddAllInList: _TL_('Add all columns'),\r\n ColumnChooser_RemoveAllInList: _TL_('Remove all columns'),\r\n ColumnChooser_RemoveAllSelected: _TL_('Remove all selected columns'),\r\n ColumnChooser_NoSearchResult: _TL_('No results found'),\r\n ColumnChooser_Disabled: _TL_('Add'),\r\n ColumnChooser_Search_Column: _TL_('Search column'),\r\n ColumnChooser_AddColumn: _TL_('Add Column {{columnName}}'),\r\n ColumnChooser_RemoveColumn: _TL_('Remove Column {{columnName}}'),\r\n ColumnChooser_LiftColumn: _TL_('You have lifted the {{columnName}} column in position {{positionFrom}}.'),\r\n ColumnChooser_MoveColumn: _TL_('You have moved the {{columnName}} column from position {{positionFrom}} to position {{positionTo}}.'),\r\n ColumnChooser_DropColumn: _TL_('You have dropped the {{columnName}} column. You have moved the {{columnName}} column from position {{positionFrom}} to position {{positionTo}}.'),\r\n};\r\n\r\n","export const filter = {\r\n Filter_Operator_IN: _TL_('either of'),\r\n Filter_Operator_EQ: _TL_('equals'),\r\n Filter_Operator_NEQ: _TL_('does not equal'),\r\n Filter_Operator_Contains: _TL_('contains'),\r\n Filter_Operator_Not_Contains: _TL_('does not contain'),\r\n Filter_Operator_StartsWith: _TL_('begins with'),\r\n Filter_Operator_EndsWith: _TL_('ends with'),\r\n Filter_Operator_LT: _TL_('less than'),\r\n Filter_Operator_GT: _TL_('greater than'),\r\n Filter_Operator_LTE: _TL_('less than or equals'),\r\n Filter_Operator_GTE: _TL_('greater than or equals'),\r\n Filter_Validation_EnumSelectionRequired: _TL_('Select at least one option'),\r\n Filter_Validation_Common_Required: _TL_('Required field'),\r\n Filter_Validation_Common_Number: _TL_('Only numeric values allowed'),\r\n Filter_Validation_Common_Number_Range: _TL_('Numeric value out of allowed range'),\r\n Filter_Validation_Common_Integer: _TL_('Only integer values allowed'),\r\n Filter_Validation_Common_Date: _TL_('Incorrect date format'),\r\n Filter_Validation_Common_Id_Count: _TL_('Only {{maxCount}} items allowed'),\r\n Filter_Cannot_Have_Duplicate: _TL_('Cannot filter by duplicate property'),\r\n Filter_Remove: _TL_('Remove'),\r\n Filter_PredicateList_New: _TL_('Add another'),\r\n Performance: _TL_('Performance'),\r\n Filter_Key_AriaLabel: _TL_('What to filter'),\r\n Filter_Operator_AriaLabel: _TL_('How to filter'),\r\n Filter_Value_AriaLabel: _TL_('What to filter on'),\r\n SelectEntityOrEntities: _TL_('Select {0}', { comment: '{0} is placeholder for name' }),\r\n SelectedEntityOrEntities: _TL_(' selected {0}', { comment: '{0} is placeholder for name' }),\r\n Selector_LoadingText: _TL_('Loading...'),\r\n Selector_Check_All: _TL_('All'),\r\n Filter_Selector_MoreThanLimit: _TL_('Showing only the first {0} {1}. Narrow your search to find the right set of {1}', { comment: '{0} is the max number of items that can be displayed. {1} is the name of the entity in plural form, eg. campaigns, ads, labels etc.' }),\r\n NoEntityOrEntities: _TL_('No {0}', { comment: '{0} is placeholder for name' }),\r\n 'Select all': _TL_('Select all'),\r\n 'Deselect all': _TL_('Deselect all'),\r\n 'Select this row': _TL_('Select this row'),\r\n 'Deselect this row': _TL_('Deselect this row'),\r\n};\r\n","export const CronFormat = {\r\n CronFormatter_Frequency_MonthlyTemplate: _TL_('Runs {{frequency}} on day {{dayOfMonth}} at {{hour}}'),\r\n CronFormatter_Frequency_WeeklyTemplate: _TL_('Runs {{frequency}} on {{dayOfWeek}} at {{hour}}'),\r\n CronFormatter_Frequency_DailyTemplate: _TL_('Runs {{frequency}} at {{hour}}'),\r\n CronFormatter_FrequencyGrain_Runs_Daily: _TL_('daily'),\r\n CronFormatter_FrequencyGrain_Runs_Monthly: _TL_('monthly'),\r\n CronFormatter_FrequencyGrain_Runs_Weekly: _TL_('weekly'),\r\n CronFormatter_FrequencyGrain_DropdownMenu_None: _TL_('None'),\r\n CronFormatter_FrequencyGrain_DropdownMenu_Daily: _TL_('Daily'),\r\n CronFormatter_FrequencyGrain_DropdownMenu_Monthly: _TL_('Monthly'),\r\n CronFormatter_FrequencyGrain_DropdownMenu_Weekly: _TL_('Weekly'),\r\n};\r\n","export const dateRange = {\r\n DateFilter_Option_Custom: _TL_('Custom'),\r\n DateFilter_Option_CustomTime: _TL_('Time'),\r\n DateFilter_Option_Today: _TL_('Today'),\r\n DateFilter_Option_Yesterday: _TL_('Yesterday'),\r\n DateFilter_Option_ThisWeekSunday: _TL_('This week (Sun - Today)'),\r\n DateFilter_Option_ThisWeekMonday: _TL_('This week (Mon - Today)'),\r\n DateFilter_Option_Last7days: _TL_('Last 7 days'),\r\n DateFilter_Option_LastWeekSunday: _TL_('Last week (Sun - Sat)'),\r\n DateFilter_Option_LastWeekMonday: _TL_('Last week (Mon - Sun)'),\r\n DateFilter_Option_Last14Days: _TL_('Last 14 days'),\r\n DateFilter_Option_ThisMonth: _TL_('This month'),\r\n DateFilter_Option_LastMonth: _TL_('Last month'),\r\n DateFilter_Option_Last30Days: _TL_('Last 30 days'),\r\n DateFilter_Option_Last3Months: _TL_('Last 3 months'),\r\n DateFilter_Option_Last6Months: _TL_('Last 6 months'),\r\n DateFilter_Option_TwelveMonthsToDate: _TL_('Rolling year'),\r\n DateFilter_Option_ThisYear: _TL_('This year'),\r\n DateFilter_Option_LastYear: _TL_('Last year'),\r\n DateFilter_Option_AllTime: _TL_('Entire time'),\r\n DateFilter_Option_PreviousPeriod: _TL_('Previous period'),\r\n DateFilter_Option_SamePeriodLastYear: _TL_('Same period last year'),\r\n DateFilter_Option_CustomPeriod: _TL_('Custom'),\r\n};\r\n","export const inlineDownload = {\r\n InlineDownloadReports_Column_EmailFrequency: _TL_('How often'),\r\n InlineDownloadReports_EmailAndScheduling_Frequency_None: _TL_('One time'),\r\n InlineDownloadReports_EmailAndScheduling_Frequency_Daily_Template: _TL_('at {{hour}}'),\r\n InlineDownloadReports_EmailAndScheduling_Frequency_Weekly_Template: _TL_('on {{dayOfWeek}} at {{hour}}'),\r\n InlineDownloadReports_EmailAndScheduling_Frequency_Monthly_Template: _TL_('on day {{dayOfMonth}} of every month at {{hour}}'),\r\n InlineDownloadReports_Action_UnsubscribeMe_Failed_NotSubscribed: _TL_('You didn\\'t subscribe to report \"{{report}}\"'),\r\n InlineDownloadReports_Action_UnsubscribeMe_Failed: _TL_('Failed to unsubscribe from report \"{{report}}\"'),\r\n InlineDownloadReports_Action_UnsubscribeMe_Succeeded: _TL_('You have unsubscribed from report \"{{report}}\"'),\r\n};\r\n","export const inlineEdit = {\r\n Grid_Edit_Cell: _TL_('Edit cell of column {{columnName}} and row {{rowIndex}}'),\r\n Grid_EditButtonText: _TL_('Edit'),\r\n Save: _TL_('Save'),\r\n Cancel: _TL_('Cancel'),\r\n Loading: _TL_('Loading...'),\r\n Schema_ReportEmailRule_Property_Cron: _TL_('Frequency'),\r\n Schema_ReportEmailRule_Property_StartTime: _TL_('Start date'),\r\n Schema_ReportEmailRule_Property_EndTime: _TL_('End date'),\r\n InlineDownloadReports_EmailAndScheduling_SendReportTo: _TL_('Send report to'),\r\n InlineDownloadReports_SearchUsers: _TL_('Search users'),\r\n InlineDownloadReports_EmailAndScheduling_Email_Me: _TL_('me'),\r\n InlineDownloadReports_EmailAndScheduling_Email_Template_Me: _TL_('{{email}} ({{me}})'),\r\n InlineDownloadReports_EmailAndScheduling_User: _TL_('{{email}} {{firstName}} {{lastName}}'),\r\n InlineDownloadReports_EmailAndScheduling_FailedToLoadUsers: _TL_('Failed to load users'),\r\n InlineDownloadReports_EmailAndScheduling_AllUsers: _TL_('All users with access to view reports'),\r\n 'Click to learn more about {{item}}': _TL_('Click to learn more about {{item}}'),\r\n SimpleForm_Button_Save: _TL_('Save'),\r\n SimpleForm_Button_Cancel: _TL_('Cancel'),\r\n KoSchema_String_RemainingCharactersText: _TL_('{{count}} characters remaining'),\r\n KoSchema_String_ExceededCharactersText: _TL_('Exceeded by {{count}} characters'),\r\n /* Start: date range column */\r\n Custom: _TL_('Custom'),\r\n Schema_Enum_DateRangePreset_AllTime: _TL_('Entire time'),\r\n Schema_Enum_DateRangePreset_LastBusinessWeek: _TL_('Last business week'),\r\n Schema_Enum_DateRangePreset_LastFourteenDays: _TL_('Last 14 days'),\r\n Schema_Enum_DateRangePreset_LastMonth: _TL_('Last month'),\r\n Schema_Enum_DateRangePreset_LastSevenDays: _TL_('Last 7 days'),\r\n Schema_Enum_DateRangePreset_LastSixMonth: _TL_('Last six month'),\r\n Schema_Enum_DateRangePreset_LastThirtyDays: _TL_('Last 30 days'),\r\n Schema_Enum_DateRangePreset_LastThreeMonth: _TL_('Last three month'),\r\n Schema_Enum_DateRangePreset_LastWeekStartingMon: _TL_('Last week (Mon - Sun)'),\r\n Schema_Enum_DateRangePreset_LastWeekStartingSun: _TL_('Last week (Sun - Sat)'),\r\n Schema_Enum_DateRangePreset_LastYear: _TL_('Last year'),\r\n Schema_Enum_DateRangePreset_ThisMonth: _TL_('This month'),\r\n Schema_Enum_DateRangePreset_ThisWeekFromMon: _TL_('This week (Mon - Today)'),\r\n Schema_Enum_DateRangePreset_ThisWeekFromSun: _TL_('This week (Sun - Today)'),\r\n Schema_Enum_DateRangePreset_ThisYear: _TL_('This year'),\r\n Schema_Enum_DateRangePreset_Today: _TL_('Today'),\r\n Schema_Enum_DateRangePreset_Yesterday: _TL_('Yesterday'),\r\n /* End: date range column */\r\n};\r\n","import { validateNumber, numberErrorCode, getNumberErrorMsg, bidStrategyOptionKeys } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport appConfig from '@bingads-webui-component-legacy/config/index';\r\n\r\nexport const fields = {\r\n ManualCpc: 'ManualCpc',\r\n PercentCpc: 'PercentCpc',\r\n Commission: 'Commission',\r\n AdGroupBid: 'AdGroupBid',\r\n AdGroupPercentBid: 'AdGroupPercentBid',\r\n AdGroupCommissionRate: 'AdGroupCommissionRate',\r\n};\r\n\r\nexport const bidStrategyTypeValueMap = {\r\n ManualCpc: '',\r\n PercentCpc: 'PercentMaxCpc',\r\n Commission: 'CommissionRate',\r\n};\r\n\r\nexport const bidStrategyOptions = (i18n, isPayPerStayEnabled) => [\r\n {\r\n key: bidStrategyOptionKeys.ManualCpc, text: i18n.getString(_TL_('Fixed bid per night (per click)')),\r\n },\r\n {\r\n key: bidStrategyOptionKeys.PercentCpc, text: i18n.getString(_TL_('Percentage of room price (per click)')),\r\n },\r\n ...(isPayPerStayEnabled ? [{ key: bidStrategyOptionKeys.Commission, text: i18n.getString(_TL_('Percentage of room price (per stay)')) }] : []),\r\n];\r\n\r\nconst percentageOrBidConst = {\r\n min: 0,\r\n max: 1000,\r\n};\r\n\r\n\r\nexport const getAdGroupBidMinMax = ({ selectedKey, bidStrategy, serverContext }) => {\r\n const key = selectedKey || bidStrategy.option;\r\n // align the range with search ad group campaign as MT create it with the same flow.\r\n const min = (serverContext && serverContext.KeywordBidRange && serverContext.KeywordBidRange.FloorValue) || 0.01;\r\n const max = (serverContext && serverContext.KeywordBidRange && serverContext.KeywordBidRange.CeilingValue) || 1000;\r\n switch (key) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n return { min, max };\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return { min: appConfig.get('KeywordPercentCpcBidRange') && appConfig.get('KeywordPercentCpcBidRange').FloorValue, max: appConfig.get('KeywordPercentCpcBidRange') && appConfig.get('KeywordPercentCpcBidRange').CeilingValue };\r\n case bidStrategyOptionKeys.Commission:\r\n return { min: appConfig.get('KeywordCommissionRateRange') && appConfig.get('KeywordCommissionRateRange').FloorValue, max: appConfig.get('KeywordCommissionRateRange') && appConfig.get('KeywordCommissionRateRange').CeilingValue };\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\nexport const validateAdGroupBid = ({\r\n selectedKey, bidStrategy, min, max,\r\n}) => {\r\n const key = selectedKey || bidStrategy.option;\r\n switch (key) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n return validateNumber({\r\n value: bidStrategy[fields.AdGroupBid], min, max, digitLength: 2,\r\n });\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return validateNumber({\r\n value: bidStrategy[fields.AdGroupPercentBid], min, max, digitLength: 2, notIncludeMin: true,\r\n });\r\n case bidStrategyOptionKeys.Commission:\r\n return validateNumber({\r\n value: bidStrategy[fields.AdGroupCommissionRate], min, max, notRequired: true, digitLength: 2, notIncludeMin: true,\r\n });\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\nexport const getBidStrategyMinMax = ({ selectedKey, bidStrategy, serverContext }) => {\r\n const key = selectedKey || bidStrategy.option;\r\n const min = (serverContext && serverContext.ProductGroupBidRange && serverContext.ProductGroupBidRange.FloorValue) || 0.01;\r\n const max = (serverContext && serverContext.ProductGroupBidRange && serverContext.ProductGroupBidRange.CeilingValue) || 1000;\r\n switch (key) {\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return { min, max };\r\n case bidStrategyOptionKeys.Commission:\r\n return { min: appConfig.get('KeywordCommissionRateRange') && appConfig.get('KeywordCommissionRateRange').FloorValue, max: appConfig.get('KeywordCommissionRateRange') && appConfig.get('KeywordCommissionRateRange').CeilingValue };\r\n case bidStrategyOptionKeys.ManualCpc:\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\nexport const validateBidStrategy = ({\r\n selectedKey, bidStrategy, min, max,\r\n}) => {\r\n const key = selectedKey || bidStrategy.option;\r\n switch (key) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n return null;\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return validateNumber({\r\n value: bidStrategy[key],\r\n min,\r\n max,\r\n notRequired: true,\r\n digitLength: 2,\r\n });\r\n case bidStrategyOptionKeys.Commission:\r\n return validateNumber({\r\n value: bidStrategy[key], min, max, digitLength: 2, notIncludeMin: true,\r\n });\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\nexport const isBidStrategyValid = ({\r\n selectedKey, bidStrategy, serverContext, isCreation,\r\n}) => {\r\n const valid = validateBidStrategy({ selectedKey, bidStrategy, ...getBidStrategyMinMax({ selectedKey, bidStrategy, serverContext }) }) == null;\r\n if (valid && isCreation) {\r\n return validateAdGroupBid({ selectedKey, bidStrategy, ...getAdGroupBidMinMax({ selectedKey, bidStrategy, serverContext }) }) == null;\r\n }\r\n return valid;\r\n};\r\n\r\nexport const getPercentageOrBidErrorMsg = ({\r\n code, i18n, min = percentageOrBidConst.min, max = percentageOrBidConst.max, isPercent,\r\n}) => {\r\n switch (code) {\r\n case numberErrorCode.RequiredField:\r\n if (isPercent) {\r\n return i18n.getString(_TL_('Enter a percentage'));\r\n }\r\n return i18n.getString(_TL_('Enter a bid'));\r\n default:\r\n return getNumberErrorMsg({\r\n code, i18n, min, max,\r\n });\r\n }\r\n};\r\n","import React, { Fragment, useContext, useCallback } from 'react';\r\nimport classnames from 'classnames';\r\nimport { Dropdown, Label, Stack, TextField } from '@bingads-webui-react/fabric-control';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport PropTypes from 'prop-types';\r\nimport { getAccountCurrencyCode, bidStrategyOptionKeys, Disclaimer } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { ErrorString, SpanWithComponent, checkShouldShowError } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { validateBidStrategy, getPercentageOrBidErrorMsg, fields, bidStrategyOptions, validateAdGroupBid, getBidStrategyMinMax, getAdGroupBidMinMax } from './utility';\r\n\r\nconst Bid = React.memo((props) => {\r\n const {\r\n content,\r\n field,\r\n bidStrategy,\r\n setBidStrategy,\r\n isPercent,\r\n selectedKey,\r\n } = props;\r\n const serverContext = useContext(ServerContext);\r\n const accountCurrencyCode = getAccountCurrencyCode(serverContext);\r\n const i18n = useContext(I18nContext);\r\n const shouldShowError = checkShouldShowError(bidStrategy);\r\n const minMax = getAdGroupBidMinMax({ selectedKey, bidStrategy, serverContext });\r\n const error = getPercentageOrBidErrorMsg({\r\n code: validateAdGroupBid({ selectedKey, bidStrategy, ...minMax }),\r\n i18n,\r\n ...minMax,\r\n isPercent,\r\n });\r\n return (\r\n <div className=\"bid\">\r\n <Label styles={{\r\n root: {\r\n marginTop: '8px',\r\n marginBottom: '8px',\r\n },\r\n }}\r\n >\r\n {content}\r\n </Label>\r\n <Stack horizontal verticalAlign=\"center\" tokens={{ childrenGap: 4 }}>\r\n <TextField\r\n className={field}\r\n value={bidStrategy[field] || ''}\r\n placeholder=\"\"\r\n ariaLabel={`${field}Label`}\r\n styles={{ fieldGroup: { width: 80 } }}\r\n onBlur={() => { setBidStrategy({ isDirty: true }); }}\r\n onChange={(e, value) => { setBidStrategy({ [field]: value, isDirty: true }); }}\r\n />\r\n {isPercent ? <span>{i18n.getString(_TL_('%'))}</span> : <span>{accountCurrencyCode}</span>}\r\n </Stack>\r\n {shouldShowError && error && <ErrorString error={error} />}\r\n </div>\r\n );\r\n});\r\n\r\nBid.propTypes = {\r\n bidStrategy: PropTypes.shape({}),\r\n setBidStrategy: PropTypes.func.isRequired,\r\n content: PropTypes.string.isRequired,\r\n field: PropTypes.string.isRequired,\r\n isPercent: PropTypes.bool.isRequired,\r\n selectedKey: PropTypes.string.isRequired,\r\n};\r\n\r\nBid.defaultProps = {\r\n bidStrategy: {},\r\n};\r\n\r\nconst Percentage = React.memo((props) => {\r\n const {\r\n content,\r\n field,\r\n bidStrategy,\r\n setBidStrategy,\r\n selectedKey,\r\n isPercent,\r\n } = props;\r\n const i18n = useContext(I18nContext);\r\n const serverContext = useContext(ServerContext);\r\n const accountCurrencyCode = getAccountCurrencyCode(serverContext);\r\n const shouldShowError = checkShouldShowError(bidStrategy);\r\n const minMax = getBidStrategyMinMax({ selectedKey, bidStrategy });\r\n const error = getPercentageOrBidErrorMsg({\r\n code: validateBidStrategy({ selectedKey, bidStrategy, ...minMax }),\r\n i18n,\r\n ...minMax,\r\n isPercent,\r\n });\r\n\r\n return (\r\n <div className=\"percentage\">\r\n <Label styles={{\r\n root: {\r\n marginBottom: '8px',\r\n },\r\n }}\r\n >\r\n {content}\r\n </Label>\r\n <Stack horizontal verticalAlign=\"center\" tokens={{ childrenGap: 4 }}>\r\n <TextField\r\n ariaLabel={`${field}Label`}\r\n className={field}\r\n value={bidStrategy[field] || ''}\r\n placeholder=\"\"\r\n styles={{ fieldGroup: { width: 80 } }}\r\n onBlur={() => { setBidStrategy({ isDirty: true }); }}\r\n onChange={(e, value) => { setBidStrategy({ [field]: value, isDirty: true }); }}\r\n />\r\n {isPercent ? <span>{i18n.getString(_TL_('%'))}</span> : <span>{accountCurrencyCode}</span>}\r\n {shouldShowError && error && <ErrorString error={error} />}\r\n </Stack>\r\n </div >\r\n );\r\n});\r\n\r\nPercentage.propTypes = {\r\n bidStrategy: PropTypes.shape({}),\r\n setBidStrategy: PropTypes.func.isRequired,\r\n content: PropTypes.string.isRequired,\r\n field: PropTypes.string.isRequired,\r\n selectedKey: PropTypes.string.isRequired,\r\n isPercent: PropTypes.bool,\r\n};\r\n\r\nPercentage.defaultProps = {\r\n bidStrategy: {},\r\n isPercent: false,\r\n};\r\n\r\nconst DefaultBidValue = React.memo((props) => {\r\n const {\r\n selectedKey,\r\n } = props;\r\n const i18n = useContext(I18nContext);\r\n switch (selectedKey) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n return (\r\n <Bid field={fields.AdGroupBid} content={i18n.getString(_TL_('Default ad group bid'))} {...props} selectedKey={selectedKey} />\r\n );\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return (\r\n <Bid field={fields.AdGroupPercentBid} content={i18n.getString(_TL_('Default ad group percent bid'))} {...props} isPercent selectedKey={selectedKey} />\r\n );\r\n case bidStrategyOptionKeys.Commission:\r\n default:\r\n return null;\r\n }\r\n});\r\n\r\nDefaultBidValue.propTypes = {\r\n bidStrategy: PropTypes.shape({}),\r\n selectedKey: PropTypes.string.isRequired,\r\n setBidStrategy: PropTypes.func.isRequired,\r\n};\r\n\r\nDefaultBidValue.defaultProps = {\r\n bidStrategy: {},\r\n};\r\n\r\n\r\nconst AdditionalInfo = React.memo((props) => {\r\n const {\r\n selectedKey,\r\n isPayPerStayEnabled,\r\n } = props;\r\n const i18n = useContext(I18nContext);\r\n switch (selectedKey) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n return null;\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return (\r\n <Fragment>\r\n <Percentage field={fields.PercentCpc} content={i18n.getString(_TL_('Maximum effective bid limit'))} {...props} />\r\n </Fragment>\r\n );\r\n case bidStrategyOptionKeys.Commission: {\r\n let detail;\r\n if (isPayPerStayEnabled) {\r\n detail = (\r\n <Fragment>\r\n <Percentage field={fields.Commission} content={i18n.getString(_TL_('Room price (per stay)'))} isPercent {...props} />\r\n </Fragment>);\r\n } else {\r\n detail = null;\r\n }\r\n return detail;\r\n }\r\n default:\r\n return null;\r\n }\r\n});\r\n\r\nAdditionalInfo.propTypes = {\r\n bidStrategy: PropTypes.shape({}),\r\n selectedKey: PropTypes.string.isRequired,\r\n setBidStrategy: PropTypes.func.isRequired,\r\n isPayPerStayEnabled: PropTypes.bool.isRequired,\r\n};\r\n\r\nAdditionalInfo.defaultProps = {\r\n bidStrategy: {},\r\n};\r\n\r\nexport const defaultBidStrategy = {\r\n option: bidStrategyOptionKeys.ManualCpc,\r\n};\r\n\r\nexport const CampaignBidStrategy = React.memo((props) => {\r\n const {\r\n bidStrategy,\r\n setBidStrategy,\r\n scenario,\r\n getAdScheduleView,\r\n permissions,\r\n } = props;\r\n const isPayPerStayEnabled = permissions && permissions.dynamic && permissions.dynamic.PayPerStay;\r\n const mySetBidStrategy = useCallback((partialUpdate) => {\r\n const adScheduleView = getAdScheduleView();\r\n const data = {\r\n ...bidStrategy,\r\n ...partialUpdate,\r\n };\r\n if (adScheduleView != null) {\r\n if (data.option === bidStrategyOptionKeys.Commission) {\r\n adScheduleView.koModel.hideAdScheduleBidAdjustments(true);\r\n } else {\r\n adScheduleView.koModel.hideAdScheduleBidAdjustments(false);\r\n }\r\n }\r\n setBidStrategy(data);\r\n }, [bidStrategy, setBidStrategy, getAdScheduleView]);\r\n\r\n const isCreation = scenario === 'creation';\r\n const i18n = useContext(I18nContext);\r\n const howToManageYourBidsText = i18n.getString(_TL_('How do you want to manage your bids?'));\r\n const selectedKey = bidStrategy.option || bidStrategyOptionKeys.ManualCpc;\r\n const shouldShowError = checkShouldShowError(bidStrategy);\r\n const minMax = getBidStrategyMinMax({ selectedKey, bidStrategy });\r\n const errorCode = validateBidStrategy({ selectedKey, bidStrategy, ...minMax });\r\n\r\n return (\r\n <div className={classnames('campaign-bid-strategy', 'section')}>\r\n <div className=\"description\">\r\n <Label\r\n className=\"campaign-bid-strategy-title-labe\"\r\n >\r\n <SpanWithComponent\r\n SpanText={howToManageYourBidsText}\r\n Component={() => (\r\n <HelpPopup\r\n topic=\"pop_BA_CampaignGrids_BidStrategy\"\r\n aria-label={i18n.getString(_TL_('Click to learn more about {{item}}'), { item: i18n.getString(_TL_('Bid Strategy')) })}\r\n />)}\r\n />\r\n </Label>\r\n </div>\r\n <div className=\"bid-strategy-options\">\r\n <Stack horizontal verticalAlign=\"center\" tokens={{ childrenGap: 4 }}>\r\n <Dropdown\r\n label={i18n.getString(_TL_('Bid management'))}\r\n options={bidStrategyOptions(i18n, isPayPerStayEnabled)}\r\n defaultSelectedKey={selectedKey}\r\n styles={{\r\n dropdown: {\r\n width: 487,\r\n marginTop: '8px',\r\n },\r\n }}\r\n className=\"campaign-bid-strategy-dropdown\"\r\n onChange={(e, option) => mySetBidStrategy({ option: option.key })}\r\n />\r\n <AdditionalInfo isPayPerStayEnabled={isPayPerStayEnabled} {...props} selectedKey={selectedKey} setBidStrategy={mySetBidStrategy} />\r\n </Stack>\r\n {isCreation && <DefaultBidValue {...props} selectedKey={selectedKey} setBidStrategy={mySetBidStrategy} />}\r\n {(selectedKey === bidStrategyOptionKeys.Commission && isPayPerStayEnabled) &&\r\n <div className={classnames('disclaimer', shouldShowError && errorCode !== null ? 'has-error' : 'has-no-error')}>\r\n <Disclaimer\r\n message={i18n.getString(_TL_('Not all criteria is applicable, only excluded locations & -100% devices bid adjustment is supported'))}\r\n />\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n );\r\n});\r\n\r\nCampaignBidStrategy.propTypes = {\r\n bidStrategy: PropTypes.shape({}),\r\n setBidStrategy: PropTypes.func.isRequired,\r\n scenario: PropTypes.string.isRequired,\r\n getAdScheduleView: PropTypes.func.isRequired,\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.shape({\r\n PayPerStay: PropTypes.bool,\r\n }),\r\n }).isRequired,\r\n};\r\n\r\nCampaignBidStrategy.defaultProps = {\r\n bidStrategy: {},\r\n};\r\n","import decimal from '@bingads-webui-component-legacy/humanize/decimal';\r\nimport { getAccountCurrencyCode, numberErrorCode } from '@bingads-webui-campaign/hotel-common-upsert';\r\n\r\nexport const getDefaultBudget = (serverContext) => {\r\n const USDefaultBudget = (serverContext && serverContext.Permissions && serverContext.Permissions.IsDefaultBudgetExperimentationEnabled) ? 25 : 20;\r\n const budgetRange = serverContext && serverContext.BudgetRange;\r\n const accountCurrencyCode = getAccountCurrencyCode(serverContext);\r\n if (accountCurrencyCode === 'USD') {\r\n return decimal.fromFloatToString(USDefaultBudget, 2);\r\n }\r\n return decimal.fromFloatToString((budgetRange && budgetRange.DailyRange && budgetRange.DailyRange.FloorValue > 20) ? budgetRange.DailyRange.FloorValue : 20, 2);\r\n};\r\n\r\nexport const getBudgetErrorMsg = ({ code, i18n, serverContext }) => {\r\n const budgetRange = serverContext && serverContext.BudgetRange;\r\n const accountCurrencyCode = getAccountCurrencyCode(serverContext);\r\n const min = (budgetRange && budgetRange.DailyRange && budgetRange.DailyRange.FloorValue) || 0.05;\r\n switch (code) {\r\n case numberErrorCode.RequiredField:\r\n return i18n.getString(_TL_('Enter a budget amount'));\r\n case numberErrorCode.InValidNumber:\r\n return i18n.getString(_TL_('Field requires numeric value'));\r\n case numberErrorCode.OutOfRange:\r\n return i18n.getString(_TL_('Your budget should be greater than {{currencyCode}} {{min}} and less than your daily maximum. The daily max. is your monthly budget averaged out over the number of days left in the month.'), { currencyCode: accountCurrencyCode, min: decimal.fromFloatToString(min) });\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\nexport const validateBudget = ({ value, serverContext }) => {\r\n const budgetRange = serverContext && serverContext.BudgetRange;\r\n const isValidNumber = typeof value === 'number' ? true : decimal.isValid(value);\r\n if (value == null || value === '') {\r\n return numberErrorCode.RequiredField;\r\n } else if (!isValidNumber) {\r\n return numberErrorCode.InValidNumber;\r\n } else if (budgetRange == null || budgetRange.DailyRange == null) {\r\n const number = decimal.fromLocalToFloat(value);\r\n if (number < 0.05) {\r\n return numberErrorCode.OutOfRange;\r\n }\r\n }\r\n const number = decimal.fromLocalToFloat(value);\r\n const min = budgetRange.DailyRange.FloorValue;\r\n const max = budgetRange.DailyRange.CeilingValue;\r\n if (number < min || number > max) {\r\n return numberErrorCode.OutOfRange;\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport const isBudgetValid = ({ value, serverContext }) => validateBudget({ value, serverContext }) == null;\r\n","/* eslint-disable no-script-url */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, { Fragment, useState, useContext, useCallback } from 'react';\r\nimport classnames from 'classnames';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\nimport PropTypes from 'prop-types';\r\nimport { Stack, ChoiceGroup, TextField, Link, Label } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { getAccountCurrencyCode } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { SpanWithComponent, ErrorString, checkShouldShowError, } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { Button } from '@bingads-webui-react/primitive';\r\nimport PageContext from '@bingads-webui-static-legacy/page-context';\r\nimport { getDefaultBudget, validateBudget, getBudgetErrorMsg } from './utility';\r\n\r\nexport const individualBudgetOptionKeys = {\r\n true: 'true',\r\n};\r\n\r\nconst IndividualBudgetEditor = React.memo((props) => {\r\n const {\r\n budget,\r\n setBudget,\r\n showBudgetMinRecommend,\r\n curBudgetAmount,\r\n activity,\r\n } = props;\r\n\r\n const i18n = useContext(I18nContext);\r\n const serverContext = useContext(ServerContext);\r\n const accountCurrencyCode = getAccountCurrencyCode(serverContext);\r\n const [isExpanded, setIsExpanded] = useState(false);\r\n const shouldShowError = checkShouldShowError(budget);\r\n const error = getBudgetErrorMsg({ code: validateBudget({ value: budget.amount, serverContext }), i18n, serverContext });\r\n\r\n const individualBudgetOptions = [\r\n {\r\n key: individualBudgetOptionKeys.true,\r\n text: i18n.getString(_TL_('Standard (we will intelligently pick and choose the right time to serve your ads)')),\r\n },\r\n ];\r\n\r\n const toggleExpanded = () => {\r\n setIsExpanded(!isExpanded);\r\n };\r\n\r\n const currencySymbol = i18n.getCurrencySymbol(PageContext.AccountCurrencyCode);\r\n const applyRecommend = () => {\r\n if (activity) {\r\n activity.trace('BCCForBudgetMinimumRecommendation: apply');\r\n }\r\n setBudget({ amount: (curBudgetAmount * 0.5).toFixed(2) * 1, isDirty: true });\r\n };\r\n\r\n if (activity && showBudgetMinRecommend) {\r\n activity.trace('BCCForBudgetMinimumRecommendation: show');\r\n }\r\n\r\n return (\r\n <div className=\"individual-budget-editor\">\r\n <Stack horizontal verticalAlign=\"center\" tokens={{ childrenGap: 4 }}>\r\n <TextField\r\n value={budget.amount}\r\n placeholder={i18n.getString(_TL_('Example: {{defaultBudget}}'), { defaultBudget: getDefaultBudget(serverContext) })}\r\n aria-label={i18n.getString(_TL_('Campaign budget per day by {{item}}'), { item: accountCurrencyCode })}\r\n styles={{ fieldGroup: { width: 110 } }}\r\n onChange={(e, value) => {\r\n setBudget({ amount: value, isDirty: true });\r\n }}\r\n />\r\n <span>{i18n.getString(_TL_('{{item}}'), { item: accountCurrencyCode })}</span>\r\n </Stack>\r\n {shouldShowError && error && <ErrorString error={error} />}\r\n <Stack>\r\n <Link className=\"expander\" onClick={toggleExpanded}>\r\n {i18n.getString(_TL_('Daily budget options'))}\r\n </Link>\r\n {isExpanded && (\r\n <ChoiceGroup\r\n options={individualBudgetOptions}\r\n defaultSelectedKey={budget.individualOption || individualBudgetOptionKeys.true}\r\n onChange={(e, option) => setBudget({ individualOption: option.key })}\r\n />\r\n )}\r\n </Stack>\r\n {showBudgetMinRecommend ?\r\n <div className=\"alert alert-info budget-alert\">\r\n <div className=\"alert-image\" />\r\n <div className=\"alert-info-inline\">\r\n <span>{i18n.getString(_TL_('To best optimize your campaigns, we recommend a minimum budget of '))}</span>\r\n <span className=\"bold\">{currencySymbol + (curBudgetAmount * 0.5).toFixed(2)}</span>\r\n <span>{i18n.getString(_TL_('.'))}</span>\r\n </div>\r\n <div className=\"alert-budget-button\">\r\n <Button\r\n className=\"apply-budget\"\r\n onClick={applyRecommend}\r\n >\r\n {i18n.getString(_TL_('Apply recommendation'))}\r\n </Button>\r\n </div>\r\n\r\n </div> : null}\r\n </div>\r\n );\r\n});\r\n\r\nIndividualBudgetEditor.propTypes = {\r\n setBudget: PropTypes.func.isRequired,\r\n budget: PropTypes.shape({}),\r\n showBudgetMinRecommend: PropTypes.bool,\r\n curBudgetAmount: PropTypes.number,\r\n activity: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nIndividualBudgetEditor.defaultProps = {\r\n budget: {},\r\n showBudgetMinRecommend: false,\r\n curBudgetAmount: 0,\r\n};\r\n\r\nexport const budgetOptionKeys = {\r\n Individual: 'Individual',\r\n};\r\n\r\nconst budgetOptions = props => [\r\n {\r\n key: budgetOptionKeys.Individual,\r\n text: props.i18n.getString(_TL_('Spend/Day (avg.)')),\r\n onRenderField: (params, render) => (\r\n <Fragment>\r\n {render(params)}\r\n {params.checked && <IndividualBudgetEditor {...params} {...props} />}\r\n </Fragment>\r\n ),\r\n styles: {\r\n root: {\r\n '& label': {\r\n marginBottom: '8px',\r\n fontWeight: 'unset',\r\n },\r\n },\r\n },\r\n },\r\n];\r\n\r\nexport const defaultBudget = {\r\n option: budgetOptionKeys.Individual,\r\n individualOption: individualBudgetOptionKeys.true,\r\n amount: '25',\r\n};\r\n\r\nexport const CampaignBudget = React.memo((props) => {\r\n const {\r\n budget,\r\n setBudget,\r\n } = props;\r\n\r\n const mySetBudget = useCallback((partialUpdate) => {\r\n setBudget({\r\n ...budget,\r\n ...partialUpdate,\r\n });\r\n }, [budget, setBudget]);\r\n\r\n const i18n = useContext(I18nContext);\r\n const campaingBudgetText = i18n.getString(_TL_('How much would you like to spend?'));\r\n const labelId = 'campaign-budget-label';\r\n return (\r\n <div className={classnames('campaign-budget', 'section')}>\r\n <Label\r\n className=\"campaign-budget-label\"\r\n id={labelId}\r\n >\r\n <SpanWithComponent\r\n SpanText={campaingBudgetText}\r\n Component={() => (\r\n <HelpPopup\r\n topic=\"pop_BA_CampaignCreate_Budget_SharedBudget\"\r\n aria-label={i18n.getString(_TL_('Click to learn more about {{item}}'), { item: i18n.getString(_TL_('Campaign budget')) })}\r\n />)}\r\n />\r\n </Label>\r\n <ChoiceGroup\r\n defaultSelectedKey={budget.option || budgetOptionKeys.Individual}\r\n onChange={(e, option) => mySetBudget({ option: option.key })}\r\n options={budgetOptions({ ...props, i18n, setBudget: mySetBudget })}\r\n ariaLabelledBy={labelId}\r\n />\r\n </div>\r\n );\r\n});\r\n\r\nCampaignBudget.propTypes = {\r\n budget: PropTypes.shape({}),\r\n setBudget: PropTypes.func.isRequired,\r\n};\r\n\r\nCampaignBudget.defaultProps = {\r\n budget: {},\r\n};\r\n","\r\nimport {\r\n deviceDefaultSetting,\r\n defaultLocationData,\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\nimport { audienceAdsOptionKeys, defaultAdFormat } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { defaultName } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { defaultBidStrategy } from './bid-strategy';\r\nimport { defaultBudget } from './budget';\r\n\r\nconst fields = {\r\n name: 'name',\r\n budget: 'budget',\r\n bidStrategy: 'bidStrategy',\r\n device: 'device',\r\n location: 'location',\r\n adSchedule: 'adSchedule',\r\n adFormat: 'adFormat',\r\n audienceAds: 'audienceAds',\r\n};\r\n\r\nconst {\r\n name,\r\n budget,\r\n bidStrategy,\r\n device,\r\n location,\r\n adSchedule,\r\n adFormat,\r\n audienceAds,\r\n} = fields;\r\n\r\nexport const fieldsToCheck = [adSchedule, audienceAds, name, budget, bidStrategy, device, location, adFormat];\r\n\r\nexport const defaultCampaignBasicData = {\r\n name: {\r\n value: defaultName,\r\n },\r\n adFormat: defaultAdFormat,\r\n budget: defaultBudget,\r\n bidStrategy: defaultBidStrategy,\r\n audienceAds: {\r\n parentLevelSettings: {},\r\n currentLevelSettings: { option: audienceAdsOptionKeys.Increase, value: 0 },\r\n useParentLevel: false,\r\n },\r\n dayTimeRanges: [],\r\n urlOptions: {},\r\n location: defaultLocationData,\r\n exclusions: {},\r\n device: {\r\n parentLevelSettings: [...deviceDefaultSetting],\r\n currentLevelSettings: [...deviceDefaultSetting],\r\n useParentLevel: false,\r\n },\r\n};\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, { useState, useContext } from 'react';\r\nimport _ from 'underscore';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport PropTypes from 'prop-types';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { usePatch, globalErrorMsg, AdFormat, getAccountCurrencyCode, bidStrategyOptionKeys, isAdFormatValid } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { checkShouldShowError, checkShouldShowErrors, CampaignName, isCampaignNameValid, LocalizationKeys } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { Collapse, TextTitle } from '@bingads-webui-campaign/wizard-jumbo-card';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport classNames from 'classnames';\r\nimport { Link, Stack } from '@bingads-webui-react/fabric-control';\r\nimport { CampaignBudget } from './budget';\r\nimport { CampaignBidStrategy } from './bid-strategy';\r\nimport { isBudgetValid } from './budget/utility';\r\nimport { isBidStrategyValid, fields } from './bid-strategy/utility';\r\n\r\nconst getStyles = () =>\r\n ({\r\n basicCampaignSection: {\r\n '& label': {\r\n padding: 'unset',\r\n },\r\n '& .section ~ .section': {\r\n marginTop: '24px',\r\n },\r\n '& .description': {\r\n marginBottom: '8px',\r\n },\r\n '& label, .helpbutton': {\r\n display: 'inline-block',\r\n },\r\n '& .individual-budget-editor': {\r\n padding: '4px 0 10px 26px',\r\n },\r\n },\r\n });\r\n\r\nexport const CampaignBasic = (props) => {\r\n const {\r\n campaign,\r\n patchCampaign,\r\n scenario,\r\n getAdScheduleView,\r\n permissions,\r\n activity,\r\n } = props;\r\n\r\n const i18n = useContext(I18nContext);\r\n const serverContext = useContext(ServerContext);\r\n const classes = useDefaultStyles(getStyles);\r\n const setName = usePatch(patchCampaign, 'name');\r\n const setBudget = usePatch(patchCampaign, 'budget');\r\n const setAdFormat = usePatch(patchCampaign, 'adFormat');\r\n const setBidStrategy = usePatch(patchCampaign, 'bidStrategy');\r\n const isCreation = scenario === 'creation';\r\n\r\n const allPanelItems = ['campaign', 'budget', 'bidStrategy'];\r\n const [activeKeys, setActiveKeys] = useState(allPanelItems);\r\n const onCollapseAll = () => {\r\n if (activeKeys.length) {\r\n setActiveKeys([]);\r\n } else {\r\n setActiveKeys(allPanelItems);\r\n }\r\n };\r\n\r\n const getBudgetTitleDetails = () => {\r\n if (campaign.budget && campaign.budget.amount) {\r\n if (campaign.budget.option === 'Individual') {\r\n const { amount } = campaign.budget;\r\n const accountCurrencyCode = getAccountCurrencyCode(serverContext);\r\n return i18n.getString(_TL_('Spend {{amount}} {{accountCurrencyCode}}/Day (avg.)'), { amount, accountCurrencyCode });\r\n }\r\n }\r\n return '';\r\n };\r\n\r\n const getBidStrategyTitleDetails = () => {\r\n const { bidStrategy } = campaign;\r\n const percentageOrBid = bidStrategy && bidStrategy[campaign.bidStrategy.option];\r\n const accountCurrencyCode = getAccountCurrencyCode(serverContext);\r\n let detail = '';\r\n switch (campaign.bidStrategy.option) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n detail = `${i18n.getString(_TL_('Bid management'))}: ${i18n.getString(LocalizationKeys[campaign.bidStrategy.option])}`;\r\n break;\r\n case bidStrategyOptionKeys.PercentCpc:\r\n detail = `${i18n.getString(_TL_('Bid management'))}: ${i18n.getString(LocalizationKeys[campaign.bidStrategy.option])}, ${i18n.getString(_TL_('Maximum effective bid limit'))}: ${percentageOrBid ? `${percentageOrBid} ${accountCurrencyCode}` : ''}`;\r\n break;\r\n case bidStrategyOptionKeys.Commission:\r\n detail = `${i18n.getString(_TL_('Bid management'))}: ${i18n.getString(LocalizationKeys[campaign.bidStrategy.option])}, ${i18n.getString(_TL_('Room price (per stay)'))}: ${percentageOrBid ? `${percentageOrBid}%` : ''}`;\r\n break;\r\n default:\r\n detail = '';\r\n break;\r\n }\r\n if (isCreation) {\r\n switch (campaign.bidStrategy.option) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n detail += `, ${i18n.getString(_TL_('Default ad group bid'))}: ${bidStrategy[fields.AdGroupBid] ? `${bidStrategy[fields.AdGroupBid]} ${accountCurrencyCode}` : ''}`;\r\n break;\r\n case bidStrategyOptionKeys.PercentCpc:\r\n detail += `, ${i18n.getString(_TL_('Default ad group percent bid'))}: ${bidStrategy[fields.AdGroupPercentBid] ? `${bidStrategy[fields.AdGroupPercentBid]}%` : ''}`;\r\n break;\r\n case bidStrategyOptionKeys.Commission:\r\n break;\r\n default:\r\n detail = '';\r\n break;\r\n }\r\n }\r\n return detail;\r\n };\r\n\r\n const getCampaignTitleDetail = () => {\r\n const details = [];\r\n details.push(`${i18n.getString(_TL_('Campaign name'))}: ${campaign.name.value ? campaign.name.value : ''}`);\r\n if (campaign.adFormat) {\r\n const entries = ['HPA', 'PPA'];\r\n const adFormatValue = _.compact(entries.map((entry) => { if (campaign.adFormat[entry]) { return entry; } return false; })).join(', ');\r\n if (adFormatValue) {\r\n const IsRenameHotelToLodgingEnabled = permissions && permissions.dynamic && permissions.dynamic.IsRenameHotelToLodgingEnabled;\r\n const detailString = IsRenameHotelToLodgingEnabled ? `${i18n.getString(_TL_('Property ad format'))}: ${adFormatValue}` : `${i18n.getString(_TL_('Hotel ad format'))}: ${adFormatValue}`;\r\n details.push(detailString);\r\n }\r\n }\r\n return details.join(', ');\r\n };\r\n const showBudgetMinRecommend = permissions.dynamic.BCCBudgetImprovementEnabled && !isCreation && campaign.curBudgetAmount && campaign.curBudgetAmount >= 0.1 && campaign.budget.amount && ((campaign.budget.amount * 1.0) < (campaign.curBudgetAmount * 0.5).toFixed(2));\r\n\r\n return (\r\n <div className={classNames('basic-campaign-section', classes.basicCampaignSection)}>\r\n <Stack horizontalAlign=\"end\" tokens={{ padding: '0 0 12px 0' }}>\r\n <Link className=\"jumbo-card-control-all-btn\" onClick={onCollapseAll}>{activeKeys.length ? i18n.getString(_TL_('Collapse all')) : i18n.getString(_TL_('Expand all'))}</Link>\r\n </Stack>\r\n <Collapse activeKeys={activeKeys} setActiveKeys={setActiveKeys}>\r\n <Collapse.Panel\r\n key=\"campaign\"\r\n title={<TextTitle titleKey={_TL_('Campaign')} details={isCreation ? getCampaignTitleDetail() : campaign.name.value} />}\r\n error={((!isCampaignNameValid(campaign.name.value) && checkShouldShowError(campaign.name)) || !isAdFormatValid(campaign.adFormat) || checkShouldShowErrors(campaign.name)) ? globalErrorMsg : ''}\r\n >\r\n <CampaignName name={campaign.name} setName={setName} />\r\n {isCreation && <AdFormat adFormat={campaign.adFormat} setAdFormat={setAdFormat} scenario={scenario} permissions={permissions} />}\r\n </Collapse.Panel>\r\n <Collapse.Panel\r\n key=\"budget\"\r\n title={<TextTitle titleKey={_TL_('Budget')} details={getBudgetTitleDetails()} />}\r\n error={!isBudgetValid({ value: campaign.budget.amount, serverContext }) && checkShouldShowError(campaign.budget) ? globalErrorMsg : ''}\r\n >\r\n <CampaignBudget showBudgetMinRecommend={showBudgetMinRecommend} curBudgetAmount={campaign.curBudgetAmount} budget={campaign.budget} setBudget={setBudget} activity={activity} />\r\n </Collapse.Panel>\r\n <Collapse.Panel\r\n key=\"bidStrategy\"\r\n title={<TextTitle titleKey={_TL_('Bid strategy')} details={getBidStrategyTitleDetails()} />}\r\n error={!isBidStrategyValid({ bidStrategy: campaign.bidStrategy, isCreation, serverContext }) && checkShouldShowError(campaign.bidStrategy) ? globalErrorMsg : ''}\r\n >\r\n <CampaignBidStrategy permissions={permissions} bidStrategy={campaign.bidStrategy} setBidStrategy={setBidStrategy} scenario={scenario} getAdScheduleView={getAdScheduleView} />\r\n </Collapse.Panel>\r\n </Collapse>\r\n </div>\r\n );\r\n};\r\n\r\nCampaignBasic.propTypes = {\r\n campaign: PropTypes.shape({}).isRequired,\r\n patchCampaign: PropTypes.func.isRequired,\r\n scenario: PropTypes.string.isRequired,\r\n errMsg: PropTypes.shape({}),\r\n getAdScheduleView: PropTypes.func.isRequired,\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.shape({\r\n IsRenameHotelToLodgingEnabled: PropTypes.bool,\r\n }),\r\n }),\r\n activity: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nCampaignBasic.defaultProps = {\r\n errMsg: {},\r\n permissions: {\r\n dynamic: {\r\n IsRenameHotelToLodgingEnabled: false,\r\n },\r\n },\r\n};\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport classnames from 'classnames';\r\nimport { Link, Label, Stack } from '@bingads-webui-react/fabric-control';\r\nimport PropTypes from 'prop-types';\r\nimport React, { useMemo, useContext, useState, useCallback, useEffect } from 'react';\r\nimport _ from 'underscore';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { AdSchedule,\r\n BaseExclusion, UrlOptions, AudienceAds, usePatch,\r\n getUrlOptionsDetails, getExclusionsDetails, getAudienceAdsDetails,\r\n globalErrorMsg, isAudienceAdsValid } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { AdDistribution } from '@bingads-webui-campaign/ad-distribution';\r\nimport { checkShouldShowError, getAdScheduleDetails } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { Collapse, TextTitle } from '@bingads-webui-campaign/wizard-jumbo-card';\r\nimport { useCurrentCampaign, useCurrentAdGroup } from '@bingads-webui-campaign-react/use-current-scope-entity';\r\nimport { scenarios } from '../shared';\r\n\r\nconst getStyles = () =>\r\n ({\r\n advancedSettingsSection: {\r\n marginTop: '36px',\r\n '& .displayNone': {\r\n display: 'none',\r\n },\r\n '& .expandedImage:before, .expanderImage:before': {\r\n marginRight: '12px',\r\n },\r\n },\r\n advancedSettingsContainer: {\r\n marginLeft: '32px',\r\n },\r\n });\r\n\r\nfunction getAdDistributionOption() {\r\n return {\r\n AdDistribution: 'BingYahooAndSearchPartners',\r\n campaignType: 'hotel',\r\n Languages: ['All'],\r\n };\r\n}\r\n\r\nfunction getAdScheduleOption(campaign, isCreation) {\r\n const model = {\r\n dayTimeRanges: campaign.dayTimeRanges,\r\n timeZone: campaign.TimeZone,\r\n adScheduleUseSearcherTimeZone: campaign.AdScheduleUseSearcherTimeZone,\r\n };\r\n return {\r\n model,\r\n level: 'campaign',\r\n showDateSettings: isCreation,\r\n hideAdScheduleBidAdjustments: campaign.bidStrategy.option === 'Commission',\r\n };\r\n}\r\n\r\nexport const AdvancedSettings = (props) => {\r\n const {\r\n campaign,\r\n scenario,\r\n errMsg,\r\n patchErrMsg,\r\n patchCampaign,\r\n getAdScheduleView,\r\n setAdScheduleView,\r\n setAdDistributionView,\r\n getAdDistributionView,\r\n setUrlOptionsView,\r\n setSiteExclusionView,\r\n setIPExclusionView,\r\n getUrlOptionsValues,\r\n getExclusionsValues,\r\n advancedSettinsApiErrors,\r\n isDataFetched,\r\n } = props;\r\n\r\n const i18n = useContext(I18nContext);\r\n const classes = useDefaultStyles(getStyles);\r\n const currentCampaign = useCurrentCampaign();\r\n const currentAdgroup = useCurrentAdGroup();\r\n const campaignId = currentCampaign ? currentCampaign.Id : null;\r\n const adgroupId = currentAdgroup ? currentAdgroup.Id : null;\r\n const setAudienceAds = usePatch(patchCampaign, 'audienceAds');\r\n const isCreation = scenario === scenarios.creation;\r\n\r\n const allPanelItems = _.compact(['adSchedule', 'audienceAds', isCreation && 'adDistribution', 'urlOptions', 'baseExclusion']);\r\n const [activeKeys, setActiveKeys] = useState(['adSchedule', 'audienceAds', 'adDistribution']);\r\n\r\n useEffect(() => {\r\n const hasApiErrorKeys = Object.keys(advancedSettinsApiErrors);\r\n const needToExpandKeys = [];\r\n allPanelItems.forEach((key) => {\r\n if (hasApiErrorKeys.includes(key) && advancedSettinsApiErrors[key] && advancedSettinsApiErrors[key].length) {\r\n patchErrMsg(key, globalErrorMsg);\r\n needToExpandKeys.push(key);\r\n }\r\n });\r\n setActiveKeys(activeKeys.concat(needToExpandKeys));\r\n }, [advancedSettinsApiErrors]);\r\n\r\n const onCollapseAll = () => {\r\n if (activeKeys.length) {\r\n setActiveKeys([]);\r\n } else {\r\n setActiveKeys(allPanelItems);\r\n }\r\n };\r\n\r\n // After collecting the needed data, need to ensure the view is created once.\r\n const adScheduleOption = useMemo(\r\n () => getAdScheduleOption(campaign, isCreation),\r\n [campaign.dayTimeRanges, campaign.AdScheduleUseSearcherTimeZone, isCreation]\r\n );\r\n\r\n const adDistributionOption = useMemo(\r\n () => getAdDistributionOption(),\r\n []\r\n );\r\n\r\n\r\n const setUrlOptionsActiveCallback = useCallback(() => { patchCampaign('urlOptions', getUrlOptionsValues()); }, []);\r\n const setExclusionsActiveCallback = useCallback(() => { patchCampaign('exclusions', getExclusionsValues()); }, []);\r\n\r\n return (\r\n <div className={classnames('advanced-settings-section', classes.advancedSettingsSection)}>\r\n <Stack horizontal horizontalAlign=\"space-between\" tokens={{ padding: '0 0 12px 0' }}>\r\n <Label>{i18n.getString(_TL_('ADVANCED SETTINGS'))}</Label>\r\n <Link className=\"jumbo-card-control-all-btn\" onClick={onCollapseAll}>{activeKeys.length ? i18n.getString(_TL_('Collapse all')) : i18n.getString(_TL_('Expand all'))}</Link>\r\n </Stack>\r\n <Collapse allPanelItems={allPanelItems} checkItems activeKeys={activeKeys} setActiveKeys={setActiveKeys}>\r\n {isDataFetched &&\r\n <Collapse.Panel\r\n key=\"adSchedule\"\r\n title={<TextTitle\r\n titleKey={_TL_('Ad schedule')}\r\n topicKey=\"pop_BA_Targeting_DayTime\"\r\n details={getAdScheduleDetails(i18n, getAdScheduleView())}\r\n />}\r\n error={errMsg.adSchedule}\r\n >\r\n <AdSchedule\r\n key=\"ad-schedule\"\r\n setAdScheduleView={setAdScheduleView}\r\n options={adScheduleOption}\r\n getAdScheduleView={getAdScheduleView}\r\n getCreatedView={getAdScheduleView}\r\n managed\r\n />\r\n </Collapse.Panel>}\r\n <Collapse.Panel\r\n key=\"audienceAds\"\r\n title={<TextTitle\r\n titleKey={_TL_('Audience ads')}\r\n details={getAudienceAdsDetails({ rawData: campaign.audienceAds, i18n })}\r\n />}\r\n error={!isAudienceAdsValid(campaign.audienceAds) && checkShouldShowError(campaign.audienceAds) ? globalErrorMsg : ''}\r\n >\r\n <AudienceAds key=\"audience-ads\" setAudienceAds={setAudienceAds} audienceAds={campaign.audienceAds} />\r\n </Collapse.Panel>\r\n {isCreation &&\r\n <Collapse.Panel\r\n key=\"adDistribution\"\r\n title={<TextTitle\r\n titleKey={_TL_('Ad distribution')}\r\n topicKey=\"pop_BA_NewCampaignCreate_AdDistribution\"\r\n details={(() => {\r\n const view = getAdDistributionView();\r\n return view ? view.getTranslatedOption() : '';\r\n })()}\r\n />}\r\n error={errMsg.adDistribution}\r\n >\r\n <AdDistribution key=\"ad-distribution\" setAdDistributionView={setAdDistributionView} options={adDistributionOption} />\r\n </Collapse.Panel>}\r\n {!isCreation &&\r\n <Collapse.Panel key=\"urlOptions\" title={<TextTitle titleKey={_TL_('URL options')} details={getUrlOptionsDetails(i18n, campaign.urlOptions)} />} error={errMsg.urlOptions} setActiveCallback={setUrlOptionsActiveCallback}>\r\n <UrlOptions\r\n key=\"url-options\"\r\n setUrlOptionsView={setUrlOptionsView}\r\n options={{\r\n level: 'campaign', campaignId, adgroupId, model: campaign.urlOptions,\r\n }}\r\n />\r\n </Collapse.Panel>}\r\n {\r\n scenario === 'settings' &&\r\n <Collapse.Panel key=\"baseExclusion\" title={<TextTitle titleKey={_TL_('Website & IP address exclusions')} details={getExclusionsDetails(i18n, campaign.exclusions)} />} error={errMsg.baseExclusion} setActiveCallback={setExclusionsActiveCallback}>\r\n <BaseExclusion\r\n key=\"base-exclusion\"\r\n patchData={patchCampaign}\r\n setSiteExclusionView={setSiteExclusionView}\r\n setIPExclusionView={setIPExclusionView}\r\n options={{\r\n level: 'campaign', campaignId, adgroupId, showSiteExclusion: true, showIPExclusion: true,\r\n }}\r\n />\r\n </Collapse.Panel>\r\n }\r\n </Collapse>\r\n </div>\r\n );\r\n};\r\n\r\nAdvancedSettings.propTypes = {\r\n campaign: PropTypes.shape({}).isRequired,\r\n scenario: PropTypes.string.isRequired,\r\n errMsg: PropTypes.shape({}),\r\n patchErrMsg: PropTypes.func.isRequired,\r\n patchCampaign: PropTypes.func.isRequired,\r\n setAdScheduleView: PropTypes.func.isRequired,\r\n getAdScheduleView: PropTypes.func.isRequired,\r\n setAdDistributionView: PropTypes.func.isRequired,\r\n getAdDistributionView: PropTypes.func.isRequired,\r\n setUrlOptionsView: PropTypes.func.isRequired,\r\n setSiteExclusionView: PropTypes.func.isRequired,\r\n setIPExclusionView: PropTypes.func.isRequired,\r\n getUrlOptionsValues: PropTypes.func.isRequired,\r\n getExclusionsValues: PropTypes.func.isRequired,\r\n advancedSettinsApiErrors: PropTypes.shape({}),\r\n isDataFetched: PropTypes.bool.isRequired,\r\n};\r\nAdvancedSettings.defaultProps = {\r\n errMsg: {},\r\n advancedSettinsApiErrors: {},\r\n};\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\n/* eslint-disable no-plusplus */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, { useState, useContext, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport {\r\n usePatch,\r\n getGridTargetTitleDetails,\r\n getLocationTargetTitleDetails,\r\n getLocationTargetErrorMessage,\r\n globalErrorMsg,\r\n} from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { ErrorString, locationTargetsOptionKeys } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { Collapse, ToggleTitle } from '@bingads-webui-campaign/wizard-jumbo-card';\r\nimport { Link, Stack, DefaultButton } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\n\r\nimport {\r\n DeviceTargetSetting,\r\n LocationTargetSetting,\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\nimport { defaultCampaignBasicData } from './default-value';\r\n\r\nconst getStyles = () => ({\r\n CampaignTargets: {\r\n marginTop: '40px',\r\n },\r\n title: {\r\n fontWeight: 600,\r\n fontSize: '20px',\r\n },\r\n subtitle: {\r\n marginBottom: '16px',\r\n fontSize: '20px',\r\n },\r\n mt33: {\r\n marginTop: '33px',\r\n },\r\n});\r\n\r\n\r\nexport const CampaignTargets = (props) => {\r\n const {\r\n campaign,\r\n patchCampaign,\r\n errMsg,\r\n patchErrMsg,\r\n targetsApiErrors,\r\n patchTargetsApiErrMsg,\r\n } = props;\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n const i18n = useContext(I18nContext);\r\n\r\n const allPanelItems = ['location', 'device'];\r\n const [activeKeys, setActiveKeys] = useState(['location', 'device']);\r\n useEffect(() => {\r\n const hasApiErrorKeys = Object.keys(targetsApiErrors);\r\n const needToExpandKeys = [];\r\n allPanelItems.forEach((key) => {\r\n if (hasApiErrorKeys.includes(key) && targetsApiErrors[key] && targetsApiErrors[key].length) {\r\n patchErrMsg(key, globalErrorMsg);\r\n needToExpandKeys.push(key);\r\n }\r\n });\r\n setActiveKeys(activeKeys.concat(hasApiErrorKeys));\r\n }, [targetsApiErrors]);\r\n const onCollapseAll = () => {\r\n if (activeKeys.length) {\r\n setActiveKeys([]);\r\n } else {\r\n setActiveKeys(allPanelItems);\r\n }\r\n };\r\n\r\n const setLocation = usePatch(patchCampaign, 'location');\r\n const setDevice = usePatch(patchCampaign, 'device');\r\n\r\n const {\r\n location, device, bundleCountries, bundleLocationCriterions,\r\n } = campaign;\r\n\r\n const {\r\n device: { currentLevelSettings: deviceDefaultCurrentLevelSettings },\r\n } = defaultCampaignBasicData;\r\n\r\n const resetTarget = (setFn, targetData, targetDefaultCurrentLevelSettings, targetName) => {\r\n let tempCurrentLevelSettings = [...targetData.currentLevelSettings];\r\n for (let i = 0; i < tempCurrentLevelSettings.length; i++) {\r\n if (tempCurrentLevelSettings[i]) {\r\n const tempId = tempCurrentLevelSettings[i].Id;\r\n const tempObj = { ...targetDefaultCurrentLevelSettings[i] };\r\n if (tempCurrentLevelSettings[i].Id) {\r\n tempCurrentLevelSettings[i] = tempObj;\r\n tempCurrentLevelSettings[i].Id = tempId;\r\n tempCurrentLevelSettings[i].Status = 'Deleted';\r\n } else {\r\n tempCurrentLevelSettings.splice(i, 1);\r\n i--;\r\n }\r\n }\r\n }\r\n tempCurrentLevelSettings = targetDefaultCurrentLevelSettings.concat(tempCurrentLevelSettings);\r\n setFn({ ...targetData, currentLevelSettings: tempCurrentLevelSettings, reset: true });\r\n patchTargetsApiErrMsg(targetName, []);\r\n };\r\n\r\n // Turn off --- you set nothing, you use default settings 0 0 0\r\n // Turn on --- you override 0 0 0\r\n const onChangeToggle = (fn, key, value) => {\r\n fn({ ...campaign[key], useParentLevel: !value });\r\n };\r\n\r\n const campaignBidStrategyType = campaign && campaign.bidStrategy && campaign.bidStrategy.option;\r\n const locationTitle = (<ToggleTitle\r\n titleKey={_TL_('Location')}\r\n topicKey=\"pop_BA_Settings_LocationTargeting\"\r\n details={getLocationTargetTitleDetails(i18n, location, false, campaignBidStrategyType)}\r\n isChecked={!location.useParentLevel}\r\n handleChangeToggle={(_e, value) => {\r\n if (location.useParentLevel === true &&\r\n location.bidMode === true &&\r\n location.currentLevelSettings.targetOption === locationTargetsOptionKeys.everywhere) {\r\n setLocation({\r\n ...location,\r\n useParentLevel: false,\r\n bidMode: false,\r\n errors: undefined,\r\n });\r\n } else {\r\n setLocation({\r\n ...location,\r\n useParentLevel: !value,\r\n errors: undefined,\r\n });\r\n }\r\n }}\r\n />);\r\n\r\n const deviceTitle = (<ToggleTitle\r\n titleKey={_TL_('Device')}\r\n topicKey=\"pop_BA_CampaignCreate_AudTargets_Device\"\r\n details={device.useParentLevel ? '' : getGridTargetTitleDetails(i18n, device)}\r\n isChecked={!device.useParentLevel}\r\n handleChangeToggle={(_e, value) => { onChangeToggle(setDevice, 'device', value); }}\r\n />);\r\n\r\n return (\r\n <div className={classnames('campaign-targets-section', classes.CampaignTargets)}>\r\n <div>\r\n <div className={classes.title}>\r\n {i18n.getString(_TL_('Campaign targets'))}\r\n </div>\r\n <Stack horizontal horizontalAlign=\"space-between\" tokens={{ padding: '0 0 12px 0' }}>\r\n <span className={classes.description}> {i18n.getString(_TL_('Who do you want to target for this campaign? You can select any combination of the criteria below.'))}</span>\r\n <Link className=\"jumbo-card-control-all-btn\" onClick={onCollapseAll}>{activeKeys.length ? i18n.getString(_TL_('Collapse all')) : i18n.getString(_TL_('Expand all'))}</Link>\r\n </Stack>\r\n </div>\r\n\r\n <Collapse activeKeys={activeKeys} setActiveKeys={setActiveKeys}>\r\n <Collapse.Panel\r\n key=\"location\"\r\n title={locationTitle}\r\n error={getLocationTargetErrorMessage(location, campaignBidStrategyType)}\r\n >\r\n <LocationTargetSetting\r\n data={location}\r\n setData={setLocation}\r\n bundleCountries={bundleCountries}\r\n bundleLocationCriterions={bundleLocationCriterions}\r\n scope={props.scope}\r\n bidStrategyType={campaignBidStrategyType}\r\n />\r\n </Collapse.Panel>\r\n <Collapse.Panel key=\"device\" title={deviceTitle} error={errMsg.device}>\r\n <DeviceTargetSetting\r\n data={device}\r\n setData={setDevice}\r\n patchErrMsg={patchErrMsg}\r\n patchTargetsApiErrMsg={patchTargetsApiErrMsg}\r\n apiErrors={targetsApiErrors.device}\r\n bidStrategyType={campaignBidStrategyType}\r\n />\r\n {!device.useParentLevel && targetsApiErrors.device && targetsApiErrors.device.map(item => (<ErrorString error={item} />))}\r\n <Stack horizontal horizontalAlign=\"end\" className={classes.mt33}>\r\n <DefaultButton text={i18n.getString(_TL_('Reset'))} disabled={device.useParentLevel} onClick={() => { resetTarget(setDevice, device, deviceDefaultCurrentLevelSettings, 'device'); }} />\r\n </Stack>\r\n </Collapse.Panel>\r\n </Collapse>\r\n </div>);\r\n};\r\n\r\nCampaignTargets.propTypes = {\r\n campaign: PropTypes.shape({}),\r\n errMsg: PropTypes.shape({}),\r\n patchCampaign: PropTypes.func.isRequired,\r\n scope: PropTypes.shape({\r\n values: PropTypes.shape({\r\n cid: PropTypes.number.isRequired,\r\n aid: PropTypes.number.isRequired,\r\n campaignId: PropTypes.number,\r\n }).isRequired,\r\n }).isRequired,\r\n patchErrMsg: PropTypes.func.isRequired,\r\n targetsApiErrors: PropTypes.shape({}),\r\n patchTargetsApiErrMsg: PropTypes.func,\r\n};\r\n\r\nCampaignTargets.defaultProps = {\r\n campaign: {},\r\n errMsg: {},\r\n targetsApiErrors: {},\r\n patchTargetsApiErrMsg() {},\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\n\r\nexport const CampaignTitle = React.memo(({ permissions }) => {\r\n const i18n = useContext(I18nContext);\r\n const IsRenameHotelToLodgingEnabled = permissions && permissions.dynamic && permissions.dynamic.IsRenameHotelToLodgingEnabled;\r\n return (\r\n <div className={classnames('campaign-title', 'section')}>\r\n <div className=\"title\">\r\n { IsRenameHotelToLodgingEnabled ? i18n.getString(_TL_('Create a lodging campaign')) : i18n.getString(_TL_('Create a hotel campaign'))}\r\n </div>\r\n </div>);\r\n});\r\nCampaignTitle.propTypes = {\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.shape({\r\n IsRenameHotelToLodgingEnabled: PropTypes.bool,\r\n }),\r\n }),\r\n};\r\n\r\nCampaignTitle.defaultProps = {\r\n permissions: {\r\n dynamic: {\r\n IsRenameHotelToLodgingEnabled: false,\r\n },\r\n },\r\n};\r\n","/* eslint-disable no-plusplus */\r\nimport _ from 'underscore';\r\n\r\nfunction commonConvertTargetStateToTargetSchema({\r\n campaign, target, CriterionType, targetCriterion,\r\n}) {\r\n const { useParentLevel } = target;\r\n const currentLevelSettings = [...target.currentLevelSettings];\r\n let newCurrentLevelSettings = [];\r\n const targetSchema = [];\r\n if (useParentLevel) {\r\n for (let i = 0; i < currentLevelSettings.length; i++) {\r\n const item = { ...currentLevelSettings[i] };\r\n if (item.Id) {\r\n item.Status = 'Deleted';\r\n newCurrentLevelSettings.push(item);\r\n } else {\r\n currentLevelSettings.splice(i, 1);\r\n i--;\r\n }\r\n }\r\n } else {\r\n newCurrentLevelSettings = currentLevelSettings;\r\n }\r\n newCurrentLevelSettings.sort(a => (a.Status === 'Deleted' ? -1 : 1)); // Place the deleted item in front of the array\r\n const parentParams = {};\r\n if (campaign.Id) {\r\n parentParams.Campaign = { Id: campaign.Id };\r\n } else {\r\n parentParams.CampaignName = campaign.name.value;\r\n }\r\n for (let i = 0; i < newCurrentLevelSettings.length; i++) {\r\n const item = newCurrentLevelSettings[i];\r\n if (item) {\r\n targetSchema.push({\r\n Id: item.Id,\r\n CriterionType,\r\n ...parentParams,\r\n Status: item.Status,\r\n Criterion: {\r\n BidAdjustment: item.bidAdjustmentDropdown === 'Increase by' ? item.bidAdjustmentInput - 0 : -(item.bidAdjustmentInput - 0),\r\n Type: CriterionType,\r\n ...targetCriterion(item),\r\n },\r\n });\r\n }\r\n }\r\n return { targetSchema, currentLevelSettings: newCurrentLevelSettings };\r\n}\r\n\r\nexport const convertDeviceStateToDeviceSchema = (campaign, initTargets) => {\r\n const DeviceMap = {\r\n Tablet: 'Tablets',\r\n Computer: 'Computers',\r\n Smartphone: 'Smartphones',\r\n };\r\n const currentDeviceSchema = commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n target: campaign.device,\r\n CriterionType: 'Device',\r\n targetCriterion(item) {\r\n return { DeviceCriterion: { DeviceName: DeviceMap[item.device] } };\r\n },\r\n });\r\n\r\n let currentDeviceSchemaResult = [];\r\n if (!_.isEqual(initTargets.device, currentDeviceSchema.currentLevelSettings)) {\r\n currentDeviceSchemaResult = currentDeviceSchema.targetSchema;\r\n }\r\n return currentDeviceSchemaResult;\r\n};\r\n\r\nexport const convertABWStateToABWSchema = campaign => commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n target: campaign.ABW,\r\n CriterionType: 'AdvanceBookingWindow',\r\n targetCriterion(item) {\r\n return { AdvanceBookingWindowCriterion: { MinDays: item.minimumDays, MaxDays: item.maximumDays } };\r\n },\r\n});\r\n\r\nexport const convertCheckInDayStateToCheckInDaySchema = campaign => commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n target: campaign.checkinDay,\r\n CriterionType: 'CheckInDay',\r\n targetCriterion(item) {\r\n return { CheckInDayCriterion: { CheckInDay: item.day } };\r\n },\r\n});\r\n\r\nexport const convertLengthofStayStateToLengthofStaySchema = campaign => commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n target: campaign.lengthOfStay,\r\n CriterionType: 'LengthofStay',\r\n targetCriterion(item) {\r\n return { LengthOfStayCriterion: { MinNights: item.minimumNumber, MaxNights: item.maximumNumber } };\r\n },\r\n});\r\n\r\nexport const convertCheckInDateStateToCheckInDateSchema = campaign => commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n target: campaign.checkinDate,\r\n CriterionType: 'CheckInDate',\r\n targetCriterion(item) {\r\n return { CheckInDateCriterion: { StartDate: item.startDate, EndDate: item.endDate } };\r\n },\r\n});\r\n\r\nexport const convertUserSetDatesStateToUserSetDatesSchema = (campaign) => {\r\n const UserSetDateMap = {\r\n 'Selected date': 'UserSelection',\r\n 'Defaulted date': 'DefaultSelection',\r\n };\r\n return commonConvertTargetStateToTargetSchema({\r\n campaign,\r\n target: campaign.userSetDates,\r\n CriterionType: 'DateSelectionType',\r\n targetCriterion(item) {\r\n return { DateSelectionTypeCriterion: { HotelDateSelectionType: UserSetDateMap[item.dates] } };\r\n },\r\n });\r\n};\r\n","import timeZoneMapper from '@bingads-webui-component-legacy/timezonemapper/index';\r\nimport decimal from '@bingads-webui-component-legacy/humanize/decimal';\r\nimport _ from 'underscore';\r\nimport {\r\n bidStrategyOptionKeys, collectCriterions, getAudienceAds, isAdFormatValid, isAudienceAdsValid,\r\n} from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport {\r\n isDeviceTargetValid,\r\n isLocationValid,\r\n convertLocationStateToLocationSchemaCampaign,\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\nimport { isCampaignNameValid } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { bidStrategyTypeValueMap, isBidStrategyValid, fields as bidStrategyFields } from './components/bid-strategy/utility';\r\nimport { isBudgetValid } from './components/budget/utility';\r\nimport { fieldsToCheck } from './components';\r\nimport { convertDeviceStateToDeviceSchema } from './get-targets-criterion';\r\n\r\nexport function getUnSupportedBidAdjustmentFeatures(CampaignBidStrategyType) {\r\n switch (CampaignBidStrategyType) {\r\n case 'Commission':\r\n return ['adSchedule'];\r\n default:\r\n return [];\r\n }\r\n}\r\n\r\nexport function getAdSchedule(campaign) {\r\n const targets = campaign.adScheduleData;\r\n return targets.map((criterion) => {\r\n const Status = _.isEmpty(criterion) ? 'Active' : criterion.Status;\r\n if (campaign.Id) {\r\n return {\r\n ...criterion,\r\n Status,\r\n Campaign: {\r\n Id: campaign.Id,\r\n },\r\n };\r\n }\r\n return {\r\n ...criterion,\r\n Status,\r\n CampaignName: campaign.name.value,\r\n };\r\n });\r\n}\r\n\r\nexport function getAdGroupBid(values) {\r\n const {\r\n bidStrategy,\r\n } = values;\r\n\r\n switch (bidStrategy.option) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n return {\r\n SearchBid: bidStrategy[bidStrategyFields.AdGroupBid] && decimal.fromLocalToFloat(bidStrategy[bidStrategyFields.AdGroupBid]),\r\n };\r\n case bidStrategyOptionKeys.PercentCpc:\r\n return {\r\n AdGroupPercentCpcBid: bidStrategy[bidStrategyFields.AdGroupPercentBid] && decimal.fromLocalToFloat(bidStrategy[bidStrategyFields.AdGroupPercentBid]),\r\n };\r\n case bidStrategyOptionKeys.Commission:\r\n return {\r\n AdGroupCommissionRate: bidStrategy[bidStrategyFields.AdGroupCommissionRate] && decimal.fromLocalToFloat(bidStrategy[bidStrategyFields.AdGroupCommissionRate]),\r\n };\r\n default:\r\n return {\r\n SearchBid: bidStrategy[bidStrategyFields.AdGroupBid] && decimal.fromLocalToFloat(bidStrategy[bidStrategyFields.AdGroupBid]),\r\n };\r\n }\r\n}\r\n\r\nfunction getName(campaign) {\r\n const Name = { Name: campaign.name.value };\r\n return Name;\r\n}\r\n\r\nfunction getBiddingScheme(campaign) {\r\n const bidStrategyType = campaign.bidStrategy.option;\r\n const bidOrPercentValue = campaign.bidStrategy[bidStrategyType];\r\n const bidStrategyField = bidStrategyTypeValueMap[bidStrategyType];\r\n const BiddingScheme = bidStrategyType === bidStrategyOptionKeys.ManualCpc ? { Type: bidStrategyType } : { Type: bidStrategyType, [bidStrategyField]: bidOrPercentValue };\r\n if (bidStrategyField !== bidStrategyTypeValueMap.ManualCpc) {\r\n BiddingScheme[bidStrategyField] = bidOrPercentValue && decimal.fromLocalToFloat(bidOrPercentValue);\r\n }\r\n return { BiddingScheme };\r\n}\r\n\r\nfunction getBudget(campaign) {\r\n const Budget = {\r\n Amount: campaign.budget.amount && decimal.fromLocalToFloat(campaign.budget.amount),\r\n Type: 'DailyStandard',\r\n };\r\n return { Budget };\r\n}\r\n\r\nfunction getAdScheduleUseSearcherTimeZone(campaign) {\r\n const { AdScheduleUseSearcherTimeZone } = campaign;\r\n return { AdScheduleUseSearcherTimeZone };\r\n}\r\n\r\nexport function convertCampaignStateToCampaignJSONSchemaData(campaign, initTargets) {\r\n // could reference mt-entity-tapi or client-data package\r\n const AdScheduleUseSearcherTimeZone = getAdScheduleUseSearcherTimeZone(campaign);\r\n const Name = getName(campaign);\r\n const BiddingScheme = getBiddingScheme(campaign);\r\n const Budget = getBudget(campaign);\r\n const deviceSettings = convertDeviceStateToDeviceSchema(campaign, initTargets);\r\n const locationTargets = convertLocationStateToLocationSchemaCampaign(campaign.location, campaign.bundleLocationCriterions, campaign);\r\n const adschedules = getAdSchedule(campaign);\r\n const AdGroups = campaign.AdGroups ? { AdGroups: campaign.AdGroups } : {};\r\n const unSupportedFeatures = getUnSupportedBidAdjustmentFeatures(campaign.bidStrategy.option);\r\n const audienceAds = getAudienceAds(campaign.audienceAds);\r\n const jsonSchemaData = {\r\n ...Name,\r\n ...AdScheduleUseSearcherTimeZone,\r\n ...BiddingScheme,\r\n ...Budget,\r\n ...audienceAds,\r\n CampaignType: 'Hotel',\r\n Languages: ['All'], // Hotel Campaign support All language by default\r\n TimeZone: timeZoneMapper.getAccountTimeZone(),\r\n TrackingUrlTemplate: campaign.urlOptions.TrackingUrlTemplate,\r\n FinalUrlSuffix: campaign.urlOptions.FinalUrlSuffix,\r\n UrlCustomParameters: campaign.urlOptions.UrlCustomParameters,\r\n ...AdGroups,\r\n CampaignCriterions: [\r\n ...deviceSettings,\r\n ...locationTargets,\r\n ...collectCriterions('adSchedule', unSupportedFeatures, adschedules),\r\n ],\r\n };\r\n\r\n if (campaign.Id) {\r\n return {\r\n Id: campaign.Id,\r\n ...jsonSchemaData,\r\n };\r\n }\r\n return {\r\n Status: 'Active',\r\n ...jsonSchemaData,\r\n };\r\n}\r\n\r\nexport function validateCampaignState(campaign, serverContext, isCreation, patchErrMsg) {\r\n return {\r\n name: isCampaignNameValid(campaign.name.value),\r\n budget: isBudgetValid({ value: campaign.budget.amount, serverContext }),\r\n bidStrategy: isBidStrategyValid({ bidStrategy: campaign.bidStrategy, isCreation, serverContext }),\r\n audienceAds: isAudienceAdsValid(campaign.audienceAds),\r\n device: campaign.device.useParentLevel ? true : isDeviceTargetValid(campaign.device.currentLevelSettings, patchErrMsg, campaign.bidStrategy.option),\r\n location: isLocationValid(campaign.location, campaign.bidStrategy.option),\r\n adFormat: isAdFormatValid(campaign.adFormat) || !isCreation,\r\n };\r\n}\r\n\r\nexport function generateDataToInvalidState(validationData, campaign) {\r\n let data = { ...campaign };\r\n fieldsToCheck.forEach((field) => {\r\n if (validationData[field] === false) {\r\n data = {\r\n ...data,\r\n [field]: {\r\n ...data[field],\r\n isInvalid: true,\r\n },\r\n };\r\n }\r\n });\r\n return data;\r\n}\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\n/* eslint-disable no-param-reassign */\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport { perfMarkerPropTypes } from '@bingads-webui/performance-marker';\r\nimport _, { each } from 'underscore';\r\nimport { UiBlocker } from '@bingads-webui-react/ui-blocker';\r\nimport { PrimaryButton, DefaultButton } from '@bingads-webui-react/fabric-control';\r\nimport { getODataErrors } from '@bingads-webui-campaign/api-errors';\r\nimport {\r\n getCampaignTargetsCriterions,\r\n converODataObjectToDeviceState,\r\n globalErrorMsg,\r\n showWarning,\r\n bidStrategyOptionKeys,\r\n getCampaignData, updateDeviceByResponse, handleApiErrors, clearSubViewApiErrors, scrollToErrors, invalidateCache, mergeCampaignStateWithErrors,\r\n subscribeUrlOptions, subscribeSiteExclusion, subscribeIPExclusion, createDefaultHotelGroup, send, sendErrors,\r\n} from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { Errors, modelToViewModelDayTimeTargets, locationTargetsOptionKeys } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport instrumentation from '@bingads-webui-campaign-legacy/instrumentation/index';\r\nimport { edmCampaign } from '@bingads-webui/edm-campaign';\r\nimport {\r\n patchForLocationTargetGrid, shouldSelectBundleOption, getBundleCountriesAndBundleLocationCriterions, parseLocationTargets,\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\nimport { getRoutePathById } from '@bingads-webui-campaign-react/with-site-map';\r\nimport exclusionRepository from '@bingads-webui-campaign-legacy/advanced-settings/util/exclusion-repository';\r\nimport { AdvancedSettings, CampaignBasic, CampaignTitle, defaultCampaignBasicData, CampaignTargets, fieldsToCheck } from './components';\r\nimport { convertCampaignStateToCampaignJSONSchemaData, validateCampaignState, generateDataToInvalidState, getAdGroupBid, getUnSupportedBidAdjustmentFeatures } from './util';\r\n\r\nexport const scenarios = {\r\n settings: 'settings',\r\n creation: 'creation',\r\n};\r\n\r\nexport const HotelCampaignBase = class HotelCampaignBase extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.isCreation = props.scenario === scenarios.creation;\r\n this.initializeTheInstrumentation();\r\n\r\n this.state = {\r\n campaign: {\r\n ...defaultCampaignBasicData,\r\n },\r\n errMsg: {\r\n },\r\n initTargets: {},\r\n isLoading: true,\r\n campaignApiErrors: [],\r\n targetsApiErrors: {},\r\n advancedSettinsApiErrors: {},\r\n isDataFetched: false,\r\n };\r\n this.subViews = {};\r\n this.defaultAdGroupId = undefined;\r\n this.defaultAdGroupCreated = props.scenario === scenarios.settings;\r\n this.defaultHotelGroupCreated = props.scenario === scenarios.settings;\r\n this.adScheduleView = undefined;\r\n this.adDistributionView = undefined;\r\n this.removeWarningInterval = undefined;\r\n this.getAdDistributionView = () => this.adDistributionView;\r\n this.getAdScheduleView = () => this.adScheduleView;\r\n this.setAdScheduleView = (view) => {\r\n this.adScheduleView = view;\r\n this.subViews.adScheduleView = view;\r\n this.adScheduleView.koModel.hasErrors.subscribe((x) => {\r\n if (x) {\r\n this.patchErrMsg('adSchedule', globalErrorMsg);\r\n return;\r\n }\r\n this.patchErrMsg('adSchedule', '');\r\n });\r\n };\r\n this.setAdDistributionView = (view) => { this.adDistributionView = view; };\r\n this.setSiteExclusionView = (view) => { this.siteExclusionView = view; subscribeSiteExclusion(this); };\r\n this.setIPExclusionView = (view) => { this.IPExclusionView = view; subscribeIPExclusion(this); };\r\n this.setUrlOptionsView = (view) => {\r\n this.urlOptionsView = view;\r\n this.subViews.urlOptionsView = view;\r\n subscribeUrlOptions(this, globalErrorMsg);\r\n };\r\n\r\n const campaignEDM = edmCampaign.types.resolve('Model.Campaign');\r\n this.campaignResource = new campaignEDM.ResourceIdentifier();\r\n }\r\n\r\n // eslint-disable-next-line react/sort-comp\r\n handleCreateOrUpdateSuccess = (response, resolve) => {\r\n const {\r\n scope,\r\n siteMap,\r\n } = this.props;\r\n if (this.isCreation) {\r\n const campaignId = this.getCreatedCampaignId(response);\r\n send(this.activity, 'campaign_creation_succeeded', { campaignId });\r\n this.createDefaultHotelGroupAfterCampaignAdGroupCreation(response, () => {\r\n send(this.activity, 'all_succeeded');\r\n this.durationActivity.stopSignal('completed');\r\n scope.save(getRoutePathById(siteMap, 'campaigns'));\r\n }).finally(() => resolve(true));\r\n } else {\r\n // we backfill advanced settings models here, so we have correct model if the saveExtensions call fails.\r\n send(this.activity, 'campaign_update_succeeded');\r\n this.updateResponseData({ entity: response }, resolve);\r\n\r\n if (this.isExclusionsUpdated()) {\r\n this.saveExtensions().then(() => {\r\n send(this.activity, 'all_succeeded');\r\n this.durationActivity.stopSignal('completed');\r\n scope.save(getRoutePathById(siteMap, 'adgroups'));\r\n });\r\n } else {\r\n send(this.activity, 'all_succeeded');\r\n this.durationActivity.stopSignal('completed');\r\n scope.save(getRoutePathById(siteMap, 'adgroups'));\r\n }\r\n }\r\n };\r\n\r\n getCreatedCampaignId = (response) => {\r\n let entity = response;\r\n if (response && response.entity) {\r\n // eslint-disable-next-line prefer-destructuring\r\n entity = response.entity;\r\n }\r\n return entity.Id;\r\n };\r\n\r\n getCreatedDefaultAdGroupId = (response) => {\r\n let entity = response;\r\n if (response && response.entity) {\r\n // eslint-disable-next-line prefer-destructuring\r\n entity = response.entity;\r\n }\r\n const adGroups = entity.AdGroups;\r\n if (adGroups && adGroups.length > 0) {\r\n const adGroup = adGroups[0];\r\n if (adGroup.Id) {\r\n return adGroup.Id;\r\n }\r\n }\r\n return undefined;\r\n };\r\n\r\n handleCreatedDefaultAdGroup = (response) => {\r\n this.defaultAdGroupId = this.getCreatedDefaultAdGroupId(response);\r\n };\r\n\r\n scrollAndShowWarning() {\r\n this.removeWarningInterval = showWarning('campaign', this.props.i18n, this.removeWarningInterval);\r\n scrollToErrors('campaign');\r\n }\r\n\r\n createDefaultHotelGroupAfterCampaignAdGroupCreation = (response, callback) => {\r\n if (!this.defaultHotelGroupCreated) {\r\n const campaignId = this.getCreatedCampaignId(response);\r\n const adGroupId = this.getCreatedDefaultAdGroupId(response);\r\n\r\n if (adGroupId && campaignId) {\r\n const {\r\n cid,\r\n aid,\r\n } = this.props.scope.values;\r\n let bid = 0.05;\r\n let type = 'FixedBid';\r\n const {\r\n bidStrategy,\r\n } = this.state.campaign;\r\n switch (bidStrategy.option) {\r\n case bidStrategyOptionKeys.ManualCpc:\r\n bid = bidStrategy.AdGroupBid;\r\n type = 'FixedBid';\r\n break;\r\n case bidStrategyOptionKeys.PercentCpc:\r\n bid = bidStrategy.AdGroupPercentBid;\r\n type = 'RateBid';\r\n break;\r\n case bidStrategyOptionKeys.Commission:\r\n bid = bidStrategy.AdGroupCommissionRate;\r\n if (bid == null || bid.length === 0) {\r\n bid = bidStrategy.Commission;\r\n }\r\n type = 'RateBid';\r\n break;\r\n default:\r\n bid = 0.05;\r\n type = 'FixedBid';\r\n break;\r\n }\r\n return createDefaultHotelGroup(cid, aid, campaignId, adGroupId, type, bid).then(() => {\r\n send(this.activity, 'hotel_group_creation_succeeded');\r\n this.defaultHotelGroupCreated = true;\r\n if (callback) {\r\n callback();\r\n }\r\n }).catch((res) => {\r\n // TODO: should not get here.\r\n send(this.activity, 'hotel_group_creation_failed');\r\n sendErrors(this.activity, 'hotel_group_creation_error', res);\r\n let errors;\r\n if (res.errors) {\r\n errors = getODataErrors(res.errors, this.props.i18n);\r\n }\r\n if (errors && errors.length) {\r\n this.setState(prevState => ({\r\n campaignApiErrors: prevState.campaignApiErrors.concat(errors),\r\n }));\r\n this.scrollAndShowWarning();\r\n }\r\n });\r\n }\r\n }\r\n return new Promise((resolve) => {\r\n if (callback) {\r\n callback();\r\n }\r\n resolve(true);\r\n });\r\n };\r\n\r\n handleCreateOrUpdateError = (response, resolve) => {\r\n if (this.isCreation) {\r\n send(this.activity, 'campaign_creation_failed');\r\n sendErrors(this.activity, 'campaign_creation_error', response);\r\n } else {\r\n send(this.activity, 'campaign_update_failed');\r\n sendErrors(this.activity, 'campaign_update_error', response);\r\n }\r\n const allApiErrors = handleApiErrors(response, this.props.i18n, this.subViews, 'campaign');\r\n\r\n this.setState(prevState => ({\r\n campaign: {\r\n ...mergeCampaignStateWithErrors(prevState.campaign, allApiErrors),\r\n },\r\n campaignApiErrors: allApiErrors.entityApiErrors.General || [],\r\n targetsApiErrors: allApiErrors.targetsApiErrors,\r\n advancedSettinsApiErrors: allApiErrors.advancedSettinsApiErrors,\r\n }));\r\n this.updateResponseData(response, resolve);\r\n };\r\n\r\n createOrUpdateCampaign = (data) => {\r\n const createOrUpdateCall = this.isCreation ? this.campaignResource.bulkCreate.bind(this.campaignResource) : this.campaignResource.bulkUpdate.bind(this.campaignResource);\r\n return new Promise(resolve => createOrUpdateCall(data)\r\n .then(response => this.handleCreateOrUpdateSuccess(response, resolve))\r\n .catch(response => this.handleCreateOrUpdateError(response, resolve)));\r\n };\r\n\r\n getBundleCountries() {\r\n const {\r\n cid,\r\n aid,\r\n } = this.props.scope.values;\r\n const {\r\n serverContext,\r\n } = this.props;\r\n const lcid = serverContext ? serverContext.CurrentUser.LocaleID : '1033';\r\n const market = serverContext ? serverContext.CurrentUser.Market : 'US';\r\n const language = 'All';\r\n\r\n return getBundleCountriesAndBundleLocationCriterions(cid, aid, lcid, language, market);\r\n }\r\n\r\n renderCampaignTargets(cid, aid, campaignId) {\r\n const getCampaignDeviceCriterionsPromise = getCampaignTargetsCriterions({\r\n type: \"isof(Criterion,'Model.DeviceCriterion')\", cid, aid, campaignId,\r\n });\r\n\r\n return getCampaignDeviceCriterionsPromise.then((campaignTargets) => {\r\n const defalutDeviceSettings = defaultCampaignBasicData.device.parentLevelSettings;\r\n let deviceCriterion = [...defalutDeviceSettings];\r\n if (campaignTargets.length) {\r\n deviceCriterion = converODataObjectToDeviceState(campaignTargets);\r\n }\r\n this.setState(prev => ({ initTargets: { ...prev.initTargets, device: campaignTargets.length > 0 ? deviceCriterion : [] } }));\r\n this.patchCampaign('device', {\r\n parentLevelSettings: [...defalutDeviceSettings],\r\n currentLevelSettings: deviceCriterion,\r\n useParentLevel: campaignTargets.length === 0,\r\n reset: true,\r\n });\r\n });\r\n }\r\n\r\n syncLocationCriterions(cid, aid, campaignId) {\r\n invalidateCache('Model.CampaignCriterion');\r\n const getLocationCriterionsPromise = getCampaignTargetsCriterions({\r\n type: \"isof(Criterion,'Model.LocationCriterion') or isof(Criterion,'Model.RadiusCriterion')\",\r\n cid,\r\n aid,\r\n campaignId,\r\n });\r\n\r\n return getLocationCriterionsPromise.then((rawLocations) => {\r\n const {\r\n locations,\r\n } = parseLocationTargets(rawLocations, 'campaign', campaignId);\r\n this.setState(prevState => ({\r\n campaign: {\r\n ...prevState.campaign,\r\n location: {\r\n ...prevState.campaign.location,\r\n currentLevelSettings: {\r\n ...prevState.campaign.location.currentLevelSettings,\r\n initLocations: locations,\r\n },\r\n },\r\n },\r\n }));\r\n });\r\n }\r\n\r\n fetchLocationCriterions(cid, aid, campaignId, getBundleCountriesPromise) {\r\n const getLocationCriterionsPromise = getCampaignTargetsCriterions({\r\n type: \"isof(Criterion,'Model.LocationCriterion') or isof(Criterion,'Model.RadiusCriterion') or isof(Criterion,'Model.LocationIntentCriterion')\",\r\n cid,\r\n aid,\r\n campaignId,\r\n });\r\n\r\n return Promise.all([getBundleCountriesPromise, getLocationCriterionsPromise]).then(([{ bundleCountries, bundleLocationCriterions }, rawLocations]) => {\r\n const {\r\n locations,\r\n intentId,\r\n intentOption,\r\n } = parseLocationTargets(rawLocations, 'campaign', campaignId);\r\n let targetOption = locations.length ? locationTargetsOptionKeys.specific : locationTargetsOptionKeys.everywhere;\r\n targetOption = shouldSelectBundleOption(bundleCountries, locations) ? locationTargetsOptionKeys.bundleOrDefaultMarket : targetOption;\r\n this.patchCampaign('location', {\r\n currentLevelSettings: {\r\n initLocations: locations,\r\n currentLocations: locations,\r\n targetOption,\r\n intentId,\r\n ...intentOption,\r\n },\r\n bidMode: true,\r\n useParentLevel: locations.length === 0,\r\n });\r\n this.patchCampaign('bundleCountries', bundleCountries);\r\n this.patchCampaign('bundleLocationCriterions', bundleLocationCriterions.map(x => patchForLocationTargetGrid(x)));\r\n });\r\n }\r\n\r\n fetchDayTimeCriterions(cid, aid, campaignId) {\r\n const getDayTimeCriterionsPromise = getCampaignTargetsCriterions({\r\n type: \"isof(Criterion,'Model.DayTimeCriterion')\",\r\n cid,\r\n aid,\r\n campaignId,\r\n });\r\n\r\n return getDayTimeCriterionsPromise.then((dayTimeRanges) => {\r\n this.patchCampaign('dayTimeRanges', modelToViewModelDayTimeTargets(dayTimeRanges));\r\n });\r\n }\r\n\r\n fetchCampaignData(cid, aid, campaignId) {\r\n const getCampaignDataPromise = getCampaignData(cid, aid, campaignId);\r\n return getCampaignDataPromise\r\n .then(campaignData => this.setState(prevState => ({ campaign: { ...prevState.campaign, ...campaignData, curBudgetAmount: campaignData.budget.amount } })));\r\n }\r\n\r\n componentDidMount() {\r\n this.perfMarker.willFetchData();\r\n\r\n const {\r\n scenario,\r\n } = this.props;\r\n\r\n const getBundleCountriesPromise = this.getBundleCountries();\r\n\r\n if (scenario === scenarios.creation) {\r\n getBundleCountriesPromise.then(({ bundleCountries, bundleLocationCriterions }) => {\r\n this.patchCampaign('bundleCountries', bundleCountries);\r\n this.patchCampaign('bundleLocationCriterions', bundleLocationCriterions.map(x => patchForLocationTargetGrid(x)));\r\n }).finally(() => {\r\n this.perfMarker.willRender();\r\n this.setState(() => ({ isLoading: false, isDataFetched: true }));\r\n });\r\n } else if (scenario === scenarios.settings) {\r\n const {\r\n cid,\r\n aid,\r\n campaignId,\r\n } = this.props.scope.values;\r\n\r\n Promise.all([\r\n this.renderCampaignTargets(cid, aid, campaignId),\r\n this.fetchCampaignData(cid, aid, campaignId),\r\n this.fetchLocationCriterions(cid, aid, campaignId, getBundleCountriesPromise),\r\n this.fetchDayTimeCriterions(cid, aid, campaignId),\r\n ]).finally(() => {\r\n this.perfMarker.willRender();\r\n this.setState(() => ({ isLoading: false, isDataFetched: true }));\r\n });\r\n }\r\n }\r\n\r\n componentDidUpdate() {\r\n if (this.state.isLoading === false && this.state.isDataFetched === true && this.perfMarker.isDone === false) {\r\n this.durationActivity.startSignal();\r\n this.perfMarker.done();\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.activity.stop();\r\n if (this.state.campaign && this.state.campaign.Id) {\r\n invalidateCache('Model.Campaign', [this.state.campaign.Id]);\r\n }\r\n if (this.removeWarningInterval) {\r\n this.removeWarningInterval();\r\n }\r\n if (this.adScheduleView) {\r\n this.adScheduleView.undelegateEvents().off().remove();\r\n }\r\n }\r\n\r\n // eslint-disable-next-line react/sort-comp\r\n patchCampaign = (key, value) => {\r\n this.setState(prevState => ({\r\n campaign: {\r\n ...prevState.campaign,\r\n [key]: value,\r\n },\r\n }));\r\n };\r\n patchErrMsg = (key, value) => {\r\n this.setState(prevState => ({\r\n errMsg: {\r\n ...prevState.errMsg,\r\n [key]: value,\r\n },\r\n }));\r\n };\r\n patchTargetsApiErrMsg = (key, value) => {\r\n this.setState(prevState => ({\r\n targetsApiErrors: {\r\n ...prevState.targetsApiErrors,\r\n [key]: value,\r\n },\r\n }));\r\n };\r\n patchAdvancedSettinsApiErrors = (key, value) => {\r\n this.setState(prevState => ({\r\n advancedSettinsApiErrors: {\r\n ...prevState.advancedSettinsApiErrors,\r\n [key]: value,\r\n },\r\n }));\r\n };\r\n getCurrentCampaignId() {\r\n const {\r\n currentCampaign,\r\n } = this.props;\r\n return currentCampaign && currentCampaign.Id;\r\n }\r\n\r\n validate = () => {\r\n const {\r\n serverContext,\r\n } = this.props;\r\n let validationData = validateCampaignState(this.state.campaign, serverContext, this.isCreation, this.patchErrMsg);\r\n const unSupportedFeatures = getUnSupportedBidAdjustmentFeatures(this.state.campaign.bidStrategy.option);\r\n validationData = Object.assign(\r\n validationData,\r\n { urlOptions: this.urlOptionsView ? this.urlOptionsView.validate() : true },\r\n { adSchedule: this.adScheduleView && !unSupportedFeatures.includes('adSchedule') ? this.adScheduleView.validate() : true }\r\n );\r\n const isValid = fieldsToCheck.every(x => validationData[x] === true);\r\n if (isValid !== true) {\r\n this.setState(prevState => ({\r\n campaign: {\r\n ...generateDataToInvalidState(validationData, prevState.campaign),\r\n },\r\n }));\r\n }\r\n return isValid;\r\n };\r\n\r\n getAdScheduleValues = () => {\r\n const deletedDayTimeCb = (deletedDayTimeCriterions) => {\r\n const currentCampaignId = this.getCurrentCampaignId();\r\n\r\n each(deletedDayTimeCriterions, (criterion) => {\r\n criterion.Status = 'Deleted';\r\n criterion.Campaign = {\r\n Id: currentCampaignId,\r\n };\r\n });\r\n };\r\n\r\n return this.adScheduleView ? this.adScheduleView.getValues(deletedDayTimeCb) : [];\r\n };\r\n\r\n getUrlOptionsValues = () => {\r\n const urlOptions = this.urlOptionsView ? this.urlOptionsView.toObject() : {};\r\n\r\n if (_.isEmpty(urlOptions.TrackingUrlTemplate)) {\r\n urlOptions.TrackingUrlTemplate = null;\r\n }\r\n if (_.isEmpty(urlOptions.UrlCustomParameters)) {\r\n urlOptions.UrlCustomParameters = null;\r\n }\r\n\r\n return urlOptions;\r\n };\r\n\r\n getExclusionsValues = () => {\r\n const siteExclusionData = this.siteExclusionView ? this.siteExclusionView.getValues() : {};\r\n const IPExclusionData = this.IPExclusionView ? this.IPExclusionView.getValues() : {};\r\n const Exclusions = {\r\n ExcludedSites: siteExclusionData,\r\n ExcludedIPs: IPExclusionData,\r\n };\r\n return { Exclusions };\r\n };\r\n\r\n getDateSettings = () => {\r\n if (this.isCreation && this.adScheduleView) {\r\n return this.adScheduleView.getDateSettings();\r\n }\r\n return {};\r\n };\r\n\r\n getAdGroup = (values) => {\r\n const defaultAdGroupName = 'Ad group #1';\r\n const adgroup = {\r\n CampaignName: values.name.value,\r\n Name: defaultAdGroupName,\r\n Medium: 'Search',\r\n PricingModel: 'CPC',\r\n Status: 'Active',\r\n AdGroupType: 'HotelAds',\r\n ...this.getDateSettings(),\r\n ...getAdGroupBid(values),\r\n ...values.netWorkOptions,\r\n };\r\n\r\n if (this.adScheduleView && this.adScheduleView.getAdScheduleUseSearcherTimeZone) {\r\n adgroup.AdScheduleUseSearcherTimeZone = this.adScheduleView.getAdScheduleUseSearcherTimeZone();\r\n }\r\n\r\n if (values.Id) {\r\n adgroup.Campaign = {\r\n Id: values.Id,\r\n };\r\n }\r\n\r\n if (this.defaultAdGroupId) {\r\n adgroup.Id = this.defaultAdGroupId;\r\n } else {\r\n adgroup.HotelAdGroupType = _.compact([values.adFormat.HPA && 'HotelAd', values.adFormat.PPA && 'PropertyAd']);\r\n }\r\n\r\n return adgroup;\r\n };\r\n\r\n getValues = () => {\r\n const values = {\r\n ...this.state.campaign,\r\n adScheduleData: this.getAdScheduleValues(),\r\n urlOptions: this.getUrlOptionsValues(),\r\n netWorkOptions: this.adDistributionView ? this.adDistributionView.toObject() : {},\r\n };\r\n\r\n if (this.adScheduleView && this.adScheduleView.getAdScheduleUseSearcherTimeZone) {\r\n values.AdScheduleUseSearcherTimeZone = this.adScheduleView.getAdScheduleUseSearcherTimeZone();\r\n }\r\n\r\n if (!this.defaultAdGroupCreated) {\r\n values.AdGroups = [this.getAdGroup(values)];\r\n }\r\n\r\n return values;\r\n };\r\n\r\n initializeTheInstrumentation = () => {\r\n if (this.isCreation) {\r\n const scenario = instrumentation.hotelCampaignCreation.create();\r\n\r\n this.activity = scenario.hotelCampaignCreation.create();\r\n // duration activity, from user could edit & all successeed/completed\r\n this.durationActivity = scenario.duration.create();\r\n this.perfMarker = this.props.perfMarker.createChild('HotelCampaignBaseCreation');\r\n } else {\r\n const scenario = instrumentation.hotelCampaignSettings.create();\r\n\r\n this.activity = scenario.hotelCampaignSettings.create();\r\n this.durationActivity = scenario.duration.create();\r\n this.perfMarker = this.props.perfMarker.createChild('HotelCampaignBaseSettings');\r\n }\r\n // the component life time\r\n this.activity.start();\r\n send(this.activity, 'enter_page');\r\n\r\n this.perfMarker.willInit();\r\n };\r\n\r\n syncLocationCriterionsPromise = (payload) => {\r\n const {\r\n cid,\r\n aid,\r\n campaignId,\r\n } = this.props.scope.values;\r\n if (campaignId) {\r\n return this.syncLocationCriterions(cid, aid, campaignId);\r\n } else if (payload && payload.entity && payload.entity.Id) {\r\n return this.syncLocationCriterions(cid, aid, payload.entity.Id);\r\n } else if (payload && payload.Id) {\r\n return this.syncLocationCriterions(cid, aid, payload.Id);\r\n }\r\n return Promise.resolve(true);\r\n };\r\n\r\n updateResponseData = (payload, resolve) => {\r\n if (!payload) {\r\n resolve(true);\r\n return;\r\n }\r\n // Fill back the data to the view;\r\n if (payload.entity && payload.entity.Id) {\r\n this.patchCampaign('Id', payload.entity.Id);\r\n }\r\n const resourceName = 'CampaignCriterions';\r\n\r\n if (this.adScheduleView) {\r\n this.adScheduleView.backFillItems(payload.entity ? payload : { entity: payload });\r\n }\r\n\r\n this.handleCreatedDefaultAdGroup(payload);\r\n\r\n let resources = [];\r\n if (_.has(payload, 'entity') && _.has(payload.entity, resourceName)) {\r\n resources = payload.entity[resourceName];\r\n } else if (_.has(payload, resourceName)) {\r\n resources = payload[resourceName];\r\n }\r\n const DeviceCriterion = [];\r\n const ServerDeviceCriterion = [];\r\n _.each(resources, (criterion) => {\r\n switch (criterion.CriterionType) {\r\n case 'Device':\r\n case 'OriginalDevice':\r\n DeviceCriterion.push(criterion);\r\n if (!criterion.errors) {\r\n ServerDeviceCriterion.push(criterion);\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n const currentCriterionMap = {};\r\n if (DeviceCriterion.length > 0) {\r\n updateDeviceByResponse(DeviceCriterion, this.state.campaign.device, this.patchCampaign);\r\n }\r\n if (ServerDeviceCriterion.length > 0) {\r\n const currentDeviceCriterion = updateDeviceByResponse(ServerDeviceCriterion, this.state.campaign.device);\r\n currentCriterionMap.device = currentDeviceCriterion;\r\n }\r\n\r\n this.setState(prev => ({ initTargets: { ...prev.initTargets, ...currentCriterionMap } }));\r\n if (payload && payload.errors) {\r\n this.removeWarningInterval = showWarning('campaign', this.props.i18n, this.removeWarningInterval);\r\n }\r\n\r\n Promise.all([this.syncLocationCriterionsPromise(payload), this.createDefaultHotelGroupAfterCampaignAdGroupCreation(payload)])\r\n .finally(() => resolve(true));\r\n };\r\n\r\n isExclusionsUpdated() {\r\n if (!this.siteExclusionView && !this.IPExclusionView) {\r\n return false;\r\n }\r\n\r\n const siteExclusionsUpdated = this.siteExclusionView &&\r\n !_.isEqual(this.siteExclusionView.options.exclusions, this.siteExclusionView.getValues());\r\n\r\n const IPExclusionsUpdated = this.IPExclusionView &&\r\n !_.isEqual(this.IPExclusionView.options.exclusions, this.IPExclusionView.getValues());\r\n\r\n return siteExclusionsUpdated || IPExclusionsUpdated;\r\n }\r\n\r\n saveExtensions() {\r\n const { campaignId } = this.props.scope.values;\r\n const data = {\r\n campaignId,\r\n AdvanceSettings: {\r\n ...this.getExclusionsValues(),\r\n },\r\n };\r\n const that = this;\r\n return exclusionRepository.saveExtensions(data, 'campaign')\r\n .then(() => {\r\n send(this.activity, 'hotel_campaign_extensions_update_succeeded');\r\n that.IPExclusionView.clearApiErrors();\r\n that.siteExclusionView.clearApiErrors();\r\n that.patchErrMsg('baseExclusion', '');\r\n this.patchAdvancedSettinsApiErrors('baseExclusion', []);\r\n })\r\n .catch((response) => {\r\n send(this.activity, 'hotel_campaign_extensions_update_failed');\r\n if (response.NegativeSitesResult || response.NegativeIPsResult) {\r\n const { NegativeSitesResult: siteErrors, NegativeIPsResult: ipErrors } = response;\r\n const exclusionApiErrors = [];\r\n if (siteErrors || ipErrors) {\r\n if (that.siteExclusionView && siteErrors) {\r\n that.siteExclusionView.showErrors(siteErrors);\r\n exclusionApiErrors.push({ siteErrors });\r\n } else {\r\n that.siteExclusionView.clearApiErrors();\r\n }\r\n if (that.IPExclusionView && ipErrors) {\r\n that.IPExclusionView.showErrors(ipErrors);\r\n exclusionApiErrors.push({ ipErrors });\r\n } else {\r\n that.IPExclusionView.clearApiErrors();\r\n }\r\n that.patchErrMsg('baseExclusion', globalErrorMsg);\r\n this.patchAdvancedSettinsApiErrors('baseExclusion', exclusionApiErrors);\r\n scrollToErrors('campaign');\r\n } else {\r\n that.patchErrMsg('baseExclusion', '');\r\n this.patchAdvancedSettinsApiErrors('baseExclusion', []);\r\n }\r\n // eslint-disable-next-line no-throw-literal\r\n throw 'exclusion error';\r\n }\r\n });\r\n }\r\n\r\n clearAllApiErrors() {\r\n clearSubViewApiErrors(this.subViews);\r\n this.setState(prev => ({\r\n targetsApiErrors: {},\r\n advancedSettinsApiErrors: { baseExclusion: prev.advancedSettinsApiErrors.baseExclusion },\r\n }));\r\n }\r\n\r\n save = () => {\r\n send(this.activity, 'save_clicked');\r\n // If something is wrong, you want show error message in the titlebar, you can patchErrMsg like below.\r\n // this.patchErrMsg('campaign', '*Required field'); // The two parameters are the key of Collapse.Panel, and the error message displayed.\r\n const isValid = this.validate();\r\n if (isValid) {\r\n const data = this.getValues();\r\n this.setState(() => ({ isLoading: true }));\r\n const createOrUpdatePromise = this.createOrUpdateCampaign(convertCampaignStateToCampaignJSONSchemaData(data, this.state.initTargets));\r\n createOrUpdatePromise.finally(() => this.setState(() => ({ isLoading: false })));\r\n } else {\r\n scrollToErrors('campaign');\r\n }\r\n };\r\n\r\n cancel = () => {\r\n send(this.activity, 'cancel_clicked');\r\n this.durationActivity.stopSignal('canceled');\r\n const {\r\n scope,\r\n siteMap,\r\n } = this.props;\r\n scope.save(getRoutePathById(siteMap, 'campaigns'));\r\n };\r\n\r\n render() {\r\n const {\r\n classes,\r\n i18n,\r\n scenario,\r\n } = this.props;\r\n\r\n return (\r\n <div\r\n className={classnames(classes.hotelCampaignBase, `hotel-campaign-${scenario}-app`)}\r\n onFocus={() => { if (!_.isEmpty(this.state.campaignApiErrors)) { _.delay(() => this.setState(() => ({ campaignApiErrors: [] })), 200); } }}\r\n >\r\n <UiBlocker\r\n blocking={this.state.isLoading}\r\n loadingText={i18n.getString(_TL_('Loading...'))}\r\n >\r\n <div className={classnames(`hotel-campaign-${scenario}-container`, 'hotel-campaign-shared')}>\r\n {this.isCreation && <CampaignTitle permissions={this.props.permissions} />}\r\n <Errors errors={!_.isEmpty(this.state.campaignApiErrors) && this.state.campaignApiErrors.map(x => x.message)} />\r\n <CampaignBasic\r\n campaign={this.state.campaign}\r\n patchCampaign={this.patchCampaign}\r\n scenario={scenario}\r\n errMsg={this.state.errMsg}\r\n patchErrMsg={this.patchErrMsg}\r\n getAdScheduleView={this.getAdScheduleView}\r\n permissions={this.props.permissions}\r\n activity={this.activity}\r\n />\r\n <AdvancedSettings\r\n campaign={this.state.campaign}\r\n patchCampaign={this.patchCampaign}\r\n setAdScheduleView={this.setAdScheduleView}\r\n getAdScheduleView={this.getAdScheduleView}\r\n setAdDistributionView={this.setAdDistributionView}\r\n getAdDistributionView={this.getAdDistributionView}\r\n setBaseExclusionView={this.setBaseExclusionView}\r\n setUrlOptionsView={this.setUrlOptionsView}\r\n setSiteExclusionView={this.setSiteExclusionView}\r\n setIPExclusionView={this.setIPExclusionView}\r\n scenario={scenario}\r\n errMsg={this.state.errMsg}\r\n patchErrMsg={this.patchErrMsg}\r\n getUrlOptionsValues={this.getUrlOptionsValues}\r\n getExclusionsValues={this.getExclusionsValues}\r\n advancedSettinsApiErrors={this.state.advancedSettinsApiErrors}\r\n adScheduleModel={this.adScheduleModel}\r\n isDataFetched={this.state.isDataFetched}\r\n />\r\n <CampaignTargets\r\n campaign={this.state.campaign}\r\n patchCampaign={this.patchCampaign}\r\n errMsg={this.state.errMsg}\r\n patchErrMsg={this.patchErrMsg}\r\n scope={this.props.scope}\r\n targetsApiErrors={this.state.targetsApiErrors}\r\n patchTargetsApiErrMsg={this.patchTargetsApiErrMsg}\r\n />\r\n <div className=\"dashline\" />\r\n <PrimaryButton className=\"save-campaign-btn\" text={i18n.getString(_TL_('Save'))} onClick={this.save} />\r\n <DefaultButton className=\"cancel-btn\" text={i18n.getString(_TL_('Cancel'))} onClick={this.cancel} />\r\n </div>\r\n </UiBlocker>\r\n </div>\r\n );\r\n }\r\n};\r\n\r\nHotelCampaignBase.propTypes = {\r\n currentCampaign: PropTypes.shape({}).isRequired,\r\n i18n: PropTypes.shape({\r\n getString: PropTypes.func,\r\n }).isRequired,\r\n perfMarker: perfMarkerPropTypes.isRequired,\r\n classes: PropTypes.shape({}).isRequired,\r\n scenario: PropTypes.string,\r\n scope: PropTypes.shape({\r\n values: PropTypes.shape({\r\n cid: PropTypes.number.isRequired,\r\n aid: PropTypes.number.isRequired,\r\n campaignId: PropTypes.number,\r\n }).isRequired,\r\n }).isRequired,\r\n siteMap: PropTypes.shape([]).isRequired,\r\n serverContext: PropTypes.shape({}).isRequired,\r\n permissions: PropTypes.shape({}),\r\n};\r\n\r\nHotelCampaignBase.defaultProps = {\r\n scenario: scenarios.creation,\r\n permissions: {},\r\n};\r\n","import { helpbuttonStyle, datePickerStyle, convertToLocalStyle, glyphIconStyle, getBlockerStyle, spinnerKeyframe } from '@bingads-webui-campaign-react/common-styles';\r\nimport { creationCommonStyle } from '@bingads-webui-campaign-react/campaign-adgroup-settings-shared-styles';\r\n\r\nexport const sharedStyles = core =>\r\n ({\r\n hotelCampaignBase: {\r\n padding: '32px 32px 48px 24px',\r\n minWidth: '1032px',\r\n backgroundColor: `${core && core.palette && core.palette.neutralLighterAlt}`,\r\n '& .campaign-title .title': {\r\n fontSize: '20px',\r\n fontWeight: '600',\r\n },\r\n '& .helpbutton': helpbuttonStyle(core)['.helpbutton'],\r\n '& .helpbutton::before': helpbuttonStyle(core)['.helpbutton::before'],\r\n ...convertToLocalStyle(glyphIconStyle(core)),\r\n ...creationCommonStyle(core),\r\n '& .dashline': {\r\n borderBottom: `1px solid ${core && core.palette && core.palette.neutralLight}`,\r\n width: '100%',\r\n margin: '24px 0 16px 0',\r\n },\r\n '& span': {\r\n verticalAlign: 'unset',\r\n },\r\n '& .jumbo-card-control-all-btn': {\r\n color: '#323230',\r\n },\r\n '& .alert-info': {\r\n marginTop: '8px',\r\n },\r\n '& .location-target-options label': {\r\n display: 'inherit',\r\n },\r\n '& .intent-target-options label': {\r\n display: 'inherit',\r\n },\r\n '& .intent-target': {\r\n marginTop: '8px',\r\n },\r\n '& .cancel-btn': {\r\n marginLeft: '8px',\r\n },\r\n '& .react-block-ui': {\r\n '& > div:last-child > div > div': {\r\n backgroundColor: 'unset',\r\n },\r\n '& > div:last-child': {\r\n alignItems: 'center',\r\n backgroundColor: 'rgba(256, 256, 256, 0.5)',\r\n color: core.palette.themePrimary,\r\n display: 'flex',\r\n outline: 'none',\r\n padding: 10,\r\n '& .blocker-text': {\r\n fontWeight: 'normal',\r\n top: '23.5px',\r\n display: 'inline-block',\r\n position: 'absolute',\r\n },\r\n '& .blocker-image': {\r\n ...getBlockerStyle(28, core.palette),\r\n display: 'inline-block',\r\n },\r\n },\r\n },\r\n '& table tbody .col-sm-9': {\r\n width: 'unset',\r\n paddingLeft: 'unset',\r\n },\r\n '& .bing-maps-search-box-dropdown li a::after': {\r\n display: 'none',\r\n },\r\n '& .bing-maps-search-box-dropdown li a:focus': {\r\n outline: '1px solid #605e5c',\r\n },\r\n '& table tbody .item-label.schedule-item-label.form-control-static': {\r\n fontWeight: '600',\r\n color: '#323130',\r\n paddingTop: '10px',\r\n display: 'block',\r\n },\r\n '& table tbody .radio .col-sm-3': {\r\n width: 'unset',\r\n },\r\n '& table tbody .radio .col-sm-9': {\r\n paddingLeft: '8px',\r\n },\r\n '& table tbody .col-sm-9 input.k-input.form-control': {\r\n width: '100px !important',\r\n },\r\n '& .adschedule-targets-container .ba-backbone-instance-wrapper .advanced-scheduling-grid .ad-scheduling-panel table tr:nth-child(3) td .radio-inline:nth-child(2)': {\r\n top: 'unset',\r\n },\r\n '& .form-horizontal table tbody .radio': {\r\n paddingTop: 'unset',\r\n },\r\n '& .scheduling-grid .advanced-scheduling-grid': {\r\n marginTop: '16px',\r\n },\r\n '& .hotel-campaign-shared': {\r\n width: '62.5%',\r\n minWidth: '968px',\r\n },\r\n '& span.error-string': {\r\n whiteSpace: 'normal',\r\n },\r\n '& .hotel-ad-format label': {\r\n display: 'inherit',\r\n },\r\n '& .bid-strategy-options': {\r\n minHeight: '84px',\r\n '& .percentage': {\r\n position: 'relative',\r\n minWidth: '296px',\r\n '& .error-string': {\r\n position: 'absolute',\r\n top: '64px',\r\n },\r\n },\r\n '& .disclaimer.has-error': {\r\n marginTop: '24px',\r\n },\r\n },\r\n '& .campaign': {\r\n '& .collapse-content.content-show': {\r\n marginTop: '-4px',\r\n marginLeft: '-4px',\r\n '& .campaign-name': {\r\n marginTop: '4px',\r\n marginLeft: '4px',\r\n },\r\n '& .hotel-ad-format': {\r\n marginLeft: '4px',\r\n marginBottom: '4px',\r\n },\r\n },\r\n },\r\n '& .budget': {\r\n '& .collapse-content.content-show': {\r\n marginTop: '-4px',\r\n marginLeft: '-4px',\r\n '& .campaign-budget': {\r\n marginTop: '4px',\r\n marginLeft: '4px',\r\n marginBottom: '4px',\r\n },\r\n },\r\n },\r\n '& span.bold': {\r\n fontWeight: 1000,\r\n },\r\n '& .alert-budget-button': {\r\n marginLeft: '10px',\r\n paddingTop: '5px',\r\n '& button': {\r\n color: 'black',\r\n fontSize: '13px',\r\n fontWeight: 500,\r\n borderColor: '#edebe9',\r\n },\r\n },\r\n },\r\n '@global': {\r\n '.floating-banner.warnFloatingBanner': {\r\n bottom: 'unset',\r\n top: '10%',\r\n background: '#A80000',\r\n '& .iconba, [role=\"alert\"], [role=\"button\"]': {\r\n color: 'white',\r\n },\r\n\r\n },\r\n '.app-shell .app-content-body div.settings-page': {\r\n overflow: 'visible',\r\n },\r\n '.app-shell .app-content-container-col': {\r\n backgroundColor: `${core && core.palette && core.palette.neutralLighterAlt}`,\r\n '& .ba-content-footer, .back-to-campaign': {\r\n minWidth: '1032px',\r\n },\r\n },\r\n ...spinnerKeyframe,\r\n ...datePickerStyle(core),\r\n },\r\n });\r\n","import React from 'react';\r\nimport { withCreationHeader } from '@bingads-webui-campaign-react/campaign-adgroup-creation';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { mergeStyles } from '@bingads-webui-campaign-react/common-styles';\r\nimport { withI18nConsumer } from '@bingads-webui-react/i18n-context';\r\nimport { compose } from 'underscore';\r\nimport { HotelCampaignBase, scenarios } from './shared';\r\nimport { sharedStyles } from './style';\r\n\r\nconst getStyles = (_, theme) => ({\r\n ...mergeStyles(\r\n { theme },\r\n sharedStyles\r\n ),\r\n});\r\n\r\n\r\nexport const HotelCampaignCreation = compose(\r\n withI18nConsumer,\r\n WrappedComponent => withDefaultStyles(WrappedComponent, getStyles),\r\n withCreationHeader\r\n)(props => (<HotelCampaignBase {...props} scenario={scenarios.creation} />));\r\n","import React from 'react';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { withI18nConsumer } from '@bingads-webui-react/i18n-context';\r\nimport { compose } from 'underscore';\r\nimport { mergeStyles } from '@bingads-webui-campaign-react/common-styles';\r\nimport { HotelCampaignBase, scenarios } from './shared';\r\nimport { sharedStyles } from './style';\r\n\r\nconst getStyles = (_, theme) => ({\r\n ...mergeStyles(\r\n { theme },\r\n sharedStyles,\r\n {\r\n hotelCampaignBase: {\r\n paddingLeft: '32px',\r\n },\r\n }\r\n ),\r\n});\r\n\r\nexport const HotelCampaignSettings = compose(\r\n withI18nConsumer,\r\n WrappedComponent => withDefaultStyles(WrappedComponent, getStyles)\r\n)(props => (<HotelCampaignBase {...props} scenario={scenarios.settings} />));\r\n\r\n","import React, { Fragment } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Text } from '@bingads-webui-react/fabric-control';\r\n\r\nexport const ErrorString = ({\r\n error,\r\n}) => (\r\n <Fragment>\r\n <Text variant=\"small\" className=\"error-string\" block styles={{ root: { color: '#A80000', whiteSpace: 'break-spaces', lineHeight: '18px' } }}>{error}</Text>\r\n </Fragment>\r\n);\r\n\r\nErrorString.propTypes = {\r\n error: PropTypes.string,\r\n};\r\nErrorString.defaultProps = {\r\n error: '',\r\n};\r\n\r\n","import decimal from '@bingads-webui-component-legacy/humanize/decimal';\r\nimport { validateNumber, getNumberErrorMsg } from '../components/utility';\r\n\r\nconst advancedBookConst = {\r\n min: 0,\r\n max: 330,\r\n isInteger: true,\r\n};\r\n\r\nexport const validateAdvancedBookingDays = ({\r\n value, min = advancedBookConst.min, max = advancedBookConst.max, isInteger = advancedBookConst.isInteger,\r\n}) => validateNumber({\r\n value, min, max, isInteger, extra: [],\r\n});\r\nexport const getValidateAdvancedBookingDaysErrorMsg = ({\r\n code, i18n, min = advancedBookConst.min, max = advancedBookConst.max,\r\n}) => {\r\n switch (code) {\r\n default:\r\n return getNumberErrorMsg({\r\n code, i18n, min, max,\r\n });\r\n }\r\n};\r\n\r\nexport const isABWOverlapCal = (dt1, dt2) => {\r\n const start1 = Number(dt1.minimumDays);\r\n const end1 = Number(dt1.maximumDays);\r\n const start2 = Number(dt2.minimumDays);\r\n const end2 = Number(dt2.maximumDays);\r\n let [flag1, flag2, flag3] = [true, true, true];\r\n if (decimal.isValid(dt1.minimumDays) && decimal.isValid(dt1.maximumDays)) {\r\n flag1 = start1 <= end1;\r\n }\r\n if (decimal.isValid(dt2.minimumDays) && decimal.isValid(dt2.maximumDays)) {\r\n flag2 = start2 <= end2;\r\n }\r\n if (decimal.isValid(dt1.maximumDays) && decimal.isValid(dt2.minimumDays)) {\r\n flag3 = end1 < start2;\r\n }\r\n if (!flag1 || !flag2) {\r\n return 'minimum_greater_than_maximum';\r\n }\r\n if (!flag3) {\r\n return 'adjust_settings';\r\n }\r\n return '';\r\n};\r\n\r\n","import decimal from '@bingads-webui-component-legacy/humanize/decimal';\r\nimport { validateNumber, getNumberErrorMsg } from '../components/utility';\r\n\r\nconst lengthOfStayConst = {\r\n min: 0,\r\n max: 30,\r\n isInteger: true,\r\n};\r\n\r\nexport const validateLengthOfStayDays = ({\r\n value, min = lengthOfStayConst.min, max = lengthOfStayConst.max, isInteger = lengthOfStayConst.isInteger,\r\n}) => validateNumber({\r\n value, min, max, isInteger, extra: [],\r\n});\r\nexport const getValidateLengthOfStayDaysErrorMsg = ({\r\n code, i18n, min = lengthOfStayConst.min, max = lengthOfStayConst.max,\r\n}) => {\r\n switch (code) {\r\n default:\r\n return getNumberErrorMsg({\r\n code, i18n, min, max,\r\n });\r\n }\r\n};\r\n\r\nexport const isLengthOfStayOverlapCal = (dt1, dt2) => {\r\n const start1 = Number(dt1.minimumNumber);\r\n const end1 = Number(dt1.maximumNumber);\r\n const start2 = Number(dt2.minimumNumber);\r\n const end2 = Number(dt2.maximumNumber);\r\n let [flag1, flag2, flag3] = [true, true, true];\r\n if (decimal.isValid(dt1.minimumNumber) && decimal.isValid(dt1.maximumNumber)) {\r\n flag1 = start1 <= end1;\r\n }\r\n if (decimal.isValid(dt2.minimumNumber) && decimal.isValid(dt2.maximumNumber)) {\r\n flag2 = start2 <= end2;\r\n }\r\n if (decimal.isValid(dt1.maximumNumber) && decimal.isValid(dt2.minimumNumber)) {\r\n flag3 = end1 < start2;\r\n }\r\n if (!flag1 || !flag2) {\r\n return 'minimum_greater_than_maximum_nights';\r\n }\r\n if (!flag3) {\r\n return 'adjust_settings';\r\n }\r\n return '';\r\n};\r\n","export const getValidateCheckinDateErrorMsg = ({\r\n code, i18n,\r\n}) => {\r\n if (code.value === '' || code.value == null) {\r\n return i18n.getString(_TL_('Required field'));\r\n }\r\n return null;\r\n};\r\n\r\nexport const validateCheckinDate = ({ value }) => {\r\n if (value === '' || value == null) {\r\n return 'RequiredField';\r\n }\r\n return null;\r\n};\r\n\r\nfunction getDaysBetween(dateString1, dateString2) {\r\n const startDate = Date.parse(dateString1);\r\n const endDate = Date.parse(dateString2);\r\n const days = (endDate - startDate) / (1 * 24 * 60 * 60 * 1000);\r\n return days;\r\n}\r\n\r\nexport const isCheckinDateOverlapCal = (dt1, dt2) => {\r\n const start1 = dt1.startDate;\r\n const end1 = dt1.endDate;\r\n const start2 = dt2.startDate;\r\n const end2 = dt2.endDate;\r\n let [isStart1EarlyThanEnd1, isStart2EarlyThanEnd2, isEnd1EarlyThanStart2, isRange1NotGreaterThan999, isRange2NotGreaterThan999] = [true, true, true, true, true];\r\n if (dt1.startDate && dt1.endDate) {\r\n isStart1EarlyThanEnd1 = start1 <= end1;\r\n isRange1NotGreaterThan999 = getDaysBetween(start1, end1) <= 999;\r\n }\r\n if (dt2.startDate && dt2.endDate) {\r\n isStart2EarlyThanEnd2 = start2 <= end2;\r\n isRange2NotGreaterThan999 = getDaysBetween(start2, end2) <= 999;\r\n }\r\n if (dt1.endDate && dt2.startDate) {\r\n isEnd1EarlyThanStart2 = end1 < start2;\r\n }\r\n if (!isStart1EarlyThanEnd1 || !isStart2EarlyThanEnd2) {\r\n return 'startdate_greater_than_enddate';\r\n }\r\n if (!isEnd1EarlyThanStart2) {\r\n return 'adjust_settings';\r\n }\r\n if (!isRange1NotGreaterThan999 || !isRange2NotGreaterThan999) {\r\n return 'out_of_checkin_date_range';\r\n }\r\n return '';\r\n};\r\n","/* eslint-disable no-param-reassign */\r\n/* eslint-disable no-plusplus */\r\nimport _ from 'underscore';\r\nimport decimal from '@bingads-webui-component-legacy/humanize/decimal';\r\nimport targetConstants from '@bingads-webui-campaign-legacy/base-targets/viewmodel/targetConstants';\r\nimport { isABWTargetValid, isLengthOfStayTargetValid, isCheckinDateTargetValid } from '../index';\r\nimport { isABWOverlapCal } from '../advanced-booking-window-target-setting/utility';\r\nimport { isLengthOfStayOverlapCal } from '../length-of-stay-target-setting/utility';\r\nimport { isCheckinDateOverlapCal } from '../check-in-date-target-setting/utility';\r\n\r\nexport function shouldNotHideInclude(bidStrategyType) {\r\n return bidStrategyType !== 'Commission';\r\n}\r\n\r\nconst bidAdjustmentConst = {\r\n min: 0,\r\n max: 1000,\r\n};\r\nexport const numberErrorCode = {\r\n RequiredField: 'RequiredField',\r\n InValidNumber: 'InValidNumber',\r\n OutOfRange: 'OutOfRange',\r\n RequiredInteger: 'RequiredInteger',\r\n};\r\n\r\nexport const getNumberErrorMsg = ({\r\n code, i18n, min, max,\r\n}) => {\r\n switch (code) {\r\n case numberErrorCode.RequiredField:\r\n return i18n.getString(_TL_('Required field'));\r\n case numberErrorCode.InValidNumber:\r\n return i18n.getString(_TL_('Field requires numeric value'));\r\n case numberErrorCode.OutOfRange:\r\n return i18n.getString(_TL_('Number should be between {{min}} and {{max}}'), { min, max });\r\n case numberErrorCode.RequiredInteger:\r\n return i18n.getString(_TL_('Field requires integer value'));\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\nexport const validateNumber = ({\r\n value,\r\n min,\r\n max,\r\n isInteger,\r\n extra,\r\n onlyExtra,\r\n}) => {\r\n const isValidNumber = typeof value === 'number' ? true : decimal.isValid(value);\r\n if (value === '' || value == null) {\r\n return numberErrorCode.RequiredField;\r\n } else if (!isValidNumber) {\r\n return numberErrorCode.InValidNumber;\r\n }\r\n const number = decimal.fromLocalToFloat(value);\r\n if ((number < min || number > max) && ((extra && extra.indexOf(number) === -1) || _.isUndefined(extra))) {\r\n return numberErrorCode.OutOfRange;\r\n }\r\n if (onlyExtra && ((extra && extra.indexOf(number) === -1) || _.isUndefined(extra))) {\r\n return numberErrorCode.OutOfRange;\r\n }\r\n if (isInteger && !Number.isInteger(number)) {\r\n return numberErrorCode.RequiredInteger;\r\n }\r\n\r\n return null;\r\n};\r\n\r\nconst transExtra = (i18n, extra) => {\r\n const num = extra.length;\r\n const last = extra[num - 1];\r\n if (num > 1) {\r\n const pre = extra.slice(0, num - 1);\r\n return i18n.getString(_TL_('{{pre}}% or {{last}}%'), { pre: pre.join('%, '), last });\r\n }\r\n return i18n.getString(_TL_('{{last}}%'), { last });\r\n};\r\n\r\nexport const validateBidAdjustment = ({\r\n value, min = bidAdjustmentConst.min, max = bidAdjustmentConst.max, extra, onlyExtra,\r\n}) => validateNumber({\r\n value, min, max, extra, onlyExtra, isInteger: true,\r\n});\r\nexport const getValidateBidAdjustmentErrorMsg = ({\r\n code, i18n, min = bidAdjustmentConst.min, max = bidAdjustmentConst.max, extra, onlyExtra,\r\n}) => {\r\n switch (code) {\r\n case numberErrorCode.OutOfRange:\r\n if (extra && extra.length) {\r\n if (onlyExtra) {\r\n return i18n.getString(_TL_('The bid adjustment must be {{extra}}'), { extra: transExtra(i18n, extra) });\r\n }\r\n return i18n.getString(_TL_('The bid adjustment must be {{extra}} or {{min}}% to {{max}}%'), { min, max, extra: transExtra(i18n, extra) });\r\n }\r\n return i18n.getString(_TL_('The bid adjustment must be between {{min}}% and {{max}}%'), { min, max });\r\n default:\r\n return getNumberErrorMsg({\r\n code, i18n, min, max,\r\n });\r\n }\r\n};\r\n\r\nconst defaultSupportedLocationsForGEODeal = ['Country', 'SubGeography', 'MetroArea'];\r\n\r\nexport const locationErrors = {\r\n IntentIsNotValid: 'IntentIsNotValid',\r\n BidIsNotValid: 'BidIsNotValid',\r\n HasConflict: 'HasConflict',\r\n InvalidLocationForDeal: 'InvalidLocationForDeal',\r\n};\r\n\r\nconst checkConflict = (areaLocations) => {\r\n const includedLocations = [];\r\n const excludedLocations = [];\r\n\r\n _.each(areaLocations, (location) => {\r\n if (location.Criterion.LocationCriterion) {\r\n if (location.SelectionStatus === 'Included') {\r\n includedLocations.push(location);\r\n } else if (location.SelectionStatus === 'Excluded') {\r\n excludedLocations.push(location);\r\n }\r\n }\r\n });\r\n\r\n return _.every(includedLocations, includedLoc =>\r\n _.every(includedLoc.Criterion.LocationCriterion.EnclosingLocationIds, parentLocationId =>\r\n _.isUndefined(_.find(excludedLocations, excludedLoc =>\r\n excludedLoc.Criterion.LocationCriterion.LocationId === parentLocationId))));\r\n};\r\n\r\nconst locationTypeNameMap = {\r\n Country: _TL_('country'),\r\n SubGeography: _TL_('region, state, province '),\r\n MetroArea: _TL_('metro area'),\r\n City: _TL_('city'),\r\n PostalCode: _TL_('postal code'),\r\n County: _TL_('county'),\r\n Neighborhood: _TL_('neighborhood'),\r\n};\r\n\r\nconst constructErrorMessageForDeal = ({ i18n, dealInfo = {} }) => {\r\n const { dealSupportedLocationType } = dealInfo;\r\n let message = '';\r\n if (dealSupportedLocationType) {\r\n const supportedLocationType = dealSupportedLocationType\r\n .map(type => (_.has(locationTypeNameMap, type) ? locationTypeNameMap[type] : ''))\r\n .join(', ');\r\n message = i18n.getString(_TL_('The location you selected is not valid for this deal. This deal supported location types {{supportedLocationType}} location targeting under the country.'), { supportedLocationType });\r\n }\r\n return message;\r\n};\r\n\r\nexport const getLocationErrorMsg = ({\r\n code, i18n, dealInfo = {},\r\n}) => {\r\n switch (code) {\r\n case locationErrors.HasConflict:\r\n return i18n.getString(_TL_('You cannot target a location that is within an excluded location.'));\r\n case locationErrors.InvalidLocationForDeal:\r\n return constructErrorMessageForDeal({ i18n, dealInfo });\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\nexport const validateLocations = (location, bidStrategyType, dealInfo = null) => {\r\n if (location.useParentLevel) {\r\n return null;\r\n }\r\n const {\r\n currentLevelSettings = {},\r\n } = location;\r\n\r\n const {\r\n peopleInLocation,\r\n peopleSearchingForLocation,\r\n currentLocations,\r\n } = currentLevelSettings;\r\n\r\n if (shouldNotHideInclude(bidStrategyType) && !checkConflict(currentLocations)) {\r\n return locationErrors.HasConflict;\r\n }\r\n\r\n if (shouldNotHideInclude(bidStrategyType) && (peopleInLocation === false && peopleSearchingForLocation === false)) {\r\n return locationErrors.IntentIsNotValid;\r\n }\r\n\r\n const data = currentLocations && currentLocations.find(target => validateBidAdjustment({\r\n min: -targetConstants.minimumBid.Location,\r\n max: targetConstants.maximumBid.Location,\r\n value: target.Criterion.BidAdjustment,\r\n }) !== null);\r\n\r\n if (data) {\r\n return locationErrors.BidIsNotValid;\r\n }\r\n\r\n const {\r\n isForDeal,\r\n dealSupportedLocationType,\r\n dealCountryCode,\r\n } = dealInfo || {};\r\n\r\n // Deal Check\r\n if (isForDeal) {\r\n let invalidCountryLocations = [];\r\n // If supportedLocationType is not provided, default to country, subgeography, metroarea\r\n const supportedLocationType = dealSupportedLocationType || defaultSupportedLocationsForGEODeal;\r\n const invalidTypeLocations = currentLocations\r\n && currentLocations.find((target) => {\r\n const locationType = _.get(target, ['Criterion', 'LocationCriterion', 'LocationType'], '');\r\n return _.contains(supportedLocationType, locationType) === false;\r\n });\r\n\r\n if (!_.isEmpty(dealCountryCode)) {\r\n invalidCountryLocations = currentLocations\r\n && currentLocations.find((target) => {\r\n const targetCountryCode = _.get(target, ['Criterion', 'LocationCriterion', 'CountryCode'], '').toLowerCase();\r\n // If the location selected is not in the same country announced by the deal, return error\r\n return !_.isEqual(dealCountryCode.toLowerCase(), targetCountryCode);\r\n });\r\n }\r\n\r\n if (!_.isEmpty(invalidTypeLocations) || !_.isEmpty(invalidCountryLocations)) {\r\n return locationErrors.InvalidLocationForDeal;\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport const isLocationValid = (location, bidStrategyType, dealInfo = {}) => validateLocations(location, bidStrategyType, dealInfo) === null;\r\n\r\nexport const getDatePickerStrings = i18n => ({\r\n months: [\r\n i18n.getString(_TL_('January')),\r\n i18n.getString(_TL_('February')),\r\n i18n.getString(_TL_('March')),\r\n i18n.getString(_TL_('April')),\r\n i18n.getString(_TL_('May')),\r\n i18n.getString(_TL_('June')),\r\n i18n.getString(_TL_('July')),\r\n i18n.getString(_TL_('August')),\r\n i18n.getString(_TL_('September')),\r\n i18n.getString(_TL_('October')),\r\n i18n.getString(_TL_('November')),\r\n i18n.getString(_TL_('December')),\r\n ],\r\n\r\n shortMonths: [\r\n i18n.getString(_TL_('Jan')),\r\n i18n.getString(_TL_('Feb')),\r\n i18n.getString(_TL_('Mar')),\r\n i18n.getString(_TL_('Apr')),\r\n i18n.getString(_TL_('May')),\r\n i18n.getString(_TL_('Jun')),\r\n i18n.getString(_TL_('Jul')),\r\n i18n.getString(_TL_('Aug')),\r\n i18n.getString(_TL_('Sep')),\r\n i18n.getString(_TL_('Oct')),\r\n i18n.getString(_TL_('Nov')),\r\n i18n.getString(_TL_('Dec')),\r\n ],\r\n\r\n days: [\r\n i18n.getString(_TL_('Sunday')),\r\n i18n.getString(_TL_('Monday')),\r\n i18n.getString(_TL_('Tuesday')),\r\n i18n.getString(_TL_('Wednesday')),\r\n i18n.getString(_TL_('Thursday')),\r\n i18n.getString(_TL_('Friday')),\r\n i18n.getString(_TL_('Saturday')),\r\n ],\r\n\r\n // likezh: These short day initials are not used. Left en-US defaults from Fluent UI.\r\n // https://github.com/microsoft/fluentui/blob/4f907a837f3b85923178b611e4fbb0d9ac222dda/packages/date-time-utilities/src/dateFormatting/dateFormatting.defaults.ts#L55\r\n shortDays: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\r\n\r\n goToToday: i18n.getString(_TL_('Go to today')),\r\n prevMonthAriaLabel: i18n.getString(_TL_('Go to previous month')),\r\n nextMonthAriaLabel: i18n.getString(_TL_('Go to next month')),\r\n prevYearAriaLabel: i18n.getString(_TL_('Go to previous year')),\r\n nextYearAriaLabel: i18n.getString(_TL_('Go to next year')),\r\n closeButtonAriaLabel: i18n.getString(_TL_('Close date picker')),\r\n\r\n isRequiredErrorMessage: i18n.getString(_TL_('Start date is required.')),\r\n invalidInputErrorMessage: i18n.getString(_TL_('Invalid date format.')),\r\n});\r\n\r\nexport const areEqual = (prevProps, nextProps) => prevProps.data === nextProps.data;\r\n\r\nexport function notifyTargetsShowError(target, patchTarget) {\r\n if (!target.ABW.useParentLevel && isABWTargetValid(target.ABW.currentLevelSettings) === false) {\r\n patchTarget('ABW', { ...target.ABW, isInvalid: true });\r\n }\r\n if (!target.lengthOfStay.useParentLevel && isLengthOfStayTargetValid(target.lengthOfStay.currentLevelSettings) === false) {\r\n patchTarget('lengthOfStay', { ...target.lengthOfStay, isInvalid: true });\r\n }\r\n if (!target.checkinDate.useParentLevel && isCheckinDateTargetValid(target.checkinDate.currentLevelSettings) === false) {\r\n patchTarget('checkinDate', { ...target.checkinDate, isInvalid: true });\r\n }\r\n}\r\n\r\nconst isValueOverlapMap = {\r\n ABW: isABWOverlapCal,\r\n lengthOfStay: isLengthOfStayOverlapCal,\r\n checkinDate: isCheckinDateOverlapCal,\r\n};\r\nconst isValueOverlapMapSortByParams = {\r\n ABW: { key: 'minimumDays', type: 'number' },\r\n lengthOfStay: { key: 'minimumNumber', type: 'number' },\r\n checkinDate: { key: 'startDate', type: 'string' },\r\n};\r\n\r\nexport function isValueOverlap(targetName, data) {\r\n if (data && data.length) {\r\n let sortData = [...data];\r\n if (isValueOverlapMapSortByParams[targetName] && isValueOverlapMapSortByParams[targetName].type === 'number') {\r\n sortData = _.sortBy(sortData, item => item[isValueOverlapMapSortByParams[targetName].key] - 0);\r\n }\r\n if (isValueOverlapMapSortByParams[targetName] && isValueOverlapMapSortByParams[targetName].type === 'string') {\r\n sortData = _.sortBy(sortData, item => item[isValueOverlapMapSortByParams[targetName].key]);\r\n }\r\n sortData = sortData.filter(item => item.Status !== 'Deleted');\r\n for (let i = 0, len = sortData.length; i < len; i++) {\r\n const curDt = sortData[i];\r\n const isValueOverlapMapFn = isValueOverlapMap[targetName];\r\n if (sortData.length === 1) {\r\n if (isValueOverlapMapFn && isValueOverlapMapFn(curDt, {})) {\r\n return isValueOverlapMapFn(curDt, {});\r\n }\r\n }\r\n for (let j = i + 1; j < len; j++) {\r\n const otherDt = sortData[j];\r\n if (isValueOverlapMapFn && isValueOverlapMapFn(curDt, otherDt)) {\r\n return isValueOverlapMapFn(curDt, otherDt);\r\n }\r\n }\r\n }\r\n }\r\n return '';\r\n}\r\nexport function setIsDirtyByNotifyFn({ data, setKeySuffix, setIsDirty }) {\r\n if (data.reset) {\r\n setKeySuffix(new Date().getTime());\r\n delete data.reset;\r\n setIsDirty({});\r\n }\r\n if (data.remove) {\r\n setKeySuffix(new Date().getTime());\r\n const dirty = {};\r\n data.currentLevelSettings.forEach((_item, index) => {\r\n Object.entries(_item).forEach(([key, value]) => {\r\n if (!data.useParentLevel && value !== '') {\r\n dirty[`${key}-${index}`] = true;\r\n }\r\n });\r\n });\r\n setIsDirty(dirty);\r\n delete data.remove;\r\n }\r\n if (data.isInvalid) {\r\n delete data.isInvalid;\r\n const dirty = {};\r\n data.currentLevelSettings.forEach((_item, index) => {\r\n Object.entries(_item).forEach(([key]) => {\r\n if (!data.useParentLevel) {\r\n dirty[`${key}-${index}`] = true;\r\n }\r\n });\r\n });\r\n setIsDirty(dirty);\r\n }\r\n}\r\n\r\nexport const overlapErrorMsg = {\r\n minimum_greater_than_maximum: _TL_('Minimum days cannot be greater than maximum days'),\r\n minimum_greater_than_maximum_nights: _TL_('Minimum number of nights cannot be greater than maximum number of nights'),\r\n adjust_settings: _TL_(\"Adjust your settings so they don't overlap.\"),\r\n startdate_greater_than_enddate: _TL_('Start check-in date cannot be later than end check-in date'),\r\n out_of_checkin_date_range: _TL_('The number of days between start check-in date and end check-in date cannot be greater than 999.'),\r\n};\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\n\r\nimport React, { useContext, Fragment, useState, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Stack, Dropdown, TextField } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { validateBidAdjustment, getValidateBidAdjustmentErrorMsg } from './utility';\r\nimport { ErrorString } from './shared';\r\n\r\nexport const BidAdjustment = (props) => {\r\n const i18n = useContext(I18nContext);\r\n const {\r\n data,\r\n adjustmentDropdown,\r\n adjustmentInput,\r\n handleChangeInput,\r\n handleBatchChangeInput,\r\n isDirty,\r\n index,\r\n keySuffix,\r\n item,\r\n column,\r\n setIsDirty,\r\n disableDecrease,\r\n } = props;\r\n\r\n const dropdownOption = disableDecrease ? [\r\n { key: 'Increase by', text: i18n.getString(_TL_('Increase by')) },\r\n ] : [\r\n { key: 'Increase by', text: i18n.getString(_TL_('Increase by')) },\r\n { key: 'Decrease by', text: i18n.getString(_TL_('Decrease by')) },\r\n ];\r\n\r\n const {\r\n min, max, extra, onlyExtra,\r\n } = column;\r\n const [bidAdjustmentError, setBidAdjustmentError] = useState('');\r\n const [adjustmentDropdownValue, setAdjustmentDropdownValue] = useState('');\r\n const [currentKeySuffix, setCurrentKeySuffix] = useState('');\r\n\r\n useEffect(() => {\r\n let validateValue = item.bidAdjustmentInput;\r\n if (adjustmentDropdownValue === 'Decrease by') {\r\n validateValue = -item.bidAdjustmentInput;\r\n }\r\n // When the valid value range or input value changes, check again\r\n setBidAdjustmentError(getValidateBidAdjustmentErrorMsg({\r\n code: validateBidAdjustment({\r\n value: validateValue, min, max, extra, onlyExtra,\r\n }),\r\n i18n,\r\n min,\r\n max,\r\n extra,\r\n onlyExtra,\r\n }));\r\n }, [item[column.fieldName], min, max, extra, onlyExtra, adjustmentDropdownValue]);\r\n\r\n useEffect(() => { setAdjustmentDropdownValue(adjustmentDropdown); }, [adjustmentDropdown]);\r\n useEffect(() => { setCurrentKeySuffix(keySuffix); }, [keySuffix]);\r\n\r\n const handleBlur = (value) => {\r\n let tempValue = value - 0;\r\n if (!disableDecrease && !isNaN(tempValue) && tempValue < 0) {\r\n tempValue = -tempValue;\r\n setCurrentKeySuffix(new Date().getTime());\r\n let tempAdjustmentDropdownValue = '';\r\n if (adjustmentDropdownValue === 'Decrease by') {\r\n tempAdjustmentDropdownValue = 'Increase by';\r\n } else {\r\n tempAdjustmentDropdownValue = 'Decrease by';\r\n }\r\n setAdjustmentDropdownValue(tempAdjustmentDropdownValue);\r\n handleBatchChangeInput({ bidAdjustmentInput: tempValue, bidAdjustmentDropdown: tempAdjustmentDropdownValue });\r\n } else {\r\n handleChangeInput('bidAdjustmentInput', value);\r\n }\r\n };\r\n\r\n return (\r\n <Fragment>\r\n <Stack horizontal verticalAlign=\"center\" tokens={{ childrenGap: 4 }} className=\"bid-adjustment-wrapper\">\r\n <Dropdown\r\n className=\"bid-adjustment-dropdown\"\r\n aria-label=\"bid-adjustment-dropdown-label\"\r\n options={dropdownOption}\r\n selectedKey={adjustmentDropdownValue}\r\n onChange={(_e, option) => {\r\n if (!isDirty[`bidAdjustmentDropdown-${index}`]) {\r\n setIsDirty({ ...isDirty, [`bidAdjustmentDropdown-${index}`]: true });\r\n }\r\n handleChangeInput('bidAdjustmentDropdown', option.key);\r\n }}\r\n styles={{\r\n dropdown: { width: 135 },\r\n dropdownOptionText: { overflow: 'visible', whiteSpace: 'normal' },\r\n dropdownItem: { height: 'auto' },\r\n dropdownItemSelected: { height: 'auto' },\r\n }}\r\n disabled={data.useParentLevel}\r\n />\r\n <TextField\r\n className={`bid-adjustment-input ${!data.useParentLevel && isDirty[`bidAdjustmentInput-${index}`] && bidAdjustmentError ? 'input-error-border' : ''}`}\r\n ariaLabel=\"bid-adjustment-input-label\"\r\n defaultValue={adjustmentInput}\r\n key={`${column.fieldName}-${index}-${currentKeySuffix}`}\r\n onChange={(_e, value) => {\r\n if (!isDirty[`bidAdjustmentInput-${index}`]) {\r\n setIsDirty({ ...isDirty, [`bidAdjustmentInput-${index}`]: true });\r\n }\r\n let validateValue = value;\r\n if (adjustmentDropdownValue === 'Decrease by') {\r\n validateValue = -value;\r\n }\r\n const err = getValidateBidAdjustmentErrorMsg({\r\n code: validateBidAdjustment({\r\n value: validateValue, min, max, extra, onlyExtra,\r\n }),\r\n i18n,\r\n min,\r\n max,\r\n extra,\r\n onlyExtra,\r\n });\r\n setBidAdjustmentError(err);\r\n }}\r\n onBlur={e => handleBlur(e.target.value)}\r\n disabled={data.useParentLevel}\r\n />\r\n <span className=\"bidBoost-percent\">%</span>\r\n </Stack>\r\n {!data.useParentLevel && isDirty[`bidAdjustmentInput-${index}`] && bidAdjustmentError && <ErrorString error={bidAdjustmentError} />}\r\n </Fragment>\r\n );\r\n};\r\n\r\nBidAdjustment.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n item: PropTypes.shape({}).isRequired,\r\n adjustmentDropdown: PropTypes.string,\r\n adjustmentInput: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\r\n handleChangeInput: PropTypes.func.isRequired,\r\n handleBatchChangeInput: PropTypes.func.isRequired,\r\n isDirty: PropTypes.shape({}).isRequired,\r\n index: PropTypes.number.isRequired,\r\n keySuffix: PropTypes.number.isRequired,\r\n column: PropTypes.shape({}).isRequired,\r\n setIsDirty: PropTypes.func.isRequired,\r\n disableDecrease: PropTypes.bool,\r\n};\r\n\r\nBidAdjustment.defaultProps = {\r\n adjustmentDropdown: '',\r\n adjustmentInput: '',\r\n disableDecrease: false,\r\n};\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { Fragment, useEffect, useState } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { TextField } from '@bingads-webui-react/fabric-control';\r\nimport { ErrorString } from './shared';\r\n\r\nexport const CommonTextField = (props) => {\r\n const {\r\n column, index, item, keySuffix, data, fieldContent, isDirty, setIsDirty, handleChangeInput, getFieldErrorMsg,\r\n } = props;\r\n const [fieldErrorMsg, setFieldErrorMsg] = useState('');\r\n useEffect(() => { setFieldErrorMsg(getFieldErrorMsg(item[column.fieldName])); }, [data]);\r\n\r\n return (\r\n <Fragment>\r\n <TextField\r\n ariaLabel={`${column.fieldName}Label`}\r\n key={`${column.fieldName}-${index}-${keySuffix}`}\r\n className={`target-input ${!data.useParentLevel && (isDirty[`${column.fieldName}-${index}`]) && fieldErrorMsg ? 'input-error-border' : ''}`}\r\n styles={{ fieldGroup: { width: 92 } }}\r\n disabled={data.useParentLevel || item.Id}\r\n defaultValue={fieldContent}\r\n onChange={(_e, value) => {\r\n if (!isDirty[`${column.fieldName}-${index}`]) {\r\n setIsDirty({ ...isDirty, [`${column.fieldName}-${index}`]: true });\r\n }\r\n setFieldErrorMsg(getFieldErrorMsg(value));\r\n }}\r\n onBlur={(e) => { handleChangeInput({ fieldName: column.fieldName, index }, e.target && e.target.value, 'blur'); }}\r\n />\r\n {!data.useParentLevel && (isDirty[`${column.fieldName}-${index}`]) && fieldErrorMsg && <ErrorString error={fieldErrorMsg} />}\r\n </Fragment>\r\n );\r\n};\r\n\r\nCommonTextField.propTypes = {\r\n column: PropTypes.shape({}).isRequired,\r\n item: PropTypes.shape({}).isRequired,\r\n index: PropTypes.number.isRequired,\r\n keySuffix: PropTypes.number.isRequired,\r\n data: PropTypes.shape({}).isRequired,\r\n fieldContent: PropTypes.string,\r\n isDirty: PropTypes.shape({}).isRequired,\r\n setIsDirty: PropTypes.func.isRequired,\r\n handleChangeInput: PropTypes.func.isRequired,\r\n getFieldErrorMsg: PropTypes.func.isRequired,\r\n};\r\nCommonTextField.defaultProps = {\r\n fieldContent: '',\r\n};\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, { Fragment } from 'react';\r\nimport { Link, DatePicker, Label } from '@bingads-webui-react/fabric-control';\r\nimport { globalErrorMsg } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { ErrorString } from './shared';\r\nimport { BidAdjustment } from './bid-adjustment';\r\nimport { getDatePickerStrings } from './utility';\r\nimport { CommonTextField } from './common-textfield';\r\n\r\nfunction clearValidation({\r\n item, index, setIsDirty, isDirty,\r\n}) {\r\n const isDirtyCopy = {};\r\n Object.entries(item).forEach(([key]) => {\r\n isDirtyCopy[`${key}-${index}`] = false;\r\n });\r\n setIsDirty({ ...isDirty, ...isDirtyCopy });\r\n}\r\nexport function validateFn(validateParams) {\r\n if (validateParams.targetId) {\r\n if (document.getElementById(validateParams.targetId) && document.getElementById(validateParams.targetId).parentNode.querySelectorAll('.error-string').length) {\r\n validateParams.patchErrMsg(validateParams.targetName, globalErrorMsg);\r\n } else {\r\n validateParams.patchErrMsg(validateParams.targetName, '');\r\n }\r\n }\r\n}\r\nexport function generateColumn(parmas) {\r\n const {\r\n item,\r\n index,\r\n column,\r\n i18n,\r\n serverContext,\r\n isDirty,\r\n setIsDirty,\r\n handleRemove,\r\n props: {\r\n handleChangeInput, handleBatchChangeInput, data, setData, getFieldErrorMsg, keySuffix, disableDecrease,\r\n },\r\n } = parmas;\r\n\r\n\r\n const fieldContent = item[column.fieldName];\r\n const fieldErrorMsg = getFieldErrorMsg(fieldContent);\r\n\r\n const formatDateValue = value => i18n.formatDate(value, { raw: serverContext.CurrentUser.CultureDateTimeFormat.ShortDatePattern });\r\n\r\n let { bidAdjustmentInput, bidAdjustmentDropdown } = item;\r\n if (!disableDecrease && bidAdjustmentInput - 0 < 0) {\r\n bidAdjustmentDropdown = 'Decrease by';\r\n bidAdjustmentInput = -bidAdjustmentInput;\r\n }\r\n switch (column.type) {\r\n case 'bid-adjustment':\r\n return (\r\n <Fragment>\r\n <BidAdjustment\r\n index={index}\r\n item={item}\r\n keySuffix={keySuffix}\r\n data={data}\r\n setData={setData}\r\n column={column}\r\n adjustmentDropdown={bidAdjustmentDropdown}\r\n adjustmentInput={bidAdjustmentInput}\r\n handleChangeInput={(key, value) => {\r\n handleChangeInput({ fieldName: key, index }, value);\r\n }}\r\n handleBatchChangeInput={(fieldName) => {\r\n handleBatchChangeInput({ fieldName, index });\r\n }}\r\n isDirty={isDirty}\r\n setIsDirty={setIsDirty}\r\n disableDecrease={disableDecrease}\r\n />\r\n </Fragment>);\r\n case 'input':\r\n return (\r\n <Fragment>\r\n <CommonTextField\r\n item={item}\r\n column={column}\r\n index={index}\r\n keySuffix={keySuffix}\r\n data={data}\r\n fieldContent={fieldContent}\r\n isDirty={isDirty}\r\n setIsDirty={setIsDirty}\r\n handleChangeInput={handleChangeInput}\r\n getFieldErrorMsg={getFieldErrorMsg}\r\n />\r\n </Fragment>);\r\n case 'remove':\r\n return (\r\n <Link\r\n className=\"target-remove-btn\"\r\n disabled={data.useParentLevel}\r\n onClick={() => {\r\n handleRemove(index);\r\n clearValidation({\r\n data, item, index, setIsDirty, isDirty,\r\n });\r\n }}\r\n >\r\n {i18n.getString(_TL_('Remove'))}\r\n </Link>);\r\n case 'datePicker':\r\n return (\r\n <Fragment>\r\n <DatePicker\r\n strings={getDatePickerStrings(i18n)}\r\n ariaLabel={i18n.getString(_TL_('check-in date picker'))}\r\n isMonthPickerVisible\r\n showGoToToday={false}\r\n value={fieldContent}\r\n formatDate={value => formatDateValue(value)}\r\n onSelectDate={(value) => { setIsDirty({ ...isDirty, [`${column.fieldName}-${index}`]: true }); handleChangeInput({ fieldName: column.fieldName, index }, value); }}\r\n className={`date-picker ${!data.useParentLevel && (isDirty[`${column.fieldName}-${index}`]) && fieldErrorMsg ? 'input-error-border' : ''} `}\r\n disabled={data.useParentLevel}\r\n />\r\n {!data.useParentLevel && (isDirty[`${column.fieldName}-${index}`]) && fieldErrorMsg && <ErrorString error={fieldErrorMsg} />}\r\n </Fragment>\r\n );\r\n case 'plainString':\r\n return (<span className={column.spanClassName}>{fieldContent}</span>);\r\n default:\r\n return <Label style={{ fontWeight: 'normal' }}>{fieldContent && i18n.getString(fieldContent)}</Label>;\r\n }\r\n}\r\n\r\n\r\nexport function getAllColumns({\r\n i18n,\r\n props,\r\n setIsDirty,\r\n handleRemoveAll,\r\n minBid,\r\n maxBid,\r\n extraBid,\r\n onlyExtra,\r\n}) {\r\n const bidAdjustmentTitle = (\r\n <Fragment>\r\n <span>{i18n.getString(_TL_('Bid adjustment'))}</span>\r\n </Fragment>\r\n );\r\n const removetTitle = (\r\n <Link className=\"target-remove-all-btn\" disabled={props.data.useParentLevel} onClick={() => { handleRemoveAll(); setIsDirty({}); }}>\r\n {i18n.getString(_TL_('Remove all'))}\r\n </Link>\r\n );\r\n\r\n let bidAdjustmentColumn = {\r\n key: 'bid-adjustment',\r\n name: bidAdjustmentTitle,\r\n fieldName: 'bidAdjustment',\r\n type: 'bid-adjustment',\r\n minWidth: 200,\r\n min: minBid,\r\n max: maxBid,\r\n extra: extraBid,\r\n onlyExtra,\r\n };\r\n\r\n const RemoveBtnColumn = {\r\n key: 'remove',\r\n name: removetTitle,\r\n fieldName: 'remove',\r\n type: 'remove',\r\n minWidth: 200,\r\n };\r\n\r\n let allColums = [...props.columns, bidAdjustmentColumn];\r\n if (props.showAddBtn) {\r\n bidAdjustmentColumn = {\r\n ...bidAdjustmentColumn,\r\n className: 'border-right',\r\n headerClassName: 'target-custom-header',\r\n };\r\n allColums = [...props.columns, bidAdjustmentColumn, RemoveBtnColumn];\r\n }\r\n if (props.noBidAdjustment) {\r\n allColums = [...props.columns];\r\n }\r\n return allColums;\r\n}\r\n\r\n","/* eslint-disable react/no-unused-prop-types */\r\nimport React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { ServerContext } from '@bingads-webui-campaign-react/server-context';\r\nimport { DetailsList, SelectionMode } from '@bingads-webui-react/fabric-control';\r\nimport { DetailsRow } from '@fluentui/react';\r\nimport { Pagination } from '@bingads-webui-grid/campaign-details-list';\r\nimport { generateColumn, getAllColumns } from './generate-column';\r\n\r\nconst cropWithPage = (pageSize, pageNumber, data) => {\r\n const min = (pageNumber - 1) * pageSize;\r\n const max = pageNumber * pageSize;\r\n return data.slice(min, max);\r\n};\r\n\r\nexport const TargetDetailList = (props) => {\r\n const i18n = useContext(I18nContext);\r\n const serverContext = useContext(ServerContext);\r\n const {\r\n data,\r\n setData,\r\n isDirty,\r\n setIsDirty,\r\n enablePagination,\r\n pageSize,\r\n pageNumber,\r\n setPageSize,\r\n setPageNumber,\r\n hideWhenEmpty,\r\n minBid,\r\n maxBid,\r\n extraBid,\r\n onlyExtra,\r\n validateParams,\r\n patchTargetsApiErrMsg,\r\n } = props;\r\n\r\n const handleRemove = (index) => {\r\n const currentLevelSettings = [...data.currentLevelSettings];\r\n const item = { ...currentLevelSettings[index] };\r\n if (item.Id) {\r\n item.Status = 'Deleted';\r\n currentLevelSettings[index] = item;\r\n } else {\r\n currentLevelSettings.splice(index, 1);\r\n }\r\n setData({ ...data, currentLevelSettings, remove: true });\r\n if (validateParams) {\r\n patchTargetsApiErrMsg(validateParams.targetName, []);\r\n }\r\n };\r\n\r\n const handleRemoveAll = () => {\r\n const currentLevelSettings = [...data.currentLevelSettings];\r\n const tempCurrentLevelSettings = [];\r\n // eslint-disable-next-line no-plusplus\r\n for (let i = 0; i < currentLevelSettings.length; i++) {\r\n const item = currentLevelSettings[i];\r\n if (item.Id) {\r\n tempCurrentLevelSettings.push({\r\n ...item,\r\n Status: 'Deleted',\r\n });\r\n }\r\n }\r\n setData({ ...data, currentLevelSettings: tempCurrentLevelSettings });\r\n if (validateParams) {\r\n validateParams.patchErrMsg(validateParams.targetName, '');\r\n patchTargetsApiErrMsg(validateParams.targetName, []);\r\n }\r\n };\r\n\r\n const renderItemColumn = (item, index, column) => generateColumn({\r\n item,\r\n index,\r\n column,\r\n i18n,\r\n serverContext,\r\n isDirty,\r\n setIsDirty,\r\n handleRemove,\r\n props,\r\n hideWhenEmpty,\r\n });\r\n\r\n const renderItemRow = (row) => {\r\n const customStyles = {};\r\n if (row) {\r\n if (row.item.Status === 'Deleted') {\r\n customStyles.root = { display: 'none' };\r\n }\r\n return <DetailsRow {...row} styles={customStyles} />;\r\n }\r\n return null;\r\n };\r\n\r\n let itemsSetting = data.currentLevelSettings;\r\n if (data.useParentLevel) {\r\n itemsSetting = data.parentLevelSettings;\r\n }\r\n\r\n const items = enablePagination ? cropWithPage(pageSize, pageNumber, itemsSetting) : itemsSetting;\r\n if (hideWhenEmpty && items.length === 0) {\r\n return null;\r\n }\r\n\r\n return (\r\n <React.Fragment>\r\n <DetailsList\r\n className=\"criterion-target-table\"\r\n selectionMode={SelectionMode.none}\r\n items={items}\r\n columns={getAllColumns({\r\n i18n,\r\n props,\r\n setIsDirty,\r\n handleRemoveAll,\r\n minBid,\r\n maxBid,\r\n extraBid,\r\n onlyExtra,\r\n })}\r\n onRenderItemColumn={renderItemColumn}\r\n onRenderRow={renderItemRow}\r\n />\r\n {enablePagination &&\r\n <div className=\"pagination-control\">\r\n <Pagination\r\n pageNumber={pageNumber}\r\n onPageChange={number => setPageNumber(number)}\r\n pageSize={pageSize}\r\n total={itemsSetting.length}\r\n onPageSizeChange={size => setPageSize(size)}\r\n />\r\n </div>}\r\n </React.Fragment>\r\n );\r\n};\r\n\r\nTargetDetailList.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n setData: PropTypes.func,\r\n columns: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\r\n isDirty: PropTypes.shape({}).isRequired,\r\n setIsDirty: PropTypes.func.isRequired,\r\n showAddBtn: PropTypes.bool,\r\n handleChangeInput: PropTypes.func.isRequired,\r\n getFieldErrorMsg: PropTypes.func,\r\n enablePagination: PropTypes.bool,\r\n setPageSize: PropTypes.func.isRequired,\r\n setPageNumber: PropTypes.func.isRequired,\r\n pageSize: PropTypes.number.isRequired,\r\n pageNumber: PropTypes.number.isRequired,\r\n minBid: PropTypes.number,\r\n maxBid: PropTypes.number,\r\n extraBid: PropTypes.arrayOf(PropTypes.number),\r\n onlyExtra: PropTypes.bool,\r\n hideWhenEmpty: PropTypes.bool,\r\n validateParams: PropTypes.shape({}).isRequired,\r\n patchTargetsApiErrMsg: PropTypes.func,\r\n};\r\n\r\nTargetDetailList.defaultProps = {\r\n setData() { },\r\n getFieldErrorMsg() { },\r\n showAddBtn: false,\r\n enablePagination: false,\r\n hideWhenEmpty: false,\r\n minBid: undefined,\r\n maxBid: undefined,\r\n onlyExtra: false,\r\n extraBid: [],\r\n patchTargetsApiErrMsg() { },\r\n};\r\n","import { helpbuttonStyle } from '@bingads-webui-campaign-react/common-styles';\r\n\r\nexport const getStyles = (_, core) => ({\r\n criterionSettingContainer: {\r\n '& .helpbutton': helpbuttonStyle(core)['.helpbutton'],\r\n '& .helpbutton::before': helpbuttonStyle(core)['.helpbutton::before'],\r\n '& .control-label': {\r\n paddingBottom: '0px',\r\n },\r\n '& .target-toggle': {\r\n '& .ms-Toggle-label': {\r\n fontWeight: 400,\r\n },\r\n },\r\n\r\n '& .table-container': {\r\n width: '716px',\r\n '&.length-of-stay-container,&.checkin-date-container': {\r\n width: '890px',\r\n },\r\n '& .bid-adjustment-input': {\r\n width: '66px',\r\n },\r\n '& .criterion-target-table': {\r\n '& .ms-List-cell': {\r\n minHeight: '0',\r\n },\r\n '& .ms-DetailsHeader': {\r\n paddingTop: 0,\r\n paddingBottom: 0,\r\n borderTop: `1px solid ${core.palette.neutralLight}`,\r\n '& .ms-DetailsHeader-cellName': {\r\n fontWeight: 'normal',\r\n },\r\n },\r\n '& .ms-DetailsRow': {\r\n animationFillMode: 'none',\r\n },\r\n '& .ms-DetailsRow:hover,& .ms-DetailsHeader-cell:hover': {\r\n backgroundColor: `${core.palette.white}`,\r\n color: 'inherit',\r\n '& .ms-DetailsRow-cell .ms-Link.is-disabled': {\r\n color: `${core.palette.neutralTertiary}`,\r\n },\r\n },\r\n '& .target-remove-btn': {\r\n fontSize: '14px',\r\n },\r\n '& .target-custom-header': {\r\n borderRight: `1px solid ${core.palette.neutralLight}`,\r\n },\r\n '& .ms-DetailsRow-cell': {\r\n paddingTop: '5px',\r\n paddingBottom: '5px',\r\n lineHeight: '30px',\r\n },\r\n '& .border-right': {\r\n borderRight: `1px solid ${core.palette.neutralLight}`,\r\n },\r\n },\r\n '& .ms-TextField-fieldGroup::after': {\r\n border: '0px',\r\n },\r\n },\r\n '& .target-add-btn': {\r\n marginTop: '12px',\r\n },\r\n '& .green-dot label': {\r\n '&:before': {\r\n width: '10px',\r\n height: '10px',\r\n borderRadius: '5px',\r\n display: 'inline-block',\r\n content: '\"\"',\r\n backgroundColor: `${core.palette.green}`,\r\n marginRight: '5px',\r\n },\r\n },\r\n '& input:focus': {\r\n outline: 'none',\r\n },\r\n '& .input-error-border .ms-TextField-fieldGroup': {\r\n borderColor: `${core.semanticColors && core.semanticColors.errorIcon}`,\r\n },\r\n\r\n },\r\n});\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\n\r\nimport React, { useContext, useState, useCallback, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\nimport _, { constant, compose, mapObject } from 'underscore';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { Link, FontIcon } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { TargetDetailList } from './components/detail-list';\r\nimport { getStyles } from './style';\r\nimport { validateFn } from './components/generate-column';\r\nimport { ErrorString } from './components/shared';\r\nimport { isValueOverlap, setIsDirtyByNotifyFn, overlapErrorMsg } from './components/utility';\r\n\r\nexport const usePageControl = () => {\r\n const [pageNumber, setPageNumber] = useState(1);\r\n const [pageSize, setPageSize] = useState(20);\r\n\r\n return {\r\n pageNumber, setPageNumber, pageSize, setPageSize,\r\n };\r\n};\r\n\r\nexport const GridTargetsBaseApp = (props) => {\r\n const i18n = useContext(I18nContext);\r\n const {\r\n data,\r\n setData,\r\n basicConfig,\r\n handleAddLine,\r\n getFieldErrorMsg,\r\n classes,\r\n validateParams,\r\n apiErrors,\r\n patchTargetsApiErrMsg,\r\n } = props;\r\n\r\n const [isDirty, setIsDirty] = useState({});\r\n const [errMsg, setErrMsg] = useState('');\r\n const [keySuffix, setKeySuffix] = useState('');\r\n\r\n const {\r\n pageNumber, setPageNumber, pageSize, setPageSize,\r\n } = usePageControl();\r\n\r\n const {\r\n enablePagination,\r\n } = basicConfig;\r\n\r\n const shift = enablePagination ? (pageNumber - 1) * pageSize : 0;\r\n\r\n const debounceFn = useCallback(_.debounce((callback) => { callback(); }, 500), []);\r\n const handleChangeInput = useCallback((...rest) => {\r\n const [{ fieldName, index }, value] = rest;\r\n const realIndex = index + shift;\r\n const currentLevelSettings = [...data.currentLevelSettings];\r\n currentLevelSettings[realIndex] = { ...currentLevelSettings[realIndex], [fieldName]: value };\r\n props.setData({ ...data, currentLevelSettings });\r\n }, [data, props, shift]);\r\n\r\n const handleBatchChangeInput = useCallback((...rest) => {\r\n const [{ fieldName, index }] = rest;\r\n const realIndex = index + shift;\r\n const currentLevelSettings = [...data.currentLevelSettings];\r\n currentLevelSettings[realIndex] = { ...currentLevelSettings[realIndex], ...fieldName };\r\n props.setData({ ...data, currentLevelSettings });\r\n }, [data, props, shift]);\r\n\r\n\r\n const setIsDirtyByNotify = useCallback(() => {\r\n setIsDirtyByNotifyFn({ data, setKeySuffix, setIsDirty });\r\n }, [data.reset, data.isInvalid, data.remove]);\r\n setIsDirtyByNotify();\r\n\r\n // When the valid value range or input value changes, check again, show or hide error message on the top right corner of jumbo card.\r\n useEffect(() => { setErrMsg(isValueOverlap(validateParams.targetName, data.currentLevelSettings)); debounceFn(() => validateFn(validateParams)); }, [data.currentLevelSettings, data.useParentLevel, basicConfig.minBid, basicConfig.maxBid, basicConfig.extraBid, basicConfig.onlyExtra]);\r\n useEffect(() => { setKeySuffix(new Date().getTime()); }, [data.useParentLevel]);\r\n useEffect(() => {\r\n if ((!_.isEmpty(isDirty) || data.useParentLevel) && apiErrors && apiErrors.length) {\r\n patchTargetsApiErrMsg(validateParams.targetName, []);\r\n }\r\n }, [isDirty, data.useParentLevel]);\r\n const localizeErrorMsg = useCallback(\r\n error => (overlapErrorMsg[error] ? i18n.getString(overlapErrorMsg[error]) : error),\r\n [i18n]\r\n );\r\n\r\n return (\r\n <div className={classnames(classes.criterionSettingContainer, 'criterion-setting-container')}>\r\n <div className={classnames(basicConfig.extraClass ? basicConfig.extraClass : '', 'table-container')}>\r\n <TargetDetailList\r\n columns={basicConfig.columns}\r\n minBid={basicConfig.minBid}\r\n maxBid={basicConfig.maxBid}\r\n extraBid={basicConfig.extraBid}\r\n onlyExtra={basicConfig.onlyExtra}\r\n data={data}\r\n setData={setData}\r\n isDirty={isDirty}\r\n setIsDirty={setIsDirty}\r\n showAddBtn={basicConfig.showAddBtn}\r\n noBidAdjustment={basicConfig.noBidAdjustment}\r\n handleChangeInput={handleChangeInput}\r\n handleBatchChangeInput={handleBatchChangeInput}\r\n getFieldErrorMsg={getFieldErrorMsg}\r\n enablePagination={basicConfig.enablePagination}\r\n disableDecrease={basicConfig.disableDecrease}\r\n pageNumber={pageNumber}\r\n setPageNumber={setPageNumber}\r\n pageSize={pageSize}\r\n setPageSize={setPageSize}\r\n hideWhenEmpty={basicConfig.hideWhenEmpty}\r\n validateParams={validateParams}\r\n keySuffix={keySuffix}\r\n patchTargetsApiErrMsg={patchTargetsApiErrMsg}\r\n />\r\n </div>\r\n {!data.useParentLevel && errMsg && <ErrorString error={localizeErrorMsg(errMsg)} />}\r\n {\r\n basicConfig.showAddBtn && (\r\n <div>\r\n <Link className=\"target-add-btn\" disabled={data.useParentLevel || (basicConfig.maxLimit && data.currentLevelSettings.filter(item => item.Status !== 'Deleted').length >= basicConfig.maxLimit)} onClick={handleAddLine}>\r\n <FontIcon aria-label=\"Add\" iconName=\"Add\" /> {i18n.getString(_TL_('Add another'))}\r\n </Link>\r\n </div>\r\n )\r\n }\r\n </div>\r\n );\r\n};\r\n\r\n\r\nGridTargetsBaseApp.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n setData: PropTypes.func,\r\n basicConfig: PropTypes.shape({}).isRequired,\r\n handleAddLine: PropTypes.func,\r\n getFieldErrorMsg: PropTypes.func,\r\n classes: PropTypes.shape(mapObject(\r\n getStyles({}, { palette: {} }),\r\n constant(PropTypes.string.isRequired)\r\n )).isRequired,\r\n validateParams: PropTypes.shape({}),\r\n patchTargetsApiErrMsg: PropTypes.func,\r\n apiErrors: PropTypes.arrayOf(PropTypes.string),\r\n};\r\n\r\nGridTargetsBaseApp.defaultProps = {\r\n setData() {},\r\n handleAddLine() { },\r\n getFieldErrorMsg() { },\r\n validateParams: {},\r\n patchTargetsApiErrMsg() {},\r\n apiErrors: [],\r\n};\r\n\r\nexport const GridTargetsBase = compose(WrappedComponent => withDefaultStyles(WrappedComponent, getStyles))(GridTargetsBaseApp);\r\n","import { globalErrorMsg } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { validateBidAdjustment, isValueOverlap } from '../components/utility';\r\nimport { validateAdvancedBookingDays } from './utility';\r\n\r\nexport function getAbwBasicConfig(i18n) {\r\n const columns = [\r\n {\r\n key: 'minimum-days', name: i18n.getString(_TL_('Minimum days')), fieldName: 'minimumDays', minWidth: 100, maxWidth: 117, type: 'input', className: 'border-right', headerClassName: 'target-custom-header',\r\n },\r\n {\r\n key: 'maximum-days', name: i18n.getString(_TL_('Maximum days')), fieldName: 'maximumDays', minWidth: 100, maxWidth: 127, type: 'input', className: 'border-right', headerClassName: 'target-custom-header',\r\n },\r\n ];\r\n return {\r\n basicConfig: {\r\n columns,\r\n showAddBtn: true,\r\n showSettingToggle: true,\r\n titleKey: i18n.getString(_TL_('Advanced booking window')),\r\n topicKey: 'pop_BA_CampaignTargets_AdvancedBookingWindow',\r\n maxLimit: 10,\r\n minBid: -90,\r\n maxBid: 900,\r\n extraBid: [-100],\r\n },\r\n };\r\n}\r\n\r\n\r\nexport const advancedBookingDefaultSetting = [{\r\n minimumDays: '',\r\n maximumDays: '',\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n}];\r\n\r\nexport const isABWTargetValid = (ABW, patchErrMsg = function () { }) => {\r\n let isValid = true;\r\n ABW.filter(item => item.Status !== 'Deleted').forEach((item) => {\r\n let validateValue = item.bidAdjustmentInput;\r\n if (item.bidAdjustmentDropdown === 'Decrease by') {\r\n validateValue = -validateValue;\r\n }\r\n if (validateBidAdjustment({\r\n value: validateValue, min: -90, max: 900, extra: [-100],\r\n }) || validateAdvancedBookingDays({ value: item.minimumDays }) || validateAdvancedBookingDays({ value: item.maximumDays })) {\r\n isValid = false;\r\n }\r\n });\r\n if (isValueOverlap('ABW', ABW)) {\r\n isValid = false;\r\n }\r\n\r\n if (isValid) {\r\n patchErrMsg('ABW', '');\r\n } else {\r\n patchErrMsg('ABW', globalErrorMsg);\r\n }\r\n return isValid;\r\n};\r\n\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { GridTargetsBase } from '../grid-target-base';\r\nimport { validateAdvancedBookingDays, getValidateAdvancedBookingDaysErrorMsg } from './utility';\r\nimport { areEqual } from '../components/utility';\r\nimport { getAbwBasicConfig, advancedBookingDefaultSetting } from './basic-config';\r\n\r\nexport const AdvancedBookingWindowTargetSetting = React.memo((props) => {\r\n const i18n = useContext(I18nContext);\r\n const {\r\n data, setData, patchErrMsg, patchTargetsApiErrMsg, apiErrors,\r\n } = props;\r\n const advancedBookingDaysError = value => getValidateAdvancedBookingDaysErrorMsg({ code: validateAdvancedBookingDays({ value }), i18n });\r\n\r\n const handleAddLine = () => {\r\n const currentLevelSettings = [...data.currentLevelSettings, ...advancedBookingDefaultSetting];\r\n props.setData({ ...data, currentLevelSettings });\r\n };\r\n\r\n const params = {\r\n ...getAbwBasicConfig(i18n),\r\n handleAddLine,\r\n getFieldErrorMsg: advancedBookingDaysError,\r\n validateParams: { targetId: 'abw-target-wrapper', patchErrMsg, targetName: 'ABW' },\r\n patchTargetsApiErrMsg,\r\n apiErrors,\r\n };\r\n\r\n\r\n return (\r\n <div id=\"abw-target-wrapper\">\r\n <GridTargetsBase data={data} setData={setData} {...params} />\r\n </div>\r\n );\r\n}, areEqual);\r\n\r\nAdvancedBookingWindowTargetSetting.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n setData: PropTypes.func.isRequired,\r\n patchErrMsg: PropTypes.func,\r\n patchTargetsApiErrMsg: PropTypes.func,\r\n apiErrors: PropTypes.arrayOf(PropTypes.string),\r\n};\r\n\r\nAdvancedBookingWindowTargetSetting.defaultProps = {\r\n patchErrMsg() { },\r\n patchTargetsApiErrMsg() {},\r\n apiErrors: [],\r\n};\r\n","import { globalErrorMsg } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { validateBidAdjustment } from '../components/utility';\r\n\r\nexport function getCheckinDayBasicConfig(i18n) {\r\n const columns = [\r\n {\r\n key: 'day', name: i18n.getString(_TL_('Day of the week')), fieldName: 'day', minWidth: 100, maxWidth: 117, type: 'string', className: 'border-right', headerClassName: 'target-custom-header',\r\n },\r\n ];\r\n return {\r\n basicConfig: {\r\n columns,\r\n showAddBtn: false,\r\n showSettingToggle: true,\r\n titleKey: i18n.getString(_TL_('Check-in day')),\r\n topicKey: 'pop_BA_CampaignTargets_CheckinDay',\r\n minBid: -90,\r\n maxBid: 900,\r\n extraBid: [-100],\r\n },\r\n };\r\n}\r\n\r\n\r\nexport const checkinDayDefaultSetting = [{\r\n day: _TL_('Monday'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n},\r\n{\r\n day: _TL_('Tuesday'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n},\r\n{\r\n day: _TL_('Wednesday'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n},\r\n{\r\n day: _TL_('Thursday'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n},\r\n{\r\n day: _TL_('Friday'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n},\r\n{\r\n day: _TL_('Saturday'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n},\r\n{\r\n day: _TL_('Sunday'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n}];\r\n\r\nexport const isCheckinDayTargetValid = (checkinDay, patchErrMsg = function () { }) => {\r\n let isValid = true;\r\n\r\n checkinDay.filter(item => item.Status !== 'Deleted').forEach((item) => {\r\n let validateValue = item.bidAdjustmentInput;\r\n if (item.bidAdjustmentDropdown === 'Decrease by') {\r\n validateValue = -validateValue;\r\n }\r\n if (validateBidAdjustment({\r\n value: validateValue, min: -90, max: 900, extra: [-100],\r\n })) {\r\n isValid = false;\r\n }\r\n });\r\n if (isValid) {\r\n patchErrMsg('checkinDay', '');\r\n } else {\r\n patchErrMsg('checkinDay', globalErrorMsg);\r\n }\r\n return isValid;\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { GridTargetsBase } from '../grid-target-base';\r\nimport { getCheckinDayBasicConfig } from './basic-config';\r\nimport { areEqual } from '../components/utility';\r\n\r\nexport const CheckinDayTargetSetting = React.memo((props) => {\r\n const i18n = useContext(I18nContext);\r\n const {\r\n data, setData, patchErrMsg, patchTargetsApiErrMsg, apiErrors,\r\n } = props;\r\n\r\n const params = {\r\n ...getCheckinDayBasicConfig(i18n),\r\n validateParams: { targetId: 'check-in-day-target-wrapper', patchErrMsg, targetName: 'checkinDay' },\r\n patchTargetsApiErrMsg,\r\n apiErrors,\r\n };\r\n\r\n return (\r\n <div id=\"check-in-day-target-wrapper\">\r\n <GridTargetsBase data={data} setData={setData} {...params} />\r\n </div>\r\n );\r\n}, areEqual);\r\n\r\nCheckinDayTargetSetting.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n setData: PropTypes.func.isRequired,\r\n patchErrMsg: PropTypes.func,\r\n patchTargetsApiErrMsg: PropTypes.func,\r\n apiErrors: PropTypes.arrayOf(PropTypes.string),\r\n};\r\nCheckinDayTargetSetting.defaultProps = {\r\n patchErrMsg() {},\r\n patchTargetsApiErrMsg() {},\r\n apiErrors: [],\r\n};\r\n","\r\nimport { globalErrorMsg } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { validateBidAdjustment } from '../components/utility';\r\n\r\nexport function getUserSetDatesBasicConfig(i18n) {\r\n const columns = [\r\n {\r\n key: 'dates', name: '', fieldName: 'dates', minWidth: 100, maxWidth: 135, type: 'string', className: 'border-right', headerClassName: 'target-custom-header',\r\n },\r\n ];\r\n return {\r\n basicConfig: {\r\n columns,\r\n showAddBtn: false,\r\n showSettingToggle: true,\r\n titleKey: i18n.getString(_TL_('User set dates')),\r\n topicKey: 'pop_BA_CampaignTargets_UserSetDates',\r\n minBid: -50,\r\n maxBid: 100,\r\n },\r\n };\r\n}\r\n\r\nexport const userSetDatesDefaultSetting = [\r\n {\r\n dates: _TL_('Selected date'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n },\r\n {\r\n dates: _TL_('Default date'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n }];\r\n\r\nexport const isUserSetDatesTargetValid = (userSetDates, patchErrMsg = function () { }) => {\r\n let isValid = true;\r\n\r\n userSetDates.filter(item => item.Status !== 'Deleted').forEach((item) => {\r\n let validateValue = item.bidAdjustmentInput;\r\n if (item.bidAdjustmentDropdown === 'Decrease by') {\r\n validateValue = -validateValue;\r\n }\r\n if (validateBidAdjustment({\r\n value: validateValue, min: -90, max: 900, extra: [-100],\r\n })) {\r\n isValid = false;\r\n }\r\n });\r\n\r\n if (isValid) {\r\n patchErrMsg('userSetDates', '');\r\n } else {\r\n patchErrMsg('userSetDates', globalErrorMsg);\r\n }\r\n return isValid;\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { GridTargetsBase } from '../grid-target-base';\r\nimport { getUserSetDatesBasicConfig } from './basic-config';\r\nimport { areEqual } from '../components/utility';\r\n\r\nexport const UserSetDatesTargetSetting = React.memo((props) => {\r\n const i18n = useContext(I18nContext);\r\n const {\r\n data, setData, patchErrMsg, patchTargetsApiErrMsg, apiErrors,\r\n } = props;\r\n\r\n const params = {\r\n ...getUserSetDatesBasicConfig(i18n),\r\n validateParams: { targetId: 'user-set-dates-target-wrapper', patchErrMsg, targetName: 'userSetDates' },\r\n patchTargetsApiErrMsg,\r\n apiErrors,\r\n };\r\n\r\n return (\r\n <div id=\"user-set-dates-target-wrapper\">\r\n <GridTargetsBase data={data} setData={setData} {...params} />\r\n </div>\r\n );\r\n}, areEqual);\r\n\r\nUserSetDatesTargetSetting.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n setData: PropTypes.func.isRequired,\r\n patchErrMsg: PropTypes.func,\r\n patchTargetsApiErrMsg: PropTypes.func,\r\n apiErrors: PropTypes.arrayOf(PropTypes.string),\r\n};\r\nUserSetDatesTargetSetting.defaultProps = {\r\n patchErrMsg() {},\r\n patchTargetsApiErrMsg() {},\r\n apiErrors: [],\r\n};\r\n","import { globalErrorMsg } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { validateBidAdjustment, isValueOverlap } from '../components/utility';\r\nimport { validateCheckinDate } from './utility';\r\n\r\nexport function getCheckinDateBasicConfig(i18n) {\r\n const columns = [\r\n {\r\n key: 'start-date', name: i18n.getString(_TL_('Start check-in date')), fieldName: 'startDate', minWidth: 200, maxWidth: 245, type: 'datePicker', className: 'border-right', headerClassName: 'target-custom-header',\r\n },\r\n {\r\n key: 'end-date', name: i18n.getString(_TL_('End check-in date')), fieldName: 'endDate', minWidth: 200, maxWidth: 240, type: 'datePicker', className: 'border-right', headerClassName: 'target-custom-header',\r\n },\r\n ];\r\n return {\r\n basicConfig: {\r\n columns,\r\n showAddBtn: true,\r\n showSettingToggle: true,\r\n titleKey: i18n.getString(_TL_('Check-in date')),\r\n topicKey: 'pop_BA_CampaignTargets_CheckinDate',\r\n extraClass: 'checkin-date-container',\r\n maxLimit: 30,\r\n minBid: -90,\r\n maxBid: 900,\r\n extraBid: [-100],\r\n },\r\n };\r\n}\r\n\r\n\r\nexport const checkinDateDefaultSetting = [{\r\n startDate: '',\r\n endDate: '',\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n}];\r\n\r\n\r\nexport const isCheckinDateTargetValid = (checkinDate, patchErrMsg = function () { }) => {\r\n let isValid = true;\r\n\r\n checkinDate.filter(item => item.Status !== 'Deleted').forEach((item) => {\r\n let validateValue = item.bidAdjustmentInput;\r\n if (item.bidAdjustmentDropdown === 'Decrease by') {\r\n validateValue = -validateValue;\r\n }\r\n if (validateBidAdjustment({\r\n value: validateValue, min: -90, max: 900, extra: [-100],\r\n }) || validateCheckinDate({ value: item.startDate }) || validateCheckinDate({ value: item.endDate })) {\r\n isValid = false;\r\n }\r\n });\r\n if (isValueOverlap('checkinDate', checkinDate)) {\r\n isValid = false;\r\n }\r\n if (isValid) {\r\n patchErrMsg('checkinDate', '');\r\n } else {\r\n patchErrMsg('checkinDate', globalErrorMsg);\r\n }\r\n return isValid;\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { GridTargetsBase } from '../grid-target-base';\r\nimport { getCheckinDateBasicConfig, checkinDateDefaultSetting } from './basic-config';\r\nimport { areEqual } from '../components/utility';\r\nimport { getValidateCheckinDateErrorMsg } from './utility';\r\n\r\nexport const CheckinDateTargetSetting = React.memo((props) => {\r\n const i18n = useContext(I18nContext);\r\n const {\r\n data, setData, patchErrMsg, patchTargetsApiErrMsg, apiErrors,\r\n } = props;\r\n const checkinDateError = value => getValidateCheckinDateErrorMsg({ code: { value }, i18n });\r\n\r\n const handleAddLine = () => {\r\n const currentLevelSettings = [...data.currentLevelSettings, ...checkinDateDefaultSetting];\r\n props.setData({ ...data, currentLevelSettings });\r\n };\r\n const params = {\r\n ...getCheckinDateBasicConfig(i18n),\r\n handleAddLine,\r\n getFieldErrorMsg: checkinDateError,\r\n validateParams: { targetId: 'check-in-date-target-wrapper', patchErrMsg, targetName: 'checkinDate' },\r\n patchTargetsApiErrMsg,\r\n apiErrors,\r\n };\r\n\r\n return (\r\n <div id=\"check-in-date-target-wrapper\">\r\n <GridTargetsBase data={data} setData={setData} {...params} />\r\n </div>\r\n\r\n );\r\n}, areEqual);\r\n\r\nCheckinDateTargetSetting.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n setData: PropTypes.func.isRequired,\r\n patchErrMsg: PropTypes.func,\r\n patchTargetsApiErrMsg: PropTypes.func,\r\n apiErrors: PropTypes.arrayOf(PropTypes.string),\r\n};\r\nCheckinDateTargetSetting.defaultProps = {\r\n patchErrMsg() {},\r\n patchTargetsApiErrMsg() {},\r\n apiErrors: [],\r\n};\r\n","import { globalErrorMsg } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { validateBidAdjustment, isValueOverlap } from '../components/utility';\r\nimport { validateLengthOfStayDays } from './utility';\r\n\r\nexport function getLengthOfStayBasicConfig(i18n) {\r\n const columns = [\r\n {\r\n key: 'minimum-number', name: i18n.getString(_TL_('Minimum number of nights')), fieldName: 'minimumNumber', minWidth: 188, maxWidth: 188, type: 'input', className: 'border-right', headerClassName: 'target-custom-header',\r\n },\r\n {\r\n key: 'maximum-number', name: i18n.getString(_TL_('Maximum number of nights')), fieldName: 'maximumNumber', minWidth: 198, maxWidth: 198, type: 'input', className: 'border-right', headerClassName: 'target-custom-header',\r\n },\r\n ];\r\n return {\r\n basicConfig: {\r\n columns,\r\n showAddBtn: true,\r\n showSettingToggle: true,\r\n titleKey: i18n.getString(_TL_('Length of stay')),\r\n topicKey: 'pop_BA_CampaignTargets_LengthOfStay',\r\n extraClass: 'length-of-stay-container',\r\n maxLimit: 30,\r\n minBid: -90,\r\n maxBid: 900,\r\n extraBid: [-100],\r\n },\r\n };\r\n}\r\n\r\n\r\nexport const lengthOfStayDefaultSetting = [{\r\n minimumNumber: '',\r\n maximumNumber: '',\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n}];\r\n\r\nexport const isLengthOfStayTargetValid = (lengthOfStay, patchErrMsg = function () { }) => {\r\n let isValid = true;\r\n\r\n lengthOfStay.filter(item => item.Status !== 'Deleted').forEach((item) => {\r\n let validateValue = item.bidAdjustmentInput;\r\n if (item.bidAdjustmentDropdown === 'Decrease by') {\r\n validateValue = -validateValue;\r\n }\r\n if (validateBidAdjustment({\r\n value: validateValue, min: -90, max: 900, extra: [-100],\r\n }) || validateLengthOfStayDays({ value: item.minimumNumber }) || validateLengthOfStayDays({ value: item.maximumNumber })) {\r\n isValid = false;\r\n }\r\n });\r\n if (isValueOverlap('lengthOfStay', lengthOfStay)) {\r\n isValid = false;\r\n }\r\n if (isValid) {\r\n patchErrMsg('lengthOfStay', '');\r\n } else {\r\n patchErrMsg('lengthOfStay', globalErrorMsg);\r\n }\r\n return isValid;\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { GridTargetsBase } from '../grid-target-base';\r\nimport { validateLengthOfStayDays, getValidateLengthOfStayDaysErrorMsg, } from './utility';\r\nimport { getLengthOfStayBasicConfig, lengthOfStayDefaultSetting } from './basic-config';\r\nimport { areEqual } from '../components/utility';\r\n\r\nexport const LengthOfStayTargetSetting = React.memo((props) => {\r\n const i18n = useContext(I18nContext);\r\n const {\r\n data, setData, patchErrMsg, patchTargetsApiErrMsg, targetsApiErrMsg,\r\n } = props;\r\n const lengthOfStayDatesError = value => getValidateLengthOfStayDaysErrorMsg({ code: validateLengthOfStayDays({ value }), i18n });\r\n\r\n const handleAddLine = () => {\r\n const currentLevelSettings = [...data.currentLevelSettings, ...lengthOfStayDefaultSetting];\r\n props.setData({ ...data, currentLevelSettings });\r\n };\r\n\r\n const params = {\r\n ...getLengthOfStayBasicConfig(i18n),\r\n handleAddLine,\r\n getFieldErrorMsg: lengthOfStayDatesError,\r\n validateParams: { targetId: 'length-of-stay-target-wrapper', patchErrMsg, targetName: 'lengthOfStay' },\r\n patchTargetsApiErrMsg,\r\n targetsApiErrMsg,\r\n };\r\n\r\n return (\r\n <div id=\"length-of-stay-target-wrapper\">\r\n <GridTargetsBase data={data} setData={setData} {...params} />\r\n </div>\r\n );\r\n}, areEqual);\r\n\r\nLengthOfStayTargetSetting.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n setData: PropTypes.func.isRequired,\r\n patchErrMsg: PropTypes.func,\r\n patchTargetsApiErrMsg: PropTypes.func,\r\n targetsApiErrMsg: PropTypes.arrayOf(PropTypes.string),\r\n};\r\nLengthOfStayTargetSetting.defaultProps = {\r\n patchErrMsg() {},\r\n patchTargetsApiErrMsg() {},\r\n targetsApiErrMsg: [],\r\n};\r\n","import _ from 'underscore';\r\n\r\nimport { globalErrorMsg } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { validateBidAdjustment } from '../components/utility';\r\n\r\nexport function getDeviceBasicConfig(i18n, campaignBidStrategyType, showTargetedColumn = true) {\r\n const columns = _.compact([\r\n showTargetedColumn ? ({\r\n key: 'targeted', name: '', fieldName: 'targeted', minWidth: 100, maxWidth: 135, type: 'string', className: 'border-right green-dot', headerClassName: 'target-custom-header',\r\n }) : null,\r\n {\r\n key: 'device', name: i18n.getString(_TL_('Device')), fieldName: 'device', minWidth: 100, maxWidth: 135, type: 'string', className: 'border-right', headerClassName: 'target-custom-header',\r\n },\r\n ]);\r\n\r\n const isCommission = campaignBidStrategyType === 'Commission';\r\n return {\r\n basicConfig: {\r\n columns,\r\n showAddBtn: false,\r\n showSettingToggle: true,\r\n titleKey: i18n.getString(_TL_('Device')),\r\n topicKey: 'pop_BA_CampaignTargets_Device',\r\n minBid: -90,\r\n maxBid: 900,\r\n extraBid: isCommission ? [-100, 0] : [-100],\r\n onlyExtra: isCommission,\r\n },\r\n };\r\n}\r\n\r\nexport const deviceDefaultSetting = [\r\n {\r\n targeted: _TL_('Targeted'),\r\n device: _TL_('Computer'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n },\r\n {\r\n targeted: _TL_('Targeted'),\r\n device: _TL_('Tablet'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n },\r\n {\r\n targeted: _TL_('Targeted'),\r\n device: _TL_('Smartphone'),\r\n bidAdjustmentDropdown: 'Increase by',\r\n bidAdjustmentInput: 0,\r\n }];\r\n\r\nexport const isDeviceTargetValid = (device, patchErrMsg = function () { }, campaignBidStrategyType) => {\r\n let isValid = true;\r\n const isCommission = campaignBidStrategyType === 'Commission';\r\n device.filter(item => item.Status !== 'Deleted').forEach((item) => {\r\n let validateValue = item.bidAdjustmentInput;\r\n if (item.bidAdjustmentDropdown === 'Decrease by') {\r\n validateValue = -validateValue;\r\n }\r\n if (validateBidAdjustment({\r\n value: validateValue,\r\n min: -90,\r\n max: 900,\r\n extra: isCommission ? [-100, 0] : [-100],\r\n onlyExtra: isCommission,\r\n })) {\r\n isValid = false;\r\n }\r\n });\r\n if (isValid) {\r\n patchErrMsg('device', '');\r\n } else {\r\n patchErrMsg('device', globalErrorMsg);\r\n }\r\n\r\n return isValid;\r\n};\r\n\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { GridTargetsBase } from '../grid-target-base';\r\nimport { getDeviceBasicConfig } from './basic-config';\r\n\r\nexport const DeviceTargetSetting = React.memo((props) => {\r\n const i18n = useContext(I18nContext);\r\n const {\r\n data, setData, patchErrMsg, patchTargetsApiErrMsg, apiErrors, bidStrategyType, showTargetedColumn,\r\n } = props;\r\n\r\n const params = {\r\n ...getDeviceBasicConfig(i18n, bidStrategyType, showTargetedColumn),\r\n validateParams: { targetId: 'device-target-wrapper', patchErrMsg, targetName: 'device' },\r\n patchTargetsApiErrMsg,\r\n apiErrors,\r\n };\r\n\r\n return (\r\n <div id=\"device-target-wrapper\">\r\n <GridTargetsBase data={data} setData={setData} {...params} />\r\n </div>\r\n );\r\n}, (prevProps, nextProps) => prevProps.data === nextProps.data && prevProps.bidStrategyType === nextProps.bidStrategyType);\r\n\r\nDeviceTargetSetting.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n setData: PropTypes.func.isRequired,\r\n patchErrMsg: PropTypes.func,\r\n patchTargetsApiErrMsg: PropTypes.func,\r\n apiErrors: PropTypes.arrayOf(PropTypes.string),\r\n bidStrategyType: PropTypes.string,\r\n showTargetedColumn: PropTypes.bool,\r\n};\r\n\r\nDeviceTargetSetting.defaultProps = {\r\n patchErrMsg() { },\r\n patchTargetsApiErrMsg() { },\r\n apiErrors: [],\r\n bidStrategyType: '',\r\n showTargetedColumn: true,\r\n};\r\n","import targetConstants from '@bingads-webui-campaign-legacy/base-targets/viewmodel/targetConstants';\r\nimport { locationTargetsOptionKeys } from '@bingads-webui-campaign-react/wizard-shared-components';\r\n\r\nexport function getIncludedLocationBasicConfig(i18n) {\r\n const columns = [\r\n {\r\n key: 'icon', name: '', fieldName: 'icon', minWidth: 32, maxWidth: 32, type: 'plainString', headerClassName: 'target-custom-header', raw: true, spanClassName: 'map-icon__pin--included', className: 'col-icon',\r\n },\r\n {\r\n key: 'location', name: i18n.getString(_TL_('Targeted locations')), fieldName: 'location', minWidth: 100, maxWidth: 333, type: 'plainString', headerClassName: 'target-custom-header',\r\n },\r\n ];\r\n return {\r\n basicConfig: {\r\n columns,\r\n showSettingToggle: true,\r\n enablePagination: true,\r\n hideWhenEmpty: true,\r\n minBid: -targetConstants.minimumBid.Location,\r\n maxBid: targetConstants.maximumBid.Location,\r\n },\r\n };\r\n}\r\n\r\nexport function getExcludedLocationBasicConfig(i18n) {\r\n const columns = [\r\n {\r\n key: 'icon', name: '', fieldName: 'icon', minWidth: 32, maxWidth: 32, type: 'plainString', headerClassName: 'target-custom-header', spanClassName: 'map-icon__pin--excluded', className: 'col-icon',\r\n },\r\n {\r\n key: 'location', name: i18n.getString('Excluded locations'), fieldName: 'location', minWidth: 100, maxWidth: 333, type: 'plainString', headerClassName: 'target-custom-header',\r\n },\r\n ];\r\n return {\r\n basicConfig: {\r\n columns,\r\n showSettingToggle: true,\r\n noBidAdjustment: true,\r\n enablePagination: true,\r\n hideWhenEmpty: true,\r\n },\r\n };\r\n}\r\n\r\nexport const defaultLocationData = {\r\n parentLevelSettings: {},\r\n currentLevelSettings: {\r\n targetOption: locationTargetsOptionKeys.everywhere,\r\n initLocations: [],\r\n peopleInLocation: true,\r\n peopleSearchingForLocation: true,\r\n },\r\n useParentLevel: false,\r\n bidMode: false,\r\n};\r\n","import React, { useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { GridTargetsBase } from '../grid-target-base';\r\nimport { getIncludedLocationBasicConfig, getExcludedLocationBasicConfig } from './basic-config';\r\nimport { areEqual } from '../components/utility';\r\n\r\nexport const IncludedLocationGrid = React.memo((props) => {\r\n const i18n = useContext(I18nContext);\r\n const { data, setData } = props;\r\n\r\n const params = {\r\n ...getIncludedLocationBasicConfig(i18n),\r\n };\r\n\r\n return (\r\n <div className=\"included-location-target-wrapper\">\r\n <GridTargetsBase data={data} setData={setData} {...params} />\r\n </div>\r\n );\r\n}, areEqual);\r\n\r\nIncludedLocationGrid.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n setData: PropTypes.func.isRequired,\r\n};\r\n\r\n\r\nexport const ExcludedLocationGrid = React.memo((props) => {\r\n const i18n = useContext(I18nContext);\r\n const { data } = props;\r\n\r\n const params = {\r\n ...getExcludedLocationBasicConfig(i18n),\r\n };\r\n\r\n return (\r\n <div className=\"excluded-location-target-wrapper\">\r\n <GridTargetsBase data={data} {...params} />\r\n </div>\r\n );\r\n}, areEqual);\r\n\r\nExcludedLocationGrid.propTypes = {\r\n data: PropTypes.shape({}).isRequired,\r\n setData: PropTypes.func.isRequired,\r\n};\r\n\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport { SEARCH_TYPE, LocationTarget } from '@bingads-webui-react/bing-maps';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport _ from 'underscore';\r\nimport odata from '@bingads-webui-component-legacy/http/channel/odata';\r\nimport { edmCampaign } from '@bingads-webui/edm-campaign';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\nimport { RadioGroup } from '@bingads-webui-react/radio';\r\nimport React, { useContext, useMemo, useCallback, useEffect, useRef, Fragment } from 'react';\r\nimport { PrimaryButton, DefaultButton, Stack, Link, Label, Checkbox, Toggle } from '@bingads-webui-react/fabric-control';\r\nimport * as languageBundle from '@bingads-webui-campaign-legacy/location-targets/util/languageBundle';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { Disclaimer } from '@bingads-webui-campaign/hotel-common-upsert';\r\nimport { SpecificLocationTargetsEditor, ErrorString, withVerticalAlignCenterSpan, Errors, checkShouldShowErrors, locationTargetsOptionKeys } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport * as locationTargetConverter from '@bingads-webui-campaign-legacy/location-targets/util/locationTargetConverter';\r\nimport { glyphIconStyle, convertToLocalStyle } from '@bingads-webui-campaign-react/common-styles';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { withPermissions } from '@bingads-webui-react/hoc-with-permissions';\r\nimport { IncludedLocationGrid, ExcludedLocationGrid } from './grid';\r\nimport { validateLocations, locationErrors, getLocationErrorMsg, shouldNotHideInclude } from '../components/utility';\r\n\r\nexport const physicalIntentOptions = {\r\n PeopleIn: 'PeopleIn',\r\n PeopleSearchingForOrViewingPages: 'PeopleSearchingForOrViewingPages',\r\n PeopleInOrSearchingForOrViewingPages: 'PeopleInOrSearchingForOrViewingPages',\r\n};\r\n\r\nexport function convertIntentOption(option) {\r\n if (option.peopleInLocation && option.peopleSearchingForLocation) {\r\n return physicalIntentOptions.PeopleInOrSearchingForOrViewingPages;\r\n } else if (option.peopleInLocation) {\r\n return physicalIntentOptions.PeopleIn;\r\n } else if (option.peopleSearchingForLocation) {\r\n return physicalIntentOptions.PeopleSearchingForOrViewingPages;\r\n }\r\n return physicalIntentOptions.PeopleInOrSearchingForOrViewingPages;\r\n}\r\n\r\nexport function getLocationIntent(option) {\r\n switch (option) {\r\n case physicalIntentOptions.PeopleIn:\r\n return {\r\n peopleInLocation: true,\r\n peopleSearchingForLocation: false,\r\n };\r\n case physicalIntentOptions.PeopleSearchingForOrViewingPages:\r\n return {\r\n peopleInLocation: false,\r\n peopleSearchingForLocation: true,\r\n };\r\n case physicalIntentOptions.PeopleInOrSearchingForOrViewingPages:\r\n default:\r\n return {\r\n peopleInLocation: true,\r\n peopleSearchingForLocation: true,\r\n };\r\n }\r\n}\r\n\r\nexport function patchForLocationTargetGrid(criterion) {\r\n const Criterion = criterion.CriterionType === 'Radius' ? criterion.Criterion.RadiusCriterion : criterion.Criterion.LocationCriterion;\r\n return {\r\n ...criterion,\r\n location: Criterion.NameTypeCombo,\r\n bidAdjustmentDropdown: criterion.Criterion.BidAdjustment >= 0 ? 'Increase by' : 'Decrease by',\r\n bidAdjustmentInput: criterion.Criterion.BidAdjustment == null ? 0 : Math.abs(criterion.Criterion.BidAdjustment),\r\n };\r\n}\r\n\r\nconst RadisUnitMap = {\r\n mi: 'mi',\r\n km: 'km',\r\n Miles: 'mi',\r\n Kilometers: 'km',\r\n};\r\n\r\nexport function getLocationHashWithStatus(criterion) {\r\n const Criterion = criterion.CriterionType === 'Radius' ? criterion.Criterion.RadiusCriterion : criterion.Criterion.LocationCriterion;\r\n return JSON.stringify([\r\n Criterion.LocationId,\r\n Criterion.Type,\r\n Criterion.CountryCode,\r\n Criterion.Latitude,\r\n Criterion.Longitude,\r\n criterion.SelectionStatus,\r\n Criterion.Radius,\r\n RadisUnitMap[Criterion.RadiusUnit],\r\n ]);\r\n}\r\n\r\nexport function getLocationHash(criterion) {\r\n const Criterion = criterion.CriterionType === 'Radius' ? criterion.Criterion.RadiusCriterion : criterion.Criterion.LocationCriterion;\r\n return JSON.stringify({\r\n LocationId: Criterion.LocationId,\r\n Type: Criterion.Type,\r\n Name: Criterion.Name,\r\n CountryCode: Criterion.CountryCode,\r\n Latitude: Criterion.Latitude,\r\n Longitude: Criterion.Longitude,\r\n });\r\n}\r\n\r\nfunction fromBingMapTargetToLocationCriterion(data) {\r\n const isRadius = data.isRadiusLocationTarget;\r\n const isIncluded = data.targetingType === 'Included';\r\n const criterion = isRadius ? locationTargetConverter.buildLocationCriterionFromSearchResult(\r\n data.location,\r\n {\r\n mode: 'radius', radius: data.radiusSize, unit: data.radiusUnit, status: isIncluded ? 'Included' : 'Excluded',\r\n }\r\n ) : locationTargetConverter.buildLocationCriterionFromSearchResult(\r\n data.location,\r\n { mode: 'location', status: isIncluded ? 'Included' : 'Excluded' }\r\n );\r\n\r\n if (isIncluded) {\r\n criterion.SelectionStatus = 'Included';\r\n } else {\r\n criterion.SelectionStatus = 'Excluded';\r\n }\r\n criterion.Id = data.Id;\r\n\r\n return criterion;\r\n}\r\n\r\nfunction createIdAttributes(Ids) {\r\n if (Ids == null) return [];\r\n return Ids.map(Id => ({ Id }));\r\n}\r\n\r\nfunction fromLocationCriterionToBingMapTarget(data) {\r\n if (data) {\r\n // TO DO Need to check how to merge bulkupsert format to criterion odata format\r\n return _.chain(data)\r\n .filter(criterion => criterion.Criterion.Type !== 'LocationIntentOption')\r\n .map((criterion) => {\r\n const Criterion = criterion.CriterionType === 'Radius' ? criterion.Criterion.RadiusCriterion : criterion.Criterion.LocationCriterion;\r\n const isExcluded = criterion.SelectionStatus === 'Excluded';\r\n const ParentLocations = criterion.CriterionType === 'Radius' ? createIdAttributes(Criterion.LocationTargetEnclosingLocationIds) : createIdAttributes(Criterion.EnclosingLocationIds);\r\n const locationTarget =\r\n isExcluded ?\r\n LocationTarget.CreateExcludedLocationTarget({\r\n CountryCode: Criterion.CountryCode,\r\n ExpandedName: Criterion.Name,\r\n GeoPoint: Criterion.GeoPoint ? Criterion.GeoPoint : {\r\n Latitude: Criterion.Latitude,\r\n Longitude: Criterion.Longitude,\r\n },\r\n Id: Criterion.LocationId,\r\n ParentLocations,\r\n Type: Criterion.LocationTargetType || Criterion.LocationType || Criterion.Type,\r\n }, Criterion.Radius, RadisUnitMap[Criterion.RadiusUnit])\r\n : LocationTarget.CreateIncludedLocationTarget({\r\n CountryCode: Criterion.CountryCode,\r\n ExpandedName: Criterion.Name,\r\n GeoPoint: Criterion.GeoPoint ? Criterion.GeoPoint : {\r\n Latitude: Criterion.Latitude,\r\n Longitude: Criterion.Longitude,\r\n },\r\n Id: Criterion.LocationId,\r\n ParentLocations,\r\n Type: Criterion.LocationTargetType || Criterion.LocationType || Criterion.Type,\r\n }, Criterion.Radius, RadisUnitMap[Criterion.RadiusUnit]);\r\n locationTarget.Id = criterion.Id;\r\n return locationTarget;\r\n })\r\n .value();\r\n }\r\n\r\n return [];\r\n}\r\n\r\nexport const LocationTargetsIntent = (props) => {\r\n const {\r\n data,\r\n setData,\r\n isLocationTargetingImprovementEnabled,\r\n } = props;\r\n\r\n const {\r\n peopleInLocation,\r\n peopleSearchingForLocation,\r\n } = data;\r\n\r\n const i18n = useContext(I18nContext);\r\n const peopleInLocationString = i18n.getString(_TL_('People in your targeted locations'));\r\n const peopleSearchingForLocationString = i18n.getString(_TL_('People searching for or viewing pages about your targeted locations'));\r\n const peopleInOrInterestedInLocationString = i18n.getString(_TL_('People in, searching for, or viewing webpages about your targeted locations'));\r\n\r\n // For user who only select original option \"peopleSearchingForLocation\", we will convert it to \"peopleInOrInterestedInLocation\" option\r\n if (isLocationTargetingImprovementEnabled && !peopleInLocation && peopleSearchingForLocation) {\r\n setData({ peopleInLocation: true, peopleSearchingForLocation: true });\r\n }\r\n\r\n const intentOptionsKeysMap = useMemo(() => ({\r\n [physicalIntentOptions.PeopleIn]: (\r\n <>\r\n <span>{peopleInLocationString}</span>\r\n <HelpPopup\r\n topic=\"pop_BA_CampaignCreate_Settings_PhysicalIntentOn\"\r\n aria-label={i18n.getString(_TL_('Click to learn more about {{item}}'), { item: peopleInLocationString })}\r\n />\r\n </>\r\n ),\r\n [physicalIntentOptions.PeopleInOrSearchingForOrViewingPages]: (\r\n <>\r\n <span>{peopleInOrInterestedInLocationString}</span>\r\n <HelpPopup\r\n topic=\"pop_BA_CampaignCreate_Settings_PhysicalIntentOnly\"\r\n aria-label={i18n.getString(_TL_('Click to learn more about {{item}}'), { item: peopleInOrInterestedInLocationString })}\r\n />\r\n </>\r\n ),\r\n }), [i18n, peopleInLocationString, peopleInOrInterestedInLocationString]);\r\n\r\n const intentOptionsKeys = useMemo(() => (_.compact([\r\n physicalIntentOptions.PeopleIn,\r\n physicalIntentOptions.PeopleInOrSearchingForOrViewingPages,\r\n ])), []);\r\n\r\n const checkedRadio = peopleSearchingForLocation ?\r\n physicalIntentOptions.PeopleInOrSearchingForOrViewingPages :\r\n physicalIntentOptions.PeopleIn;\r\n\r\n const onIntentOptionChanged = useCallback((key) => {\r\n if (key === physicalIntentOptions.PeopleIn) {\r\n setData({\r\n peopleInLocation: true,\r\n peopleSearchingForLocation: false,\r\n });\r\n } else {\r\n setData({\r\n peopleInLocation: true,\r\n peopleSearchingForLocation: true,\r\n });\r\n }\r\n }, [setData]);\r\n\r\n return (\r\n <div className={classNames('intent-target')}>\r\n <div className={classNames('title')}>\r\n <Label>{i18n.getString(_TL_('Who should see your ads?'))}</Label>\r\n </div>\r\n <div className={classNames('intent-target-options')}>\r\n {isLocationTargetingImprovementEnabled ?\r\n <ul role=\"radiogroup\" aria-label={i18n.getString(_TL_('Who should see your ads?'))}>\r\n <RadioGroup\r\n items={intentOptionsKeys}\r\n renderItem={key => intentOptionsKeysMap[key]}\r\n onChange={onIntentOptionChanged}\r\n checked={checkedRadio}\r\n getItemId={_.identity}\r\n />\r\n </ul> :\r\n <Stack tokens={{ childrenGap: 8 }}>\r\n <Checkbox\r\n className=\"peopleIn\"\r\n label={peopleInLocationString}\r\n checked={peopleInLocation}\r\n onChange={(ev, isChecked) => {\r\n setData({ peopleInLocation: isChecked });\r\n }}\r\n onRenderLabel={withVerticalAlignCenterSpan(() => (<HelpPopup\r\n topic=\"pop_BA_CampaignCreate_Settings_PhysicalIntentOn\"\r\n aria-label={i18n.getString(_TL_('Click to learn more about {{item}}'), { item: peopleInLocationString })}\r\n />))}\r\n />\r\n <Checkbox\r\n className=\"peopleSearchingFor\"\r\n label={peopleSearchingForLocationString}\r\n checked={peopleSearchingForLocation}\r\n onChange={(ev, isChecked) => {\r\n setData({ peopleSearchingForLocation: isChecked });\r\n }}\r\n onRenderLabel={withVerticalAlignCenterSpan(() => (<HelpPopup\r\n topic=\"pop_BA_CampaignCreate_Settings_PhysicalIntentOnly\"\r\n aria-label={i18n.getString(_TL_('Click to learn more about {{item}}'), { item: peopleSearchingForLocationString })}\r\n />))}\r\n />\r\n {!peopleInLocation && !peopleSearchingForLocation &&\r\n <div role=\"alert\" aria-live=\"polite\">\r\n <ErrorString error={i18n.getString(_TL_('At least one intent option must be selected'))} />\r\n </div>}\r\n </Stack>\r\n }\r\n </div>\r\n </div>);\r\n};\r\n\r\nLocationTargetsIntent.propTypes = {\r\n setData: PropTypes.func.isRequired,\r\n data: PropTypes.shape({}),\r\n isLocationTargetingImprovementEnabled: PropTypes.bool.isRequired,\r\n};\r\n\r\nLocationTargetsIntent.defaultProps = {\r\n data: {},\r\n};\r\n\r\nfunction getIncludedLocations(locations) {\r\n if (locations == null) return [];\r\n return locations.filter(location => location.SelectionStatus === 'Included');\r\n}\r\n\r\nfunction getExcludedLocations(locations) {\r\n if (locations == null) return [];\r\n return locations.filter(location => location.SelectionStatus === 'Excluded');\r\n}\r\n\r\nfunction fillAdditionalInfoToCriterion(location) {\r\n const isPositive = location.bidAdjustmentDropdown === 'Increase by';\r\n // eslint-disable-next-line no-param-reassign\r\n location.Criterion.BidAdjustment = isPositive ? location.bidAdjustmentInput : -location.bidAdjustmentInput;\r\n}\r\n\r\nexport function fillAdditionalInfoToBundleLocationCriterions(currentLocations, bundleLocationCriterions) {\r\n if (bundleLocationCriterions) {\r\n return _.chain(bundleLocationCriterions)\r\n .map((target) => {\r\n const criterion = { ...target };\r\n const hash = getLocationHash(criterion);\r\n const currentLocation = currentLocations.find(current => getLocationHash(current) === hash);\r\n if (currentLocation) {\r\n criterion.Criterion.BidAdjustment = currentLocation.Criterion.BidAdjustment;\r\n criterion.Criterion.OriginalBidAdjustment = currentLocation.Criterion.OriginalBidAdjustment;\r\n }\r\n return patchForLocationTargetGrid(criterion);\r\n })\r\n .value();\r\n }\r\n return [];\r\n}\r\n\r\nfunction fillAdditionalInfoToGrid(currentLocations, newLocations) {\r\n if (newLocations) {\r\n return _.chain(newLocations)\r\n .map((locationTarget) => {\r\n const isIncluded = locationTarget.targetingType === 'Included';\r\n const criterion = fromBingMapTargetToLocationCriterion(locationTarget);\r\n criterion.SelectionStatus = isIncluded ? 'Included' : 'Excluded';\r\n const hash = getLocationHash(criterion);\r\n const currentLocation = currentLocations.find(current => getLocationHash(current) === hash);\r\n if (currentLocation) {\r\n criterion.Criterion.BidAdjustment = currentLocation.Criterion.BidAdjustment;\r\n criterion.Criterion.OriginalBidAdjustment = currentLocation.Criterion.OriginalBidAdjustment;\r\n }\r\n return patchForLocationTargetGrid(criterion);\r\n })\r\n .value();\r\n }\r\n\r\n return [];\r\n}\r\n\r\nconst LocationTargetsEditor = (props) => {\r\n const i18n = useContext(I18nContext);\r\n const {\r\n data,\r\n setData,\r\n isAdGroupLevel,\r\n toggleBidModeAndSetData,\r\n languageBundleString,\r\n bundleLocationCriterions,\r\n bidStrategyType,\r\n allowBidAdjustment,\r\n allowNegativeLocationTargeting,\r\n showSearchTypeOptions,\r\n showBulkLocations,\r\n strings,\r\n isBrandAwarenessCampaignScenario,\r\n defaultSelectedSearchType,\r\n showIntent,\r\n isLocationTargetingImprovementEnabled,\r\n isDomesticSimplifiedChineseEnabled,\r\n dealInfo,\r\n } = props;\r\n\r\n const backUpData = useRef({});\r\n\r\n useEffect(() => {\r\n backUpData.current = _.deepClone(data);\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n const myData = useMemo(() => ({\r\n includedLocations: shouldNotHideInclude(bidStrategyType) ? fromLocationCriterionToBingMapTarget(getIncludedLocations(data.currentLocations)) : [],\r\n excludedLocations: fromLocationCriterionToBingMapTarget(getExcludedLocations(data.currentLocations)),\r\n targetOption: data.targetOption,\r\n peopleInLocation: data.peopleInLocation,\r\n peopleSearchingForLocation: data.peopleSearchingForLocation,\r\n }), [bidStrategyType, data.currentLocations, data.peopleInLocation, data.peopleSearchingForLocation, data.targetOption]);\r\n\r\n const mySetData = useCallback((partialUpdate) => {\r\n const newData = {\r\n ...myData,\r\n ...partialUpdate,\r\n };\r\n\r\n const {\r\n excludedLocations = [],\r\n peopleInLocation,\r\n peopleSearchingForLocation,\r\n } = newData;\r\n\r\n let {\r\n includedLocations = [],\r\n } = newData;\r\n\r\n const {\r\n currentLocations = [],\r\n } = data;\r\n\r\n if (!shouldNotHideInclude(bidStrategyType)) {\r\n includedLocations = fromLocationCriterionToBingMapTarget(getIncludedLocations(data.currentLocations));\r\n }\r\n\r\n const newLocations = fillAdditionalInfoToGrid(currentLocations, includedLocations).concat(fillAdditionalInfoToGrid(currentLocations, excludedLocations));\r\n\r\n setData({\r\n targetOption: newData.targetOption,\r\n currentLocations: newLocations,\r\n peopleInLocation,\r\n peopleSearchingForLocation,\r\n });\r\n }, [data, myData, setData, bidStrategyType]);\r\n\r\n const targetOptionsKeysMap = useMemo(() => {\r\n const keysMap = {\r\n [locationTargetsOptionKeys.everywhere]: i18n.getString(_TL_('All available countries/regions')),\r\n [locationTargetsOptionKeys.specific]: i18n.getString(_TL_('Let me choose specific locations')),\r\n };\r\n if (shouldNotHideInclude(bidStrategyType)) {\r\n keysMap[locationTargetsOptionKeys.bundleOrDefaultMarket] = languageBundleString;\r\n return keysMap;\r\n }\r\n return keysMap;\r\n }, [i18n, languageBundleString, bidStrategyType]);\r\n\r\n const targetOptionsKeys = useMemo(() => (_.compact([\r\n shouldNotHideInclude(bidStrategyType) && locationTargetsOptionKeys.bundleOrDefaultMarket,\r\n !isDomesticSimplifiedChineseEnabled && locationTargetsOptionKeys.everywhere,\r\n locationTargetsOptionKeys.specific,\r\n ])), [bidStrategyType, isDomesticSimplifiedChineseEnabled]);\r\n\r\n const done = () => {\r\n const valid = validateLocations({\r\n currentLevelSettings: data,\r\n }, bidStrategyType);\r\n\r\n if (valid && valid !== locationErrors.BidIsNotValid) {\r\n return;\r\n }\r\n const isBundle = data.targetOption === locationTargetsOptionKeys.bundleOrDefaultMarket;\r\n const isTargetEverywhere = data.currentLocations == null || data.currentLocations.length === 0;\r\n if (isTargetEverywhere && !isBundle) {\r\n toggleBidModeAndSetData({\r\n targetOption: locationTargetsOptionKeys.everywhere,\r\n currentLocations: data.currentLocations,\r\n });\r\n } else {\r\n toggleBidModeAndSetData({\r\n currentLocations: isBundle ? fillAdditionalInfoToBundleLocationCriterions(data.currentLocations, bundleLocationCriterions) : data.currentLocations,\r\n });\r\n }\r\n };\r\n\r\n const cancel = () => {\r\n toggleBidModeAndSetData({\r\n targetOption: backUpData.current.targetOption,\r\n currentLocations: backUpData.current.currentLocations,\r\n peopleInLocation: backUpData.current.peopleInLocation,\r\n peopleSearchingForLocation: backUpData.current.peopleSearchingForLocation,\r\n });\r\n };\r\n\r\n const onTargetOptionChanged = (key) => {\r\n if (key === locationTargetsOptionKeys.everywhere) {\r\n mySetData({\r\n targetOption: key,\r\n peopleInLocation: true,\r\n peopleSearchingForLocation: true,\r\n });\r\n } else {\r\n mySetData({ targetOption: key });\r\n }\r\n };\r\n\r\n const {\r\n targetOption,\r\n } = myData;\r\n\r\n const showSpecificLocationTargetEditor = targetOption === locationTargetsOptionKeys.specific || isAdGroupLevel;\r\n const error = getLocationErrorMsg({ code: validateLocations({ currentLevelSettings: data }, bidStrategyType, dealInfo), i18n, dealInfo });\r\n\r\n return (\r\n <div className=\"location-target-options\">\r\n {!shouldNotHideInclude(bidStrategyType) && <Disclaimer\r\n message={i18n.getString(_TL_('Only excluded locations are supported'))}\r\n />}\r\n <div className=\"header\"><Label>{i18n.getString(_TL_('Where do you want your ads to appear?'))}</Label></div>\r\n {\r\n (!isAdGroupLevel) && (\r\n <div className=\"choiceGroup\">\r\n <ul role=\"radiogroup\" aria-label={i18n.getString(_TL_('Where do you want your ads to appear?'))}>\r\n <RadioGroup\r\n items={targetOptionsKeys}\r\n renderItem={key => targetOptionsKeysMap[key]}\r\n onChange={onTargetOptionChanged}\r\n checked={targetOption || locationTargetsOptionKeys.everywhere}\r\n getItemId={_.identity}\r\n />\r\n </ul>\r\n </div>\r\n )\r\n }\r\n <ul>\r\n {showSpecificLocationTargetEditor && <SpecificLocationTargetsEditor\r\n allowNegativeLocationTargeting={allowNegativeLocationTargeting}\r\n showSearchTypeOptions={showSearchTypeOptions}\r\n showBulkLocations={showBulkLocations}\r\n strings={strings}\r\n defaultSelectedSearchType={defaultSelectedSearchType}\r\n isBrandAwarenessCampaignScenario={isBrandAwarenessCampaignScenario}\r\n data={myData}\r\n setData={mySetData}\r\n scope={props.scope}\r\n edmCampaign={edmCampaign}\r\n allowPositiveLocationTargeting={shouldNotHideInclude(bidStrategyType)}\r\n />}\r\n </ul>\r\n {error && <div className=\"error\"><ErrorString error={error} /></div>}\r\n <div>\r\n {showIntent && <LocationTargetsIntent data={myData} setData={mySetData} isLocationTargetingImprovementEnabled={isLocationTargetingImprovementEnabled} />}\r\n </div>\r\n {allowBidAdjustment &&\r\n <div className=\"footer\">\r\n <PrimaryButton text={i18n.getString(_TL_('Done'))} onClick={done} />\r\n <DefaultButton text={i18n.getString(_TL_('Cancel'))} onClick={cancel} />\r\n </div>}\r\n </div>\r\n );\r\n};\r\n\r\nLocationTargetsEditor.propTypes = {\r\n setData: PropTypes.func.isRequired,\r\n toggleBidModeAndSetData: PropTypes.func.isRequired,\r\n data: PropTypes.shape({}),\r\n scope: PropTypes.shape({\r\n values: PropTypes.shape({\r\n cid: PropTypes.number.isRequired,\r\n aid: PropTypes.number.isRequired,\r\n }).isRequired,\r\n }).isRequired,\r\n bundleLocationCriterions: PropTypes.shape([]).isRequired,\r\n languageBundleString: PropTypes.string,\r\n bidStrategyType: PropTypes.string.isRequired,\r\n isAdGroupLevel: PropTypes.bool,\r\n allowBidAdjustment: PropTypes.bool,\r\n allowNegativeLocationTargeting: PropTypes.bool,\r\n showSearchTypeOptions: PropTypes.bool,\r\n showBulkLocations: PropTypes.bool,\r\n strings: PropTypes.shape({}),\r\n isBrandAwarenessCampaignScenario: PropTypes.bool,\r\n defaultSelectedSearchType: PropTypes.oneOf(_.values(SEARCH_TYPE)),\r\n showIntent: PropTypes.bool.isRequired,\r\n isLocationTargetingImprovementEnabled: PropTypes.bool.isRequired,\r\n isDomesticSimplifiedChineseEnabled: PropTypes.bool.isRequired,\r\n dealInfo: PropTypes.shape({\r\n isForDeal: PropTypes.bool,\r\n dealCountryCode: PropTypes.string,\r\n dealSupportedLocationType: PropTypes.arrayOf(PropTypes.string),\r\n }),\r\n};\r\n\r\nLocationTargetsEditor.defaultProps = {\r\n data: {\r\n },\r\n languageBundleString: 'Canada, United States',\r\n isAdGroupLevel: false,\r\n allowBidAdjustment: true,\r\n allowNegativeLocationTargeting: true,\r\n showSearchTypeOptions: true,\r\n showBulkLocations: false,\r\n strings: {},\r\n isBrandAwarenessCampaignScenario: false,\r\n defaultSelectedSearchType: SEARCH_TYPE.Boundary,\r\n dealInfo: {},\r\n};\r\n\r\nconst LocationTargetsGridContainer = (props) => {\r\n const {\r\n data,\r\n setData,\r\n bidStrategyType,\r\n showIntent,\r\n } = props;\r\n\r\n const i18n = useContext(I18nContext);\r\n\r\n const {\r\n currentLevelSettings = {},\r\n parentLevelSettings = {},\r\n useParentLevel,\r\n } = data;\r\n\r\n const myData = useMemo(() => ({\r\n peopleInLocation: currentLevelSettings.peopleInLocation,\r\n peopleSearchingForLocation: currentLevelSettings.peopleSearchingForLocation,\r\n }), [currentLevelSettings.peopleInLocation, currentLevelSettings.peopleSearchingForLocation]);\r\n\r\n const error = getLocationErrorMsg({ code: validateLocations(data, bidStrategyType), i18n });\r\n\r\n return (\r\n <div className=\"location-targets-grids\">\r\n <Stack>\r\n {shouldNotHideInclude(bidStrategyType) && (\r\n <IncludedLocationGrid\r\n data={{\r\n currentLevelSettings: getIncludedLocations(currentLevelSettings.currentLocations),\r\n parentLevelSettings: getIncludedLocations(parentLevelSettings.currentLocations),\r\n useParentLevel,\r\n }}\r\n setData={(newIncluded) => {\r\n newIncluded.currentLevelSettings.forEach(fillAdditionalInfoToCriterion);\r\n setData({\r\n currentLocations: newIncluded.currentLevelSettings.concat(getExcludedLocations(currentLevelSettings.currentLocations)),\r\n });\r\n }}\r\n />\r\n )}\r\n <ExcludedLocationGrid\r\n data={{\r\n currentLevelSettings: getExcludedLocations(currentLevelSettings.currentLocations),\r\n parentLevelSettings: getExcludedLocations(parentLevelSettings.currentLocations),\r\n useParentLevel,\r\n }}\r\n setData={newExcluded => setData({\r\n currentLocations: newExcluded.currentLevelSettings.concat(getIncludedLocations(currentLevelSettings.currentLocations)),\r\n })}\r\n />\r\n {showIntent && <LocationTargetsIntent data={myData} setData={setData} isLocationTargetingImprovementEnabled />}\r\n {error && <div className=\"error\"><ErrorString error={error} /></div>}\r\n </Stack>\r\n </div>\r\n );\r\n};\r\n\r\nLocationTargetsGridContainer.propTypes = {\r\n scope: PropTypes.shape({\r\n values: PropTypes.shape({\r\n cid: PropTypes.number.isRequired,\r\n aid: PropTypes.number.isRequired,\r\n }).isRequired,\r\n }).isRequired,\r\n data: PropTypes.shape({\r\n currentLevelSettings: PropTypes.shape({}),\r\n }),\r\n setData: PropTypes.func.isRequired,\r\n bidStrategyType: PropTypes.string.isRequired,\r\n showIntent: PropTypes.bool.isRequired,\r\n};\r\n\r\nLocationTargetsGridContainer.defaultProps = {\r\n data: {\r\n currentLevelSettings: {\r\n targetOption: locationTargetsOptionKeys.everywhere,\r\n },\r\n useParentLevel: true,\r\n },\r\n};\r\n\r\n\r\nconst getStyles = (__, core) => ({\r\n LocationTargetSetting: {\r\n ...convertToLocalStyle(glyphIconStyle(core)),\r\n '& .col-icon': {\r\n fontSize: '16px',\r\n },\r\n '& .everywhere': {\r\n '& .content': {\r\n marginRight: '8px',\r\n },\r\n },\r\n '& .edit-location-targets-button': {\r\n textDecoration: 'underline',\r\n },\r\n '& .location-target-options': {\r\n '& .choiceGroup': {\r\n '& label': {\r\n fontWeight: '400',\r\n padding: 'unset',\r\n },\r\n '& .radio ~ .radio': {\r\n marginTop: '8px',\r\n },\r\n '& > ul': {\r\n paddingLeft: 0,\r\n },\r\n marginLeft: '20px',\r\n marginTop: '8px',\r\n },\r\n '& .footer': {\r\n marginTop: '16px',\r\n },\r\n '& .ms-Button--primary': {\r\n marginRight: '8px',\r\n },\r\n },\r\n '& .specific-location-targets-editor': {\r\n marginLeft: '26px',\r\n marginTop: '4px',\r\n marginBottom: '16px',\r\n },\r\n '& .error': {\r\n marginTop: '8px',\r\n },\r\n },\r\n});\r\n\r\nexport function getBundleCountries(language, market) {\r\n let bundleCountries = languageBundle.getBundle(language, market);\r\n\r\n if (!bundleCountries) {\r\n bundleCountries = [];\r\n let publisherCountry = languageBundle.getPublisherCountryByCode(market);\r\n\r\n if (_.isUndefined(publisherCountry)) {\r\n publisherCountry = {\r\n Country: 'US',\r\n LocationId: 190,\r\n };\r\n }\r\n\r\n bundleCountries.push(publisherCountry);\r\n }\r\n return bundleCountries;\r\n}\r\n\r\nconst globalI18n = window.globalLegacyI18n.get('@bingads-webui/i18n-amd-loader!campaignui/location-targets');\r\n\r\nexport function getLanguageBundleString(bundleCountries) {\r\n const bundleCountryNames = [];\r\n _.each(bundleCountries, (country) => {\r\n const countryName = globalI18n.getString(`PublisherCountry_${country.Country}`);\r\n\r\n bundleCountryNames.push(countryName);\r\n });\r\n return bundleCountryNames.join(', ');\r\n}\r\n\r\nexport function shouldSelectBundleOption(bundleCountries, locations) {\r\n // if there is no bundle found, return false\r\n if (!bundleCountries) {\r\n return false;\r\n }\r\n\r\n // if number of locations are not equal to number of bundle countries, return false\r\n if (bundleCountries.length !== locations.length) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < locations.length; i += 1) {\r\n const location = locations[i];\r\n\r\n // if there is any radius/excluded target defined, we're not in bundle mode\r\n if (location.Criterion.Type === 'Radius' ||\r\n location.SelectionStatus === 'Excluded') {\r\n return false;\r\n } else if (!_.find(bundleCountries, country => country.LocationId === location.Criterion.LocationCriterion.LocationId)) { // if the location is not in the bundle list, return false\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nexport function getBundleCountriesLocations(bundleCountries, lcid, cid, aid) {\r\n const locationIds = _.pluck(bundleCountries, 'LocationId');\r\n if (_.size(locationIds) === 0) {\r\n return Promise.resolve([]);\r\n }\r\n\r\n const reqs = _.map(locationIds, id => ({\r\n type: 'GET',\r\n url: `${edmCampaign.Customers.$withKey(cid).Accounts.$withKey(aid).Locations.$withKey(id).path}?%24expand=ParentLocations`,\r\n headers: lcid ? {\r\n lcid,\r\n } : undefined,\r\n }));\r\n\r\n return odata.batch({ reqs, needContentType: true });\r\n}\r\n\r\nexport function getBundleCountriesAndBundleLocationCriterions(cid, aid, lcid, language, market) {\r\n const bundleCountries = getBundleCountries(language, market);\r\n return new Promise(resolve => getBundleCountriesLocations(bundleCountries, lcid, cid, aid).then((response) => {\r\n const bundleLocationCriterions = [];\r\n if (response.message) {\r\n throw new Error(response.message);\r\n }\r\n _.each(response, (location) => {\r\n bundleLocationCriterions.push(locationTargetConverter.buildLocationCriterionFromSearchResult(\r\n location.data,\r\n { mode: 'location', status: 'Included' }\r\n ));\r\n });\r\n console.log(response);\r\n resolve({ bundleCountries, bundleLocationCriterions });\r\n }).catch((error) => {\r\n console.log(error);\r\n resolve({ bundleCountries: [], bundleLocationCriterions: [] });\r\n }));\r\n}\r\n\r\nexport const isTargetEverywhere = (settings, isAdGroupLevel, bidStrategyType) => {\r\n const {\r\n targetOption,\r\n currentLocations = [],\r\n } = settings;\r\n\r\n if (!shouldNotHideInclude(bidStrategyType)) {\r\n const excludedLocations = getExcludedLocations(currentLocations);\r\n return excludedLocations.length === 0;\r\n }\r\n\r\n if (isAdGroupLevel) {\r\n return currentLocations.length === 0;\r\n }\r\n return targetOption === locationTargetsOptionKeys.everywhere;\r\n};\r\n\r\nfunction compareLocationTargetArrays(initLocations, currentLocations) {\r\n const changes = { Added: [], Deleted: [] };\r\n\r\n // convert arrays into dictionaries, with hashcode as key\r\n const initDict = _.object(_.map(initLocations, lt => [getLocationHashWithStatus(lt), lt]));\r\n const currentDict = _.object(_.map(currentLocations, lt => [getLocationHashWithStatus(lt), lt]));\r\n\r\n // calculate newly added location targets\r\n _.each(currentDict, (currentTarget, hashCode) => {\r\n if (!_.has(initDict, hashCode)) {\r\n if (_.isUndefined(currentTarget.Id)) {\r\n // no Id, this is a new location target\r\n changes.Added.push(currentTarget);\r\n } else {\r\n // changed from radius to location or location to radius or radius changed for the same location\r\n changes.Added.push(_.omit(currentTarget, 'Id'));\r\n }\r\n } else if (currentTarget.Criterion.BidAdjustment !== currentTarget.Criterion.OriginalBidAdjustment) {\r\n if (_.isUndefined(currentTarget.Id)) {\r\n const currentHash = getLocationHashWithStatus(currentTarget);\r\n const initTarget = initLocations.find(x => getLocationHashWithStatus(x) === currentHash);\r\n if (initTarget) {\r\n // eslint-disable-next-line no-param-reassign\r\n currentTarget.Id = initTarget.Id;\r\n }\r\n }\r\n changes.Added.push(currentTarget);\r\n }\r\n });\r\n\r\n // calculate deleted location targets\r\n _.each(initDict, (initTarget, hashCode) => {\r\n if (!_.has(currentDict, hashCode)) {\r\n changes.Deleted.push(initTarget);\r\n }\r\n });\r\n\r\n return changes;\r\n}\r\n\r\nexport function compareAndProcessLocations(initLocations, currentLocations) {\r\n let finalLocations = currentLocations;\r\n const changes = compareLocationTargetArrays(initLocations, finalLocations);\r\n\r\n finalLocations = _.map(changes.Deleted, locationTarget => ({\r\n ...locationTarget,\r\n Status: 'Deleted',\r\n })).concat(changes.Added);\r\n\r\n finalLocations = _.map(finalLocations, (finalLocation) => {\r\n let locationToSend = finalLocation;\r\n\r\n if (locationToSend.Criterion.Type === 'Radius') {\r\n locationToSend.CriterionType = locationToSend.Criterion.Type;\r\n if (locationToSend.Criterion.RadiusCriterion.IsOriginalNameEmpty) {\r\n locationToSend.Criterion.RadiusCriterion.Name = null;\r\n }\r\n } else {\r\n locationToSend.CriterionType = locationToSend.SelectionStatus === 'Included' ? 'Location' : 'NegativeLocation';\r\n }\r\n\r\n // For those not created in MT, it should be zero.\r\n if (locationToSend.Id < 0) {\r\n locationToSend = _.omit(locationToSend, 'Id');\r\n }\r\n locationToSend = _.omit(locationToSend, 'location', 'bidAdjustmentDropdown', 'bidAdjustmentInput', 'Campaign', 'LesLocationType');\r\n return locationToSend;\r\n });\r\n\r\n return finalLocations;\r\n}\r\n\r\nexport function parseLocationTargets(rawLocations, level, Id) {\r\n const locations = rawLocations\r\n .filter(criterion => criterion.Criterion.Type === 'Radius' || criterion.Criterion.Type === 'Location')\r\n .map(criterion => patchForLocationTargetGrid(locationTargetConverter.buildLocationCriterionFromBiddableCampaignCriterion(criterion, level, Id)));\r\n const intent = rawLocations.find(criterion => criterion.Criterion.Type === 'LocationIntentOption');\r\n const intentId = intent ? intent.Id : null;\r\n const intentOption = intent ? getLocationIntent(intent.Criterion.IntentOption) : null;\r\n\r\n return {\r\n locations,\r\n intentId,\r\n intentOption,\r\n };\r\n}\r\n\r\nconst InnerLocationTargetSettingWithoutError = (props) => {\r\n const {\r\n data,\r\n setData,\r\n bundleCountries,\r\n bundleLocationCriterions,\r\n isAdGroupLevel,\r\n bidStrategyType,\r\n allowBidAdjustment,\r\n allowNegativeLocationTargeting,\r\n showSearchTypeOptions,\r\n showBulkLocations,\r\n strings,\r\n isBrandAwarenessCampaignScenario,\r\n defaultSelectedSearchType,\r\n hideIntent,\r\n dealInfo,\r\n permissions = {},\r\n } = props;\r\n\r\n const {\r\n currentLevelSettings = {},\r\n parentLevelSettings = {},\r\n useParentLevel,\r\n bidMode,\r\n } = data;\r\n\r\n const isLocationTargetingImprovementEnabled = _.result(permissions.dynamic, 'LocationTargetingImprovement', false);\r\n const isDomesticSimplifiedChineseEnabled = _.result(permissions, 'IsDomesticSimplifiedChineseEnabled', false);\r\n\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n const mySetLocationTargets = useCallback((partialUpdate) => {\r\n setData({\r\n ...data,\r\n currentLevelSettings: {\r\n ...data.currentLevelSettings,\r\n ...partialUpdate,\r\n },\r\n });\r\n }, [data, setData]);\r\n\r\n const toggleBidModeAndSetLocationTargets = useCallback((partialUpdate) => {\r\n setData({\r\n ...data,\r\n currentLevelSettings: {\r\n ...data.currentLevelSettings,\r\n ...partialUpdate,\r\n },\r\n bidMode: !bidMode,\r\n });\r\n }, [data, setData, bidMode]);\r\n\r\n const i18n = useContext(I18nContext);\r\n\r\n const toggleBidMode = useCallback(() => {\r\n setData({\r\n ...data,\r\n bidMode: !bidMode,\r\n });\r\n }, [setData, data, bidMode]);\r\n\r\n const turnOffBidAndToggleParentLevel = useCallback(() => {\r\n setData({\r\n ...data,\r\n useParentLevel: !useParentLevel,\r\n bidMode: false,\r\n });\r\n }, [setData, data, useParentLevel]);\r\n\r\n useEffect(() => {\r\n if (shouldNotHideInclude(bidStrategyType)) {\r\n // Check conflict and reset Data\r\n const includedLocations = getIncludedLocations(currentLevelSettings.currentLocations);\r\n const includedLocationsHash = includedLocations.map(getLocationHash);\r\n let excludedLocations = getExcludedLocations(currentLevelSettings.currentLocations);\r\n const excludedLocationsHash = excludedLocations.map(getLocationHash);\r\n if (!_.isEmpty(_.intersection(includedLocationsHash, excludedLocationsHash))) {\r\n excludedLocations = excludedLocations.filter(x => !includedLocationsHash.includes(getLocationHash(x)));\r\n mySetLocationTargets({\r\n ...currentLevelSettings,\r\n currentLocations: includedLocations.concat(excludedLocations),\r\n });\r\n }\r\n }\r\n }, [bidStrategyType, currentLevelSettings, mySetLocationTargets]);\r\n\r\n const languageBundleString = useMemo(() => getLanguageBundleString(bundleCountries), [bundleCountries]);\r\n\r\n const { targetOption } = currentLevelSettings;\r\n const showIntent = !hideIntent && shouldNotHideInclude(bidStrategyType) && (targetOption === locationTargetsOptionKeys.specific || targetOption === locationTargetsOptionKeys.bundleOrDefaultMarket || isAdGroupLevel);\r\n\r\n if (useParentLevel) {\r\n if (isAdGroupLevel) {\r\n // Show Campaign Data\r\n return (\r\n <div className={classNames('location-target-settings', 'location-target-settings--use-adgroup-level', classes.LocationTargetSetting)}>\r\n {isTargetEverywhere(parentLevelSettings, isAdGroupLevel) ? (\r\n <div className=\"everywhere\">\r\n <span className=\"content\">{i18n.getString(_TL_('Targeting everywhere'))}</span>\r\n </div>\r\n ) : (\r\n <div className=\"specific\">\r\n <Stack>\r\n <LocationTargetsGridContainer data={data} setData={mySetLocationTargets} />\r\n </Stack>\r\n </div>)}\r\n </div>\r\n );\r\n }\r\n return (\r\n <div className={classNames('location-target-settings', 'location-target-settings--use-campaign-level', classes.LocationTargetSetting)}>\r\n <div className=\"everywhere\">\r\n <span className=\"content\">{i18n.getString(_TL_('Targeting everywhere'))}</span>\r\n <Link className=\"edit-location-targets-button\" onClick={turnOffBidAndToggleParentLevel}>\r\n {i18n.getString(_TL_('Edit location targets'))}\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n // target editor mode\r\n if (!bidMode) {\r\n return (\r\n <div className={classNames('location-target-settings', 'location-target-settings--edit-mode', classes.LocationTargetSetting)}>\r\n <LocationTargetsEditor\r\n scope={props.scope}\r\n bundleLocationCriterions={bundleLocationCriterions}\r\n languageBundleString={languageBundleString}\r\n allowNegativeLocationTargeting={allowNegativeLocationTargeting}\r\n showSearchTypeOptions={showSearchTypeOptions}\r\n strings={strings}\r\n isBrandAwarenessCampaignScenario={isBrandAwarenessCampaignScenario}\r\n defaultSelectedSearchType={defaultSelectedSearchType}\r\n data={currentLevelSettings}\r\n setData={mySetLocationTargets}\r\n toggleBidModeAndSetData={toggleBidModeAndSetLocationTargets}\r\n isAdGroupLevel={isAdGroupLevel}\r\n bidStrategyType={bidStrategyType}\r\n allowBidAdjustment={allowBidAdjustment}\r\n showIntent={showIntent}\r\n isLocationTargetingImprovementEnabled={isLocationTargetingImprovementEnabled}\r\n isDomesticSimplifiedChineseEnabled={isDomesticSimplifiedChineseEnabled}\r\n showBulkLocations={showBulkLocations}\r\n dealInfo={dealInfo}\r\n />\r\n </div>\r\n );\r\n }\r\n\r\n // bidMode with grid\r\n return (\r\n <div className={classNames('location-target-settings', 'location-target-settings--edit-mode--with-bids', classes.LocationTargetSetting)}>\r\n {isTargetEverywhere(currentLevelSettings, isAdGroupLevel, bidStrategyType) ? (\r\n <div className=\"everywhere\">\r\n <span className=\"content\">{i18n.getString(_TL_('Targeting everywhere'))}</span>\r\n <Link className=\"edit-location-targets-button\" onClick={toggleBidMode}>\r\n {i18n.getString(_TL_('Edit location targets'))}\r\n </Link>\r\n </div>\r\n ) : (\r\n <div className=\"specific\">\r\n <Stack>\r\n <Link className=\"edit-location-targets-button\" onClick={toggleBidMode}>\r\n {i18n.getString(_TL_('Edit location targets'))}\r\n </Link>\r\n <LocationTargetsGridContainer\r\n data={data}\r\n setData={mySetLocationTargets}\r\n bidStrategyType={bidStrategyType}\r\n showIntent={isLocationTargetingImprovementEnabled && showIntent}\r\n />\r\n </Stack>\r\n </div>)}\r\n </div>\r\n );\r\n};\r\n\r\nInnerLocationTargetSettingWithoutError.propTypes = {\r\n scope: PropTypes.shape({\r\n values: PropTypes.shape({\r\n cid: PropTypes.number.isRequired,\r\n aid: PropTypes.number.isRequired,\r\n }).isRequired,\r\n }).isRequired,\r\n data: PropTypes.shape({\r\n currentLevelSettings: PropTypes.shape({}),\r\n }),\r\n bundleCountries: PropTypes.shape([]).isRequired,\r\n bundleLocationCriterions: PropTypes.shape([]).isRequired,\r\n setData: PropTypes.func.isRequired,\r\n isAdGroupLevel: PropTypes.bool,\r\n bidStrategyType: PropTypes.string.isRequired,\r\n allowBidAdjustment: PropTypes.bool,\r\n allowNegativeLocationTargeting: PropTypes.bool,\r\n showSearchTypeOptions: PropTypes.bool,\r\n showBulkLocations: PropTypes.bool,\r\n strings: PropTypes.shape({}),\r\n defaultSelectedSearchType: PropTypes.oneOf(_.values(SEARCH_TYPE)),\r\n isBrandAwarenessCampaignScenario: PropTypes.bool,\r\n hideIntent: PropTypes.bool,\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.shape({\r\n LocationTargetingImprovement: PropTypes.bool,\r\n }),\r\n }).isRequired,\r\n dealInfo: PropTypes.shape({\r\n isForDeal: PropTypes.bool,\r\n dealCountryCode: PropTypes.string,\r\n dealSupportedLocationType: PropTypes.arrayOf(PropTypes.string),\r\n }),\r\n};\r\n\r\nInnerLocationTargetSettingWithoutError.defaultProps = {\r\n data: {\r\n currentLevelSettings: {\r\n targetOption: locationTargetsOptionKeys.everywhere,\r\n },\r\n useParentLevel: false,\r\n },\r\n isAdGroupLevel: false,\r\n allowBidAdjustment: true,\r\n allowNegativeLocationTargeting: true,\r\n showSearchTypeOptions: true,\r\n showBulkLocations: false,\r\n strings: {},\r\n defaultSelectedSearchType: SEARCH_TYPE.Boundary,\r\n isBrandAwarenessCampaignScenario: false,\r\n hideIntent: false,\r\n dealInfo: {},\r\n};\r\n\r\nconst LocationTargetSettingWithoutError = withPermissions(InnerLocationTargetSettingWithoutError);\r\n\r\nexport const LocationTargetSetting = (props) => {\r\n const {\r\n data,\r\n setData,\r\n showUserParentLevelToggle,\r\n keepInitValueWhenToggle,\r\n } = props;\r\n\r\n const {\r\n useParentLevel,\r\n currentLevelSettings,\r\n } = data || {};\r\n\r\n const {\r\n currentLocations, initLocations,\r\n } = currentLevelSettings || {};\r\n\r\n const i18n = useContext(I18nContext);\r\n\r\n const onToggle = useCallback((ev, checked) => {\r\n const noCheckedValue = keepInitValueWhenToggle ? initLocations : [];\r\n const updatedData = {\r\n ...data,\r\n useParentLevel: checked,\r\n currentLevelSettings: {\r\n ...currentLevelSettings,\r\n currentLocations: checked ? noCheckedValue : currentLocations,\r\n targetOption: checked ? locationTargetsOptionKeys.everywhere : locationTargetsOptionKeys.specific,\r\n },\r\n };\r\n\r\n setData({\r\n ...updatedData,\r\n errors: undefined,\r\n });\r\n }, [currentLevelSettings, currentLocations, data, initLocations, keepInitValueWhenToggle, setData]);\r\n\r\n return (\r\n <Fragment>\r\n <Stack tokens={{ childrenGap: 32 }}>\r\n {showUserParentLevelToggle &&\r\n <Toggle label={i18n.getString(_TL_('Use my campaign settings'))} defaultChecked={useParentLevel} onChange={onToggle} inlineLabel />\r\n }\r\n <LocationTargetSettingWithoutError\r\n {...props}\r\n setData={\r\n newData => setData({\r\n ...data,\r\n ...newData,\r\n errors: undefined,\r\n })\r\n }\r\n />\r\n {checkShouldShowErrors(data) && <Errors errors={data.errors} />}\r\n </Stack>\r\n </Fragment>\r\n );\r\n};\r\n\r\nLocationTargetSetting.propTypes = {\r\n data: PropTypes.shape({\r\n currentLevelSettings: PropTypes.shape({}),\r\n errors: PropTypes.arrayOf({}),\r\n }).isRequired,\r\n setData: PropTypes.func.isRequired,\r\n showUserParentLevelToggle: PropTypes.bool,\r\n keepInitValueWhenToggle: PropTypes.bool,\r\n};\r\n\r\nLocationTargetSetting.defaultProps = {\r\n showUserParentLevelToggle: false,\r\n keepInitValueWhenToggle: false,\r\n};\r\n","\r\nimport _ from 'underscore';\r\nimport { locationTargetsOptionKeys } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport {\r\n fillAdditionalInfoToBundleLocationCriterions,\r\n convertIntentOption,\r\n compareAndProcessLocations,\r\n getLocationHash,\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\n\r\nconst setParentForCampaign = (targets, campaign) => targets.map((criterion) => {\r\n if (campaign.Id) {\r\n return {\r\n ...criterion,\r\n Campaign: {\r\n Id: campaign.Id,\r\n },\r\n };\r\n }\r\n return {\r\n ...criterion,\r\n CampaignName: campaign.name.value,\r\n };\r\n});\r\n\r\nconst setParentForAdGroup = (targets, adGroup, campaign) => targets.map((criterion) => {\r\n if (adGroup.Id) {\r\n return {\r\n ...criterion,\r\n AdGroup: {\r\n Id: adGroup.Id,\r\n },\r\n };\r\n }\r\n return {\r\n ...criterion,\r\n CampaignName: campaign.Name,\r\n AdGroupName: adGroup.name.value,\r\n };\r\n});\r\n\r\nexport const convertLocationStateToLocationSchemaCampaign = (location, bundleLocationCriterions, campaign, adGroup) => {\r\n const {\r\n currentLocations,\r\n targetOption,\r\n } = location.currentLevelSettings;\r\n let {\r\n initLocations = [],\r\n } = location.currentLevelSettings;\r\n\r\n const isTargetEverywhere = targetOption === locationTargetsOptionKeys.everywhere || location.useParentLevel === true;\r\n let finalLocations = [];\r\n const intent = {\r\n Id: location.currentLevelSettings.intentId,\r\n CriterionType: 'LocationIntentCriterion',\r\n Criterion: {\r\n Type: 'LocationIntentCriterion',\r\n LocationIntentCriterion: {\r\n IntentOption: convertIntentOption(location.currentLevelSettings),\r\n },\r\n },\r\n };\r\n\r\n if (isTargetEverywhere) {\r\n finalLocations = [];\r\n } else if (targetOption === locationTargetsOptionKeys.bundleOrDefaultMarket) {\r\n if (location.bidMode === true) {\r\n finalLocations = currentLocations;\r\n } else {\r\n finalLocations = fillAdditionalInfoToBundleLocationCriterions(currentLocations, bundleLocationCriterions);\r\n }\r\n } else if (targetOption === locationTargetsOptionKeys.specific) {\r\n if (campaign.bidStrategy.option === 'Commission') {\r\n // filter out new added included locations\r\n finalLocations = currentLocations.filter(x => !(x.SelectionStatus === 'Included'));\r\n const includedInitLocations = initLocations.filter(x => x.SelectionStatus === 'Included' && x.Criterion.Type !== 'Radius');\r\n const excludedInitLocations = initLocations.filter(x => x.SelectionStatus === 'Excluded');\r\n const finalHashDict = _.object(_.map(finalLocations, lt => [getLocationHash(lt), lt]));\r\n const finalExcludedLocationIds = finalLocations.map(x => x.Criterion.LocationCriterion.LocationId);\r\n // delete the conflicted locations\r\n const conflictedLocations = includedInitLocations.filter((x) => {\r\n if (_.has(finalHashDict, getLocationHash(x))) {\r\n return true;\r\n }\r\n if (!_.isEmpty(_.intersection(x.Criterion.LocationCriterion.EnclosingLocationIds, finalExcludedLocationIds))) {\r\n return true;\r\n }\r\n return false;\r\n });\r\n initLocations = conflictedLocations.concat(excludedInitLocations);\r\n } else {\r\n finalLocations = currentLocations;\r\n }\r\n }\r\n\r\n finalLocations = compareAndProcessLocations(initLocations, finalLocations);\r\n\r\n if (campaign.bidStrategy.option !== 'Commission') {\r\n finalLocations = finalLocations.concat([intent]);\r\n }\r\n\r\n finalLocations = adGroup ? setParentForAdGroup(finalLocations, adGroup, campaign) : setParentForCampaign(finalLocations, campaign);\r\n\r\n return finalLocations;\r\n};\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'classnames';\r\nimport { BackboneInstanceWrapper } from '@bingads-webui-react/backbone-instance-wrapper';\r\nimport { validateLocations } from '@bingads-webui-campaign/hotel-common-targets';\r\nimport { checkShouldShowErrors, locationTargetsOptionKeys, LocalizationKeys } from '@bingads-webui-campaign-react/wizard-shared-components';\r\n\r\nexport function useToggleExpander(init = false) {\r\n const [expanded, setExpanded] = useState(init);\r\n\r\n return [expanded, () => setExpanded(!expanded)];\r\n}\r\n\r\nexport function useBackboneView(viewFactory, onViewCreated, { managed = false, onViewRemoved, getCreatedView } = {}) {\r\n const [backboneView, setBackboneView] = useState(null);\r\n\r\n useEffect(() => {\r\n let view = getCreatedView != null ? getCreatedView() : undefined;\r\n if (view == null) {\r\n view = viewFactory();\r\n onViewCreated(view);\r\n }\r\n setBackboneView(view);\r\n return () => {\r\n if (onViewRemoved != null) {\r\n onViewRemoved();\r\n }\r\n };\r\n }, [onViewCreated, viewFactory, onViewRemoved, getCreatedView]);\r\n\r\n if (backboneView) {\r\n return (<BackboneInstanceWrapper instance={backboneView} managed={managed} />);\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport const usePatch = (patchFunc, key) => useCallback((value) => {\r\n patchFunc(key, value);\r\n}, [patchFunc, key]);\r\n\r\nexport const globalErrorMsg = _TL_(\"*Something's wrong.\");\r\n\r\nexport const getLocationTargetErrorMessage = (location, bidStrategyType) => {\r\n if (checkShouldShowErrors(location)) {\r\n return globalErrorMsg;\r\n }\r\n if (validateLocations(location, bidStrategyType)) {\r\n return globalErrorMsg;\r\n }\r\n return null;\r\n};\r\n\r\nconst getLocationsString = (i18n, settings, isAdGroupLevel = false, bidStrategyType) => {\r\n if (settings == null) {\r\n return i18n.getString(_TL_('Targeting everywhere.'));\r\n }\r\n\r\n const {\r\n targetOption,\r\n currentLocations = [],\r\n } = settings;\r\n\r\n let isTargetEverywhere = targetOption === locationTargetsOptionKeys.everywhere;\r\n if (isAdGroupLevel) {\r\n isTargetEverywhere = currentLocations.length === 0;\r\n }\r\n\r\n if (isTargetEverywhere) {\r\n return i18n.getString(_TL_('Targeting everywhere.'));\r\n }\r\n\r\n let details = '';\r\n let includedLocations = currentLocations.filter(x => x.SelectionStatus === 'Included');\r\n const excludedLocations = currentLocations.filter(x => x.SelectionStatus === 'Excluded');\r\n if (bidStrategyType === 'Commission') {\r\n includedLocations = [];\r\n }\r\n if (includedLocations.length) {\r\n details += 'Included locations: ';\r\n includedLocations.forEach((target, index) => {\r\n details += target.location;\r\n details += `: ${i18n.getString(LocalizationKeys[target.bidAdjustmentDropdown])}`;\r\n details += `: ${target.bidAdjustmentInput}%`;\r\n if (index < includedLocations.length - 1) {\r\n details += ', ';\r\n }\r\n });\r\n }\r\n if (excludedLocations.length) {\r\n if (includedLocations.length) {\r\n details += ', ';\r\n }\r\n details += 'Excluded locations: ';\r\n excludedLocations.forEach((target, index) => {\r\n details += target.location;\r\n if (index < excludedLocations.length - 1) {\r\n details += ', ';\r\n }\r\n });\r\n }\r\n return details;\r\n};\r\n\r\nexport const getLocationTargetTitleDetails = (i18n, location, isAdGroupLevel, bidStrategyType) => {\r\n const {\r\n parentLevelSettings,\r\n currentLevelSettings,\r\n useParentLevel,\r\n } = location;\r\n\r\n if (useParentLevel) {\r\n if (isAdGroupLevel) {\r\n return getLocationsString(i18n, parentLevelSettings);\r\n }\r\n return i18n.getString(_TL_('Targeting everywhere.'));\r\n }\r\n\r\n return getLocationsString(i18n, currentLevelSettings, isAdGroupLevel, bidStrategyType);\r\n};\r\n\r\nexport const getGridTargetTitleDetails = (i18n, params, symbol = ': ', formatDateValue) => {\r\n let details = '';\r\n if (params.useParentLevel) {\r\n const len = params.parentLevelSettings.length;\r\n params.parentLevelSettings.forEach((key, index) => {\r\n Object.keys(key).forEach((k, i) => {\r\n if (key[k] === '' || k === 'Status' || k === 'Id') {\r\n details += '';\r\n } else if (k === 'bidAdjustmentInput') {\r\n details += `: ${key[k]}%`;\r\n } else if (k === 'bidAdjustmentDropdown') {\r\n details += `: ${LocalizationKeys[key[k]] ? i18n.getString(LocalizationKeys[key[k]]) : key[k]}`;\r\n } else if (key[k] instanceof Date) {\r\n details += `${i === 0 ? '' : symbol}${formatDateValue(key[k])}`;\r\n } else if (k === 'day' || k === 'dates' || k === 'targeted' || k === 'device') {\r\n details += `${i === 0 ? '' : symbol}${LocalizationKeys[key[k]] ? i18n.getString(LocalizationKeys[key[k]]) : key[k]}`;\r\n } else {\r\n details += `${i === 0 ? '' : symbol}${key[k]}`;\r\n }\r\n });\r\n if (details && index < len - 1) {\r\n details += ', ';\r\n }\r\n });\r\n } else {\r\n const len = params.currentLevelSettings.length;\r\n details = '';\r\n params.currentLevelSettings.forEach((key, index) => {\r\n // eslint-disable-next-line no-plusplus\r\n for (let i = 0; i < Object.keys(key).length; i++) {\r\n const k = Object.keys(key)[i];\r\n if (key[k] === '' || k === 'Status' || k === 'Id') {\r\n details += '';\r\n } else if (k === 'bidAdjustmentInput') {\r\n details += `: ${key[k]}%`;\r\n } else if (k === 'bidAdjustmentDropdown') {\r\n details += `: ${LocalizationKeys[key[k]] ? i18n.getString(LocalizationKeys[key[k]]) : key[k]}`;\r\n } else if (key[k] instanceof Date) {\r\n details += `${i === 0 ? '' : symbol}${formatDateValue(key[k])}`;\r\n } else if (k === 'day' || k === 'dates' || k === 'targeted' || k === 'device') {\r\n details += `${i === 0 ? '' : symbol}${LocalizationKeys[key[k]] ? i18n.getString(LocalizationKeys[key[k]]) : key[k]}`;\r\n } else {\r\n details += `${i === 0 ? '' : symbol}${key[k]}`;\r\n }\r\n }\r\n if (details && index < len - 1) {\r\n details += ', ';\r\n }\r\n });\r\n details = details || `${i18n.getString(_TL_('(no selection)'))}`;\r\n }\r\n return details;\r\n};\r\n\r\nexport const getUrlOptionsDetails = (i18n, urlOptions) => {\r\n let details = '';\r\n if (urlOptions.TrackingUrlTemplate) {\r\n details += `${LocalizationKeys.TrackingUrlTemplate ? i18n.getString(LocalizationKeys.TrackingUrlTemplate) : 'TrackingUrlTemplate'}: ${urlOptions.TrackingUrlTemplate}, `;\r\n }\r\n if (urlOptions.FinalUrlSuffix) {\r\n details += `${LocalizationKeys.FinalUrlSuffix ? i18n.getString(LocalizationKeys.FinalUrlSuffix) : 'FinalUrlSuffix'}: ${urlOptions.FinalUrlSuffix}, `;\r\n }\r\n if (urlOptions.UrlCustomParameters && urlOptions.UrlCustomParameters.length > 0) {\r\n details += `${LocalizationKeys.UrlCustomParameters ? i18n.getString(LocalizationKeys.UrlCustomParameters) : 'UrlCustomParameters'}: ${JSON.stringify(urlOptions.UrlCustomParameters)}, `;\r\n }\r\n const reg = /,$/gi;\r\n details = details.trim().replace(reg, '');\r\n return details;\r\n};\r\n\r\nexport const getExclusionsDetails = (i18n, exclusions) => {\r\n let details = '';\r\n let exclusionsValue = exclusions;\r\n if (exclusionsValue.Exclusions) {\r\n exclusionsValue = exclusions.Exclusions;\r\n }\r\n\r\n if (exclusionsValue.ExcludedSites) {\r\n details += `${i18n.getString(LocalizationKeys.ExcludedSites)}: ${exclusionsValue.ExcludedSites}, `;\r\n }\r\n if (exclusionsValue.ExcludedIPs) {\r\n details += `${i18n.getString(LocalizationKeys.ExcludedIPs)}: ${exclusionsValue.ExcludedIPs}, `;\r\n }\r\n const reg = /,$/gi;\r\n details = details.trim().replace(reg, '');\r\n return details;\r\n};\r\n\r\nexport const Disclaimer = ({ message }) => (\r\n <div className={classNames('alert', 'alert-info')} role=\"alert\">\r\n <div className=\"alert-image\" />\r\n <div className=\"alert-info-inline\">\r\n <span>{message}</span>\r\n </div>\r\n </div>);\r\n\r\nDisclaimer.propTypes = {\r\n message: PropTypes.string.isRequired,\r\n};\r\n","import React, { useCallback } from 'react';\r\nimport classnames from 'classnames';\r\nimport AdScheduleView from '@bingads-webui-campaign-legacy/ad-schedule/view/index';\r\nimport PropTypes from 'prop-types';\r\nimport _ from 'underscore';\r\nimport { advancedSettingsSectionStyle, toggleButtonStyle, datePickerStyle } from '@bingads-webui-campaign-react/common-styles';\r\nimport {\r\n creationCommonStyle\r\n} from '@bingads-webui-campaign-react/campaign-adgroup-settings-shared-styles';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { useBackboneView } from '../shared';\r\n\r\nconst getStyles = (__, core) =>\r\n ({\r\n '@global': {\r\n ...datePickerStyle(core),\r\n },\r\n adScheduleContainer: {\r\n '& .advanced-scheduling-grid': {\r\n width: '918px',\r\n },\r\n ...creationCommonStyle(core),\r\n ...advancedSettingsSectionStyle(core),\r\n '& .radio-inline': {\r\n display: 'block',\r\n },\r\n '& .adschedule-targets-container': {\r\n borderTop: 'unset',\r\n paddingTop: '0px',\r\n },\r\n '& .toggle-campaign-settings-switch.form-control-static[data-bind]': {\r\n display: 'inline-block',\r\n textDecoration: 'none',\r\n paddingRight: '8px',\r\n float: 'left',\r\n },\r\n ...toggleButtonStyle(core),\r\n '& .date-settings-intro': {\r\n paddingLeft: 0,\r\n },\r\n '& .date-settings': {\r\n '& .col-sm-12': {\r\n paddingLeft: 0,\r\n },\r\n '& table': {\r\n width: '500px',\r\n '& td': {\r\n width: '100%',\r\n display: 'block',\r\n },\r\n },\r\n },\r\n '& .alert-danger': {\r\n backgroundColor: 'unset',\r\n color: '#A80000',\r\n },\r\n },\r\n });\r\n\r\n// reference: private/campaign-legacy/packages/campaign-targeting/view/campaign-targeting.js\r\nexport const AdSchedule = React.memo((props) => {\r\n const {\r\n setAdScheduleView,\r\n getAdScheduleView,\r\n options,\r\n getCreatedView,\r\n managed,\r\n } = props;\r\n const adScheduleReactWrapper = useBackboneView(useCallback(() => new AdScheduleView({\r\n ...options,\r\n }).render(), [options]), setAdScheduleView, { managed, getCreatedView });\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n return (\r\n <div\r\n className={classnames(classes.adScheduleContainer)}\r\n onFocus={() => {\r\n const view = getAdScheduleView();\r\n if (view && view.koModel && !_.isEmpty((view.koModel.errors()))) {\r\n // defer to trigger click event.\r\n _.delay(view.clearApiErrors.bind(view), 200);\r\n }\r\n }}\r\n >\r\n <div className=\"adschedule-targets-container\">\r\n {adScheduleReactWrapper}\r\n </div>\r\n </div>\r\n );\r\n});\r\n\r\nAdSchedule.propTypes = {\r\n setAdScheduleView: PropTypes.func.isRequired,\r\n getAdScheduleView: PropTypes.func.isRequired,\r\n getCreatedView: PropTypes.func,\r\n options: PropTypes.shape({}),\r\n managed: PropTypes.bool,\r\n};\r\n\r\nAdSchedule.defaultProps = {\r\n options: {\r\n level: 'campaign',\r\n model: {\r\n },\r\n },\r\n managed: false,\r\n getCreatedView: null,\r\n};\r\n","export const HotelErrorToErrorMessageMapping = {\r\n CampaignServiceInvalidDeviceTargetBidAdjustment: _TL_('The bid adjustment is not valid.'),\r\n CampaignServiceIncompleteDeviceCriterionSet: _TL_('The entity must either be explicitly associated with all device criterion types (Computer, Tablet, Smartphone) or should not have any device criterion.'),\r\n InvalidCheckInDateTarget: _TL_('The check-in date target is not valid.'),\r\n};\r\n","/* eslint-disable no-plusplus */\r\nimport _, { chain } from 'underscore';\r\nimport $ from 'jquery';\r\nimport decimal from '@bingads-webui-component-legacy/humanize/decimal';\r\nimport { edmCampaign } from '@bingads-webui/edm-campaign';\r\nimport { notificationApi } from '@bingads-webui-campaign/notification-center';\r\nimport * as i18nErrors from '@bingads-webui-component-legacy/api-errors-campaign/index';\r\nimport { stringifySync } from '@bingads-webui/safe-json';\r\nimport timeZoneMapper from '@bingads-webui-component-legacy/timezonemapper/index';\r\nimport * as scrollUtils from '@bingads-webui-component-legacy/extension/scrollTo';\r\n\r\nimport {\r\n deviceDefaultSetting,\r\n advancedBookingDefaultSetting,\r\n checkinDayDefaultSetting,\r\n userSetDatesDefaultSetting,\r\n checkinDateDefaultSetting,\r\n lengthOfStayDefaultSetting,\r\n} from '@bingads-webui-campaign/hotel-common-targets';\r\nimport { HotelErrorToErrorMessageMapping } from './components/override-error';\r\nimport { audienceAdsOptionKeys } from './components/audience-ads/utility';\r\n\r\n\r\nexport function collectCriterions(feature, unSupportedFeatures, criterions) {\r\n if (unSupportedFeatures.includes(feature)) {\r\n return [];\r\n }\r\n return criterions;\r\n}\r\n\r\nexport const countNumberOfDigits = (num) => {\r\n const number = num.toString().split('.')[1];\r\n return _.isUndefined(number) ? 0 : number.length;\r\n};\r\n\r\nexport const getAccountCurrencyCode = serverContext => (serverContext && serverContext.CurrentAccount && serverContext.CurrentAccount.CurrencyCode) || 'USD';\r\n\r\nexport const numberErrorCode = {\r\n RequiredField: 'RequiredField',\r\n InValidNumber: 'InValidNumber',\r\n OutOfRange: 'OutOfRange',\r\n OutOfRangeNotIncludeMin: 'OutOfRangeNotIncludeMin',\r\n NotPositive: 'NotPositive',\r\n MaxLength: 'MaxLength',\r\n WholeNumber: 'WholeNumber',\r\n};\r\n\r\nexport const getNumberErrorMsg = ({\r\n code, i18n, min, max,\r\n}) => {\r\n switch (code) {\r\n case numberErrorCode.RequiredField:\r\n return i18n.getString(_TL_('Required field'));\r\n case numberErrorCode.InValidNumber:\r\n return i18n.getString(_TL_('Field requires numeric value'));\r\n case numberErrorCode.WholeNumber:\r\n return i18n.getString(_TL_('Number should be a whole number'));\r\n case numberErrorCode.OutOfRange:\r\n return i18n.getString(_TL_('Number should be between {{min}} and {{max}}'), { min: min && decimal.fromFloatToStringNoTrailingZero(min), max: max && decimal.fromFloatToStringNoTrailingZero(max) });\r\n case numberErrorCode.OutOfRangeNotIncludeMin:\r\n return i18n.getString(_TL_('Number should be larger than {{min}} and no more than {{max}}'), { min: min && decimal.fromFloatToStringNoTrailingZero(min), max: max && decimal.fromFloatToStringNoTrailingZero(max) });\r\n case numberErrorCode.MaxLength:\r\n return i18n.getString(_TL_('Number should not exceed max length'));\r\n default:\r\n return null;\r\n }\r\n};\r\n\r\nexport const validateNumber = ({\r\n value,\r\n min,\r\n max,\r\n notRequired,\r\n shouldBePositive,\r\n isInteger,\r\n digitLength,\r\n notIncludeMin,\r\n}) => {\r\n const isValidNumber = typeof value === 'number' ? true : decimal.isValid(value);\r\n\r\n if (value === '' || value == null) {\r\n if (notRequired) {\r\n return null;\r\n }\r\n return numberErrorCode.RequiredField;\r\n } else if (!isValidNumber) {\r\n return numberErrorCode.InValidNumber;\r\n }\r\n\r\n if (isInteger && (Number(value) !== parseInt(value, 10))) {\r\n return numberErrorCode.WholeNumber;\r\n }\r\n\r\n if (digitLength && countNumberOfDigits(value) > digitLength) {\r\n return numberErrorCode.MaxLength;\r\n }\r\n\r\n const number = decimal.fromLocalToFloat(value);\r\n if (shouldBePositive) {\r\n if (number < 0) {\r\n return numberErrorCode.NotPositive;\r\n }\r\n }\r\n\r\n if (notIncludeMin) {\r\n if (number <= min || number > max) {\r\n return numberErrorCode.OutOfRangeNotIncludeMin;\r\n }\r\n }\r\n\r\n if (number < min || number > max) {\r\n return numberErrorCode.OutOfRange;\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport const bidStrategyOptionKeys = {\r\n ManualCpc: 'ManualCpc',\r\n PercentCpc: 'PercentCpc',\r\n Commission: 'Commission',\r\n};\r\n\r\nconst bidConst = {\r\n min: 0.05,\r\n max: 1000,\r\n};\r\nexport const getBidErrorMsg = ({\r\n code, i18n, min = bidConst.min, max = bidConst.max, isPercent,\r\n}) => {\r\n switch (code) {\r\n case numberErrorCode.RequiredField:\r\n if (isPercent) {\r\n return i18n.getString(_TL_('Enter a percent'));\r\n }\r\n return i18n.getString(_TL_('Enter a bid'));\r\n default:\r\n return getNumberErrorMsg({\r\n code, i18n, min, max,\r\n });\r\n }\r\n};\r\n\r\nexport function convertODataObjectToCampaignState(ODataObject) {\r\n const data = {\r\n Id: ODataObject.Id,\r\n name: {\r\n value: ODataObject.Name,\r\n },\r\n audienceAds: {\r\n currentLevelSettings: {\r\n option: ODataObject.NativeBidAdjustment == null || ODataObject.NativeBidAdjustment >= 0 ? audienceAdsOptionKeys.Increase : audienceAdsOptionKeys.Decrease,\r\n value: ODataObject.NativeBidAdjustment == null ? 0 : Math.abs(ODataObject.NativeBidAdjustment),\r\n },\r\n parentLevelSettings: {\r\n },\r\n useParentLevel: false,\r\n },\r\n budget: {\r\n option: 'Individual',\r\n individualOption: 'true',\r\n amount: ODataObject.Budget && ODataObject.Budget.Amount ? decimal.fromFloatToStringNoTrailingZero(ODataObject.Budget.Amount) : 0,\r\n },\r\n bidStrategy: {\r\n option: ODataObject.BiddingScheme ? ODataObject.BiddingScheme.Type : 'ManualCpc',\r\n PercentCpc: ODataObject.BiddingScheme && ODataObject.BiddingScheme.MaxPercentCpc && decimal.fromFloatToStringNoTrailingZero(ODataObject.BiddingScheme.MaxPercentCpc),\r\n Commission: ODataObject.BiddingScheme && ODataObject.BiddingScheme.CommissionRate && decimal.fromFloatToStringNoTrailingZero(ODataObject.BiddingScheme.CommissionRate),\r\n },\r\n urlOptions: {\r\n TrackingUrlTemplate: ODataObject.TrackingUrlTemplate,\r\n FinalUrlSuffix: ODataObject.FinalUrlSuffix,\r\n UrlCustomParameters: ODataObject.UrlCustomParameters,\r\n },\r\n TimeZone: timeZoneMapper.getAccountTimeZone(),\r\n AdScheduleUseSearcherTimeZone: ODataObject.AdScheduleUseSearcherTimeZone,\r\n };\r\n return data;\r\n}\r\n\r\nfunction commonConverODataObjectToTargetsState({\r\n ODataObject, criterionType, keyCb, key, defaultSetting,\r\n}) {\r\n const commonTargetCriterion = {};\r\n chain(ODataObject)\r\n .filter(item => item && item.Criterion &&\r\n item.Criterion['@odata.type'] === criterionType && item.CriterionBid)\r\n .value()\r\n .forEach((item) => {\r\n commonTargetCriterion[keyCb(item)] = {\r\n Id: item.Id,\r\n bidAdjustmentDropdown: `${item.CriterionBid.Multiplier < 0 ? 'Decrease by' : 'Increase by'}`,\r\n bidAdjustmentInput: item.CriterionBid.Multiplier < 0 ? -(item.CriterionBid.Multiplier - 0) : item.CriterionBid.Multiplier,\r\n };\r\n });\r\n\r\n // by default settings sort\r\n const commonSettings = chain(defaultSetting)\r\n .map(item => ({\r\n ...item,\r\n Id: commonTargetCriterion[item[key]] && commonTargetCriterion[item[key]].Id,\r\n bidAdjustmentDropdown: commonTargetCriterion[item[key]] ? commonTargetCriterion[item[key]].bidAdjustmentDropdown : 'Increase by',\r\n bidAdjustmentInput: commonTargetCriterion[item[key]] ? commonTargetCriterion[item[key]].bidAdjustmentInput : 0,\r\n })).value();\r\n return commonSettings;\r\n}\r\n\r\nfunction commonConverODataObjectToRangeTargetsState({\r\n ODataObject, criterionType, key1, key2, MTKey1, MTKey2,\r\n}) {\r\n const commonTargetCriterion = [];\r\n chain(ODataObject)\r\n .filter(item => item && item.Criterion &&\r\n item.Criterion['@odata.type'] === criterionType && item.CriterionBid)\r\n .value()\r\n .forEach((item) => {\r\n commonTargetCriterion.push({\r\n [key1]: item.Criterion[MTKey1],\r\n [key2]: item.Criterion[MTKey2],\r\n bidAdjustmentDropdown: `${item.CriterionBid.Multiplier < 0 ? 'Decrease by' : 'Increase by'}`,\r\n bidAdjustmentInput: item.CriterionBid.Multiplier < 0 ? -(item.CriterionBid.Multiplier - 0) : item.CriterionBid.Multiplier,\r\n Id: item.Id,\r\n Status: item.Status,\r\n });\r\n });\r\n return commonTargetCriterion;\r\n}\r\n\r\nexport function converODataObjectToDeviceState(ODataObject) {\r\n const DeviceMap = {\r\n Tablets: _TL_('Tablet'),\r\n Computers: _TL_('Computer'),\r\n Smartphones: _TL_('Smartphone'),\r\n };\r\n return commonConverODataObjectToTargetsState({\r\n ODataObject, criterionType: '#Model.DeviceCriterion', keyCb(item) { return DeviceMap[item.Criterion.DeviceName]; }, key: 'device', defaultSetting: deviceDefaultSetting,\r\n });\r\n}\r\n\r\nexport function converODataObjectToABWState(ODataObject) {\r\n return commonConverODataObjectToRangeTargetsState({\r\n ODataObject, criterionType: '#Model.AdvanceBookingWindowCriterion', key1: 'minimumDays', key2: 'maximumDays', MTKey1: 'MinDays', MTKey2: 'MaxDays',\r\n });\r\n}\r\n\r\nexport function converODataObjectToLengthOfStayState(ODataObject) {\r\n return commonConverODataObjectToRangeTargetsState({\r\n ODataObject, criterionType: '#Model.LengthOfStayCriterion', key1: 'minimumNumber', key2: 'maximumNumber', MTKey1: 'MinNights', MTKey2: 'MaxNights',\r\n });\r\n}\r\n\r\nexport function converODataObjectToCheckinDayState(ODataObject) {\r\n return commonConverODataObjectToTargetsState({\r\n ODataObject, criterionType: '#Model.CheckInDayCriterion', keyCb(item) { return item.Criterion.CheckInDay; }, key: 'day', defaultSetting: checkinDayDefaultSetting,\r\n });\r\n}\r\n\r\nexport function converODataObjectToCheckinDateState(ODataObject) {\r\n const criterionType = '#Model.CheckInDateCriterion';\r\n const key1 = 'startDate';\r\n const key2 = 'endDate';\r\n const MTKey1 = 'StartDate';\r\n const MTKey2 = 'EndDate';\r\n\r\n const commonTargetCriterion = [];\r\n chain(ODataObject)\r\n .filter(item => item && item.Criterion &&\r\n item.Criterion['@odata.type'] === criterionType && item.CriterionBid)\r\n .value()\r\n .forEach((item) => {\r\n commonTargetCriterion.push({\r\n [key1]: new Date(item.Criterion[MTKey1]),\r\n [key2]: new Date(item.Criterion[MTKey2]),\r\n bidAdjustmentDropdown: `${item.CriterionBid.Multiplier < 0 ? 'Decrease by' : 'Increase by'}`,\r\n bidAdjustmentInput: item.CriterionBid.Multiplier < 0 ? -(item.CriterionBid.Multiplier - 0) : item.CriterionBid.Multiplier,\r\n Id: item.Id,\r\n Status: item.Status,\r\n });\r\n });\r\n return commonTargetCriterion;\r\n}\r\n\r\nexport function converODataObjectToUserSetDatesState(ODataObject) {\r\n const UserSetDatesMap = {\r\n UserSelection: 'Selected date',\r\n DefaultSelection: 'Default date',\r\n };\r\n return commonConverODataObjectToTargetsState({\r\n ODataObject, criterionType: '#Model.DateSelectionTypeCriterion', keyCb(item) { return UserSetDatesMap[item.Criterion.HotelDateSelectionType]; }, key: 'dates', defaultSetting: userSetDatesDefaultSetting,\r\n });\r\n}\r\n\r\nexport function send(activity, message, others = {}) {\r\n activity.signal(stringifySync({ messageType: message, ...others }));\r\n}\r\n\r\nexport function sendErrors(activity, message, response) {\r\n try {\r\n const { errors } = response;\r\n const errorCodes = _.chain(errors).map(error => error.Error || error.Code).uniq().value();\r\n errorCodes.forEach((error) => {\r\n send(activity, message, { error });\r\n });\r\n // eslint-disable-next-line no-empty\r\n } catch (err) {\r\n }\r\n}\r\n\r\nexport function createDefaultHotelGroup(cid, aid, campaignId, adGroupId, type, bid) {\r\n let defaultHotelGroup = {\r\n Id: -1,\r\n ParentId: null,\r\n RateBidAmount: null,\r\n IsLeaf: true,\r\n IsExcluded: false,\r\n IsBidLandscapeEnable: false,\r\n Condition: {\r\n Operand: 'All',\r\n Attribute: null,\r\n },\r\n CampaignId: parseInt(campaignId, 10),\r\n AdGroupId: parseInt(adGroupId, 10),\r\n };\r\n\r\n if (type === 'FixedBid') {\r\n defaultHotelGroup = {\r\n ...defaultHotelGroup,\r\n BidAmount: {\r\n Bid: {\r\n Amount: bid && decimal.fromLocalToFloat(bid),\r\n },\r\n },\r\n };\r\n } else {\r\n defaultHotelGroup = {\r\n ...defaultHotelGroup,\r\n RateBidAmount: {\r\n RateAmount: {\r\n Amount: bid && decimal.fromLocalToFloat(bid),\r\n },\r\n },\r\n };\r\n }\r\n\r\n const defaultHotelGroupPayload = {\r\n HotelListingGroupsToAdd: [\r\n defaultHotelGroup,\r\n ],\r\n HotelListingGroupsToDelete: [],\r\n };\r\n\r\n return edmCampaign.Customers.$withKey(cid).Accounts\r\n .$withKey(aid).Campaigns.$withKey(campaignId).AdGroups.$withKey(adGroupId).HotelListingGroups['Default.UpdateHotelListingTree']\r\n .$makeCall({ functionParams: {}, payload: defaultHotelGroupPayload }).toPromise();\r\n}\r\n\r\nexport function getCampaignData(cid, aid, campaignId) {\r\n return new Promise(resolve =>\r\n edmCampaign.Customers.$withKey(cid).Accounts.$withKey(aid).Campaigns.$withKey(campaignId).get({\r\n select: ['Budget'],\r\n }).toPromise()\r\n .then((response) => {\r\n resolve(convertODataObjectToCampaignState(response));\r\n })\r\n .catch((error) => {\r\n console.log(error);\r\n resolve({});\r\n }));\r\n}\r\n\r\nexport function parseDayTimeRanges(targets, resetId = false) {\r\n const schedulingRows = [];\r\n\r\n targets.forEach((target) => {\r\n const criterion = target.Criterion;\r\n const multiplier = target.CriterionBid.Multiplier;\r\n\r\n schedulingRows.push({\r\n Id: resetId ? '' : target.Id,\r\n Day: criterion.Day,\r\n StartHour: criterion.FromHour,\r\n StartMinute: criterion.FromMinute,\r\n EndHour: criterion.ToHour,\r\n EndMinute: criterion.ToMinute,\r\n BidAdjustmentType: multiplier < 0 ? -1 : 1,\r\n BidAdjustmentAmount: window.Math.abs(multiplier),\r\n });\r\n });\r\n\r\n return schedulingRows;\r\n}\r\n\r\nexport function getAdGroupTargetsCriterions({\r\n type, cid, aid, campaignId, adGroupId,\r\n}) {\r\n return new Promise(resolve =>\r\n edmCampaign.Customers.$withKey(cid).Accounts.$withKey(aid).Campaigns.$withKey(campaignId).AdGroups.$withKey(adGroupId).AdGroupCriterions.$cast('Model.AdGroupCriterion').get({\r\n filter: {\r\n where: type,\r\n },\r\n }).toPromise()\r\n .then((response) => {\r\n resolve(response.value);\r\n })\r\n .catch((error) => {\r\n console.log(error);\r\n resolve([]);\r\n }));\r\n}\r\n\r\nexport function getCampaignTargetsCriterions({\r\n type, cid, aid, campaignId,\r\n}) {\r\n return new Promise(resolve =>\r\n edmCampaign.Customers.$withKey(cid).Accounts.$withKey(aid).Campaigns.$withKey(campaignId).CampaignCriterions.$cast('Model.CampaignCriterion').get({\r\n filter: {\r\n where: type,\r\n },\r\n }).toPromise()\r\n .then((response) => {\r\n resolve(response.value);\r\n })\r\n .catch((error) => {\r\n console.log(error);\r\n resolve([]);\r\n }));\r\n}\r\n\r\nfunction analyzeHotelSettings(ODataObject) {\r\n const { Settings } = ODataObject;\r\n if (Settings) {\r\n const HotelSeting = Settings.find(x => x['@odata.type'] === '#Model.HotelSetting');\r\n if (HotelSeting) {\r\n const HotelAdGroupType = HotelSeting.HotelAdGroupType || '';\r\n return ({\r\n adFormat: {\r\n HPA: HotelAdGroupType.includes('HotelAd'),\r\n PPA: HotelAdGroupType.includes('PropertyAd'),\r\n },\r\n });\r\n }\r\n }\r\n return ({\r\n adFormat: {\r\n HPA: false,\r\n PPA: false,\r\n },\r\n });\r\n}\r\n\r\nfunction getBaseBid(ODataObject) {\r\n const data = {\r\n };\r\n if (ODataObject.PercentCpcBid) {\r\n data.percentCpcBid = ODataObject.PercentCpcBid && ODataObject.PercentCpcBid.RateAmount && ODataObject.PercentCpcBid.RateAmount.Amount;\r\n data.percentCpcBid = data.percentCpcBid && decimal.fromFloatToStringNoTrailingZero(data.percentCpcBid);\r\n }\r\n if (ODataObject.CommissionRate) {\r\n data.commissionRate = ODataObject.CommissionRate && ODataObject.CommissionRate.RateAmount && ODataObject.CommissionRate.RateAmount.Amount;\r\n data.commissionRate = data.commissionRate && decimal.fromFloatToStringNoTrailingZero(data.commissionRate);\r\n }\r\n data.searchBid = ODataObject.CpcBid && decimal.fromFloatToStringNoTrailingZero(ODataObject.CpcBid);\r\n return data;\r\n}\r\n\r\nexport function convertODataObjectToAdGroupState(ODataObject) {\r\n return {\r\n TimeZone: timeZoneMapper.getAccountTimeZone(),\r\n Id: ODataObject.Id,\r\n name: {\r\n value: ODataObject.Name,\r\n },\r\n audienceAds: {\r\n currentLevelSettings: {\r\n option: ODataObject.NativeBidAdjustment == null || ODataObject.NativeBidAdjustment >= 0 ? audienceAdsOptionKeys.Increase : audienceAdsOptionKeys.Decrease,\r\n value: ODataObject.NativeBidAdjustment == null ? 0 : Math.abs(ODataObject.NativeBidAdjustment),\r\n },\r\n parentLevelSettings: {\r\n },\r\n useParentLevel: ODataObject.NativeBidAdjustment == null,\r\n },\r\n StartDate: ODataObject.StartDate,\r\n EndDate: ODataObject.EndDate,\r\n Status: ODataObject.Status,\r\n AdDistribution: ODataObject.AdDistribution,\r\n AdScheduleUseSearcherTimeZone: ODataObject.AdScheduleUseSearcherTimeZone,\r\n baseBid: getBaseBid(ODataObject),\r\n ...analyzeHotelSettings(ODataObject),\r\n urlOptions: {\r\n TrackingUrlTemplate: ODataObject.TrackingUrlTemplate,\r\n FinalUrlSuffix: ODataObject.FinalUrlSuffix,\r\n UrlCustomParameters: ODataObject.UrlCustomParameters,\r\n },\r\n };\r\n}\r\n\r\nexport function getAdGroupData(cid, aid, campaignId, adGroupId) {\r\n return new Promise(resolve =>\r\n edmCampaign.Customers.$withKey(cid).Accounts.$withKey(aid).Campaigns.$withKey(campaignId).AdGroups.$withKey(adGroupId).get({\r\n }).toPromise()\r\n .then((response) => {\r\n resolve(convertODataObjectToAdGroupState(response));\r\n })\r\n .catch((error) => {\r\n console.log(error);\r\n resolve({});\r\n }));\r\n}\r\n\r\nfunction getTargetCriterionType(type) {\r\n if (type.indexOf('DeviceOS Criterion') > -1) {\r\n return 'device';\r\n }\r\n if (type.indexOf('Advance Booking Window Criterion') > -1) {\r\n return 'ABW';\r\n }\r\n if (type.indexOf('Length of Stay Criterion') > -1) {\r\n return 'lengthOfStay';\r\n }\r\n if (type.indexOf('Check In Day Criterion') > -1) {\r\n return 'checkinDay';\r\n }\r\n if (type.indexOf('Check In Date Criterion') > -1) {\r\n return 'checkinDate';\r\n }\r\n if (type.indexOf('Hotel Date Selection Type Criterion') > -1) {\r\n return 'userSetDates';\r\n }\r\n if (type.indexOf('Location Intent Criterion') > -1 || type.indexOf('Location Criterion') > -1) {\r\n return 'location';\r\n }\r\n return null;\r\n}\r\n\r\nexport function updateDeviceByResponse(criterion, device, patchCampaignOrAdgroup) {\r\n const DeviceMap = {\r\n Tablets: 'Tablet',\r\n Computers: 'Computer',\r\n Smartphones: 'Smartphone',\r\n };\r\n let tempCurrentLevelSettings = [];\r\n for (let j = 0; j < criterion.length; j++) {\r\n const currentCriterion = criterion[j];\r\n if (currentCriterion.Status !== 'Deleted') {\r\n tempCurrentLevelSettings.push({\r\n targeted: 'Targeted',\r\n device: DeviceMap[currentCriterion.Criterion.DeviceCriterion.DeviceName],\r\n bidAdjustmentDropdown: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? 'Increase by' : 'Decrease by',\r\n bidAdjustmentInput: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? currentCriterion.Criterion.BidAdjustment - 0 : -currentCriterion.Criterion.BidAdjustment,\r\n Id: currentCriterion.Id,\r\n Status: currentCriterion.Status,\r\n });\r\n }\r\n }\r\n if (tempCurrentLevelSettings.length === 0) {\r\n tempCurrentLevelSettings = deviceDefaultSetting;\r\n }\r\n const tempDevice = {\r\n ...device,\r\n currentLevelSettings: tempCurrentLevelSettings,\r\n reset: true,\r\n };\r\n if (patchCampaignOrAdgroup) {\r\n patchCampaignOrAdgroup('device', tempDevice);\r\n }\r\n return tempCurrentLevelSettings;\r\n}\r\n\r\nexport function updateABWByResponse(criterion, ABW, patchCampaignOrAdgroup) {\r\n let tempCurrentLevelSettings = [];\r\n for (let j = 0; j < criterion.length; j++) {\r\n const currentCriterion = criterion[j];\r\n if (currentCriterion.Status !== 'Deleted') {\r\n tempCurrentLevelSettings.push({\r\n minimumDays: currentCriterion.Criterion.AdvanceBookingWindowCriterion.MinDays,\r\n maximumDays: currentCriterion.Criterion.AdvanceBookingWindowCriterion.MaxDays,\r\n bidAdjustmentDropdown: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? 'Increase by' : 'Decrease by',\r\n bidAdjustmentInput: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? currentCriterion.Criterion.BidAdjustment - 0 : -currentCriterion.Criterion.BidAdjustment,\r\n Id: currentCriterion.Id,\r\n Status: currentCriterion.Status,\r\n });\r\n }\r\n }\r\n if (tempCurrentLevelSettings.length === 0) {\r\n tempCurrentLevelSettings = advancedBookingDefaultSetting;\r\n }\r\n const tempABW = {\r\n ...ABW,\r\n currentLevelSettings: tempCurrentLevelSettings,\r\n reset: true,\r\n };\r\n if (patchCampaignOrAdgroup) {\r\n patchCampaignOrAdgroup('ABW', tempABW);\r\n }\r\n return tempCurrentLevelSettings;\r\n}\r\n\r\nexport function updateCheckinDayByResponse(criterion, checkinDay, patchCampaignOrAdgroup) {\r\n let tempCurrentLevelSettings = [];\r\n for (let j = 0; j < criterion.length; j++) {\r\n const currentCriterion = criterion[j];\r\n if (currentCriterion.Status !== 'Deleted') {\r\n tempCurrentLevelSettings.push({\r\n day: currentCriterion.Criterion.CheckInDayCriterion.CheckInDay,\r\n bidAdjustmentDropdown: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? 'Increase by' : 'Decrease by',\r\n bidAdjustmentInput: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? currentCriterion.Criterion.BidAdjustment - 0 : -currentCriterion.Criterion.BidAdjustment,\r\n Id: currentCriterion.Id,\r\n Status: currentCriterion.Status,\r\n });\r\n }\r\n }\r\n if (tempCurrentLevelSettings.length === 0) {\r\n tempCurrentLevelSettings = checkinDayDefaultSetting;\r\n }\r\n const tempCheckinDay = {\r\n ...checkinDay,\r\n currentLevelSettings: tempCurrentLevelSettings,\r\n reset: true,\r\n };\r\n if (patchCampaignOrAdgroup) {\r\n patchCampaignOrAdgroup('checkinDay', tempCheckinDay);\r\n }\r\n return tempCurrentLevelSettings;\r\n}\r\n\r\nexport function updateLengthOfStayByResponse(criterion, lengthOfStay, patchCampaignOrAdgroup) {\r\n let tempCurrentLevelSettings = [];\r\n for (let j = 0; j < criterion.length; j++) {\r\n const currentCriterion = criterion[j];\r\n if (currentCriterion.Status !== 'Deleted') {\r\n tempCurrentLevelSettings.push({\r\n minimumNumber: currentCriterion.Criterion.LengthofStayCriterion.MinNights,\r\n maximumNumber: currentCriterion.Criterion.LengthofStayCriterion.MaxNights,\r\n bidAdjustmentDropdown: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? 'Increase by' : 'Decrease by',\r\n bidAdjustmentInput: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? currentCriterion.Criterion.BidAdjustment - 0 : -currentCriterion.Criterion.BidAdjustment,\r\n Id: currentCriterion.Id,\r\n Status: currentCriterion.Status,\r\n });\r\n }\r\n }\r\n if (tempCurrentLevelSettings.length === 0) {\r\n tempCurrentLevelSettings = lengthOfStayDefaultSetting;\r\n }\r\n const tempLengthOfStay = {\r\n ...lengthOfStay,\r\n currentLevelSettings: tempCurrentLevelSettings,\r\n reset: true,\r\n };\r\n if (patchCampaignOrAdgroup) {\r\n patchCampaignOrAdgroup('lengthOfStay', tempLengthOfStay);\r\n }\r\n return tempCurrentLevelSettings;\r\n}\r\n\r\nexport function updateCheckinDateByResponse(criterion, checkinDate, patchCampaignOrAdgroup) {\r\n let tempCurrentLevelSettings = [];\r\n for (let j = 0; j < criterion.length; j++) {\r\n const currentCriterion = criterion[j];\r\n if (currentCriterion.Status !== 'Deleted') {\r\n tempCurrentLevelSettings.push({\r\n startDate: new Date(currentCriterion.Criterion.CheckInDateCriterion.StartDate),\r\n endDate: new Date(currentCriterion.Criterion.CheckInDateCriterion.EndDate),\r\n bidAdjustmentDropdown: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? 'Increase by' : 'Decrease by',\r\n bidAdjustmentInput: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? currentCriterion.Criterion.BidAdjustment - 0 : -currentCriterion.Criterion.BidAdjustment,\r\n Id: currentCriterion.Id,\r\n Status: currentCriterion.Status,\r\n });\r\n }\r\n }\r\n if (tempCurrentLevelSettings.length === 0) {\r\n tempCurrentLevelSettings = checkinDateDefaultSetting;\r\n }\r\n const tempCheckinDate = {\r\n ...checkinDate,\r\n currentLevelSettings: tempCurrentLevelSettings,\r\n reset: true,\r\n };\r\n if (patchCampaignOrAdgroup) {\r\n patchCampaignOrAdgroup('checkinDate', tempCheckinDate);\r\n }\r\n return tempCurrentLevelSettings;\r\n}\r\n\r\nexport function updateUserSetDatesByResponse(criterion, userSetDates, patchCampaignOrAdgroup) {\r\n const UserSetDatesMap = {\r\n UserSelection: 'Selected date',\r\n DefaultSelection: 'Default date',\r\n };\r\n\r\n let tempCurrentLevelSettings = [];\r\n for (let j = 0; j < criterion.length; j++) {\r\n const currentCriterion = criterion[j];\r\n if (currentCriterion.Status !== 'Deleted') {\r\n tempCurrentLevelSettings.push({\r\n dates: UserSetDatesMap[currentCriterion.Criterion.DateSelectionTypeCriterion.HotelDateSelectionType],\r\n bidAdjustmentDropdown: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? 'Increase by' : 'Decrease by',\r\n bidAdjustmentInput: currentCriterion.Criterion.BidAdjustment - 0 >= 0 ? currentCriterion.Criterion.BidAdjustment - 0 : -currentCriterion.Criterion.BidAdjustment,\r\n Id: currentCriterion.Id,\r\n Status: currentCriterion.Status,\r\n });\r\n }\r\n }\r\n if (tempCurrentLevelSettings.length === 0) {\r\n tempCurrentLevelSettings = userSetDatesDefaultSetting;\r\n }\r\n const tempUserSetDates = {\r\n ...userSetDates,\r\n currentLevelSettings: tempCurrentLevelSettings,\r\n reset: true,\r\n };\r\n if (patchCampaignOrAdgroup) {\r\n patchCampaignOrAdgroup('userSetDates', tempUserSetDates);\r\n }\r\n return tempCurrentLevelSettings;\r\n}\r\n\r\nfunction expandSettingsWithErrors(response, subViews) {\r\n const properties = _.groupBy(response.entity.errors, 'property');\r\n const urlOptionsHaveErrors = _.has(properties, 'TrackingUrlTemplate') || _.has(properties, 'UrlCustomParameters') || _.has(properties, 'FinalUrlSuffix');\r\n if (urlOptionsHaveErrors) {\r\n subViews.urlOptionsView.expandSettingsWithApiErrors(_.has(properties, 'TrackingUrlTemplate'), _.has(properties, 'UrlCustomParameters'), _.has(properties, 'FinalUrlSuffix'));\r\n }\r\n}\r\n\r\nfunction errorElements(level) {\r\n return $(`.hotel-${level}-shared .error-string,.hotel-${level}-shared .error, .hotel-${level}-shared .alert-danger`).filter(':visible');\r\n}\r\n\r\nexport function scrollToErrors(level) {\r\n setTimeout(() => { scrollUtils.scrollAndCenter(errorElements(level)); }, 0);\r\n}\r\n\r\nexport function showWarning(level, i18n, removeLastWarning) {\r\n if (removeLastWarning) {\r\n removeLastWarning();\r\n }\r\n const id = notificationApi.showWarning(i18n.getString(_TL_('Please correct the following errors.')));\r\n const interval = {};\r\n const timeout = 500;\r\n const removeWarningInterval = () => {\r\n if (interval.id) {\r\n notificationApi.dismiss(id);\r\n clearInterval(interval.id);\r\n interval.id = undefined;\r\n }\r\n };\r\n const dismissFunc = () => {\r\n // clear the error automatically,\r\n // TODO: check the error from react component state or via jquery DOM?\r\n if (errorElements(level).length === 0) {\r\n removeWarningInterval();\r\n }\r\n };\r\n interval.id = setInterval(dismissFunc, timeout);\r\n return removeWarningInterval;\r\n}\r\n\r\nfunction handleCommonTargetsError(entity, i18n, errors) {\r\n const allTargetsApiErrors = {};\r\n for (let i = 0; i < errors.length; i++) {\r\n const currentError = errors[i];\r\n for (let j = 0; j < entity.length; j++) {\r\n const currentEntity = entity[j];\r\n if (currentError['Client Id'] === currentEntity['Client Id']) {\r\n if (!allTargetsApiErrors[getTargetCriterionType(currentError.Type)]) {\r\n allTargetsApiErrors[getTargetCriterionType(currentError.Type)] = [];\r\n }\r\n const key = HotelErrorToErrorMessageMapping[currentEntity.errors[0].code];\r\n const newHotelErrMsg = key ? i18n.getString(key) : undefined;\r\n const apiErrMsg = newHotelErrMsg || currentEntity.errors[0].message;\r\n if (allTargetsApiErrors[getTargetCriterionType(currentError.Type)].indexOf(apiErrMsg) === -1) {\r\n allTargetsApiErrors[getTargetCriterionType(currentError.Type)].push(apiErrMsg);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n return allTargetsApiErrors;\r\n}\r\n\r\nfunction parseEntityApiErrors(response, level) {\r\n let errors = (response.entity && response.entity.errors) || [];\r\n\r\n if (level === 'campaign' && response.entity && response.entity.Id) {\r\n let adGroupErrors = [];\r\n // Collect ad group errors\r\n if (response.errors) {\r\n adGroupErrors = i18nErrors.getBulkApiErrors(response.errors.filter(error => error.Type === 'AdGroup Error')).map(error => ({ ...error, property: 'General' }));\r\n }\r\n errors = errors.concat(adGroupErrors);\r\n }\r\n\r\n if (errors && errors.length) {\r\n const general = 'General';\r\n const ignoredErrors = ['TrackingUrlTemplate', 'UrlCustomParameters', 'FinalUrlSuffix'];\r\n const classified = ['Name'];\r\n errors = errors.filter(error => !ignoredErrors.includes(error.property));\r\n errors.forEach((error) => {\r\n const target = error;\r\n if (_.isEmpty(target.property) || !classified.includes(target.property)) {\r\n target.property = general;\r\n }\r\n });\r\n return _.groupBy(errors, 'property');\r\n }\r\n return {};\r\n}\r\n\r\nexport function mergeAdGroupStateWithErrors(state, errors) {\r\n const {\r\n entityApiErrors,\r\n targetsApiErrors,\r\n } = errors;\r\n return {\r\n ...state,\r\n name: {\r\n ...state.name,\r\n errors: entityApiErrors.Name ? [...entityApiErrors.Name] : [],\r\n },\r\n location: {\r\n ...state.location,\r\n errors: targetsApiErrors.location ? [...targetsApiErrors.location] : [],\r\n },\r\n };\r\n}\r\n\r\nexport function mergeCampaignStateWithErrors(state, errors) {\r\n const {\r\n entityApiErrors,\r\n targetsApiErrors,\r\n } = errors;\r\n return {\r\n ...state,\r\n name: {\r\n ...state.name,\r\n errors: entityApiErrors.Name ? [...entityApiErrors.Name] : [],\r\n },\r\n location: {\r\n ...state.location,\r\n errors: targetsApiErrors.location ? [...targetsApiErrors.location] : [],\r\n },\r\n };\r\n}\r\n\r\nfunction handleErrors(response, i18n, subViews, criterionsType, level) {\r\n if (response && response.entity && !response.entity.Id) {\r\n // If campaign is not created, show only the entity errors,\r\n return {\r\n targetsApiErrors: {},\r\n advancedSettinsApiErrors: {},\r\n entityApiErrors: parseEntityApiErrors(response, level),\r\n };\r\n }\r\n\r\n _.each(subViews, (view) => {\r\n if (_.isFunction(view.handleErrors)) {\r\n response.errors = view.handleErrors(response);\r\n }\r\n });\r\n\r\n let urlOptionsHaveErrors = false;\r\n const advancedSettinsApiErrors = {};\r\n if (response.entity.errors) {\r\n const properties = _.groupBy(response.entity.errors, 'property');\r\n subViews.urlOptionsView.handleApiErrors(properties);\r\n urlOptionsHaveErrors = _.has(properties, 'TrackingUrlTemplate') || _.has(properties, 'UrlCustomParameters') || _.has(properties, 'FinalUrlSuffix');\r\n if (urlOptionsHaveErrors) {\r\n if (!advancedSettinsApiErrors.urlOptions) {\r\n advancedSettinsApiErrors.urlOptions = [];\r\n }\r\n if (_.has(properties, 'TrackingUrlTemplate')) { advancedSettinsApiErrors.urlOptions.push({ TrackingUrlTemplate: properties.TrackingUrlTemplate }); }\r\n if (_.has(properties, 'UrlCustomParameters')) { advancedSettinsApiErrors.urlOptions.push({ UrlCustomParameters: properties.UrlCustomParameters || 'ssss' }); }\r\n if (_.has(properties, 'FinalUrlSuffix')) { advancedSettinsApiErrors.urlOptions.push({ FinalUrlSuffix: properties.FinalUrlSuffix || 'ssssddd' }); }\r\n }\r\n response.errors = _.reject(response.errors, err => err.Property === 'TrackingUrlTemplate' || err.Property === 'UrlCustomParameters');\r\n }\r\n\r\n expandSettingsWithErrors(response, subViews);\r\n\r\n return {\r\n targetsApiErrors: handleCommonTargetsError(response.entity && response.entity[criterionsType], i18n, response.errors),\r\n advancedSettinsApiErrors,\r\n entityApiErrors: parseEntityApiErrors(response, level),\r\n };\r\n}\r\n\r\nconst defaultErrorObject = {\r\n targetsApiErrors: {},\r\n advancedSettinsApiErrors: {},\r\n entityApiErrors: {},\r\n};\r\n\r\nexport function handleApiErrors(response, i18n, subViews, level) {\r\n const criterionsType = level === 'campaign' ? 'CampaignCriterions' : 'AdGroupCriterions';\r\n\r\n if (_.isUndefined(response) || _.isNull(response)) {\r\n return defaultErrorObject;\r\n }\r\n\r\n if (response.errors && !response.entity) {\r\n // Ajax error [400] - RowCountExceeded\r\n // TODO show context error in page\r\n return {\r\n ...defaultErrorObject,\r\n entityApiErrors: {\r\n General: i18nErrors.getODataErrors(response.errors),\r\n },\r\n };\r\n }\r\n\r\n if (response === 'exclusion error') {\r\n return defaultErrorObject;\r\n }\r\n\r\n if (response.errors) {\r\n const processItems = [`${criterionsType}`].concat(Object.prototype.hasOwnProperty.call(response.entity, 'AdExtensionAssociations') ? ['AdExtensionAssociations'] : []);\r\n i18nErrors.getPartial(response, processItems);\r\n scrollToErrors(level);\r\n return handleErrors(response, i18n, subViews, criterionsType, level);\r\n }\r\n return defaultErrorObject;\r\n}\r\n\r\n\r\nexport function clearSubViewApiErrors(subViews) {\r\n _.each(subViews, (view) => {\r\n if (_.isFunction(view.clearApiErrors)) {\r\n view.clearApiErrors();\r\n }\r\n });\r\n}\r\n\r\n\r\nexport function invalidateCache(entityName, ids) {\r\n if (edmCampaign['odata.cache']) {\r\n edmCampaign['odata.cache'].invalidateTypeCache(entityName, null, '');\r\n if (!_.isEmpty(ids)) {\r\n _.each(ids, id => edmCampaign['odata.cache'].invalidateTypeCache(entityName, id, ''));\r\n }\r\n }\r\n}\r\n\r\n\r\nexport const subscribeUrlOptions = (context, globalErrorMsg) => {\r\n context.urlOptionsView.trackingTemplate.ko_model.getTrackingTemplate.subscribe(() => {\r\n const urlOptionsApiErrors = context.state.advancedSettinsApiErrors.urlOptions;\r\n const newUrlOptionsApiErrors = [];\r\n if (urlOptionsApiErrors && urlOptionsApiErrors.length) {\r\n urlOptionsApiErrors.forEach((item) => {\r\n if (Object.keys(item)[0] !== 'TrackingUrlTemplate') { newUrlOptionsApiErrors.push(item); }\r\n });\r\n context.urlOptionsView.trackingTemplate.ko_model.trackingTemplateErrors([]);\r\n context.patchAdvancedSettinsApiErrors('urlOptions', newUrlOptionsApiErrors);\r\n }\r\n if (!newUrlOptionsApiErrors.length && context.urlOptionsView.isValid()) {\r\n context.patchErrMsg('urlOptions', '');\r\n } else {\r\n context.patchErrMsg('urlOptions', globalErrorMsg);\r\n }\r\n });\r\n context.urlOptionsView.finalUrlSuffix.viewModel.errorMessages.subscribe(() => {\r\n const urlOptionsApiErrors = context.state.advancedSettinsApiErrors.urlOptions;\r\n const newUrlOptionsApiErrors = [];\r\n if (urlOptionsApiErrors && urlOptionsApiErrors.length) {\r\n urlOptionsApiErrors.forEach((item) => {\r\n if (Object.keys(item)[0] !== 'FinalUrlSuffix') { newUrlOptionsApiErrors.push(item); }\r\n });\r\n if (context.urlOptionsView.options.isFinalURLSuffixEnabled) {\r\n context.urlOptionsView.finalUrlSuffix.viewModel.externalErrors([]);\r\n }\r\n context.patchAdvancedSettinsApiErrors('urlOptions', newUrlOptionsApiErrors);\r\n }\r\n if (!newUrlOptionsApiErrors.length && context.urlOptionsView.isValid()) {\r\n context.patchErrMsg('urlOptions', '');\r\n } else {\r\n context.patchErrMsg('urlOptions', globalErrorMsg);\r\n }\r\n });\r\n context.urlOptionsView.customParams.viewModel.parameterArray.subscribe(() => {\r\n const urlOptionsApiErrors = context.state.advancedSettinsApiErrors.urlOptions;\r\n const newUrlOptionsApiErrors = [];\r\n if (urlOptionsApiErrors && urlOptionsApiErrors.length) {\r\n urlOptionsApiErrors.forEach((item) => {\r\n if (Object.keys(item)[0] !== 'UrlCustomParameters') { newUrlOptionsApiErrors.push(item); }\r\n });\r\n context.urlOptionsView.customParams.viewModel.parametersError([]);\r\n context.patchAdvancedSettinsApiErrors('urlOptions', newUrlOptionsApiErrors);\r\n }\r\n if (!newUrlOptionsApiErrors.length && context.urlOptionsView.isValid()) {\r\n context.patchErrMsg('urlOptions', '');\r\n } else {\r\n context.patchErrMsg('urlOptions', globalErrorMsg);\r\n }\r\n });\r\n};\r\n\r\nexport const subscribeSiteExclusion = (context) => {\r\n context.siteExclusionView.viewModel.getExclusions.subscribe(() => {\r\n const baseExclusionApiErrors = context.state.advancedSettinsApiErrors.baseExclusion;\r\n if (baseExclusionApiErrors && baseExclusionApiErrors.length) {\r\n const newExclusionApiErrors = [];\r\n baseExclusionApiErrors.forEach((item) => {\r\n if (Object.keys(item)[0] !== 'siteErrors') { newExclusionApiErrors.push(item); }\r\n });\r\n context.siteExclusionView.clearApiErrors();\r\n context.patchAdvancedSettinsApiErrors('baseExclusion', newExclusionApiErrors);\r\n if (newExclusionApiErrors.length === 0) {\r\n context.patchErrMsg('baseExclusion', '');\r\n }\r\n }\r\n });\r\n};\r\n\r\nexport const subscribeIPExclusion = (context) => {\r\n context.IPExclusionView.viewModel.getExclusions.subscribe(() => {\r\n const baseExclusionApiErrors = context.state.advancedSettinsApiErrors.baseExclusion;\r\n if (baseExclusionApiErrors && baseExclusionApiErrors.length) {\r\n const newExclusionApiErrors = [];\r\n baseExclusionApiErrors.forEach((item) => {\r\n if (Object.keys(item)[0] !== 'ipErrors') { newExclusionApiErrors.push(item); }\r\n });\r\n context.IPExclusionView.clearApiErrors();\r\n context.patchAdvancedSettinsApiErrors('baseExclusion', newExclusionApiErrors);\r\n if (newExclusionApiErrors.length === 0) {\r\n context.patchErrMsg('baseExclusion', '');\r\n }\r\n }\r\n });\r\n};\r\n","import { validateNumber, numberErrorCode } from '../../utility';\r\n\r\nexport const audienceAdsOptionKeys = {\r\n Increase: 'Increase',\r\n Decrease: 'Decrease',\r\n};\r\n\r\nexport function getAudienceData(audienceAds) {\r\n const data = audienceAds.useParentLevel ? audienceAds.parentLevelSettings : audienceAds.currentLevelSettings;\r\n return data;\r\n}\r\n\r\n\r\nexport const audienceAdsOptions = i18n => [\r\n {\r\n key: audienceAdsOptionKeys.Increase, text: i18n.getString(_TL_('Increase by')),\r\n },\r\n {\r\n key: audienceAdsOptionKeys.Decrease, text: i18n.getString(_TL_('Decrease by')),\r\n },\r\n];\r\n\r\nexport const getAudienceAds = (audienceAds) => {\r\n if (audienceAds.useParentLevel) {\r\n return {\r\n NativeBidAdjustment: null,\r\n };\r\n }\r\n\r\n const {\r\n currentLevelSettings,\r\n } = audienceAds;\r\n\r\n const {\r\n option,\r\n value,\r\n } = currentLevelSettings;\r\n\r\n if (option === audienceAdsOptionKeys.Decrease) {\r\n return {\r\n NativeBidAdjustment: -value,\r\n };\r\n }\r\n return {\r\n NativeBidAdjustment: value,\r\n };\r\n};\r\n\r\nconst maxIn = 900;\r\nconst maxDe = 100;\r\n\r\nconst getMinMax = (data) => {\r\n if (data == null) {\r\n return {\r\n min: 0,\r\n max: maxIn,\r\n };\r\n }\r\n\r\n if (data.option === audienceAdsOptionKeys.Increase) {\r\n return {\r\n min: 0,\r\n max: maxIn,\r\n };\r\n }\r\n return {\r\n min: 0,\r\n max: maxDe,\r\n };\r\n};\r\n\r\nexport const getAudienceAdsDetails = ({ rawData, i18n }) => {\r\n const data = getAudienceData(rawData);\r\n let { value } = data;\r\n const { option } = data;\r\n value = option === audienceAdsOptionKeys.Increase ? value : -value;\r\n return i18n.getString(_TL_('Audience ads bid adjustment: {{value}}%'), { value });\r\n};\r\n\r\nexport const validateAudienceAds = (rawData) => {\r\n const data = getAudienceData(rawData);\r\n const { min, max } = getMinMax(data);\r\n const { value } = data;\r\n return validateNumber({\r\n value, min, max, shouldBePositive: true, isInteger: true,\r\n });\r\n};\r\n\r\nexport const isAudienceAdsValid = rawData => validateAudienceAds(rawData) == null;\r\n\r\nexport const getAudiencesAdsErrorMsg = ({\r\n code, i18n,\r\n}) => {\r\n switch (code) {\r\n case numberErrorCode.RequiredField:\r\n return i18n.getString(_TL_('The bid adjustment cannot be empty.'));\r\n case numberErrorCode.InValidNumber:\r\n case numberErrorCode.NotPositive:\r\n case numberErrorCode.WholeNumber:\r\n return i18n.getString(_TL_('Enter a positive, whole number.'));\r\n case numberErrorCode.OutOfRange:\r\n return i18n.getString(_TL_('The maximum increase is {{maxIn}}%; the maximum decrease is {{maxDe}}%.'), { maxIn, maxDe });\r\n default:\r\n return null;\r\n }\r\n};\r\n","/* eslint-disable no-script-url */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport classnames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport React, { useCallback, useContext } from 'react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { Dropdown, Label, Stack, TextField } from '@bingads-webui-react/fabric-control';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\nimport { ErrorString, SpanWithComponent, checkShouldShowError } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { audienceAdsOptionKeys, audienceAdsOptions, getAudiencesAdsErrorMsg, validateAudienceAds, getAudienceData } from './utility';\r\n\r\nconst getStyles = () => ({\r\n audienceAdsContainer: {\r\n },\r\n});\r\n\r\nfunction getValue(audienceAds) {\r\n const data = getAudienceData(audienceAds);\r\n return data.value;\r\n}\r\n\r\nconst BidAdjustment = React.memo((props) => {\r\n const {\r\n audienceAds,\r\n setAudienceAds,\r\n } = props;\r\n const currentValue = getValue(audienceAds);\r\n const readOnly = audienceAds.useParentLevel;\r\n\r\n return (\r\n <div className=\"bid-adjustment\">\r\n <Stack horizontal verticalAlign=\"center\" tokens={{ childrenGap: 4 }}>\r\n <TextField\r\n value={currentValue}\r\n placeholder=\"\"\r\n ariaLabel=\"bid-adjustment-label\"\r\n styles={{ fieldGroup: { width: 80 } }}\r\n onBlur={() => { setAudienceAds({ isDirty: true }); }}\r\n onChange={(e, value) => { setAudienceAds({ value, isDirty: true }); }}\r\n disabled={readOnly}\r\n />\r\n <span className=\"percent-mark\">%</span>\r\n </Stack>\r\n </div>\r\n );\r\n});\r\n\r\nBidAdjustment.propTypes = {\r\n audienceAds: PropTypes.shape({}),\r\n setAudienceAds: PropTypes.func.isRequired,\r\n};\r\n\r\nBidAdjustment.defaultProps = {\r\n audienceAds: {},\r\n};\r\n\r\nfunction getSelectedKey(audienceAds) {\r\n const data = audienceAds.useParentLevel ? audienceAds.parentLevelSettings : audienceAds.currentLevelSettings;\r\n return data.option || audienceAdsOptionKeys.Increase;\r\n}\r\n\r\nexport const AudienceAds = React.memo((props) => {\r\n const {\r\n audienceAds,\r\n setAudienceAds,\r\n } = props;\r\n\r\n const mySetAudienceAds = useCallback((partialUpdate) => {\r\n setAudienceAds({\r\n ...audienceAds,\r\n currentLevelSettings: {\r\n ...audienceAds.currentLevelSettings,\r\n ...partialUpdate,\r\n },\r\n isDirty: partialUpdate.isDirty || audienceAds.isDirty,\r\n });\r\n }, [audienceAds, setAudienceAds]);\r\n\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n const i18n = useContext(I18nContext);\r\n const audienceAdsBidAdjustmentText = i18n.getString(_TL_('Audience ads bid adjustment'));\r\n const labelId = 'audience-ads-label';\r\n const shouldShowError = checkShouldShowError(audienceAds);\r\n const error = getAudiencesAdsErrorMsg({ code: validateAudienceAds(audienceAds), i18n });\r\n const selectedKey = getSelectedKey(audienceAds);\r\n const readOnly = audienceAds.useParentLevel;\r\n\r\n return (\r\n <div className={classnames(classes.audienceAdsContainer, 'audience-ads')}>\r\n <Label className=\"audience-ads\" id={labelId} >\r\n <SpanWithComponent\r\n SpanText={audienceAdsBidAdjustmentText}\r\n Component={() => (\r\n <HelpPopup\r\n topic=\"pop_BA_NativeAd_BidAdj\"\r\n aria-label={i18n.getString(_TL_('Click to learn more about {{item}}'), { item: audienceAdsBidAdjustmentText })}\r\n />)}\r\n />\r\n </Label>\r\n <div className=\"audience-ads-options\">\r\n <Stack horizontal verticalAlign=\"center\" tokens={{ childrenGap: 4 }}>\r\n <Dropdown\r\n aria-label=\"audience-ads-options-label\"\r\n options={audienceAdsOptions(i18n)}\r\n defaultSelectedKey={selectedKey}\r\n styles={{\r\n dropdown: {\r\n width: 133,\r\n },\r\n }}\r\n disabled={readOnly}\r\n onChange={(e, option) => mySetAudienceAds({ option: option.key })}\r\n />\r\n <BidAdjustment {...props} setAudienceAds={mySetAudienceAds} />\r\n </Stack>\r\n </div>\r\n {shouldShowError && error && <ErrorString error={error} />}\r\n </div>\r\n );\r\n});\r\n\r\nAudienceAds.propTypes = {\r\n audienceAds: PropTypes.shape({}),\r\n setAudienceAds: PropTypes.func.isRequired,\r\n};\r\n\r\nAudienceAds.defaultProps = {\r\n audienceAds: {},\r\n};\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport BaseExclusionView from '@bingads-webui-campaign-legacy/advanced-settings/view/base-exclusion';\r\nimport exclusionRepository from '@bingads-webui-campaign-legacy/advanced-settings/util/exclusion-repository';\r\nimport _ from 'underscore';\r\nimport { merge } from '@bingads-webui/primitive-utilities';\r\nimport { sharedStylesFromSelDesign } from '@bingads-webui-campaign-react/campaign-adgroup-settings-shared-styles';\r\nimport classnames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport React, { useContext, useCallback, useState, useEffect } from 'react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\nimport { SpanWithComponent } from '@bingads-webui-campaign-react/wizard-shared-components';\r\nimport { useBackboneView } from '../shared';\r\n\r\nconst getStyles = () => ({\r\n '@global': merge(\r\n {},\r\n sharedStylesFromSelDesign()\r\n ),\r\n baseExclusionContainer: {\r\n '& .exclusion-wraper .row': {\r\n marginLeft: 0,\r\n marginRight: 0,\r\n },\r\n },\r\n});\r\n\r\n\r\nconst SiteExclusionView = ({ options }) => {\r\n const baseExclusionReactWrapper = useBackboneView(useCallback(() => new BaseExclusionView({\r\n exclusions: _.result(options.exclusions, 'ExcludedSites'),\r\n exclusionType: 'site',\r\n level: options.level,\r\n campaignExclusions: _.result(options.campaignExclusions, 'ExcludedSites'),\r\n }).render(), [options.campaignExclusions, options.exclusions, options.level]), options.setSiteExclusionView);\r\n return <>{baseExclusionReactWrapper}</>;\r\n};\r\nSiteExclusionView.propTypes = {\r\n options: PropTypes.shape({}).isRequired,\r\n};\r\nSiteExclusionView.defaultProps = {\r\n};\r\n\r\n\r\nconst IPExclusionView = ({ options }) => {\r\n const baseExclusionReactWrapper = useBackboneView(useCallback(() => new BaseExclusionView({\r\n exclusions: _.result(options.exclusions, 'ExcludedIPs'),\r\n exclusionType: 'ip',\r\n }).render(), [options.exclusions]), options.setIPExclusionView);\r\n return <>{baseExclusionReactWrapper}</>;\r\n};\r\nIPExclusionView.propTypes = {\r\n options: PropTypes.shape({}).isRequired,\r\n};\r\nIPExclusionView.defaultProps = {};\r\n\r\n\r\n// reference: private/campaign-legacy/packages/advanced-settings/view/advancedSettings.js\r\nexport const BaseExclusion = React.memo((props) => {\r\n const {\r\n patchData, setSiteExclusionView, setIPExclusionView, options: {\r\n level, campaignId, adgroupId, showSiteExclusion, showIPExclusion,\r\n },\r\n } = props;\r\n const classes = useDefaultStyles(getStyles);\r\n const i18n = useContext(I18nContext);\r\n const baseExclusionText = i18n.getString(_TL_('Exclusions'));\r\n const exclusionDesc = _TL_('Which websites should not show your ads and which IP addresses should be blocked from seeing your ads?');\r\n const webSiteExclusionDesc = _TL_('Which websites should not show your ads?');\r\n\r\n let currentSiteExclusionView = null;\r\n let currentIPExclusionView = null;\r\n if (showSiteExclusion) {\r\n currentSiteExclusionView = <SiteExclusionView options={{ level, setSiteExclusionView }} />;\r\n }\r\n if (showIPExclusion) {\r\n currentIPExclusionView = <IPExclusionView options={{ setIPExclusionView }} />;\r\n }\r\n const [siteExclusion, setSiteExclusion] = useState(currentSiteExclusionView);\r\n const [IPExclusion, setIPExclusion] = useState(currentIPExclusionView);\r\n\r\n\r\n useEffect(() => {\r\n if (!campaignId) { return; }\r\n exclusionRepository.load(campaignId, adgroupId, level)\r\n .then(([campaignExclusions, adgroupExclusions]) => {\r\n const exclusions = level === 'campaign' ? campaignExclusions : adgroupExclusions;\r\n patchData('exclusions', exclusions);\r\n if (showSiteExclusion) {\r\n setSiteExclusion(<SiteExclusionView options={{\r\n level, campaignExclusions, exclusions, setSiteExclusionView,\r\n }}\r\n />);\r\n }\r\n if (showIPExclusion) {\r\n setIPExclusion(<IPExclusionView options={{ exclusions, setIPExclusionView }} />);\r\n }\r\n });\r\n }, [campaignId, adgroupId, level]);\r\n\r\n return (\r\n <div className={classnames(classes.baseExclusionContainer)}>\r\n <div className=\"camp-adg-shared-label\">\r\n <SpanWithComponent\r\n SpanText={baseExclusionText}\r\n Component={() => (\r\n <HelpPopup\r\n topic=\"pop_BA_Settings_Exclusions\"\r\n aria-label={i18n.getString(_TL_('Click to learn more about {{item}}'), { item: baseExclusionText })}\r\n />)}\r\n />\r\n </div>\r\n <div className=\"exclusion-wraper\">\r\n <div className=\"form-control-static\">{i18n.getString(level === 'campaign' ? exclusionDesc : webSiteExclusionDesc)}</div>\r\n {showSiteExclusion && siteExclusion}\r\n {showIPExclusion && IPExclusion}\r\n </div>\r\n </div>\r\n );\r\n});\r\n\r\nBaseExclusion.propTypes = {\r\n patchData: PropTypes.func.isRequired,\r\n setSiteExclusionView: PropTypes.func.isRequired,\r\n setIPExclusionView: PropTypes.func,\r\n options: PropTypes.shape({}),\r\n};\r\n\r\nBaseExclusion.defaultProps = {\r\n options: {\r\n },\r\n setIPExclusionView() {},\r\n};\r\n","import { creationCommonStyle, settingsCommonStyles } from '@bingads-webui-campaign-react/campaign-adgroup-settings-shared-styles';\r\nimport { uurlTestToolStyle, convertToLocalStyle, glyphIconStyle } from '@bingads-webui-campaign-react/common-styles';\r\n\r\nexport const getStyles = (_, core) => ({\r\n urlOptionsContainer: {\r\n ...creationCommonStyle(core),\r\n ...settingsCommonStyles(core),\r\n ...uurlTestToolStyle(core),\r\n ...convertToLocalStyle(glyphIconStyle(core)),\r\n marginLeft: '-15px',\r\n backgroundColor: `${core && core.palette && core.palette.white}`,\r\n '& .control-label': {\r\n marginTop: 0,\r\n },\r\n // private\\ui-next\\packages\\settings-page\\src\\styles\\custom-params.js\r\n '& #customParametersSettings': {\r\n '& .custom-param__key-field': {\r\n width: '155px',\r\n display: 'inline-block',\r\n },\r\n '& .closeimage.custom-param__close-button': {\r\n position: 'static',\r\n },\r\n '& .custom-param__value-field': {\r\n width: '260px',\r\n display: 'inline-block',\r\n },\r\n '& .custom-param-entry': {\r\n '& .control-label': {\r\n display: 'inline-block',\r\n },\r\n '& input.form-control': {\r\n display: 'inline-block',\r\n },\r\n '& label.control-label': {\r\n display: 'inline-block',\r\n marginLeft: '5px',\r\n marginRight: '5px',\r\n },\r\n },\r\n '& .custom-param__key-container': {\r\n display: 'inline-block',\r\n },\r\n '& .flex-row-dynamic': {\r\n verticalAlign: 'initial',\r\n },\r\n },\r\n // private\\ui-next\\packages\\top-grid-panel\\src\\upgraded-url-override-style.js\r\n '& .custom-params-template .custom-param-entry': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n },\r\n '& .custom-params-template .custom-param-entry td': {\r\n display: 'flex',\r\n alignItems: 'baseline',\r\n },\r\n '& .custom-params-template .flex-row-fixed.custom-param__key-container': {\r\n display: 'flex',\r\n alignItems: 'baseline',\r\n },\r\n '& .custom-params-template .flex-row-fixed.custom-param__key-container .control-label': {\r\n whiteSpace: 'pre',\r\n },\r\n '& .custom-params-template .flex-row-fixed.custom-param__key-container input.form-control.custom-param__key-field': {\r\n margin: '0px 5px',\r\n },\r\n '& .custom-params-template .flex-row-dynamic input.form-control.custom-param__value-field': {\r\n marginLeft: '5px',\r\n },\r\n '& .custom-params-template .closeimage.custom-param__close-button': {\r\n height: '20px',\r\n display: 'flex',\r\n alignItems: 'center',\r\n\r\n '&:before': {\r\n fontFamily: '\"MsAds MDL2 Assets\"',\r\n content: '\"\\\\E711\"',\r\n },\r\n },\r\n '& .custom-param__close-button': {\r\n marginLeft: 10,\r\n cursor: 'pointer',\r\n },\r\n // hotel campaign new ui\r\n '& .tracking-template,& .final-url-suffix , & .custom-parameters': {\r\n width: 'auto',\r\n marginLeft: '-15px',\r\n },\r\n '& .tracking-template .form-control, & .final-url-suffix .form-control': {\r\n width: '435px',\r\n },\r\n '& span.is-error, & .font-error': {\r\n color: `${core.semanticColors && core.semanticColors.errorIcon}`,\r\n },\r\n '& .helpbutton': {\r\n marginRight: '5px',\r\n },\r\n },\r\n});\r\n\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport urlOptionsTemplate from '@bingads-webui-campaign-legacy/advanced-settings/template/url-options.pug';\r\nimport UpgradedUrlOptions from '@bingads-webui-component-legacy/upgraded-url/view/advancedSettingsUrlOptions';\r\nimport '@bingads-webui-campaign/ko-stop-binding';\r\nimport _ from 'underscore';\r\nimport classnames from 'classnames';\r\nimport PropTypes from 'prop-types';\r\nimport React, { useCallback } from 'react';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { getStyles } from './style';\r\nimport { useBackboneView, } from '../shared';\r\n\r\n\r\n// reference: private/campaign-legacy/packages/advanced-settings/view/advancedSettings.js\r\nexport const UrlOptions = React.memo((props) => {\r\n const {\r\n setUrlOptionsView, options: {\r\n level, campaignId, adgroupId, model,\r\n },\r\n } = props;\r\n\r\n const urlOptions = new UpgradedUrlOptions({\r\n editMode: true,\r\n entityType: level,\r\n isNewUI: true,\r\n trackingTemplate: _.result(model, 'TrackingUrlTemplate'),\r\n finalUrlSuffix: _.result(model, 'FinalUrlSuffix'),\r\n customParameters: _.isEmpty(model.UrlCustomParameters) ? undefined : model.UrlCustomParameters,\r\n urlOptionsTemplate,\r\n showUurlTestTool: false,\r\n campaignId,\r\n adGroupId: adgroupId,\r\n });\r\n const urlOptionsReactWrapper = useBackboneView(useCallback(() => urlOptions.render(), [model]), setUrlOptionsView, { managed: true });\r\n const classes = useDefaultStyles(getStyles);\r\n\r\n // useEffect(() => { urlOptions.expandSettings(true, true, true); }, [model]);\r\n\r\n return (\r\n <div className={classnames(classes.urlOptionsContainer)}>\r\n <div className=\"urloptions-wraper clearfix\">\r\n {urlOptionsReactWrapper}\r\n </div>\r\n </div>\r\n );\r\n}, (prevProps, nextProps) => prevProps.options.model === nextProps.options.model);\r\n\r\nUrlOptions.propTypes = {\r\n setUrlOptionsView: PropTypes.func.isRequired,\r\n options: PropTypes.shape({}),\r\n};\r\n\r\nUrlOptions.defaultProps = {\r\n options: {\r\n },\r\n};\r\n","import classnames from 'classnames';\r\nimport React, { useContext, useCallback } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { HelpPopup } from '@bingads-webui-react/help-popup';\r\nimport { Label, Checkbox, Stack } from '@bingads-webui-react/fabric-control';\r\nimport { useDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { SpanWithComponent, ErrorString } from '@bingads-webui-campaign-react/wizard-shared-components';\r\n\r\nexport const isAdFormatValid = adFormat => adFormat.HPA || adFormat.PPA;\r\n\r\nexport const defaultAdFormat = {\r\n HPA: true,\r\n PPA: true,\r\n};\r\n\r\nconst CheckBox = (props) => {\r\n const {\r\n infoText,\r\n field,\r\n setAdFormat,\r\n isChecked,\r\n helpId,\r\n adFormat,\r\n } = props;\r\n const i18n = useContext(I18nContext);\r\n const onChange = useCallback((event, checked) => {\r\n setAdFormat({\r\n ...adFormat,\r\n [field]: checked,\r\n isDirty: true,\r\n });\r\n }, [adFormat, field, setAdFormat]);\r\n\r\n return (\r\n <Checkbox\r\n onRenderLabel={() => (\r\n <SpanWithComponent\r\n SpanText={infoText}\r\n Component={() => (\r\n <HelpPopup\r\n topic={helpId}\r\n aria-label={i18n.getString(_TL_('Click to learn more about {{item}}'), { item: infoText })}\r\n />)}\r\n />)}\r\n checked={isChecked(field)}\r\n onChange={onChange}\r\n className={field}\r\n />);\r\n};\r\n\r\nCheckBox.propTypes = {\r\n infoText: PropTypes.string.isRequired,\r\n field: PropTypes.string.isRequired,\r\n setAdFormat: PropTypes.func.isRequired,\r\n isChecked: PropTypes.func.isRequired,\r\n helpId: PropTypes.string.isRequired,\r\n adFormat: PropTypes.shape({}).isRequired,\r\n};\r\n\r\nconst getStyles = () => ({\r\n HotelAdFormat: {\r\n '& .description': {\r\n marginBottom: '12px',\r\n },\r\n },\r\n});\r\n\r\nexport const AdFormat = React.memo((props) => {\r\n const {\r\n setAdFormat,\r\n adFormat,\r\n scenario,\r\n permissions,\r\n } = props;\r\n const i18n = useContext(I18nContext);\r\n const HPAText = i18n.getString(_TL_('Hotel price ad (HPA)'));\r\n const PPAText = i18n.getString(_TL_('Property promotion ad (PPA)'));\r\n const classes = useDefaultStyles(getStyles);\r\n const isChecked = useCallback(key => adFormat[key] === true, [adFormat]);\r\n const IsRenameHotelToLodgingEnabled = permissions && permissions.dynamic && permissions.dynamic.IsRenameHotelToLodgingEnabled;\r\n\r\n return (\r\n <div className={classnames('hotel-ad-format', 'section', classes.HotelAdFormat)}>\r\n <div className=\"title\">\r\n <Label>\r\n {IsRenameHotelToLodgingEnabled ? i18n.getString(_TL_('Property ad format')) : i18n.getString(_TL_('Hotel ad format'))}\r\n </Label>\r\n <div className=\"description\">\r\n {IsRenameHotelToLodgingEnabled ? i18n.getString(_TL_('Determines the ad type you want to create for this property ad group.')) : i18n.getString(_TL_('Determines the ad type you want to create for this hotel ad group.'))}\r\n </div>\r\n </div>\r\n <div className=\"checkboxes\">\r\n <Stack tokens={{ childrenGap: 12 }}>\r\n <CheckBox key=\"HPA\" field=\"HPA\" infoText={HPAText} helpId=\"pop_BA_HotelPriceAds\" isChecked={isChecked} adFormat={adFormat} setAdFormat={setAdFormat} scenario={scenario} />\r\n <CheckBox key=\"PPA\" field=\"PPA\" infoText={PPAText} helpId=\"pop_BA_PropertyPromotionAds\" isChecked={isChecked} adFormat={adFormat} setAdFormat={setAdFormat} scenario={scenario} />\r\n </Stack>\r\n </div>\r\n {!isAdFormatValid(adFormat) &&\r\n <ErrorString error={i18n.getString(_TL_('At least one ad format option must be selected'))} />}\r\n </div>);\r\n});\r\n\r\nAdFormat.propTypes = {\r\n adFormat: PropTypes.shape({}),\r\n setAdFormat: PropTypes.func.isRequired,\r\n scenario: PropTypes.string.isRequired,\r\n permissions: PropTypes.shape({\r\n dynamic: PropTypes.shape({\r\n IsRenameHotelToLodgingEnabled: PropTypes.bool,\r\n }),\r\n }),\r\n};\r\n\r\nAdFormat.defaultProps = {\r\n adFormat: {},\r\n permissions: {\r\n dynamic: {\r\n IsRenameHotelToLodgingEnabled: false,\r\n },\r\n },\r\n};\r\n\r\n","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"row\\\"\\u003E\\u003Cdiv class=\\\"col-sm-1\\\"\\u003E\\u003Ch3 class=\\\"type-normal margin-zero\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Subheader_Account_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh3\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-3\\\"\\u003E\\u003Ch3 class=\\\"type-bold account-name margin-zero\\\"\\u003E\" + (pug.escape(null == (pug_interp = model.account.Name) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh3\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (model.subAccount) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"row\\\"\\u003E\\u003Cdiv class=\\\"col-sm-1\\\"\\u003E\\u003Ch3 class=\\\"type-normal\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Subheader_Subaccount_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh3\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-3\\\"\\u003E\\u003Ch3 class=\\\"type-bold sub-account-name\\\"\\u003E\" + (pug.escape(null == (pug_interp = model.subAccount.Name) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh3\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Cdiv class=\\\"alert alert-warning clearfix not-in-pilot\\\"\\u003E\\u003Cdiv class=\\\"alert-icon warning\\\"\\u003E\\u003C\\u002Fdiv\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_NotInPilot')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"bid-cap-panel form-horizontal\\\"\\u003E\\u003Cdiv class=\\\"bid-selection\\\"\\u003E\\u003Cdiv class=\\\"col-sm-12 radio\\\"\\u003E\\u003Clabel class=\\\"empty\\\"\\u003E\\u003Cinput\" + (\" class=\\\"bid-cap-radio\\\"\"+\" type=\\\"radio\\\" name=\\\"bid-radio\\\" value=\\\"empty\\\"\"+pug.attr(\"checked\", model.capSelection === 'empty', true, true)) + \"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Setup_Budget_Max_Bid_Option_No_Cap')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-12 radio form-group\\\"\\u003E\\u003Clabel class=\\\"col-sm-3 bid-selection-label\\\"\\u003E\\u003Cinput\" + (\" class=\\\"bid-cap-radio\\\"\"+\" type=\\\"radio\\\" name=\\\"bid-radio\\\" value=\\\"cap\\\"\"+pug.attr(\"checked\", model.capSelection === 'cap', true, true)) + \"\\u003E\\u003Cspan\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Setup_Budget_Max_Bid_Option_With_Cap')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"col-sm-7\",model.capSelection === 'empty' ? 'hide' : 'show'], [false,true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"max-bid-input\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"bid-multipliers-panel\\\"\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cul class=\\\"btn-group col-sm-12\\\"\\u003E\\u003Cli\" + (pug.attr(\"class\", pug.classes([('deviceType' === model.selectedMultiplierType ? 'ui-tabs-selected' : '')], [true]), false, true)) + \"\\u003E\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"btn\",\"btn-default\",\"clickable\",(model.isUseParent ? 'disabled' : '')], [false,false,false,true]), false, true)+pug.attr(\"title\", view.i18n.getString('HotelCenter_Overview_DeviceType_Multipliers_Label'), true, true)+\" data-type=\\\"deviceType\\\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Overview_DeviceType_Multipliers_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003Cli\" + (pug.attr(\"class\", pug.classes([('dateType' === model.selectedMultiplierType ? 'ui-tabs-selected' : ''),(model.isPayPerStay ? 'hide' : '')], [true,true]), false, true)) + \"\\u003E\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"btn\",\"btn-default\",\"clickable\",(model.isUseParent ? 'disabled' : '')], [false,false,false,true]), false, true)+pug.attr(\"title\", view.i18n.getString('HotelCenter_Overview_DateType_Multipliers_Label'), true, true)+\" data-type=\\\"dateType\\\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Overview_DateType_Multipliers_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003Cli\" + (pug.attr(\"class\", pug.classes([('siteType' === model.selectedMultiplierType ? 'ui-tabs-selected' : ''),(model.isPayPerStay ? 'hide' : '')], [true,true]), false, true)) + \"\\u003E\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"btn\",\"btn-default\",\"clickable\",(model.isUseParent ? 'disabled' : '')], [false,false,false,true]), false, true)+pug.attr(\"title\", view.i18n.getString('HotelCenter_Overview_SiteType_Multipliers_Label'), true, true)+\" data-type=\\\"siteType\\\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Overview_SiteType_Multipliers_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003Cli\" + (pug.attr(\"class\", pug.classes([('userCountry' === model.selectedMultiplierType ? 'ui-tabs-selected' : '')], [true]), false, true)) + \"\\u003E\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"btn\",\"btn-default\",\"clickable\",(model.isUseParent ? 'disabled' : '')], [false,false,false,true]), false, true)+pug.attr(\"title\", view.i18n.getString('HotelCenter_Overview_UserCountry_Multipliers_Label'), true, true)+\" data-type=\\\"userCountry\\\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Overview_UserCountry_Multipliers_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003Cli\" + (pug.attr(\"class\", pug.classes([('lengthOfStay' === model.selectedMultiplierType ? 'ui-tabs-selected' : ''),(model.isPayPerStay ? 'hide' : '')], [true,true]), false, true)) + \"\\u003E\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"btn\",\"btn-default\",\"clickable\",(model.isUseParent ? 'disabled' : '')], [false,false,false,true]), false, true)+pug.attr(\"title\", view.i18n.getString('HotelCenter_Overview_LengthOfStay_Multipliers_Label'), true, true)+\" data-type=\\\"lengthOfStay\\\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Overview_LengthOfStay_Multipliers_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003Cli\" + (pug.attr(\"class\", pug.classes([('checkInDay' === model.selectedMultiplierType ? 'ui-tabs-selected' : ''),(model.isPayPerStay ? 'hide' : '')], [true,true]), false, true)) + \"\\u003E\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"btn\",\"btn-default\",\"clickable\",(model.isUseParent ? 'disabled' : '')], [false,false,false,true]), false, true)+pug.attr(\"title\", view.i18n.getString('HotelCenter_Overview_CheckinDay_Multipliers_Label'), true, true)+\" data-type=\\\"checkInDay\\\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Overview_CheckinDay_Multipliers_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003Cli\" + (pug.attr(\"class\", pug.classes([('advancedBooking' === model.selectedMultiplierType ? ' ui-tabs-selected' : ''),(model.isPayPerStay ? 'hide' : '')], [true,true]), false, true)) + \"\\u003E\\u003Cspan\" + (pug.attr(\"class\", pug.classes([\"btn\",\"btn-default\",\"clickable\",(model.isUseParent ? 'disabled' : '')], [false,false,false,true]), false, true)+pug.attr(\"title\", view.i18n.getString('HotelCenter_Overview_AdvancedBooking_Multipliers_Label'), true, true)+\" data-type=\\\"advancedBooking\\\" tabindex=\\\"0\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Overview_AdvancedBooking_Multipliers_Label_Short')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"form-group bid-multipliers-content\\\"\\u003E\\u003Cdiv class=\\\"col-sm-12\\\"\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"device-type-multipliers-containter\",('deviceType' === model.selectedMultiplierType ? 'show' : 'hide')], [false,true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"device-type-multipliers\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"device-type-multipliers-containter\",('dateType' === model.selectedMultiplierType ? 'show' : 'hide')], [false,true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"date-type-multipliers\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"device-type-multipliers-containter\",('siteType' === model.selectedMultiplierType ? 'show' : 'hide')], [false,true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"site-type-multipliers\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"user-country-multipliers-containter\",('userCountry' === model.selectedMultiplierType ? 'show' : 'hide')], [false,true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"user-country-multipliers\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"length-of-stay-multipliers-containter\",('lengthOfStay' === model.selectedMultiplierType ? 'show' : 'hide')], [false,true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"length-of-stay-multipliers\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"check-in-day-multipliers-containter\",('checkInDay' === model.selectedMultiplierType ? 'show' : 'hide')], [false,true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"check-in-day-multipliers\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"advanced-booking-multipliers-containter\",('advancedBooking' === model.selectedMultiplierType ? 'show' : 'hide')], [false,true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"advanced-booking-multipliers\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\nif (view.showUseParent) {\npug_html = pug_html + \"\\u003Cdiv class=\\\"bid-multipliers-use-parent\\\"\\u003E\\u003Clabel\\u003E\\u003Cinput\" + (pug.attrs(pug.merge([{\"type\": \"checkbox\",\"checked\": pug.escape((model.isUseParent===true))},model.isPayPerStay && !model.isPayPerStayPhase2Pilot ? { disabled: 'disabled' } : {}]), true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Overview_Multipliers_UseParent_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([\"bid-multipliers-errors\",\"font-error\",model.errors.length ? 'show' : 'hide'], [false,false,true]), false, true)+\" role=\\\"alert\\\"\") + \"\\u003E\";\n// iterate model.errors\n;(function(){\n var $$obj = model.errors;\n if ('number' == typeof $$obj.length) {\n for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {\n var error = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv class=\\\"bid-multipliers-error\\\"\\u003E\" + (pug.escape(null == (pug_interp = error) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index0 in $$obj) {\n $$l++;\n var error = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv class=\\\"bid-multipliers-error\\\"\\u003E\" + (pug.escape(null == (pug_interp = error) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;pug_html = pug_html + \"\\u003Cdiv class=\\\"device-type-multipliers form-horizontal\\\"\\u003E\\u003Cdiv data-ref=\\\"monday-bid-multiplier\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv data-ref=\\\"tuesday-bid-multiplier\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv data-ref=\\\"wednesday-bid-multiplier\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv data-ref=\\\"thursday-bid-multiplier\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv data-ref=\\\"friday-bid-multiplier\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv data-ref=\\\"saturday-bid-multiplier\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv data-ref=\\\"sunday-bid-multiplier\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"device-type-multipliers form-horizontal\\\"\\u003E\";\n// iterate view.listOfTypes\n;(function(){\n var $$obj = view.listOfTypes;\n if ('number' == typeof $$obj.length) {\n for (var type = 0, $$l = $$obj.length; type < $$l; type++) {\n var i18nKey = $$obj[type];\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"data-ref\", type.toLowerCase() + '-bid-multiplier', true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var type in $$obj) {\n $$l++;\n var i18nKey = $$obj[type];\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"data-ref\", type.toLowerCase() + '-bid-multiplier', true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"length-of-stay-multipliers form-horizontal\\\"\\u003E\";\n// iterate model.staySegments\n;(function(){\n var $$obj = model.staySegments;\n if ('number' == typeof $$obj.length) {\n for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {\n var segment = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv class=\\\"length-of-stay-multiplier form-group\\\"\\u003E\\u003Cdiv class=\\\"col-sm-11\\\"\\u003E\\u003Cdiv\" + (pug.attr(\"data-ref\", segment.key+'-bid-multiplier', true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-1 mulitplier-query-remove\\\"\\u003E\\u003Cspan\" + (\" class=\\\"glyphicon glyphicon-remove filter-query-remove__glyphicon clickable\\\"\"+pug.attr(\"title\", segment.key, true, true)+pug.attr(\"aria-label\", view.i18n.getString('Button_Delete'), true, true)+\" tabindex=\\\"0\\\" role=\\\"button\\\"\") + \"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index0 in $$obj) {\n $$l++;\n var segment = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv class=\\\"length-of-stay-multiplier form-group\\\"\\u003E\\u003Cdiv class=\\\"col-sm-11\\\"\\u003E\\u003Cdiv\" + (pug.attr(\"data-ref\", segment.key+'-bid-multiplier', true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-1 mulitplier-query-remove\\\"\\u003E\\u003Cspan\" + (\" class=\\\"glyphicon glyphicon-remove filter-query-remove__glyphicon clickable\\\"\"+pug.attr(\"title\", segment.key, true, true)+pug.attr(\"aria-label\", view.i18n.getString('Button_Delete'), true, true)+\" tabindex=\\\"0\\\" role=\\\"button\\\"\") + \"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003Cdiv class=\\\"mulitpliers-query-add form-group\\\"\\u003E\\u003Cdiv class=\\\"col-sm-6 col-sm-offset-5 stay-nights-input\\\"\\u003E\\u003Cdiv data-ref=\\\"stay-nights-input\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-1 text-center\\\"\\u003E\\u003Ca\" + (pug.attr(\"class\", pug.classes([\"add-new-query\",(model.isUseParent===true ? 'disabled' : '')], [false,true]), false, true)+\" href=\\\"javascript:void(0);\\\" role=\\\"button\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('Button_Add')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_mixins[\"multipliers-bid-list\"] = pug_interp = function(name, className, strategy, factorInput, isUseParent){\nvar block = (this && this.block), attributes = (this && this.attributes) || {};\npug_html = pug_html + \"\\u003Cdiv class=\\\"col-sm-4 control-label\\\"\\u003E\\u003Clabel\\u003E\" + (pug.escape(null == (pug_interp = name) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-4\\\"\\u003E\\u003Cselect\" + (pug.attr(\"class\", pug.classes([\"form-control\",\"select-strategy\",className], [false,false,true]), false, true)+pug.attr(\"disabled\", (isUseParent===true), true, true)+pug.attr(\"aria-label\", view.i18n.getString('HotelCenter_Overview_Multipliers_Bids_Strategy_Label'), true, true)) + \"\\u003E\\u003Coption\" + (\" value=\\\"increase\\\"\"+pug.attr(\"selected\", strategy === 'increase', true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Overview_Multipliers_BidIncrease_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Foption\\u003E\\u003Coption\" + (\" value=\\\"decrease\\\"\"+pug.attr(\"selected\", strategy === 'decrease', true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Overview_Multipliers_BidDecrease_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Foption\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-4\\\"\\u003E\\u003Cdiv\" + (pug.attr(\"data-ref\", factorInput, true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n};\npug_html = pug_html + \"\\u003Cdiv class=\\\"form-group\\\"\\u003E\";\npug_mixins[\"multipliers-bid-list\"](view.text, view.value, model.strategy, 'factor-input', model.isUseParent);\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"user-country-multipliers form-horizontal\\\"\\u003E\";\n// iterate model.selectedCountries\n;(function(){\n var $$obj = model.selectedCountries;\n if ('number' == typeof $$obj.length) {\n for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {\n var country = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv class=\\\"user-country-multiplier form-group\\\"\\u003E\\u003Cdiv class=\\\"col-sm-11\\\"\\u003E\\u003Cdiv\" + (pug.attr(\"data-ref\", country.Key+'-bid-multiplier', true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-1 mulitplier-query-remove\\\"\\u003E\\u003Cspan\" + (\" class=\\\"glyphicon glyphicon-remove filter-query-remove__glyphicon clickable\\\"\"+pug.attr(\"title\", country.Key, true, true)+pug.attr(\"aria-label\", view.i18n.getString('Button_Delete'), true, true)+\" tabindex=\\\"0\\\" role=\\\"button\\\"\") + \"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index0 in $$obj) {\n $$l++;\n var country = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv class=\\\"user-country-multiplier form-group\\\"\\u003E\\u003Cdiv class=\\\"col-sm-11\\\"\\u003E\\u003Cdiv\" + (pug.attr(\"data-ref\", country.Key+'-bid-multiplier', true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-1 mulitplier-query-remove\\\"\\u003E\\u003Cspan\" + (\" class=\\\"glyphicon glyphicon-remove filter-query-remove__glyphicon clickable\\\"\"+pug.attr(\"title\", country.Key, true, true)+pug.attr(\"aria-label\", view.i18n.getString('Button_Delete'), true, true)+\" tabindex=\\\"0\\\" role=\\\"button\\\"\") + \"\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003Cdiv class=\\\"mulitpliers-query-add form-group\\\"\\u003E\\u003Cdiv class=\\\"col-sm-6 col-sm-offset-5\\\"\\u003E\\u003Cselect\" + (\" class=\\\"form-control country-list\\\"\"+pug.attr(\"disabled\", (model.isUseParent===true), true, true)) + \"\\u003E\";\n// iterate view.restCountries\n;(function(){\n var $$obj = view.restCountries;\n if ('number' == typeof $$obj.length) {\n for (var pug_index1 = 0, $$l = $$obj.length; pug_index1 < $$l; pug_index1++) {\n var country = $$obj[pug_index1];\npug_html = pug_html + \"\\u003Coption\" + (pug.attr(\"value\", country.Key, true, true)+pug.attr(\"selected\", model.chooseCountry === country.Key, true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = country.Value) ? \"\" : pug_interp)) + \"\\u003C\\u002Foption\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index1 in $$obj) {\n $$l++;\n var country = $$obj[pug_index1];\npug_html = pug_html + \"\\u003Coption\" + (pug.attr(\"value\", country.Key, true, true)+pug.attr(\"selected\", model.chooseCountry === country.Key, true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = country.Value) ? \"\" : pug_interp)) + \"\\u003C\\u002Foption\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-1 text-center\\\"\\u003E\\u003Ca\" + (pug.attr(\"class\", pug.classes([\"add-new-query\",(model.isUseParent===true ? 'disabled' : '')], [false,true]), false, true)+\" href=\\\"javascript:void(0);\\\" role=\\\"button\\\"\") + \"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('Button_Add')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"bid-strategy-panel form-horizontal\\\"\\u003E\\u003Clabel class=\\\"radio fixed\\\"\\u003E\\u003Cinput\" + (pug.attrs(pug.merge([{\"class\": \"bid-strategy-radio\",\"type\": \"radio\",\"role\": \"radio\",\"name\": pug.escape(view.cid),\"value\": \"fixed\",\"checked\": pug.escape(model.bidStrategy === view.strategy.fixed)},view.disabledAttr]), true)) + \"\\u003E\\u003Cspan class=\\\"type-normal cursor-pointer\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Setup_Budget_Strategy_Option_Fixed')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([model.bidStrategy === 'fixed' ? 'show' : 'hide'], [true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"fixed-bid-input\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Flabel\\u003E\\u003Clabel class=\\\"radio percentage\\\"\\u003E\\u003Cinput\" + (pug.attrs(pug.merge([{\"class\": \"bid-strategy-radio\",\"type\": \"radio\",\"role\": \"radio\",\"name\": pug.escape(view.cid),\"value\": \"percentage\",\"checked\": pug.escape(model.bidStrategy === view.strategy.percentage)},view.disabledAttr]), true)) + \"\\u003E\\u003Cspan class=\\\"type-normal cursor-pointer\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Setup_Budget_Strategy_Option_Percentage')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([model.bidStrategy === 'percentage' ? 'show' : 'hide'], [true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"percentage-bid-input\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Flabel\\u003E\";\nif (view.isPayPerStayEnabled) {\npug_html = pug_html + \"\\u003Clabel class=\\\"radio payperstay\\\"\\u003E\\u003Cinput\" + (pug.attrs(pug.merge([{\"class\": \"bid-strategy-radio\",\"type\": \"radio\",\"role\": \"radio\",\"name\": pug.escape(view.cid),\"value\": \"payperstay\",\"checked\": pug.escape(model.bidStrategy === view.strategy.payperstay)},view.disabledPPSAttr]), true)) + \"\\u003E\\u003Cspan class=\\\"type-normal cursor-pointer\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Setup_Budget_Strategy_Option_PPS')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003Cdiv\" + (pug.attr(\"class\", pug.classes([model.bidStrategy === 'payperstay' ? 'show' : 'hide'], [true]), false, true)) + \"\\u003E\\u003Cdiv data-ref=\\\"payperstay-bid-input\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Flabel\\u003E\";\n}\nif (!(view.isAmountRequired)) {\npug_html = pug_html + \"\\u003Clabel class=\\\"radio empty\\\"\\u003E\\u003Cinput\" + (\" class=\\\"bid-strategy-radio\\\"\"+\" type=\\\"radio\\\" role=\\\"radio\\\"\"+pug.attr(\"name\", view.cid, true, true)+\" value=\\\"empty\\\"\"+pug.attr(\"checked\", model.bidStrategy === view.strategy.empty, true, true)) + \"\\u003E\\u003Cspan class=\\\"type-normal cursor-pointer\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Setup_Budget_Strategy_Option_Empty')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Flabel\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"dropdown-search-selector__dropdown\\\"\\u003E\\u003Cbutton\" + (\" class=\\\"row btn btn-default dropdown-toggle\\\"\"+\" type=\\\"button\\\" role=\\\"button\\\" tabindex=\\\"0\\\"\"+pug.attr(\"disabled\", model.isDisabled, true, true)) + \"\\u003E\\u003Cdiv class=\\\"text-left col-xs-10\\\"\\u003E\\u003Cdiv\" + (\" class=\\\"floatLeftContainer truncated\\\"\"+pug.attr(\"option-id\", model.selectOption.id, true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = model.selectOption.value) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"icon-right glyphicon glyphicon-chevron-down\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fbutton\\u003E\\u003Cul\" + (\" class=\\\"dropdown-menu\\\"\"+\" role=\\\"status\\\" aria-labelledby=\\\"srch-term\\\"\"+pug.attr(\"id\", view.searchResultsId, true, true)) + \"\\u003E\";\n// iterate view.customOptions\n;(function(){\n var $$obj = view.customOptions;\n if ('number' == typeof $$obj.length) {\n for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {\n var customOption = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"data-ref\", customOption.id + '-container', true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index0 in $$obj) {\n $$l++;\n var customOption = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"data-ref\", customOption.id + '-container', true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n }\n}).call(this);\n\npug_html = pug_html + \"\\u003Cdiv data-ref=\\\"search-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv data-ref=\\\"selector-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv data-ref=\\\"pagination-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Ful\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model) {pug_html = pug_html + \"\\u003Cli\" + (pug.attr(\"class\", pug.classes([\"dropdown-search-selector__option\",\"col-sm-12\",model.isSelected ? 'dropdown-search-selector__option--selected' : ''], [false,false,true]), false, true)) + \"\\u003E\\u003Ca\" + (pug.attr(\"class\", pug.classes([\"clear\",\"noWrap\",\"dropdown-search-selector\",model.isDisabled ? 'inactive' : ''], [false,false,false,true]), false, true)+\" role=\\\"option\\\" href=\\\"javascript:void(0)\\\"\"+pug.attr(\"title\", model.value, true, true)+pug.attr(\"option-id\", model.id, true, true)) + \"\\u003E\" + (null == (pug_interp = model.value) ? \"\" : pug_interp) + \"\\u003C\\u002Fa\\u003E\\u003C\\u002Fli\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (current, model, view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"form-inline pull-right dropdown-search-selector__pagination\\\"\\u003E\\u003Cul class=\\\"pagination\\\"\\u003E\\u003Cli\" + (pug.attr(\"class\", pug.classes([\"page-item\",\"previous-page-button\",model.currentPage <= 1 ? 'disabled' : ''], [false,false,true]), false, true)) + \"\\u003E\\u003Cspan class=\\\"account-list-selector-prev-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('AccountsDropdownSelector_PreviousPage')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003Cli class=\\\"page-item\\\"\\u003E\\u003Cspan class=\\\"page-link\\\"\\u003E\" + (pug.escape(null == (pug_interp = model.currentPage) ? \"\" : pug_interp)) + \"\\u003Cspan class=\\\"sr-only\\\"\\u003E\" + (pug.escape(null == (pug_interp = (current)) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003Cli\" + (pug.attr(\"class\", pug.classes([\"page-item\",\"next-page-button\",model.currentPage * view.pageSize >= model.totalCount ? 'disabled' : ''], [false,false,true]), false, true)) + \"\\u003E\\u003Cspan class=\\\"account-list-selector-next-label\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('AccountsDropdownSelector_NextPage')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fspan\\u003E\\u003C\\u002Fli\\u003E\\u003C\\u002Ful\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"current\" in locals_for_with?locals_for_with.current:typeof current!==\"undefined\"?current:undefined,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"dropdown-search-selector__search\\\" role=\\\"search\\\"\\u003E\\u003Cbutton class=\\\"btn btn-default dropdown-search-selector__search--submit glyphicon glyphicon-search filter_search_icon_small\\\" aria-label=\\\"Search\\\" type=\\\"button\\\" tabindex=\\\"0\\\"\\u003E\\u003C\\u002Fbutton\\u003E\\u003Cinput\" + (pug.attr(\"placeholder\", view.placeholder, true, true)+\" name=\\\"srch-term\\\" id=\\\"srch-term\\\" type=\\\"text\\\" role=\\\"combobox\\\" aria-haspopup=\\\"listbox\\\" aria-expanded=\\\"true\\\"\"+pug.attr(\"aria-owns\", view.searchResultsId, true, true)+\" aria-autocomplete=\\\"list\\\"\") + \"\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_html = pug_html + \"\\u003Cul class=\\\"dropdown-search-selector__options\\\" role=\\\"listbox\\\"\\u003E\";\nif (model.options.length > 0) {\n// iterate model.options\n;(function(){\n var $$obj = model.options;\n if ('number' == typeof $$obj.length) {\n for (var pug_index0 = 0, $$l = $$obj.length; pug_index0 < $$l; pug_index0++) {\n var option = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"data-ref\", 'option-' + option.id, true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n } else {\n var $$l = 0;\n for (var pug_index0 in $$obj) {\n $$l++;\n var option = $$obj[pug_index0];\npug_html = pug_html + \"\\u003Cdiv\" + (pug.attr(\"data-ref\", 'option-' + option.id, true, true)) + \"\\u003E\\u003C\\u002Fdiv\\u003E\";\n }\n }\n}).call(this);\n\n}\nelse {\npug_html = pug_html + \"\\u003Cdiv class=\\\"empty-result-message\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.nodataPlaceholder) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Ful\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"edit-panel\\\"\\u003E\";\nvar saveButtonAttr = model.isSaveButtonDisabled ? { disabled: 'disabled' } : {}\nvar cleanButtonAttr = model.isCleanButtonDisabled ? { disabled: 'disabled' } : {}\npug_html = pug_html + \"\\u003Cinput\" + (pug.attrs(pug.merge([{\"class\": \"btn btn-primary\",\"id\": \"Save\",\"type\": \"button\",\"value\": pug.escape(view.i18n.getString('HotelCenter_Shared_Save')),\"tabindex\": \"0\"},saveButtonAttr]), true)) + \"\\u003E\\u003Cinput\" + (pug.attrs(pug.merge([{\"class\": pug.classes([\"btn\",\"btn-default\",(model.hasCleanButton ? '' : 'hide')], [false,false,true]),\"id\": \"Clean\",\"type\": \"button\",\"value\": pug.escape(view.i18n.getString('HotelCenter_Shared_Clear')),\"tabindex\": \"0\"},cleanButtonAttr]), true)) + \"\\u003E\\u003Cinput\" + (\" class=\\\"btn btn-default\\\"\"+\" id=\\\"Cancel\\\" type=\\\"button\\\"\"+pug.attr(\"value\", view.i18n.getString('HotelCenter_Shared_Cancel'), true, true)+\" tabindex=\\\"0\\\"\") + \"\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (model, view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"panel-component\\\"\\u003E\\u003Cdiv class=\\\"panel-body\\\"\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Cdiv class=\\\"col-sm-6\\\"\\u003E\\u003Cdiv class=\\\"col-sm-1\\\"\\u003E\\u003Cdiv class=\\\"glyphicon glyphicon-arrow-left cursor-pointer clickable\\\" role=\\\"button\\\" tabindex=\\\"0\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-8\\\"\\u003E\\u003Cdiv class=\\\"col-sm-5\\\"\\u003E\\u003Ch3 class=\\\"type-normal margin-zero\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('HotelCenter_Filter_HotelGroup_Label')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh3\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-7\\\"\\u003E\\u003Ch3 class=\\\"type-bold margin-zero truncated\\\"\\u003E\" + (pug.escape(null == (pug_interp = model.hotelGroup.Name) ? \"\" : pug_interp)) + \"\\u003C\\u002Fh3\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-1\\\"\\u003E\\u003Cdiv class=\\\"glyphicon glyphicon-remove hotel-group-information-remove__glyphicon cursor-pointer clickable\\\" role=\\\"button\\\" tabindex=\\\"0\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"model\" in locals_for_with?locals_for_with.model:typeof model!==\"undefined\"?model:undefined,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;pug_html = pug_html + \"\\u003Cdiv class=\\\"hotel-center-global-toolbar-containter\\\"\\u003E\\u003Cdiv class=\\\"global-toolbar-container\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"global-filter-bar\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";;return pug_html;};\nmodule.exports = template;","import { merge } from '@bingads-webui-universal/primitive-utilities';\r\nimport { ComponentSettings } from '@bingads-webui-theme-2018/theme-fluent';\r\n\r\n\r\nconst {\r\n columnChooserStyle,\r\n getColumnChooserOverrideStyle,\r\n} = ComponentSettings;\r\n\r\nexport const getStyle = (components, { palette }) => ({\r\n columnChooser: merge(\r\n {},\r\n columnChooserStyle,\r\n getColumnChooserOverrideStyle(palette),\r\n {\r\n '& .column-chooser .panel': {\r\n boxShadow: 'none',\r\n padding: 0,\r\n marginTop: '24px',\r\n marginLeft: '32px',\r\n marginBottom: '0px',\r\n backgroundColor: 'white',\r\n '& .panel-heading': {\r\n backgroundColor: 'white',\r\n padding: 0,\r\n marginTop: '0',\r\n '& .panel-title': {\r\n fontSize: '20px',\r\n fontWeight: 600,\r\n lineHeight: '27px',\r\n },\r\n },\r\n '& .panel-body': {\r\n lineHeight: '19px',\r\n paddingLeft: 'unset',\r\n marginBottom: '18px',\r\n fontSize: '14px',\r\n '& hr': {\r\n margin: 0,\r\n borderTop: '0px',\r\n },\r\n },\r\n '& .panel-footer': {\r\n borderTop: '1px solid #edebe9',\r\n marginTop: 0,\r\n paddingTop: '16px',\r\n paddingLeft: '0px',\r\n paddingBottom: '16px',\r\n backgroundColor: 'white',\r\n '& .btn': {\r\n marginRight: '8px',\r\n },\r\n },\r\n },\r\n }\r\n ),\r\n});\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport ReportingProps from '@bingads-webui-campaign-react/props-reporting';\r\nimport { BackboneInstanceWrapper } from '@bingads-webui-react/backbone-instance-wrapper';\r\nimport { ColumnChooser as BackboneColumnChooser } from '@bingads-webui/column-chooser';\r\nimport { helpers } from '@bingads-webui/deterministic-view';\r\n\r\n// a fork of `column-chooser.js` in @bingads-webui-campaign/report-column-chooser\r\nexport class ColumnChooser extends Component {\r\n static propTypes = {\r\n categories: PropTypes.array.isRequired, // eslint-disable-line\r\n currentActive: PropTypes.string,\r\n legacyI18n: PropTypes.object.isRequired, // eslint-disable-line\r\n selected: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,\r\n onApply: PropTypes.func.isRequired,\r\n onCancel: PropTypes.func.isRequired,\r\n simplified: PropTypes.bool.isRequired,\r\n isSplittingSelectedArea: PropTypes.bool.isRequired,\r\n instrumentation: ReportingProps.instrumentation, // eslint-disable-line\r\n };\r\n\r\n static defaultProps = {\r\n currentActive: '',\r\n }\r\n\r\n constructor(props) {\r\n super(props);\r\n const {\r\n categories,\r\n selected,\r\n legacyI18n,\r\n onApply,\r\n onCancel,\r\n isSplittingSelectedArea,\r\n simplified,\r\n instrumentation,\r\n } = props;\r\n\r\n const cfg = {\r\n categories,\r\n selected,\r\n };\r\n this.state = {\r\n searchStr: '',\r\n };\r\n this.view = new BackboneColumnChooser({\r\n i18n: legacyI18n,\r\n simplified,\r\n isSplittingSelectedArea,\r\n instrumentation,\r\n }).setState(cfg);\r\n\r\n this.view.on(\r\n 'hide',\r\n ({\r\n selectedKeys,\r\n savedName,\r\n currentActive,\r\n searchStr,\r\n } = {}) => {\r\n const isApply = !!selectedKeys;\r\n if (isApply) {\r\n onApply({\r\n selectedKeys,\r\n savedName,\r\n currentActive,\r\n searchStr,\r\n });\r\n } else {\r\n onCancel();\r\n }\r\n }\r\n );\r\n helpers.updateView(this.view, {\r\n isSaveNameEnabled: false,\r\n });\r\n }\r\n\r\n render() {\r\n const { categories, currentActive, selected } = this.props;\r\n const cfg = {\r\n categories,\r\n currentActive,\r\n selected,\r\n external: true,\r\n searchStr: this.state.searchStr,\r\n };\r\n this.view.setState(cfg);\r\n return (\r\n <div className=\"bingadsgrid\">\r\n <BackboneInstanceWrapper\r\n instance={this.view}\r\n />\r\n </div>\r\n );\r\n }\r\n}\r\n","/* eslint-disable react/prop-types */\r\n/* eslint-disable react/jsx-filename-extension */\r\nimport React, { FC, useContext, useRef, useState } from 'react';\r\nimport { I18n, ColumnChooserCategory } from '@bingads-webui-grid/well-known';\r\nimport { InstrumentationContext } from '@bingads-webui-react/hoc-with-instrumentation';\r\nimport { withDefaultStyles } from '@bingads-webui-react/with-default-styles';\r\nimport { DefaultButton, Dialog, DialogFooter, DialogType, PrimaryButton } from '@fluentui/react';\r\nimport { Columns } from '@bingads-webui-component-legacy/bingads-grid/service/column-chooser-preferences';\r\nimport _ from 'underscore';\r\nimport { getStyle } from './style';\r\nimport { ColumnChooser } from './BackboneWrapper';\r\n\r\ninterface ReplaceDialogProps {\r\n hidden: boolean;\r\n i18n: I18n;\r\n columnSetName: string;\r\n onDismiss: () => void;\r\n onReplace: () => void;\r\n}\r\n\r\nconst ReplaceDialog: FC<ReplaceDialogProps> = (props) => {\r\n const {\r\n hidden,\r\n columnSetName,\r\n onReplace,\r\n onDismiss,\r\n i18n,\r\n } = props;\r\n\r\n const dialogContentProps = {\r\n type: DialogType.normal,\r\n closeButtonAriaLabel: i18n.getString(_TL_('Close')),\r\n };\r\n\r\n return (\r\n <Dialog\r\n hidden={hidden}\r\n onDismiss={onDismiss}\r\n dialogContentProps={dialogContentProps}\r\n >\r\n <p>\r\n {i18n.getString(_TL_('There is already a set of columns with this name: {{savedColumnSetName}}'), { savedColumnSetName: columnSetName })}\r\n </p>\r\n <p>\r\n {i18n.getString(_TL_('Do you want to replace it?'))}\r\n </p>\r\n <DialogFooter>\r\n <PrimaryButton onClick={onReplace} text=\"Replace\" />\r\n <DefaultButton onClick={onDismiss} text=\"Cancel\" />\r\n </DialogFooter>\r\n </Dialog>);\r\n};\r\n\r\ninterface OnApplyPayload {\r\n /**\r\n * selected column keys.\r\n */\r\n selectedKeys: string[],\r\n /**\r\n * Name of saved column set.\r\n */\r\n savedName: string,\r\n // only avaliable when simplified\r\n // for now this component is designed only for toolbar column chooser\r\n // These property should always be undefined\r\n // Keep them only for completion\r\n searchStr?: string,\r\n currentActive?: string\r\n}\r\n\r\nexport interface ToolbarColumnChooserProps {\r\n legacyI18n: I18n,\r\n classes?: any,\r\n categories: ColumnChooserCategory[],\r\n // errorMessages, // When and what?\r\n // the selected column that is initialized, the changing state is stored and changed in the backbone Component.\r\n selected: string[],\r\n onApply: (payload: OnApplyPayload) => void;\r\n onCancel: () => void;\r\n /**\r\n * Preference related.\r\n *\r\n * Important to make sure you are using the same unique grid name for one grid.\r\n */\r\n gridName: string;\r\n}\r\n\r\nconst ToolbarColumnChooser: FC<ToolbarColumnChooserProps> = (props) => {\r\n const {\r\n categories, legacyI18n, selected, onApply, onCancel, classes, gridName\r\n } = props;\r\n const instrumentation = useContext(InstrumentationContext);\r\n\r\n const [isDialogOpened, setIsDialogOpened] = useState(false);\r\n\r\n const applyValue = useRef<OnApplyPayload | undefined>(undefined);\r\n\r\n const handleApply: typeof onApply = (params) => {\r\n const query = {\r\n project: 'CampaignUI',\r\n grid: gridName,\r\n };\r\n\r\n const isDuplicatedColumnSetName = _.find(Columns.filter({ where: query }), _.matcher({ name: params.savedName }));\r\n\r\n if (isDuplicatedColumnSetName) {\r\n applyValue.current = params;\r\n setIsDialogOpened(true);\r\n return;\r\n }\r\n onApply(params);\r\n }\r\n\r\n const onReplace: ReplaceDialogProps[\"onReplace\"] = () => {\r\n setIsDialogOpened(false);\r\n onApply(applyValue.current);\r\n }\r\n\r\n const onDismiss: ReplaceDialogProps[\"onDismiss\"] = () => {\r\n setIsDialogOpened(false);\r\n }\r\n\r\n return (\r\n <div className={classes.columnChooser}>\r\n <ColumnChooser\r\n onApply={handleApply}\r\n onCancel={onCancel}\r\n instrumentation={instrumentation}\r\n categories={categories}\r\n legacyI18n={legacyI18n}\r\n selected={selected}\r\n isSplittingSelectedArea={false}\r\n simplified={false}\r\n />\r\n <ReplaceDialog\r\n hidden={!isDialogOpened}\r\n columnSetName={applyValue.current?.savedName}\r\n i18n={legacyI18n}\r\n onDismiss={onDismiss}\r\n onReplace={onReplace}\r\n />\r\n </div>\r\n );\r\n};\r\n\r\nexport const ToolbarColumnChooserWrapper: typeof ToolbarColumnChooser = withDefaultStyles(ToolbarColumnChooser, getStyle);\r\n","/* eslint-disable react/prop-types */\r\n/* eslint-disable react/jsx-filename-extension */\r\n\r\nimport { I18n } from '@bingads-webui-grid/well-known';\r\nimport { DefaultButton, Dialog, DialogFooter, DialogType, IDialogContentProps, PrimaryButton } from '@fluentui/react';\r\nimport React, { FC } from 'react';\r\n\r\ninterface RemoveDialogProps {\r\n hidden: boolean;\r\n i18n: I18n;\r\n columnSetName: string;\r\n onDismiss: () => void;\r\n onApply: () => void;\r\n}\r\n\r\nexport const RemoveDialog: FC<RemoveDialogProps> = (props) => {\r\n const {\r\n hidden,\r\n columnSetName,\r\n onApply: onReplace,\r\n onDismiss,\r\n i18n,\r\n } = props;\r\n\r\n const dialogContentProps: IDialogContentProps = {\r\n type: DialogType.normal,\r\n closeButtonAriaLabel: i18n.getString(_TL_('Close')),\r\n };\r\n\r\n return (\r\n <Dialog\r\n hidden={hidden}\r\n onDismiss={onDismiss}\r\n dialogContentProps={dialogContentProps}\r\n styles={{\r\n main: {\r\n minHeight: 0,\r\n },\r\n }}\r\n >\r\n <p>\r\n {i18n.getString(_TL_('Are you sure you want to remove saved column set: {{savedColumnSetName}}'), { savedColumnSetName: columnSetName })}\r\n </p>\r\n <DialogFooter>\r\n <PrimaryButton onClick={onReplace} text={i18n.getString(_TL_('Remove'))} />\r\n <DefaultButton onClick={onDismiss} text={i18n.getString(_TL_('Cancel'))} />\r\n </DialogFooter>\r\n </Dialog>);\r\n};\r\n","/* eslint-disable react/prop-types */\r\n/* eslint-disable react/jsx-filename-extension */\r\n/* eslint-disable no-use-before-define */\r\nimport React, { useState, useContext, useCallback, useRef } from 'react';\r\nimport { I18nContext } from '@bingads-webui-react/i18n-context';\r\nimport { Columns, SelectedColumns } from '@bingads-webui-component-legacy/bingads-grid/service/column-chooser-preferences';\r\nimport { assertIsDefined, assert } from '@bingads-webui-campaign-react/debug-assert';\r\nimport { I18n } from '@bingads-webui-grid/well-known';\r\nimport { ToolbarColumnChooserProps, ToolbarColumnChooserWrapper } from './ColumnChooser';\r\nimport { RemoveDialog } from './RemoveDialog';\r\n\r\nconst dropdownId = 'dropdown-column-chooser';\r\nconst saveListId = 'dropdown-radio-group-saved-columns';\r\nconst defaultColumnSetName = 'Custom';\r\n\r\ntype HookColumnChooserProps = Omit<ToolbarColumnChooserProps, 'onApply' | 'gridName'> & {\r\n onApply: (newColumnKeys: string[]) => void;\r\n}\r\n\r\n/**\r\n * All opeions should never change\r\n */\r\ninterface UseColumnsWithToolbarColumnChooserOptions {\r\n defaultColumns: string[],\r\n gridName: string,\r\n toolbarOptions: {\r\n toolbarEditor: any,\r\n /**\r\n * Used to open column chooser when user click \"Modify columns\"\r\n */\r\n openColumnChooser: () => void,\r\n },\r\n callbacks?: {\r\n beforeSetSelectedColumns?: () => void;\r\n },\r\n customToolbarIcon?: string,\r\n}\r\n\r\n/**\r\n * This hook handle many things\r\n * - Preference\r\n * - initial toolbar for column chooser\r\n * - update toolbar when choose new columns\r\n * - Dialog when click \"remove\" button to remove column set\r\n */\r\nexport function useColumnsWithToolbarColumnChooser(options: UseColumnsWithToolbarColumnChooserOptions) {\r\n const {\r\n defaultColumns, gridName, toolbarOptions, callbacks, customToolbarIcon,\r\n } = options;\r\n const i18n = useContext(I18nContext) as I18n;\r\n\r\n const { toolbarEditor } = toolbarOptions;\r\n\r\n const [selectedColumns, setSelectedColumns] = useState<string[]>(defaultColumns);\r\n\r\n const isInitialized = useRef(false);\r\n const initialColumns = useCallback(async () => {\r\n assert(isInitialized.current === false, 'You should only initial column chooser for once!');\r\n isInitialized.current = true;\r\n\r\n await prepareData(gridName);\r\n\r\n const selectedColumnSetName = getPreferenceSelectedColumnSetName({ gridName });\r\n\r\n // Not support custom columns for now\r\n // Not handle lagacy for now\r\n handleSelectColumnSet({\r\n callbacks,\r\n columnSetName: selectedColumnSetName,\r\n defaultColumns,\r\n gridName,\r\n setSelectedColumns,\r\n });\r\n }, [callbacks, defaultColumns, gridName]);\r\n\r\n initialColumnChooserItemInToolbar({\r\n customToolbarIcon, gridName, i18n, toolbarEditor,\r\n });\r\n\r\n const [isRemoveDialogOpened, setIsRemoveDialogOpened] = useState(false);\r\n const [columnSetNameRemoveCandidate, setColumnSetNameRemoveCandidate] = useState<string>();\r\n\r\n function onRemoveDismiss() {\r\n setIsRemoveDialogOpened(false);\r\n }\r\n\r\n async function onRemoveApply() {\r\n setIsRemoveDialogOpened(false);\r\n\r\n const promises = [];\r\n promises.push(deletePreferenceSelectedColumns({ columnSetName: columnSetNameRemoveCandidate, gridName }));\r\n if (columnSetNameRemoveCandidate === toolbarEditor.get(saveListId).value) {\r\n promises.push(handleSelectColumnSet({\r\n columnSetName: defaultColumnSetName,\r\n callbacks,\r\n defaultColumns,\r\n gridName,\r\n setSelectedColumns,\r\n }));\r\n }\r\n await Promise.all(promises);\r\n handleRefreshMenu({ gridName, i18n, toolbarEditor });\r\n }\r\n\r\n function ColumnChooserTrivia() {\r\n return (<RemoveDialog\r\n hidden={!isRemoveDialogOpened}\r\n columnSetName={columnSetNameRemoveCandidate}\r\n i18n={i18n}\r\n onDismiss={onRemoveDismiss}\r\n onApply={onRemoveApply}\r\n />);\r\n }\r\n\r\n function ColumnChooser(props: HookColumnChooserProps) {\r\n const { onApply } = props;\r\n return (\r\n <ToolbarColumnChooserWrapper\r\n {...props}\r\n gridName={gridName}\r\n onApply={async (n) => {\r\n const { selectedKeys, savedName } = n;\r\n onApply(selectedKeys);\r\n\r\n const columnSetName = savedName || defaultColumnSetName;\r\n setSelectedColumns(selectedKeys);\r\n\r\n await Promise.all([\r\n setPreferenceSelectedColumnSet({ columnSetName, gridName }),\r\n setPreferenceSelectedColumns({ columns: selectedKeys, columnSetName, gridName }),\r\n ]);\r\n\r\n handleRefreshMenu({ gridName, i18n, toolbarEditor });\r\n }}\r\n />\r\n );\r\n }\r\n\r\n return {\r\n /**\r\n * This property must be called once.\r\n *\r\n * Initialization is not done in an useEffect, for user usually wants to send only one call after all initialization is done.\r\n *\r\n * Have to let user control data flow.\r\n */\r\n initialColumns,\r\n columns: selectedColumns,\r\n /**\r\n * Always render this\r\n */\r\n ColumnChooserTrivia,\r\n ColumnChooser,\r\n };\r\n\r\n function initialColumnChooserItemInToolbar({\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n toolbarEditor, customToolbarIcon, i18n, gridName,\r\n }) {\r\n toolbarEditor.update({\r\n iconLeftGlyphName: customToolbarIcon || 'ba-TripleColumnSolid',\r\n id: dropdownId,\r\n button: {\r\n text: i18n.getString(_TL_('Columns')),\r\n iconLeft: ['glyphicon', 'toolbar-icon', 'toolbar-icon-left', 'icon-columnchooser-normal'],\r\n iconRight: ['glyphicon', 'toolbar-icon', 'glyphicon-triangle-bottom'],\r\n },\r\n menu: {\r\n items: [{\r\n text: i18n.getString('Modify columns'),\r\n onClick: toolbarOptions.openColumnChooser,\r\n }, {\r\n type: 'dropdown-divider',\r\n }, {\r\n type: 'dropdown-radio-group',\r\n id: saveListId,\r\n title: i18n.getString(_TL_('Apply saved columns')),\r\n items: [],\r\n removeText: i18n.getString(_TL_('Remove')),\r\n // `onSelect` must be async, somewhere else call `then` on the result\r\n // no need to call `handleRefreshMenu` explicitly, which will be called after `onSelect` is called\r\n onSelect: async columnSetName => handleSelectColumnSet({\r\n columnSetName, callbacks, defaultColumns, gridName, setSelectedColumns,\r\n }),\r\n onRemove: (columnSetName) => {\r\n setIsRemoveDialogOpened(true);\r\n setColumnSetNameRemoveCandidate(columnSetName);\r\n },\r\n refreshMenu: () => { handleRefreshMenu({ toolbarEditor, gridName, i18n }); },\r\n }],\r\n },\r\n });\r\n handleRefreshMenu({ toolbarEditor, gridName, i18n });\r\n }\r\n}\r\n\r\nfunction handleRefreshMenu({ toolbarEditor, gridName, i18n }) {\r\n const items = Columns.filter({ where: buildBaseQuery(gridName) }).reduce((memo, { name }) => {\r\n if (name !== defaultColumnSetName) {\r\n memo.push({\r\n text: name,\r\n value: name,\r\n });\r\n }\r\n return memo;\r\n }, [{\r\n text: i18n.getString(_TL_('Custom')),\r\n value: defaultColumnSetName,\r\n locked: true,\r\n }]);\r\n\r\n const columnSetName = getPreferenceSelectedColumnSetName({ gridName });\r\n\r\n toolbarEditor.update({\r\n id: saveListId,\r\n items,\r\n value: columnSetName,\r\n });\r\n}\r\n\r\nasync function handleSelectColumnSet({\r\n defaultColumns, columnSetName, gridName, callbacks, setSelectedColumns,\r\n}) {\r\n const promises = [];\r\n const selectedColumnsPreference = await getPreferenceSelectedColumns({ columnSetName, gridName });\r\n if (selectedColumnsPreference) {\r\n let finalColumns = [...selectedColumnsPreference.columns];\r\n finalColumns = callbacks?.beforeSetSelectedColumns(finalColumns) || finalColumns;\r\n setSelectedColumns(finalColumns);\r\n } else {\r\n setSelectedColumns(defaultColumns);\r\n promises.push(setPreferenceSelectedColumns({ columns: defaultColumns, columnSetName, gridName }));\r\n }\r\n\r\n if (columnSetName !== getPreferenceSelectedColumnSetName({ gridName })) {\r\n promises.push(setPreferenceSelectedColumnSet({ columnSetName, gridName }));\r\n }\r\n\r\n return Promise.all(promises);\r\n}\r\n\r\n// Not know what this is really doing, just imitate existing behavior in\r\n// \"projection-grid-column-chooser\\src\\plugin.js\"\r\nasync function prepareData(gridName) {\r\n const query = buildBaseQuery(gridName);\r\n return Promise.all([Columns.findAll({ where: query }), SelectedColumns.findAll({ where: query })]);\r\n}\r\n\r\n// Should not use this, but it's fine. I have not find any other proecjtName.\r\nfunction buildBaseQuery(gridName, projectName = 'CampaignUI') {\r\n return {\r\n project: projectName,\r\n grid: gridName,\r\n };\r\n}\r\n\r\nfunction getPreferenceSelectedColumnSet({ gridName }) {\r\n const query = buildBaseQuery(gridName);\r\n return SelectedColumns.filter({ where: query })[0];\r\n}\r\n\r\nfunction getPreferenceSelectedColumnSetName({ gridName }) {\r\n const columnSetPreference = getPreferenceSelectedColumnSet({ gridName });\r\n return columnSetPreference?.name ?? defaultColumnSetName;\r\n}\r\n\r\nfunction setPreferenceSelectedColumnSet({ gridName, columnSetName }) {\r\n const columnSetPreference = getPreferenceSelectedColumnSet({ gridName });\r\n if (columnSetPreference) {\r\n return SelectedColumns.update(columnSetPreference.id, { name: columnSetName });\r\n }\r\n return SelectedColumns.create({ name: columnSetName, ...buildBaseQuery(gridName) });\r\n}\r\n\r\nfunction getPreferenceSelectedColumns({ gridName, columnSetName }) {\r\n return Columns.filter({\r\n where: { name: columnSetName, ...buildBaseQuery(gridName) },\r\n })[0];\r\n}\r\n\r\nasync function setPreferenceSelectedColumns({ gridName, columnSetName, columns }) {\r\n const columnsPreference = getPreferenceSelectedColumns({ gridName, columnSetName });\r\n if (columnsPreference) {\r\n return Columns.update(columnsPreference.id, { columns });\r\n }\r\n return Columns.create({ columns, name: columnSetName, ...buildBaseQuery(gridName) });\r\n}\r\n\r\nasync function deletePreferenceSelectedColumns({ gridName, columnSetName }) {\r\n const columnsPreference = getPreferenceSelectedColumns({ gridName, columnSetName });\r\n assertIsDefined(columnsPreference);\r\n return Columns.destroy(columnsPreference.id);\r\n}\r\n"],"names":["getBulkEditParams","_ref","state","getQueryString","_ref2","str1","str2","selectionCount","selectedIds","idAttribute","filter","customStrFilter","queryArray","strFilter","isPreview","length","_","map","id","concat","join","value","FilterEntity","query","entitySchema","odata","options","odataV4","$","$filter","push","dateRange","get","startdate","start","RangeStartDate","toISOString","enddate","end","RangeEndDate","e","getDateRange","compact","getDescription","description","idsCount","JSON","stringify","bulkEditParams","_ref3","_ref3$idAttribute","batchActions","entity","_ref3$campaignId","campaignId","_ref3$adgroupId","adgroupId","BatchAction","Description","Entity","Selection","QueryString","CampaignId","AdGroupId","getGridOptionUtils","edm","getEntitySetInSubAccount","subAccountId","currentAccount","SubAccounts","$withKey","getEntitySetByScope","scope","hotelDrillDown","hotelGroupId","HotelGroups","gridOptionUtils","getUrlByName","name","url","getUrlWithSubAccountState","getEntitySetByName","arguments","undefined","Hotels","getHotelCenterService","jsdata","dataStore","_objectSpread","AccountService","_Backbone$Model","_classCallCheck","_callSuper","_inherits","_createClass","key","currentSubAccountId","subAccountModel","Id","Promise","resolve","this","fetchSubAccountById","unset","SubAccount","find","entitySet","cacheResponse","bypassCache","then","subAccount","set","Backbone","getAccountService","DataStore","pollStatus","taskId","successCb","failedCb","BulkEditSession","response","catch","processResponse","completeCB","failedCB","progressCB","Status","setTimeout","bulkEdit","params","_ref2$completeCB","_ref2$failedCB","_ref2$progressCB","preview","process","urlParameters","$expand","create","bulkEditService","save","getBulkEditService","isLightDismissibleInitialized","window","click","$lightDismissibles","clickedEl","target","each","index","closest","originalEvent","noDismiss","hasClass","addClass","removeClass","getBidMultiplierView","i18n","pageContext","multiplierSchema","BidMultiplierView","_DeterministicView","strategy","type","text","factorModel","initFactorInput","setState","factor","_this","template","isValid","getChild","getState","getFactor","model","toJSON","percentage","Factor","isUseParent","readonly","formatDecimal","minimumFractionDigits","maximumFractionDigits","trigger","editStrategy","num","Number","parseDecimal","toString","inputView","schema","properties","minimum","maximum","backboneSchema","validation","decimalLength","factorInput","InputControl","field","addonText","DecimalFormatter","percentSymbol","ariaLabel","getString","setChild","DeterministicView","getBidMultipliersView","componentState","getMultipliersState","getHotelCenterUtils","bidMultiplierUtils","_getCheckInDayMultipl","serializeBidMultipliers","weekDayMap","CheckInDayMultipliersView","toLowerCase","_this2","checkInDayMultipliersState","bidMultipliers","_this3","getCheckInDayMultipliersView","_getDeviceTypeMultipl","deviceTypeMap","Mobile","Tablet","Desktop","DeviceTypeMultipliersView","listOfTypes","i18nKey","deviceMultipliersState","getDeviceTypeMultipliersView","_getLengthOfStayMulti","formatStaySegments","LengthOfStayMultipliersView","minNumberOfNights","maxNumberOfNights","staySegments","nightsModel","initNightsInput","addNewSegment","removeSegment","MinimumNumberOfNights","override","validators","result","message","NightsModel","nightsInput","updateUserInputs","addSegmentByMinNumberOfNights","removeSegmentByMinNumberOfNights","title","currentKey","currentIndex","it","newSegment","splice","segment","isLengthOfStay","currentSegment","bidMultiplier","item","_this4","lengthOfStayMultipliersState","stayFactors","i","hasDuplicateMultipliers","errors","getLengthOfStayMultipliersView","_getUserCountryMultip","UserCountryMultipliersView","countries","selectedCountries","chooseCountry","Key","restCountries","getRestCountries","removeCountry","country","removeNodes","keys","node","_ref4","Value","_this5","userCountryMultipliersState","getUserCountryMultipliersView","deviceTypes","checkInDays","BidMultipliersView","_ref2$showUseParent","showUseParent","_ref2$isPayPerStay","isPayPerStay","_ref2$isPayPerStayPha","isPayPerStayPhase2Pilot","deviceTypeMultipliersView","dateTypeMultipliersView","Selected","Default","isHotelPropertyPromotionAdEnabled","Permissions","IsHotelPropertyPromotionAdEnabled","siteTypeMultipliersView","LocalUniversal","MapResults","PropertyPromotionAd","userCountryMultipliersView","lengthOfStayMultipliersView","advancedBookingMultipliersView","checkInDayMultipliersView","selectedMultiplierType","dataset","checked","_ref5","deviceType","dateType","siteType","getSelectedCountriesMulti","userCountry","checkInDay","lengthOfStay","advancedBooking","attributes","res","pluck","flatten","getBidMultipliers","memo","_defineProperty","getProjectionGridDateFilter","i18nDefault","dateFilterPreferences","dateUtils","setDateFilter","account2local","local2account","includeRanges","formatAccountDate","date","formatDate","raw","formatUTCDateTime","strDate","timeZone","ensureMinDate","minDate","Date","parseDate","dateString","formatDateRange","odataTimeZone","upToNowWhenToday","UTC","RANGES","CUSTOM_TIME","now","today","withoutTime","valueOf","returnDate","setHours","generateEndDateTime","startDateTime","endDateTime","Account","startDate","endDate","addDateRangeToQueryParams","queryParams","_ref2$odataTimeZone","_ref2$upToNowWhenToda","primaryRange","compared","comparisonStartDate","comparisonEndDate","setDateRange","dateFilter","comparedRange","Rangelcid","CurrentUser","Locale","selectedDate","sharedInGrids","dateFilterPlugin","definePlugin","gridView","dataSource","plugins","normalizedConfig","config","gridName","__proto__","isComparisonEnabled","enabledRangesPredicate","range","dateFormat","timeFormat","maxDate","defaultTimeRange","storedDateRangeKey","storedDateRange","normalizeConfig","dateFilterView","DateFilter","projectName","originalQuery","getPromise","initDateRange","grain","getDefaultRange","container","selection","render","append","$el","renderDateFilterView","call","on","refresh","events","Option","_ref$id","_ref$value","_ref$isSelected","isSelected","_ref$isDisabled","isDisabled","updateView","helpers","ensureChildView","Selector","_ref$options","_ref$selectOption","selectOption","_ref$nodataPlaceholde","nodataPlaceholder","option","initialOption","optionSelected","Pagination","_ref$currentPage","currentPage","_ref$pageSize","pageSize","_ref$totalCount","totalCount","goToPreviousPage","goToNextPage","_this$model$attribute","_this$getState2","Search","_ref$placeholder","placeholder","_ref$searchResultsId","searchResultsId","search","onChange","keypress","keyPress","keyCode","preventDefault","DropdownSearchSelector","_ref$customOptions","customOptions","_ref$forceEnableSearc","forceEnableSearch","_ref$invokeSearchOnCh","invokeSearchOnChange","dropDown","toggle","viewLoadAsync","fetchData","pageNumber","results","initialPaginationView","initialSearchView","slice","detachChild","remove","val","searchString","initialCustomOptionView","setOptionView","selectedId","parent","toggleClass","onSearchInvoked","searchInvoked","searchChanged","pageChanged","customOption","_this6","onOptionSelected","scenario","setting","activity","errorCodes","initSetup","getErrorMappers","odataErrorMapper","OdataErrorMapper","getProcessors","contextProcessor","ContextProcessor","debugProcessor","DebugProcessor","isDebugMode","BINGADS_DEBUG","getListeners","ariaConfig","getAriaConfig","currentEnv","tokens","env","document","domain","indexOf","basicFormatter","BasicFormatter","applicationSystem","applicationSubSystem","apiFormatter","ApiFormatter","consoleFormatter","ConsoleFormatter","logLevelFilter","LogLevelFilter","apiFilter","ApiFilter","consoleFilter","ConsoleFilter","ariaListener","AriaListener","tenantToken","flushInterval","batchSize","logTableNames","campaignLogTableConfig","defaultLogCategory","formatters","filters","init","registerForTeardown","consoleListener","ConsoleListener","listeners","isTestEnvironment","seleniumLogsSink","InMemorySink","maxSize","inMemoryListener","InMemoryListener","sink","initPerfTiming","performanceLogsFormatter","PerformanceLogsFormatter","performanceLogsFilter","PerformanceLogsFilter","resourcetiming","perfTimingProcessor","PerfTimingProcessor","landingPageUrl","instr","Instrumentation","processors","perfTimingLogger","PerformanceTimingLogger","instrumentation","getEdmBhc","schemas","CustomerIdType","namespace","EDM","jsdataExtension","store","registerAdapter","ODataAdapter","ajaxOptions","path","host","oDataToken","loginType","default","getJsDataExtension","resIdsPlugin","odataPlugin","jsdataPlugin","root","types","ComplexType","Customers","typeName","ResourceIdentifier","defineConstProperty","customerIdType","currentCustomer","collection","dependencies","defineComputedProperty","useAdvertiserCustomerId","jsdataBhc","resources","getHotelCenterShared","preferencesService","segmentationPreferences","fixedBidSchema","percentageBidSchema","payPerStayBidSchema","hotelGroupSchema","hotelSchema","subAccountSchema","lightDismissible","toolbarTemplate","AccountInformationView","getAccountInformationView","BidCapView","selections","empty","cap","FixedBidModel","fixedBidModel","maxBidInputControl","listenTo","capSelection","focus","parse","maximumBid","inputState","noCap","getBidCapView","BidStrategyView","fixed","payperstay","currentTemplate","customTemplate","isAmountRequired","isPayPerStayEnabled","dynamic","isReadonly","disabledAttr","disabled","isPPSReadOnly","disabledPPSAttr","initFixedBidInput","initPercentageBidInput","initPayPerStayBidInput","bidStrategy","bidAmount","_superPropGet","props","showError","formatDecimalToFixed","percentageBidModel","payPerStayBidModel","bidInput","bid","Amount","fixedBidInput","PercentageBidModel","percentageBidInput","PayPerStayBidModel","payPerStayBidInput","getBidStrategyView","EditPanelView","hasCleanButton","isSaveButtonDisabled","onCancel","onSave","onClean","getEditPanelView","getSegPreference","getSegType","fetchPreferenceConfig","gridConfig","sortInfoKey","p$stateManager","initialize","_ref2$Data$rowsPerPag","findByName","Data","rowsPerPage","_ref3$Data$sortInfo","sortInfo","orderbyInfo","orderby","sortableHeader","spread","pageable","pagination","segType","segmentationType","isTimeRangeValid","SegmentationTypes","getFetchPreferenceConfig","HotelGroupInformationView","onBack","onRemove","getHotelGroupInformationView","Name","required","HotelGroupModel","_SchemaModel","json","attachNestedModels","method","HotelGroup","Bid","update","attrs","destroy","Error","fieldNames","has","changedAttributes","getHotelGroupModel","SchemaModel","HotelModel","Hotel","getHotelModel","_initSetup","instrumentConfig","addScenario","stubOptions","objectsToStub","errorMappers","eventHandler","AjaxEventHandler","shouldAddHeaders","ajaxContext","isInternalUrl","ajaxStub","AjaxStub","errorStub","ErrorStub","stub","getInstrumentation","countryCodes","userCountryService","getCountriesAndSetState","code","sort","a","b","getUserCountryService","SubAccountModel","accountService","fetchSubAccountAsync","DailyBudget","MaximumBid","BidMultipliers","HotelAssociationCount","updatedId","getSubAccountModel","getBidMultiplierUtils","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday","getSegmentText","minNight","maxNight","replace","addOnText","sortedStaySegments","formatDaysAndNightsMultipliers","multiplier","Math","abs","deserializeBidMultipliers","multiplierFactor","parseFloat","toFixed","DeviceTypes","DateType","Sites","Countries","DaysOfWeek","dayOfWeek","MinimumNumberOfDays","bidMultiplierTextFormat","getDeviceTypeMultipliersText","deviceTypeMultipliers","deviceMultipliersText","deviceTypeMultiplier","getSiteTypeMultipliersText","siteTypeMultipliers","siteTypeMap","siteMultipliersText","siteTypeMultiplier","getDateTypeMultipliersText","dateTypeMultipliers","dateTypeMap","dateTypeMultipliersText","dateTypeMultiplier","getUserCountriesMultipliersText","userCountryMultipliers","userCountryMultipliersText","userCountryMultiplier","findWhere","getCheckInDayMultipliersText","checkInDayMultipliers","checkInDayMultipliersText","checkInDayMultiplier","getLengthOfStayMultipliersText","lengthOfStayMultipliers","lengthOfStayMultipliersText","lengthOfStayMultiplier","input","resetFactor","multipliers","multipliersState","addDeviceTypeBidMultipliers","addDateTypeBidMultipliers","addSiteTypeBidMultipliers","addUserCountryBidMultipliers","addCheckInDayBidMultipliers","addLengthOfStayBidMultipliers","addAdvancedBookingBidMultipliers","getMultipliersDetailText","defaultText","convert2text","getMultipliersText","hasPreLabel","bidUtils","getText","jsonValue","AccountCurrencyCode","getBidUtils","accountTimeZoneOffsetMinutes","UtcOffsetHours","totalOffset","getTimezoneOffset","getTime","getDateUtils","inlineDownloadUtils","processReportRuleForHotelCenterBIDimensionRow","ReportRule","SaveReport","Type","processReportRuleForHotelCenterBookingRow","useDidUpdate","callback","deps","isMounted","useRef","useEffect","current","useConstructor","_useState","useState","_useState2","_slicedToArray","getStyles","CampaignName","React","campaignName","useContext","I18nContext","classes","useDefaultStyles","_jsxs","className","classnames","children","_jsx","Label","_TL_","isAdgroupNameValid","validateName","maxLength","getAdGroupNameErrorMessage","adFormat","checkShouldShowErrors","checkShouldShowError","isAdFormatValid","globalErrorMsg","AdgroupName","adgroupName","setAdgroupName","adgroupNameText","error","getNameErrorMsg","shouldShowError","TextField","label","onRenderLabel","withVerticalAlignCenterSpan","HelpPopup","topic","isDirty","styles","fieldGroup","width","marginTop","ErrorString","Errors","x","defaultProps","bidFields","getBaseBidMinMax","bidStrategyType","serverContext","min","KeywordBidRange","FloorValue","max","CeilingValue","bidStrategyOptionKeys","Commission","appConfig","PercentCpc","ManualCpc","validateBaseBid","baseBid","validateNumber","commissionRate","notRequired","digitLength","notIncludeMin","percentCpcBid","searchBid","isBaseBidValid","getBaseBidErrorMessage","getBaseBidTitleDetails","accountCurrencyCode","marginBottom","fontSize","borderBottom","margin","BidOrPercent","setBaseBid","childPart","Fragment","Stack","horizontal","verticalAlign","childrenGap","CampaignBidInput","BidInput","ServerContext","getAccountCurrencyCode","BaseBid","minMax","getBidErrorMsg","isPercent","Disclaimer","AdgroupBasic","adgroup","patchAdgroup","permissions","usePatch","setAdFormat","allPanelItems","activeKeys","setActiveKeys","horizontalAlign","padding","Link","onClick","Collapse","Panel","TextTitle","titleKey","details","adFormatValue","entry","detailsString","IsRenameHotelToLodgingEnabled","getAdGroupTitleDetail","AdFormat","fieldsToCheck","defaultAdgroupBasicData","adSchedule","useParentLevel","dayTimeRanges","AdDistribution","defaultAdFormat","exclusions","urlOptions","audienceAds","parentLevelSettings","audienceAdsOptionKeys","Increase","currentLevelSettings","location","defaultLocationData","device","_toConsumableArray","deviceDefaultSetting","ABW","advancedBookingDefaultSetting","checkinDay","checkinDayDefaultSetting","userSetDates","userSetDatesDefaultSetting","checkinDate","checkinDateDefaultSetting","lengthOfStayDefaultSetting","commonConvertTargetStateToTargetSchema","campaign","CriterionType","targetCriterion","newCurrentLevelSettings","targetSchema","parentParams","AdGroup","AdGroupName","Criterion","BidAdjustment","bidAdjustmentDropdown","bidAdjustmentInput","renderAdGroupTargets","cid","aid","adGroupId","context","getCampaignDeviceCriterionsPromise","getCampaignTargetsCriterions","adgroupTargetsPromises","getAdGroupDeviceCriterionsPromise","getAdGroupTargetsCriterions","all","campaignTargets","adGroupTargets","deviceCriterion","converODataObjectToDeviceState","prev","initTargets","reset","getAdGroupABWCriterionsPromise","ABWCriterion","converODataObjectToABWState","getAdGroupLengthOfStayCriterionsPromise","_ref6","lengthOfStayCriterion","converODataObjectToLengthOfStayState","getAdGroupCheckinDayCriterionsPromise","_ref8","checkinDayCriterion","converODataObjectToCheckinDayState","getAdGroupCheckinDateCriterionsPromise","_ref10","checkinDateCriterion","converODataObjectToCheckinDateState","getAdGroupUserSetDatesCriterionsPromise","_ref12","userSetDatesCriterion","converODataObjectToUserSetDatesState","_ref14","getUnSupportedBidAdjustmentFeatures","CampaignBidStrategyType","isUnSupported","feature","unSupportedFeatures","includes","convertLocationStateToLocationSchema","currentLocations","initLocations","noLocations","finalLocations","intent","intentId","LocationIntentCriterion","IntentOption","convertIntentOption","physicalIntentOptions","PeopleInOrSearchingForOrViewingPages","targets","criterion","setParent","compareAndProcessLocations","getHotelAdGroupType","HotelAdGroupType","HPA","PPA","convertAdgroupStateToAdgroupJSONSchemaData","initDevice","initABW","initCheckinDay","initLengthOfStay","initCheckinDate","initUserSetDates","adScheduleUseSearcherTimeZone","AdScheduleUseSearcherTimeZone","getAdScheduleUseSearcherTimeZone","deviceSettings","DeviceMap","Computer","Smartphone","currentDeviceSchema","DeviceCriterion","DeviceName","currentDeviceSchemaResult","convertDeviceStateToDeviceSchema","ABWSettings","currentABWSchema","AdvanceBookingWindowCriterion","MinDays","minimumDays","MaxDays","maximumDays","currentABWSchemaResult","convertABWStateToABWSchema","checkinDaySettings","currentCheckinDaySchema","CheckInDayCriterion","CheckInDay","day","currentCheckinDaySchemaResult","convertCheckInDayStateToCheckInDaySchema","lengthOfStaySettings","currentLengthOfStaySchema","LengthofStayCriterion","MinNights","minimumNumber","MaxNights","maximumNumber","currentLengthofStaySchemaResult","convertLengthofStayStateToLengthofStaySchema","checkinDateSettings","currentCheckinDateSchema","CheckInDateCriterion","StartDate","moment","format","EndDate","currentCheckinDateSchemaResult","convertCheckInDateStateToCheckInDateSchema","userSetDatesSettings","UserSetDatesMap","currentUserSetDatesSchema","DateSelectionTypeCriterion","HotelDateSelectionType","dates","currentUserSetDatesSchemaResult","convertUserSetDatesStateToUserSetDatesSchema","locationTargets","adschedules","adScheduleData","getAdSchedule","getAudienceAds","BiddingScheme","jsonSchemaData","Campaign","SearchBid","decimal","fromLocalToFloat","AdGroupPercentCpcBid","AdGroupCommissionRate","getAdGroupBid","AdGroupType","dateSettings","netWorkOptions","TrackingUrlTemplate","FinalUrlSuffix","UrlCustomParameters","AdGroupCriterions","collectCriterions","generateDataToInvalidState","validationData","data","forEach","isInvalid","advancedSettingsSection","display","marginRight","advancedSettingsContainer","AdvancedSettings","errMsg","patchErrMsg","getAdScheduleView","setAdScheduleView","setAdDistributionView","getAdDistributionView","setUrlOptionsView","setSiteExclusionView","getUrlOptionsValues","getExclusionsValues","advancedSettinsApiErrors","isDataFetched","currentCampaign","useCurrentCampaign","currentAdgroup","useCurrentAdGroup","hasApiErrorKeys","Object","needToExpandKeys","setAdSchedule","setAudienceAds","onChangeToggle","fn","adScheduleTitle","topicKey","getAdScheduleDetails","isChecked","handleChangeToggle","_e","adScheduleView","koModel","useCampaignSettingsChecked","adScheduleOption","useMemo","TimeZone","adGroupStatus","level","campaignDayTimeRanges","showDateSettings","hideAdScheduleBidAdjustments","campaignAdScheduleUseSearcherTimeZone","getAdScheduleOption","audienceAdsTitle","ToggleTitle","getAudienceAdsDetails","rawData","adDistributionOption","Medium","Languages","campaignType","getAdDistributionOption","checkItems","AdSchedule","getCreatedView","managed","isAudienceAdsValid","AudienceAds","view","getTranslatedOption","adDistribution","getUrlOptionsDetails","setActiveCallback","UrlOptions","getExclusionsDetails","baseExclusion","BaseExclusion","patchData","showSiteExclusion","AdgroupTargets","fontWeight","subtitle","mt33","targetsApiErrors","patchTargetsApiErrMsg","setLocation","setDevice","setABW","setCheckinDay","setUserSetDates","setCheckinDate","setLengthOfStay","deviceDefaultCurrentLevelSettings","ABWDefaultCurrentLevelSettings","checkinDayDefaultCurrentLevelSettings","lengthOfStayDefaultCurrentLevelSettings","checkinDateDefaultCurrentLevelSettings","userSetDatesDefaultCurrentLevelSettings","resetTarget","setFn","targetData","targetDefaultCurrentLevelSettings","targetName","tempCurrentLevelSettings","tempId","tempObj","locationTitle","getLocationTargetTitleDetails","isTargetEverywhere","campaignLocations","campaignLocation","peopleInLocation","peopleSearchingForLocation","bidMode","deviceTitle","getGridTargetTitleDetails","abwTitle","checkinDayTitle","lengthOfStayTitle","checkinDateTitle","CultureDateTimeFormat","ShortDatePattern","userSetDatesTitle","getLocationTargetErrorMessage","LocationTargetSetting","setData","isAdGroupLevel","DeviceTargetSetting","apiErrors","DefaultButton","AdvancedBookingWindowTargetSetting","CheckinDayTargetSetting","LengthOfStayTargetSetting","CheckinDateTargetSetting","UserSetDatesTargetSetting","AdGroupTitle","Title","scenarios","HotelAdGroupBase","_React$Component","handleCreateOrUpdateSuccess","_this$props","siteMap","isCreation","getCreatedAdGroupId","send","createDefaultHotelGroupAfterAdGroupCreation","durationActivity","stopSignal","getRoutePathById","finally","updateResponseData","isExclusionsUpdated","saveExtensions","defaultHotelGroupCreated","_this$props$scope$val","values","createDefaultHotelGroup","sendErrors","i18nErrors","prevState","adgroupApiErrors","scrollAndShowWarning","handleCreateOrUpdateError","allApiErrors","handleApiErrors","subViews","mergeAdGroupStateWithErrors","entityApiErrors","General","createOrUpdateAdgroup","createOrUpdateCall","adgroupResource","bulkCreate","bind","bulkUpdate","validate","campaignBidStrategyType","notifyTargetsShowError","isDeviceTargetValid","isABWTargetValid","isCheckinDayTargetValid","isLengthOfStayTargetValid","isCheckinDateTargetValid","isUserSetDatesTargetValid","isLocationValid","validateAdGroupState","assign","urlOptionsView","every","getAdScheduleValues","getValues","deletedDayTimeCriterions","urlOptionsData","toObject","ExcludedSites","siteExclusionView","getDateSettings","adDistributionView","initializeTheInstrumentation","hotelAdGroupCreation","duration","perfMarker","createChild","hotelAdGroupSettings","willInit","syncAdGroupLocationCriterionsPromise","payload","_this$props$scope$val2","syncAdGroupLocationCriterions","resourceName","backFillItems","handleErrors","ServerDeviceCriterion","ServerABWCriterion","CheckinDayCriterion","ServerCheckinDayCriterion","LengthOfStayCriterion","ServerLengthOfStayCriterion","CheckinDateCriterion","ServerCheckinDateCriterion","UserSetDatesCriterion","ServerUserSetDatesCriterion","currentCriterionMap","updateDeviceByResponse","currentDeviceCriterion","updateABWByResponse","currentABWCriterion","updateCheckinDayByResponse","currentCheckinDayCriterion","updateLengthOfStayByResponse","currentLengthOfStayCriterion","updateCheckinDateByResponse","currentCheckinDateCriterion","updateUserSetDatesByResponse","currentUserSetDatesCriterion","updateAllTargets","removeWarningInterval","showWarning","isLoading","getCurrentCampaign","scrollToErrors","cancel","_this$props2","patchAdvancedSettinsApiErrors","hasErrors","subscribe","subscribeSiteExclusion","subscribeUrlOptions","adgroupEDM","edmCampaign","getCampaignDayTimeCriterionsPromise","rawCampaignDayTimeRanges","modelToViewModelDayTimeTargets","getCampaignLocationCriterionsPromise","rawCampaignLocations","parseLocationTargets","locations","getAdGroupDayTimeCriterionsPromise","rawAdGroupDayTimeRanges","adGroupDayTimeRanges","invalidateCache","rawLocations","getAdGroupLocationCriterionsPromise","_ref7","rawAdGroupLocations","_parseLocationTargets4","adGroupLocations","intentOption","targetOption","locationTargetsOptionKeys","specific","everywhere","_this7","getCampaignDataPromise","getCampaignData","getAdGroupDataPromise","getAdGroupData","_ref9","CampaignData","AdGroupData","_AdGroupData$audience","_AdGroupData$audience2","_AdGroupData$audience3","currentAdGroupSettings","_CampaignData$audienc","currentCampaignSettings","_this8","_ref11","_CampaignData$audienc2","_this9","willFetchData","_this$props$scope$val3","fetchCampaignData","fetchCampaignLocationCriterions","fetchCampaignDayTimeCriterions","willRender","handlePopState","addEventListener","_this$props$scope$val4","fetchCampaignAdGroupData","fetchLocationCriterions","fetchDayTimeCriterions","isDone","startSignal","done","stop","undelegateEvents","off","removeEventListener","_this10","_this$props$scope$val5","that","exclusionRepository","clearApiErrors","NegativeSitesResult","NegativeIPsResult","siteErrors","ipErrors","showErrors","clearSubViewApiErrors","baseExclusions","_this11","_this$props3","campaignBidStrategy","hotelAdGroupBase","onFocus","UiBlocker","blocking","loadingText","PrimaryButton","sharedStyles","core","minWidth","backgroundColor","palette","neutralLighterAlt","helpbuttonStyle","convertToLocalStyle","glyphIconStyle","creationCommonStyle","neutralLight","color","marginLeft","alignItems","themePrimary","outline","top","position","getBlockerStyle","paddingLeft","paddingTop","bottom","background","overflow","spinnerKeyframe","theme","mergeStyles","HotelAdGroupCreation","compose","withI18nConsumer","WrappedComponent","withDefaultStyles","HotelAdGroupSettings","legacyKeys","validationLocalization","ColumnChooser_Header","ColumnChooser_SubHeader","ColumnChooser_AvailableColumnsHeader","ColumnChooser_SelectedColumnsHeader","ColumnChooser_SelectedColumnsHeader_TopHalf","ColumnChooser_SelectedColumnsHeader_BottomHalf","ColumnChooser_SaveColumnDescription","ColumnChooser_Apply","ColumnChooser_Cancel","ColumnChooser_Add","ColumnChooser_Added","ColumnChooser_Remove","ColumnChooser_AddAllInList","ColumnChooser_RemoveAllInList","ColumnChooser_RemoveAllSelected","ColumnChooser_NoSearchResult","ColumnChooser_Disabled","ColumnChooser_Search_Column","ColumnChooser_AddColumn","ColumnChooser_RemoveColumn","ColumnChooser_LiftColumn","ColumnChooser_MoveColumn","ColumnChooser_DropColumn","Filter_Operator_IN","Filter_Operator_EQ","Filter_Operator_NEQ","Filter_Operator_Contains","Filter_Operator_Not_Contains","Filter_Operator_StartsWith","Filter_Operator_EndsWith","Filter_Operator_LT","Filter_Operator_GT","Filter_Operator_LTE","Filter_Operator_GTE","Filter_Validation_EnumSelectionRequired","Filter_Validation_Common_Required","Filter_Validation_Common_Number","Filter_Validation_Common_Number_Range","Filter_Validation_Common_Integer","Filter_Validation_Common_Date","Filter_Validation_Common_Id_Count","Filter_Cannot_Have_Duplicate","Filter_Remove","Filter_PredicateList_New","Performance","Filter_Key_AriaLabel","Filter_Operator_AriaLabel","Filter_Value_AriaLabel","SelectEntityOrEntities","SelectedEntityOrEntities","Selector_LoadingText","Selector_Check_All","Filter_Selector_MoreThanLimit","NoEntityOrEntities","CronFormatter_Frequency_MonthlyTemplate","CronFormatter_Frequency_WeeklyTemplate","CronFormatter_Frequency_DailyTemplate","CronFormatter_FrequencyGrain_Runs_Daily","CronFormatter_FrequencyGrain_Runs_Monthly","CronFormatter_FrequencyGrain_Runs_Weekly","CronFormatter_FrequencyGrain_DropdownMenu_None","CronFormatter_FrequencyGrain_DropdownMenu_Daily","CronFormatter_FrequencyGrain_DropdownMenu_Monthly","CronFormatter_FrequencyGrain_DropdownMenu_Weekly","DateFilter_Option_Custom","DateFilter_Option_CustomTime","DateFilter_Option_Today","DateFilter_Option_Yesterday","DateFilter_Option_ThisWeekSunday","DateFilter_Option_ThisWeekMonday","DateFilter_Option_Last7days","DateFilter_Option_LastWeekSunday","DateFilter_Option_LastWeekMonday","DateFilter_Option_Last14Days","DateFilter_Option_ThisMonth","DateFilter_Option_LastMonth","DateFilter_Option_Last30Days","DateFilter_Option_Last3Months","DateFilter_Option_Last6Months","DateFilter_Option_TwelveMonthsToDate","DateFilter_Option_ThisYear","DateFilter_Option_LastYear","DateFilter_Option_AllTime","DateFilter_Option_PreviousPeriod","DateFilter_Option_SamePeriodLastYear","DateFilter_Option_CustomPeriod","InlineDownloadReports_Column_EmailFrequency","InlineDownloadReports_EmailAndScheduling_Frequency_None","InlineDownloadReports_EmailAndScheduling_Frequency_Daily_Template","InlineDownloadReports_EmailAndScheduling_Frequency_Weekly_Template","InlineDownloadReports_EmailAndScheduling_Frequency_Monthly_Template","InlineDownloadReports_Action_UnsubscribeMe_Failed_NotSubscribed","InlineDownloadReports_Action_UnsubscribeMe_Failed","InlineDownloadReports_Action_UnsubscribeMe_Succeeded","Grid_Edit_Cell","Grid_EditButtonText","Save","Cancel","Loading","Schema_ReportEmailRule_Property_Cron","Schema_ReportEmailRule_Property_StartTime","Schema_ReportEmailRule_Property_EndTime","InlineDownloadReports_EmailAndScheduling_SendReportTo","InlineDownloadReports_SearchUsers","InlineDownloadReports_EmailAndScheduling_Email_Me","InlineDownloadReports_EmailAndScheduling_Email_Template_Me","InlineDownloadReports_EmailAndScheduling_User","InlineDownloadReports_EmailAndScheduling_FailedToLoadUsers","InlineDownloadReports_EmailAndScheduling_AllUsers","SimpleForm_Button_Save","SimpleForm_Button_Cancel","KoSchema_String_RemainingCharactersText","KoSchema_String_ExceededCharactersText","Custom","Schema_Enum_DateRangePreset_AllTime","Schema_Enum_DateRangePreset_LastBusinessWeek","Schema_Enum_DateRangePreset_LastFourteenDays","Schema_Enum_DateRangePreset_LastMonth","Schema_Enum_DateRangePreset_LastSevenDays","Schema_Enum_DateRangePreset_LastSixMonth","Schema_Enum_DateRangePreset_LastThirtyDays","Schema_Enum_DateRangePreset_LastThreeMonth","Schema_Enum_DateRangePreset_LastWeekStartingMon","Schema_Enum_DateRangePreset_LastWeekStartingSun","Schema_Enum_DateRangePreset_LastYear","Schema_Enum_DateRangePreset_ThisMonth","Schema_Enum_DateRangePreset_ThisWeekFromMon","Schema_Enum_DateRangePreset_ThisWeekFromSun","Schema_Enum_DateRangePreset_ThisYear","Schema_Enum_DateRangePreset_Today","Schema_Enum_DateRangePreset_Yesterday","fields","AdGroupBid","AdGroupPercentBid","bidStrategyTypeValueMap","bidStrategyOptions","percentageOrBidConst","getAdGroupBidMinMax","selectedKey","validateAdGroupBid","getBidStrategyMinMax","ProductGroupBidRange","validateBidStrategy","isBidStrategyValid","valid","getPercentageOrBidErrorMsg","_ref6$min","_ref6$max","numberErrorCode","RequiredField","getNumberErrorMsg","content","setBidStrategy","onBlur","Percentage","DefaultBidValue","AdditionalInfo","defaultBidStrategy","CampaignBidStrategy","PayPerStay","mySetBidStrategy","useCallback","partialUpdate","howToManageYourBidsText","errorCode","SpanWithComponent","SpanText","Component","Dropdown","defaultSelectedKey","dropdown","getDefaultBudget","USDefaultBudget","IsDefaultBudgetExperimentationEnabled","budgetRange","BudgetRange","fromFloatToString","DailyRange","validateBudget","isValidNumber","InValidNumber","OutOfRange","number","isBudgetValid","individualBudgetOptionKeys","IndividualBudgetEditor","budget","setBudget","showBudgetMinRecommend","curBudgetAmount","isExpanded","setIsExpanded","currencyCode","getBudgetErrorMsg","amount","individualBudgetOptions","currencySymbol","getCurrencySymbol","PageContext","trace","defaultBudget","ChoiceGroup","individualOption","Button","budgetOptionKeys","budgetOptions","onRenderField","CampaignBudget","mySetBudget","campaingBudgetText","labelId","ariaLabelledBy","defaultCampaignBasicData","defaultName","basicCampaignSection","CampaignBasic","patchCampaign","setName","BCCBudgetImprovementEnabled","classNames","detailString","getCampaignTitleDetail","isCampaignNameValid","getBudgetTitleDetails","percentageOrBid","detail","LocalizationKeys","getBidStrategyTitleDetails","setIPExclusionView","creation","setUrlOptionsActiveCallback","setExclusionsActiveCallback","showIPExclusion","CampaignTargets","bundleCountries","bundleLocationCriterions","CampaignTitle","UserSetDateMap","bidStrategyFields","convertCampaignStateToCampaignJSONSchemaData","getName","bidOrPercentValue","bidStrategyField","getBiddingScheme","Budget","getBudget","convertLocationStateToLocationSchemaCampaign","AdGroups","CampaignType","timeZoneMapper","getAccountTimeZone","CampaignCriterions","validateCampaignState","settings","HotelCampaignBase","getCreatedCampaignId","createDefaultHotelGroupAfterCampaignAdGroupCreation","getCreatedDefaultAdGroupId","adGroups","adGroup","handleCreatedDefaultAdGroup","defaultAdGroupId","getODataErrors","campaignApiErrors","mergeCampaignStateWithErrors","createOrUpdateCampaign","campaignResource","currentCampaignId","getCurrentCampaignId","Exclusions","ExcludedIPs","IPExclusionView","getAdGroup","PricingModel","defaultAdGroupCreated","hotelCampaignCreation","hotelCampaignSettings","syncLocationCriterionsPromise","syncLocationCriterions","subscribeIPExclusion","campaignEDM","lcid","LocaleID","market","Market","getBundleCountriesAndBundleLocationCriterions","defalutDeviceSettings","getBundleCountriesPromise","getLocationCriterionsPromise","_ref2$","_parseLocationTargets2","shouldSelectBundleOption","bundleOrDefaultMarket","patchForLocationTargetGrid","campaignData","getBundleCountries","renderCampaignTargets","siteExclusionsUpdated","IPExclusionsUpdated","AdvanceSettings","exclusionApiErrors","hotelCampaignBase","setBaseExclusionView","adScheduleModel","whiteSpace","minHeight","borderColor","datePickerStyle","HotelCampaignCreation","withCreationHeader","HotelCampaignSettings","Text","variant","block","lineHeight","advancedBookConst","validateAdvancedBookingDays","_ref$min","_ref$max","_ref$isInteger","isInteger","extra","lengthOfStayConst","validateLengthOfStayDays","validateCheckinDate","getDaysBetween","dateString1","dateString2","shouldNotHideInclude","bidAdjustmentConst","onlyExtra","transExtra","last","pre","validateBidAdjustment","_ref3$min","_ref3$max","getValidateBidAdjustmentErrorMsg","_ref4$min","_ref4$max","defaultSupportedLocationsForGEODeal","locationErrors","locationTypeNameMap","Country","SubGeography","MetroArea","City","PostalCode","County","Neighborhood","getLocationErrorMsg","_ref6$dealInfo","dealInfo","_ref5$dealInfo","dealSupportedLocationType","supportedLocationType","constructErrorMessageForDeal","validateLocations","_location$currentLeve","areaLocations","includedLocations","excludedLocations","LocationCriterion","SelectionStatus","includedLoc","EnclosingLocationIds","parentLocationId","excludedLoc","LocationId","checkConflict","targetConstants","minimumBid","Location","isForDeal","dealCountryCode","invalidCountryLocations","invalidTypeLocations","locationType","targetCountryCode","getDatePickerStrings","months","shortMonths","days","shortDays","goToToday","prevMonthAriaLabel","nextMonthAriaLabel","prevYearAriaLabel","nextYearAriaLabel","closeButtonAriaLabel","isRequiredErrorMessage","invalidInputErrorMessage","areEqual","prevProps","nextProps","patchTarget","isValueOverlapMap","dt1","dt2","start1","end1","start2","end2","flag1","flag2","flag3","isStart1EarlyThanEnd1","isStart2EarlyThanEnd2","isEnd1EarlyThanStart2","isRange1NotGreaterThan999","isRange2NotGreaterThan999","isValueOverlapMapSortByParams","isValueOverlap","sortData","len","curDt","isValueOverlapMapFn","j","otherDt","overlapErrorMsg","minimum_greater_than_maximum","minimum_greater_than_maximum_nights","adjust_settings","startdate_greater_than_enddate","out_of_checkin_date_range","adjustmentDropdown","adjustmentInput","handleChangeInput","handleBatchChangeInput","keySuffix","column","setIsDirty","disableDecrease","dropdownOption","bidAdjustmentError","setBidAdjustmentError","_useState3","_useState4","adjustmentDropdownValue","setAdjustmentDropdownValue","_useState5","_useState6","currentKeySuffix","setCurrentKeySuffix","validateValue","fieldName","dropdownOptionText","dropdownItem","height","dropdownItemSelected","defaultValue","err","tempValue","isNaN","tempAdjustmentDropdownValue","handleBlur","CommonTextField","fieldContent","getFieldErrorMsg","fieldErrorMsg","setFieldErrorMsg","generateColumn","parmas","handleRemove","_parmas$props","isDirtyCopy","entries","clearValidation","DatePicker","strings","isMonthPickerVisible","showGoToToday","formatDateValue","onSelectDate","spanClassName","style","getAllColumns","handleRemoveAll","minBid","maxBid","extraBid","bidAdjustmentColumn","RemoveBtnColumn","allColums","columns","showAddBtn","headerClassName","noBidAdjustment","TargetDetailList","enablePagination","setPageSize","setPageNumber","hideWhenEmpty","validateParams","itemsSetting","items","cropWithPage","DetailsList","selectionMode","SelectionMode","none","onRenderItemColumn","onRenderRow","row","customStyles","DetailsRow","onPageChange","total","onPageSizeChange","size","criterionSettingContainer","paddingBottom","borderTop","animationFillMode","white","neutralTertiary","borderRight","border","borderRadius","green","semanticColors","errorIcon","GridTargetsBaseApp","basicConfig","handleAddLine","_useState7","_useState8","setErrMsg","_useState9","_useState10","setKeySuffix","_usePageControl","usePageControl","shift","debounceFn","_len","rest","Array","_key","_rest$","realIndex","_len2","_key2","_rest$2","setIsDirtyByNotify","dirty","_item","setIsDirtyByNotifyFn","targetId","getElementById","parentNode","querySelectorAll","validateFn","localizeErrorMsg","extraClass","maxLimit","FontIcon","iconName","GridTargetsBase","maxWidth","showSettingToggle","getAbwBasicConfig","_ref2$min","_ref2$max","getValidateAdvancedBookingDaysErrorMsg","getCheckinDayBasicConfig","getUserSetDatesBasicConfig","getCheckinDateBasicConfig","getValidateCheckinDateErrorMsg","targetsApiErrMsg","getLengthOfStayBasicConfig","getValidateLengthOfStayDaysErrorMsg","targeted","isCommission","showTargetedColumn","getDeviceBasicConfig","IncludedLocationGrid","getIncludedLocationBasicConfig","ExcludedLocationGrid","getExcludedLocationBasicConfig","PeopleIn","PeopleSearchingForOrViewingPages","getLocationIntent","RadiusCriterion","NameTypeCombo","RadisUnitMap","mi","km","Miles","Kilometers","getLocationHashWithStatus","CountryCode","Latitude","Longitude","Radius","RadiusUnit","getLocationHash","createIdAttributes","Ids","fromLocationCriterionToBingMapTarget","isExcluded","ParentLocations","LocationTargetEnclosingLocationIds","locationTarget","LocationTarget","CreateExcludedLocationTarget","ExpandedName","GeoPoint","LocationTargetType","LocationType","CreateIncludedLocationTarget","LocationTargetsIntent","isLocationTargetingImprovementEnabled","peopleInLocationString","peopleSearchingForLocationString","peopleInOrInterestedInLocationString","intentOptionsKeysMap","_Fragment","intentOptionsKeys","checkedRadio","onIntentOptionChanged","role","RadioGroup","renderItem","getItemId","Checkbox","ev","getIncludedLocations","getExcludedLocations","fillAdditionalInfoToCriterion","isPositive","fillAdditionalInfoToBundleLocationCriterions","hash","currentLocation","OriginalBidAdjustment","fillAdditionalInfoToGrid","newLocations","isIncluded","targetingType","isRadius","isRadiusLocationTarget","locationTargetConverter","buildLocationCriterionFromSearchResult","mode","radius","radiusSize","unit","radiusUnit","status","fromBingMapTargetToLocationCriterion","LocationTargetsEditor","toggleBidModeAndSetData","languageBundleString","allowBidAdjustment","allowNegativeLocationTargeting","showSearchTypeOptions","showBulkLocations","isBrandAwarenessCampaignScenario","defaultSelectedSearchType","showIntent","isDomesticSimplifiedChineseEnabled","backUpData","myData","mySetData","newData","_newData$excludedLoca","_newData$includedLoca","_data$currentLocation","targetOptionsKeysMap","keysMap","targetOptionsKeys","showSpecificLocationTargetEditor","SpecificLocationTargetsEditor","allowPositiveLocationTargeting","isBundle","SEARCH_TYPE","Boundary","LocationTargetsGridContainer","_data$currentLevelSet","_data$parentLevelSett","newIncluded","newExcluded","__","textDecoration","globalI18n","globalLegacyI18n","getLanguageBundleString","bundleCountryNames","countryName","_ret","_loop","v","language","languageBundle","publisherCountry","locationIds","reqs","Accounts","Locations","headers","batch","needContentType","getBundleCountriesLocations","console","log","_settings$currentLoca","changes","Added","Deleted","initDict","lt","currentDict","currentTarget","hashCode","currentHash","initTarget","compareLocationTargetArrays","finalLocation","locationToSend","IsOriginalNameEmpty","buildLocationCriterionFromBiddableCampaignCriterion","InnerLocationTargetSettingWithoutError","hideIntent","_props$permissions","_data$currentLevelSet2","_data$parentLevelSett2","mySetLocationTargets","toggleBidModeAndSetLocationTargets","toggleBidMode","turnOffBidAndToggleParentLevel","includedLocationsHash","excludedLocationsHash","LocationTargetSettingWithoutError","withPermissions","showUserParentLevelToggle","keepInitValueWhenToggle","onToggle","noCheckedValue","updatedData","Toggle","defaultChecked","inlineLabel","_location$currentLeve2","includedInitLocations","excludedInitLocations","finalHashDict","finalExcludedLocationIds","setParentForAdGroup","setParentForCampaign","useBackboneView","viewFactory","onViewCreated","_ref$managed","onViewRemoved","backboneView","setBackboneView","BackboneInstanceWrapper","instance","patchFunc","getLocationsString","symbol","k","trim","exclusionsValue","adScheduleContainer","advancedSettingsSectionStyle","paddingRight","float","toggleButtonStyle","adScheduleReactWrapper","AdScheduleView","HotelErrorToErrorMessageMapping","CampaignServiceInvalidDeviceTargetBidAdjustment","CampaignServiceIncompleteDeviceCriterionSet","InvalidCheckInDateTarget","criterions","CurrentAccount","CurrencyCode","OutOfRangeNotIncludeMin","NotPositive","MaxLength","WholeNumber","fromFloatToStringNoTrailingZero","shouldBePositive","parseInt","split","countNumberOfDigits","bidConst","commonConverODataObjectToTargetsState","ODataObject","criterionType","keyCb","defaultSetting","commonTargetCriterion","chain","CriterionBid","Multiplier","commonConverODataObjectToRangeTargetsState","key1","key2","MTKey1","MTKey2","Tablets","Computers","Smartphones","UserSelection","DefaultSelection","others","signal","stringifySync","messageType","Code","uniq","defaultHotelGroup","ParentId","RateBidAmount","IsLeaf","IsExcluded","IsBidLandscapeEnable","Condition","Operand","Attribute","defaultHotelGroupPayload","HotelListingGroupsToAdd","BidAmount","RateAmount","HotelListingGroupsToDelete","Campaigns","HotelListingGroups","$makeCall","functionParams","toPromise","select","NativeBidAdjustment","Decrease","MaxPercentCpc","CommissionRate","$cast","where","getBaseBid","PercentCpcBid","CpcBid","Settings","HotelSeting","analyzeHotelSettings","getTargetCriterionType","patchCampaignOrAdgroup","currentCriterion","tempDevice","tempABW","tempCheckinDay","tempLengthOfStay","tempCheckinDate","tempUserSetDates","errorElements","scrollUtils","removeLastWarning","notificationApi","interval","dismiss","clearInterval","setInterval","handleCommonTargetsError","allTargetsApiErrors","currentError","currentEntity","apiErrMsg","parseEntityApiErrors","adGroupErrors","property","ignoredErrors","classified","criterionsType","Property","expandSettingsWithApiErrors","expandSettingsWithErrors","defaultErrorObject","processItems","prototype","hasOwnProperty","entityName","ids","invalidateTypeCache","trackingTemplate","ko_model","getTrackingTemplate","urlOptionsApiErrors","newUrlOptionsApiErrors","trackingTemplateErrors","finalUrlSuffix","viewModel","errorMessages","isFinalURLSuffixEnabled","externalErrors","customParams","parameterArray","parametersError","getExclusions","baseExclusionApiErrors","newExclusionApiErrors","getAudienceData","audienceAdsOptions","validateAudienceAds","_getMinMax","getMinMax","audienceAdsContainer","currentValue","getValue","readOnly","mySetAudienceAds","audienceAdsBidAdjustmentText","maxIn","maxDe","getAudiencesAdsErrorMsg","getSelectedKey","merge","sharedStylesFromSelDesign","baseExclusionContainer","SiteExclusionView","baseExclusionReactWrapper","BaseExclusionView","exclusionType","campaignExclusions","propTypes","PropTypes","isRequired","_props$options","baseExclusionText","currentSiteExclusionView","currentIPExclusionView","siteExclusion","setSiteExclusion","IPExclusion","setIPExclusion","load","adgroupExclusions","urlOptionsContainer","settingsCommonStyles","uurlTestToolStyle","fontFamily","cursor","UpgradedUrlOptions","editMode","entityType","isNewUI","customParameters","urlOptionsTemplate","showUurlTestTool","urlOptionsReactWrapper","CheckBox","infoText","helpId","event","HotelAdFormat","HPAText","PPAText","pug","module","exports","locals","pug_interp","pug_html","locals_for_with","escape","account","attr","$$obj","pug_index0","$$l","pug_mixins","pug_index1","saveButtonAttr","cleanButtonAttr","isCleanButtonDisabled","hotelGroup","columnChooserStyle","ComponentSettings","getColumnChooserOverrideStyle","ColumnChooser","_Component","categories","selected","legacyI18n","onApply","isSplittingSelectedArea","simplified","cfg","searchStr","BackboneColumnChooser","selectedKeys","savedName","currentActive","isSaveNameEnabled","external","ReplaceDialog","hidden","columnSetName","onReplace","onDismiss","dialogContentProps","normal","Dialog","savedColumnSetName","DialogFooter","ToolbarColumnChooserWrapper","InstrumentationContext","isDialogOpened","setIsDialogOpened","applyValue","columnChooser","project","grid","Columns","components","boxShadow","RemoveDialog","main","dropdownId","saveListId","defaultColumnSetName","useColumnsWithToolbarColumnChooser","defaultColumns","toolbarOptions","callbacks","customToolbarIcon","toolbarEditor","selectedColumns","setSelectedColumns","isInitialized","initialColumns","async","assert","buildBaseQuery","findAll","SelectedColumns","prepareData","selectedColumnSetName","getPreferenceSelectedColumnSetName","handleSelectColumnSet","iconLeftGlyphName","button","iconLeft","iconRight","menu","openColumnChooser","removeText","onSelect","setIsRemoveDialogOpened","setColumnSetNameRemoveCandidate","refreshMenu","handleRefreshMenu","initialColumnChooserItemInToolbar","isRemoveDialogOpened","columnSetNameRemoveCandidate","onRemoveDismiss","onRemoveApply","promises","columnsPreference","getPreferenceSelectedColumns","deletePreferenceSelectedColumns","ColumnChooserTrivia","n","setPreferenceSelectedColumnSet","setPreferenceSelectedColumns","reduce","locked","selectedColumnsPreference","finalColumns","beforeSetSelectedColumns","getPreferenceSelectedColumnSet","columnSetPreference"],"sourceRoot":""}