{"version":3,"sources":["webpack:///(webpack)/buildin/global.js","webpack:///./src/framework/compatibility/seamless-embed-compat.ts"],"names":["g","this","Function","e","window","module","exports","SeamlessEmbedCompatibilityApi","constructor","api","Object","defineProperty","configurable","enumerable","writable","value","load","args","options","arguments","length","undefined","id","target","form","mount","resourceName","Cognito","resources","overrideText","entry","prefill","success","jqPromise","loadScriptWithGlobal","ready","then","jQuery","noConflict","proxyEventsToJQuery","console","warn"],"mappings":"iFAAA,IAAIA,EAGJA,EAAI,WACH,OAAOC,KADJ,GAIJ,IAECD,EAAIA,GAAK,IAAIE,SAAS,cAAb,GACR,MAAOC,GAEc,iBAAXC,SAAqBJ,EAAII,QAOrCC,EAAOC,QAAUN,G,iCClBjB,2FAaO,MAAMO,EAEZC,YAAYC,GAAU,KADbA,SAAG,EAEXC,OAAOC,eAAeV,KAAM,MAAO,CAAEW,cAAc,EAAOC,YAAY,EAAOC,UAAU,EAAOC,MAAON,IAGtGO,KAAKX,EAAmCY,GAAmF,IAAhDC,EAAuCC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,KACpH,GAAe,UAAXd,GAAsBY,GAAQA,EAAKK,GAAI,CAE1C,IAAIC,EAASL,GAAUA,EAAQK,QAAe,GAC/B,KAAXA,IACHA,EAAS,YAGV,MAAMC,EAAOvB,KAAKQ,IAAIgB,MAAMR,EAAKK,GAAIC,GAErC,IAAK,MAAMG,KAAgBtB,OAAOuB,QAAQC,UACzCJ,EAAKK,aAAaH,EAActB,OAAOuB,QAAQC,UAAUF,IAQ1D,GAJIT,EAAKa,OACRN,EAAKO,QAAQd,EAAKa,OAGfZ,GAAWA,EAAQc,QAAS,CAC/B,MAAMC,EAAYC,YAAqB,wCAAyC,UAChFV,EAAKW,MAAMC,KAAK,KACfH,EAAUG,KAAMC,IAEfA,EAAOC,YAAW,GAGlBlC,OAAkB,UAAIiC,EAGtBE,YAAoBf,EAAMa,GAAQ,GAElCnB,EAAQc,oBAMP5B,OAAOoC,SAAWA,QAAQC,MAC7BD,QAAQC,KAAK","file":"166.c07db9df6e770174f8c8.js","sourcesContent":["var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","import type { Api } from '../public/public-api';\r\nimport { loadScriptWithGlobal } from 'src/util/script-loader';\r\nimport { proxyEventsToJQuery } from './proxy-form-events-to-jquery';\r\n\r\n/**\r\n * The compatibility API that is exposed by the legacy session script for Vue forms compatibility\r\n */\r\nexport type LegacySeamlessEmbedCompatibilityApi = {\r\n\tdeferredLoad?(api: LegacySeamlessEmbedApi): void;\r\n};\r\n\r\n/**\r\n * An API exposed by the Vue forms client for loading a form with legacy embed code\r\n */\r\nexport class SeamlessEmbedCompatibilityApi implements LegacySeamlessEmbedApi {\r\n\treadonly api: Api;\r\n\tconstructor(api: Api) {\r\n\t\tObject.defineProperty(this, 'api', { configurable: false, enumerable: false, writable: false, value: api });\r\n\t}\r\n\r\n\tload(module: LegacySeamlessEmbedModule, args: LegacySeamlessEmbedLoadArgs, options: LegacySeamlessEmbedLoadOptions = null) {\r\n\t\tif (module === 'forms' && args && args.id) {\r\n\t\t\t// Determine the mount target, either the specified selector, or the default '.cognito' div\r\n\t\t\tlet target = options ? options.target || '' : '';\r\n\t\t\tif (target === '')\r\n\t\t\t\ttarget = '.cognito';\r\n\r\n\t\t\t// Mount the form and get the resulting form handle\r\n\t\t\tconst form = this.api.mount(args.id, target);\r\n\r\n\t\t\tfor (const resourceName in window.Cognito.resources) {\r\n\t\t\t\tform.overrideText(resourceName, window.Cognito.resources[resourceName]);\r\n\t\t\t}\r\n\r\n\t\t\t// If there is an \"entry\" object, then call prefill on the form handle\r\n\t\t\tif (args.entry)\r\n\t\t\t\tform.prefill(args.entry);\r\n\r\n\t\t\t// If a 'success' callback is specified, then call it when the form is ready\r\n\t\t\tif (options && options.success) {\r\n\t\t\t\tconst jqPromise = loadScriptWithGlobal('//code.jquery.com/jquery-1.7.2.min.js', 'jQuery');\r\n\t\t\t\tform.ready.then(() => {\r\n\t\t\t\t\tjqPromise.then((jQuery: JQueryStatic) => {\r\n\t\t\t\t\t\t// Relinquish control of the global `$` in case the hosting page has already loaded jQuery\r\n\t\t\t\t\t\tjQuery.noConflict(true);\r\n\r\n\t\t\t\t\t\t// Put our version of jQuery on the window object as `ExoJQuery`, since that is what the documentation advertises\r\n\t\t\t\t\t\twindow['ExoJQuery'] = jQuery;\r\n\r\n\t\t\t\t\t\t// Proxy form events to the hosting page as jQuery events\r\n\t\t\t\t\t\tproxyEventsToJQuery(form, jQuery, true);\r\n\r\n\t\t\t\t\t\toptions.success();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (window.console && console.warn) {\r\n\t\t\t\tconsole.warn('Invalid call to Cognito.load');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n"],"sourceRoot":""}