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,EAAKO,GAE1CT,EAAiBc,MAAQ,2CACzBjB,EAAekB,YAAYf,EAC7B,EAGE9B,OAAO8C,cAAgB9C,OAAO8C,aAAa1B,KAAOpB,OAAO8C,aAAa1B,IAAI2B,QAC5E3B,EAASpB,OAAO8C,aAAa1B,IAAI2B,SAEjCC,QAAQC,KAAK,wE,8FCxCR,MAIMC,EAAkB,UAWlBV,EAAsB,CAfP,OAEU,iBAGR,SAQG,WANG,eACD,cACD,aACA,aACF,W,wBCXhCW,EAAAA,EAA0BnD,OAAOmD,uB","sources":["webpack://agra/./app/javascript/helpers/url-params.js","webpack://agra/./app/javascript/local/embed/index.js","webpack://agra/./app/javascript/local/url-keys.js","webpack://agra/./app/javascript/public-path.js"],"sourcesContent":["function urlWithParams(baseUrl, searchParamsMap) {\n const urlObj = new URL(baseUrl, window.location.origin)\n const urlSearchParams = urlObj.searchParams\n Object.entries(searchParamsMap).forEach(([k, v]) => {\n const stringValue = typeof v === 'string' ? v : JSON.stringify(v)\n urlSearchParams.append(k, stringValue)\n })\n\n // Deterministic ordering of url params. This is useful for when we check\n // the url with params in tests.\n urlSearchParams.sort()\n return urlObj.toString()\n}\n\nfunction urlParamsWithNamespace(paramsMap, namespace) {\n const newParamsMap = {}\n Object.entries(paramsMap).forEach(([k, v]) => {\n newParamsMap[`${namespace}[${k}]`] = v\n })\n return newParamsMap\n}\n\nexport {\n urlParamsWithNamespace,\n urlWithParams\n}\n","import { TRACKING_URL_PARAMS } from '../url-keys'\nimport { urlParamsWithNamespace, urlWithParams } from '../../helpers/url-params.js'\n\nconst Map = {\n init: function({filter, includeSidebar, eventCreationAllowed, includeSearchField, siteOrigin, containerId}) {\n const wrapperElement = document.getElementById(containerId)\n const newIframeElement = document.createElement('iframe')\n\n let url = includeSidebar ? `${siteOrigin}/local/embed_with_sidebar` : `${siteOrigin}/local/embed`\n\n if (filter) {\n const searchParams = urlParamsWithNamespace(filter, 'filter')\n url = urlWithParams(url, searchParams)\n }\n\n if (eventCreationAllowed !== undefined) {\n url = urlWithParams(url, {event_creation_allowed: eventCreationAllowed})\n }\n\n if (includeSearchField !== undefined) {\n url = urlWithParams(url, {include_search_field: includeSearchField})\n }\n\n const currentWindowParams = new URLSearchParams(window.location.search)\n const trackingUrlParamsToInclude = {}\n TRACKING_URL_PARAMS.forEach(key => {\n if (currentWindowParams.get(key)) {\n trackingUrlParamsToInclude[key] = currentWindowParams.get(key)\n }\n })\n\n newIframeElement.src = urlWithParams(url, trackingUrlParamsToInclude)\n\n newIframeElement.style = 'width: 100%; height: 100%; border: none;'\n wrapperElement.appendChild(newIframeElement)\n }\n}\n\nif (window.ControlShift && window.ControlShift.Map && window.ControlShift.Map.options) {\n Map.init(window.ControlShift.Map.options)\n} else {\n console.warn('ControlShift.Map.options script is not properly defined in your page.')\n}\n\n","// tracking URL param for the ActionKit CRM\nexport const URL_KEY_AKID = 'akid'\n// tracking URL param for the Action Network CRM\nexport const URL_KEY_EMAIL_REFERRER = 'email_referrer'\n// Agra uses this to pass partner hints to event creation.\nexport const URL_KEY_PARTNER = 'partner'\nexport const URL_KEY_SOURCE = 'source'\n// generic UTM codes\nexport const URL_KEY_UTM_CAMPAIGN = 'utm_campaign'\nexport const URL_KEY_UTM_CONTENT = 'utm_content'\nexport const URL_KEY_UTM_MEDIUM = 'utm_medium'\nexport const URL_KEY_UTM_SOURCE = 'utm_source'\nexport const URL_KEY_UTM_TERM = 'utm_term'\n// tracking URL param for the EveryAction CRM\nexport const URL_KEY_SOURCE_ID = 'sourceid'\n\nexport const TRACKING_URL_PARAMS = [URL_KEY_AKID, URL_KEY_EMAIL_REFERRER, URL_KEY_SOURCE,\n URL_KEY_SOURCE_ID, URL_KEY_UTM_CAMPAIGN, URL_KEY_UTM_CONTENT,\n URL_KEY_UTM_MEDIUM, URL_KEY_UTM_SOURCE,\n URL_KEY_UTM_TERM]\n","// eslint-disable-next-line no-undef\n__webpack_public_path__ = window.__webpack_public_path__\n"],"names":["urlWithParams","baseUrl","searchParamsMap","urlObj","URL","window","location","origin","urlSearchParams","searchParams","Object","entries","forEach","k","v","stringValue","JSON","stringify","append","sort","toString","urlParamsWithNamespace","paramsMap","namespace","newParamsMap","Map","filter","includeSidebar","eventCreationAllowed","includeSearchField","siteOrigin","containerId","wrapperElement","document","getElementById","newIframeElement","createElement","url","undefined","event_creation_allowed","include_search_field","currentWindowParams","URLSearchParams","search","trackingUrlParamsToInclude","TRACKING_URL_PARAMS","key","get","src","style","appendChild","ControlShift","options","console","warn","URL_KEY_PARTNER","__webpack_public_path__"],"sourceRoot":""}