@edx/frontend-platform 7.1.3 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/analytics/MockAnalyticsService.js +2 -2
  2. package/analytics/MockAnalyticsService.js.map +1 -1
  3. package/analytics/SegmentAnalyticsService.js +2 -2
  4. package/analytics/SegmentAnalyticsService.js.map +1 -1
  5. package/analytics/index.js.map +1 -1
  6. package/analytics/interface.js.map +1 -1
  7. package/auth/AxiosCsrfTokenService.js +2 -2
  8. package/auth/AxiosCsrfTokenService.js.map +1 -1
  9. package/auth/AxiosJwtAuthService.js +8 -5
  10. package/auth/AxiosJwtAuthService.js.map +1 -1
  11. package/auth/AxiosJwtTokenService.js +2 -2
  12. package/auth/AxiosJwtTokenService.js.map +1 -1
  13. package/auth/LocalForageCache.js.map +1 -1
  14. package/auth/MockAuthService.js +2 -2
  15. package/auth/MockAuthService.js.map +1 -1
  16. package/auth/index.js.map +1 -1
  17. package/auth/interceptors/createCsrfTokenProviderInterceptor.js.map +1 -1
  18. package/auth/interceptors/createJwtTokenProviderInterceptor.js.map +1 -1
  19. package/auth/interceptors/createProcessAxiosRequestErrorInterceptor.js.map +1 -1
  20. package/auth/interceptors/createRetryInterceptor.js.map +1 -1
  21. package/auth/interface.js.map +1 -1
  22. package/auth/utils.js +2 -2
  23. package/auth/utils.js.map +1 -1
  24. package/config.js.map +1 -1
  25. package/constants.js.map +1 -1
  26. package/i18n/countries.js.map +1 -1
  27. package/i18n/index.js.map +1 -1
  28. package/i18n/injectIntlWithShim.js +7 -8
  29. package/i18n/injectIntlWithShim.js.map +1 -1
  30. package/i18n/languages.js.map +1 -1
  31. package/i18n/lib.js +0 -5
  32. package/i18n/lib.js.map +1 -1
  33. package/i18n/scripts/intl-imports.js +0 -1
  34. package/i18n/scripts/intl-imports.js.map +1 -1
  35. package/i18n/scripts/transifex-utils.js.map +1 -1
  36. package/index.js.map +1 -1
  37. package/initialize.js +2 -2
  38. package/initialize.js.map +1 -1
  39. package/logging/MockLoggingService.js +2 -2
  40. package/logging/MockLoggingService.js.map +1 -1
  41. package/logging/NewRelicLoggingService.js +2 -5
  42. package/logging/NewRelicLoggingService.js.map +1 -1
  43. package/logging/index.js.map +1 -1
  44. package/logging/interface.js.map +1 -1
  45. package/package.json +7 -7
  46. package/pubSub.js.map +1 -1
  47. package/react/AppContext.js.map +1 -1
  48. package/react/AppProvider.js.map +1 -1
  49. package/react/AuthenticatedPageRoute.js.map +1 -1
  50. package/react/ErrorBoundary.js +7 -8
  51. package/react/ErrorBoundary.js.map +1 -1
  52. package/react/ErrorPage.js.map +1 -1
  53. package/react/LoginRedirect.js.map +1 -1
  54. package/react/OptionalReduxProvider.js.map +1 -1
  55. package/react/PageWrap.js.map +1 -1
  56. package/react/hooks.js.map +1 -1
  57. package/react/index.js.map +1 -1
  58. package/scripts/GoogleAnalyticsLoader.js +2 -2
  59. package/scripts/GoogleAnalyticsLoader.js.map +1 -1
  60. package/scripts/index.js.map +1 -1
  61. package/testing/index.js.map +1 -1
  62. package/testing/initializeMockApp.js +2 -2
  63. package/testing/initializeMockApp.js.map +1 -1
  64. package/testing/mockMessages.js.map +1 -1
  65. package/utils.js +2 -2
  66. package/utils.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"NewRelicLoggingService.js","names":["MAX_ERROR_LENGTH","fixErrorLength","error","message","length","processedError","Object","create","substring","pageActionNameInfo","pageActionNameIgnoredError","sendPageAction","actionName","customAttributes","process","env","NODE_ENV","console","log","window","newrelic","addPageAction","_objectSpread","sendError","noticeError","setCustomAttribute","name","value","NewRelicLoggingService","options","_classCallCheck","config","undefined","ignoredErrorRegexes","IGNORED_ERROR_REGEX","_createClass","key","logInfo","infoStringOrErrorObject","arguments","customAttrs","_typeof","infoCustomAttributes","logError","errorStringOrObject","errorCustomAttributes","allCustomAttributes","keys","errorMessage","match","default"],"sources":["../../src/logging/NewRelicLoggingService.js"],"sourcesContent":["/**\n * NewRelic will not log an error if it is too long.\n *\n * @ignore\n */\nexport const MAX_ERROR_LENGTH = 4000;\n\nfunction fixErrorLength(error) {\n if (error.message && error.message.length > MAX_ERROR_LENGTH) {\n const processedError = Object.create(error);\n processedError.message = processedError.message.substring(0, MAX_ERROR_LENGTH);\n return processedError;\n }\n if (typeof error === 'string' && error.length > MAX_ERROR_LENGTH) {\n return error.substring(0, MAX_ERROR_LENGTH);\n }\n return error;\n}\n\n/* Constants used as New Relic page action names. */\nconst pageActionNameInfo = 'INFO';\nconst pageActionNameIgnoredError = 'IGNORED_ERROR';\n\nfunction sendPageAction(actionName, message, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.log(actionName, message, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/addpageaction/\n window.newrelic.addPageAction(actionName, { message, ...customAttributes });\n }\n}\n\nfunction sendError(error, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.error(error, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/noticeerror/\n window.newrelic.noticeError(fixErrorLength(error), customAttributes);\n }\n}\n\nfunction setCustomAttribute(name, value) {\n if (process.env.NODE_ENV === 'development') {\n console.log(name, value); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setcustomattribute/\n window.newrelic.setCustomAttribute(name, value);\n }\n}\n\n/**\n * The NewRelicLoggingService is a concrete implementation of the logging service interface that\n * sends messages to NewRelic that can be seen in NewRelic Browser and NewRelic Insights. When in\n * development mode, all messages will instead be sent to the console.\n *\n * When you use `logError`, your errors will be checked to see if they're ignored *or* not.\n * Not-ignored errors will appear under \"JS errors\" for your Browser application.\n *\n * ```\n * SELECT * from JavaScriptError WHERE errorStatus is not null SINCE 10 days ago\n * ```\n *\n * Ignored errors will appear in New Relic Insights as page actions, which can be queried:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'IGNORED_ERROR' SINCE 1 hour ago\n * ```\n *\n * When using `logInfo`, these only appear in New Relic Insights when querying for page actions as\n * follows:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'INFO' SINCE 1 hour ago\n * ```\n *\n * You can also add your own custom metrics as an additional argument, or see the code to find\n * other standard custom attributes. By default, userId is added (via setCustomAttribute) for logged\n * in users via the auth service (AuthAxiosJwtService).\n *\n * Requires the NewRelic Browser JavaScript snippet.\n *\n * @implements {LoggingService}\n * @memberof module:Logging\n */\nexport default class NewRelicLoggingService {\n constructor(options) {\n const config = options ? options.config : undefined;\n /*\n String which is an explicit error message regex. If an error message matches the regex, the error\n is considered an *ignored* error and submitted to New Relic as a page action - not an error.\n\n Ignored error regexes are configured per frontend application (MFE).\n\n The regex for all ignored errors are represented in the .env files as a single string. If you need to\n ignore multiple errors, use the standard `|` regex syntax.\n\n For example, here's a .env line which ignores two specific errors:\n\n IGNORED_ERROR_REGEX='^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+'\n\n This example would ignore errors with the following messages:\n\n [frontend-app-generic] - Specific non-critical error #45678 happened.\n [frontend-app-generic] - Specific non-critical error #93475 happened.\n [frontend-auth] Unimportant Error: Browser strangeness occurred.\n\n To test your regex additions, use a JS CLI environment (such as node) and run code like this:\n\n x = new RegExp('^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+');\n '[frontend-app-generic] - Specific non-critical error #45678 happened.'.match(x);\n '[frontend-auth] Unimportant Error: Browser strangeness occurred.'.match(x);\n 'This error should not match anything!'.match(x);\n\n For edx.org, add new error message regexes in edx-internal YAML as needed.\n */\n this.ignoredErrorRegexes = config ? config.IGNORED_ERROR_REGEX : undefined;\n }\n\n /**\n *\n *\n * @param {*} infoStringOrErrorObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logInfo(infoStringOrErrorObject, customAttributes = {}) {\n let message = infoStringOrErrorObject;\n let customAttrs = customAttributes;\n if (typeof infoStringOrErrorObject === 'object' && 'message' in infoStringOrErrorObject) {\n /* Caller has passed in an error object to be logged as a page action. */\n /* Extract the attributes and the message. */\n const infoCustomAttributes = infoStringOrErrorObject.customAttributes || {};\n customAttrs = { ...infoCustomAttributes, ...customAttributes };\n message = infoStringOrErrorObject.message;\n }\n sendPageAction(pageActionNameInfo, message, customAttrs);\n }\n\n /**\n *\n *\n * @param {*} errorStringOrObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logError(errorStringOrObject, customAttributes = {}) {\n const errorCustomAttributes = errorStringOrObject.customAttributes || {};\n let allCustomAttributes = { ...errorCustomAttributes, ...customAttributes };\n if (Object.keys(allCustomAttributes).length === 0) {\n // noticeError expects undefined if there are no custom attributes.\n allCustomAttributes = undefined;\n }\n\n /*\n Separate the errors into ignored errors and other errors.\n Ignored errors are logged via adding a page action.\n Other errors are logged via noticeError and count as \"JS Errors\" for the application.\n */\n const errorMessage = errorStringOrObject.message || (typeof errorStringOrObject === 'string' ? errorStringOrObject : '');\n if (this.ignoredErrorRegexes && errorMessage.match(this.ignoredErrorRegexes)) {\n /* ignored error */\n sendPageAction(pageActionNameIgnoredError, errorMessage, allCustomAttributes);\n } else {\n /* error! */\n sendError(errorStringOrObject, allCustomAttributes);\n }\n }\n\n /**\n * Sets a custom attribute that will be included with all subsequent log messages.\n *\n * @param {string} name\n * @param {string|number|null} value\n */\n setCustomAttribute(name, value) {\n setCustomAttribute(name, value);\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMA,gBAAgB,GAAG,IAAI;AAEpC,SAASC,cAAcA,CAACC,KAAK,EAAE;EAC7B,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACC,OAAO,CAACC,MAAM,GAAGJ,gBAAgB,EAAE;IAC5D,IAAMK,cAAc,GAAGC,MAAM,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AAAT,KAAA,EAMA,SAAAF,mBAAmBC,IAAI,EAAEC,KAAK,EAAE;MAC9BF,mBAAkB,CAACC,IAAI,EAAEC,KAAK,CAAC;IACjC;EAAC;EAAA,OAAAC,sBAAA;AAAA;AAAA,SA5FkBA,sBAAsB,IAAAsB,OAAA"}
1
+ {"version":3,"file":"NewRelicLoggingService.js","names":["MAX_ERROR_LENGTH","fixErrorLength","error","message","length","processedError","Object","create","substring","pageActionNameInfo","pageActionNameIgnoredError","sendPageAction","actionName","customAttributes","process","env","NODE_ENV","console","log","window","newrelic","addPageAction","_objectSpread","sendError","noticeError","setCustomAttribute","name","value","NewRelicLoggingService","options","_classCallCheck","config","undefined","ignoredErrorRegexes","IGNORED_ERROR_REGEX","_createClass","key","logInfo","infoStringOrErrorObject","arguments","customAttrs","_typeof","infoCustomAttributes","logError","errorStringOrObject","errorCustomAttributes","allCustomAttributes","keys","errorMessage","match","default"],"sources":["../../src/logging/NewRelicLoggingService.js"],"sourcesContent":["/**\n * NewRelic will not log an error if it is too long.\n *\n * @ignore\n */\nexport const MAX_ERROR_LENGTH = 4000;\n\nfunction fixErrorLength(error) {\n if (error.message && error.message.length > MAX_ERROR_LENGTH) {\n const processedError = Object.create(error);\n processedError.message = processedError.message.substring(0, MAX_ERROR_LENGTH);\n return processedError;\n }\n if (typeof error === 'string' && error.length > MAX_ERROR_LENGTH) {\n return error.substring(0, MAX_ERROR_LENGTH);\n }\n return error;\n}\n\n/* Constants used as New Relic page action names. */\nconst pageActionNameInfo = 'INFO';\nconst pageActionNameIgnoredError = 'IGNORED_ERROR';\n\nfunction sendPageAction(actionName, message, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.log(actionName, message, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/addpageaction/\n window.newrelic.addPageAction(actionName, { message, ...customAttributes });\n }\n}\n\nfunction sendError(error, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.error(error, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/noticeerror/\n window.newrelic.noticeError(fixErrorLength(error), customAttributes);\n }\n}\n\nfunction setCustomAttribute(name, value) {\n if (process.env.NODE_ENV === 'development') {\n console.log(name, value); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setcustomattribute/\n window.newrelic.setCustomAttribute(name, value);\n }\n}\n\n/**\n * The NewRelicLoggingService is a concrete implementation of the logging service interface that\n * sends messages to NewRelic that can be seen in NewRelic Browser and NewRelic Insights. When in\n * development mode, all messages will instead be sent to the console.\n *\n * When you use `logError`, your errors will be checked to see if they're ignored *or* not.\n * Not-ignored errors will appear under \"JS errors\" for your Browser application.\n *\n * ```\n * SELECT * from JavaScriptError WHERE errorStatus is not null SINCE 10 days ago\n * ```\n *\n * Ignored errors will appear in New Relic Insights as page actions, which can be queried:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'IGNORED_ERROR' SINCE 1 hour ago\n * ```\n *\n * When using `logInfo`, these only appear in New Relic Insights when querying for page actions as\n * follows:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'INFO' SINCE 1 hour ago\n * ```\n *\n * You can also add your own custom metrics as an additional argument, or see the code to find\n * other standard custom attributes. By default, userId is added (via setCustomAttribute) for logged\n * in users via the auth service (AuthAxiosJwtService).\n *\n * Requires the NewRelic Browser JavaScript snippet.\n *\n * @implements {LoggingService}\n * @memberof module:Logging\n */\nexport default class NewRelicLoggingService {\n constructor(options) {\n const config = options ? options.config : undefined;\n /*\n String which is an explicit error message regex. If an error message matches the regex, the error\n is considered an *ignored* error and submitted to New Relic as a page action - not an error.\n\n Ignored error regexes are configured per frontend application (MFE).\n\n The regex for all ignored errors are represented in the .env files as a single string. If you need to\n ignore multiple errors, use the standard `|` regex syntax.\n\n For example, here's a .env line which ignores two specific errors:\n\n IGNORED_ERROR_REGEX='^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+'\n\n This example would ignore errors with the following messages:\n\n [frontend-app-generic] - Specific non-critical error #45678 happened.\n [frontend-app-generic] - Specific non-critical error #93475 happened.\n [frontend-auth] Unimportant Error: Browser strangeness occurred.\n\n To test your regex additions, use a JS CLI environment (such as node) and run code like this:\n\n x = new RegExp('^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+');\n '[frontend-app-generic] - Specific non-critical error #45678 happened.'.match(x);\n '[frontend-auth] Unimportant Error: Browser strangeness occurred.'.match(x);\n 'This error should not match anything!'.match(x);\n\n For edx.org, add new error message regexes in edx-internal YAML as needed.\n */\n this.ignoredErrorRegexes = config ? config.IGNORED_ERROR_REGEX : undefined;\n }\n\n /**\n *\n *\n * @param {*} infoStringOrErrorObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logInfo(infoStringOrErrorObject, customAttributes = {}) {\n let message = infoStringOrErrorObject;\n let customAttrs = customAttributes;\n if (typeof infoStringOrErrorObject === 'object' && 'message' in infoStringOrErrorObject) {\n /* Caller has passed in an error object to be logged as a page action. */\n /* Extract the attributes and the message. */\n const infoCustomAttributes = infoStringOrErrorObject.customAttributes || {};\n customAttrs = { ...infoCustomAttributes, ...customAttributes };\n message = infoStringOrErrorObject.message;\n }\n sendPageAction(pageActionNameInfo, message, customAttrs);\n }\n\n /**\n *\n *\n * @param {*} errorStringOrObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logError(errorStringOrObject, customAttributes = {}) {\n const errorCustomAttributes = errorStringOrObject.customAttributes || {};\n let allCustomAttributes = { ...errorCustomAttributes, ...customAttributes };\n if (Object.keys(allCustomAttributes).length === 0) {\n // noticeError expects undefined if there are no custom attributes.\n allCustomAttributes = undefined;\n }\n\n /*\n Separate the errors into ignored errors and other errors.\n Ignored errors are logged via adding a page action.\n Other errors are logged via noticeError and count as \"JS Errors\" for the application.\n */\n const errorMessage = errorStringOrObject.message || (typeof errorStringOrObject === 'string' ? errorStringOrObject : '');\n if (this.ignoredErrorRegexes && errorMessage.match(this.ignoredErrorRegexes)) {\n /* ignored error */\n sendPageAction(pageActionNameIgnoredError, errorMessage, allCustomAttributes);\n } else {\n /* error! */\n sendError(errorStringOrObject, allCustomAttributes);\n }\n }\n\n /**\n * Sets a custom attribute that will be included with all subsequent log messages.\n *\n * @param {string} name\n * @param {string|number|null} value\n */\n setCustomAttribute(name, value) {\n setCustomAttribute(name, value);\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMA,gBAAgB,GAAG,IAAI;AAEpC,SAASC,cAAcA,CAACC,KAAK,EAAE;EAC7B,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACC,OAAO,CAACC,MAAM,GAAGJ,gBAAgB,EAAE;IAC5D,IAAMK,cAAc,GAAGC,MAAM,CAACC,MAAM,CAACL,KAAK,CAAC;IAC3CG,cAAc,CAACF,OAAO,GAAGE,cAAc,CAACF,OAAO,CAACK,SAAS,CAAC,CAAC,EAAER,gBAAgB,CAAC;IAC9E,OAAOK,cAAc;EACvB;EACA,IAAI,OAAOH,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACE,MAAM,GAAGJ,gBAAgB,EAAE;IAChE,OAAOE,KAAK,CAACM,SAAS,CAAC,CAAC,EAAER,gBAAgB,CAAC;EAC7C;EACA,OAAOE,KAAK;AACd;;AAEA;AACA,IAAMO,kBAAkB,GAAG,MAAM;AACjC,IAAMC,0BAA0B,GAAG,eAAe;AAElD,SAASC,cAAcA,CAACC,UAAU,EAAET,OAAO,EAAEU,gBAAgB,EAAE;EAC7D,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,EAAE;IAC1CC,OAAO,CAACC,GAAG,CAACN,UAAU,EAAET,OAAO,EAAEU,gBAAgB,CAAC,CAAC,CAA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B,qBAAqB,GAAKhC,gBAAgB,CAAE;MAC3E,IAAIP,MAAM,CAACyC,IAAI,CAACD,mBAAmB,CAAC,CAAC1C,MAAM,KAAK,CAAC,EAAE;QACjD;QACA0C,mBAAmB,GAAGd,SAAS;MACjC;;MAEA;AACJ;AACA;AACA;AACA;MACI,IAAMgB,YAAY,GAAGJ,mBAAmB,CAACzC,OAAO,KAAK,OAAOyC,mBAAmB,KAAK,QAAQ,GAAGA,mBAAmB,GAAG,EAAE,CAAC;MACxH,IAAI,IAAI,CAACX,mBAAmB,IAAIe,YAAY,CAACC,KAAK,CAAC,IAAI,CAAChB,mBAAmB,CAAC,EAAE;QAC5E;QACAtB,cAAc,CAACD,0BAA0B,EAAEsC,YAAY,EAAEF,mBAAmB,CAAC;MAC/E,CAAC,MAAM;QACL;QACAvB,SAAS,CAACqB,mBAAmB,EAAEE,mBAAmB,CAAC;MACrD;IACF;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAAV,GAAA;IAAAT,KAAA,EAMA,SAAAF,mBAAmBC,IAAI,EAAEC,KAAK,EAAE;MAC9BF,mBAAkB,CAACC,IAAI,EAAEC,KAAK,CAAC;IACjC;EAAC;EAAA,OAAAC,sBAAA;AAAA;AAAA,SA5FkBA,sBAAsB,IAAAsB,OAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getLoggingService","resetLoggingService","configure","logInfo","logError","default","NewRelicLoggingService","MockLoggingService"],"sources":["../../src/logging/index.js"],"sourcesContent":["export {\n getLoggingService,\n resetLoggingService,\n configure,\n logInfo,\n logError,\n} from './interface';\nexport { default as NewRelicLoggingService } from './NewRelicLoggingService';\nexport { default as MockLoggingService } from './MockLoggingService';\n"],"mappings":"AAAA,SACEA,iBAAiB,EACjBC,mBAAmB,EACnBC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,aAAa;AACpB,SAASC,OAAO,IAAIC,sBAAsB,QAAQ,0BAA0B;AAC5E,SAASD,OAAO,IAAIE,kBAAkB,QAAQ,sBAAsB"}
1
+ {"version":3,"file":"index.js","names":["getLoggingService","resetLoggingService","configure","logInfo","logError","default","NewRelicLoggingService","MockLoggingService"],"sources":["../../src/logging/index.js"],"sourcesContent":["export {\n getLoggingService,\n resetLoggingService,\n configure,\n logInfo,\n logError,\n} from './interface';\nexport { default as NewRelicLoggingService } from './NewRelicLoggingService';\nexport { default as MockLoggingService } from './MockLoggingService';\n"],"mappings":"AAAA,SACEA,iBAAiB,EACjBC,mBAAmB,EACnBC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,aAAa;AACpB,SAASC,OAAO,IAAIC,sBAAsB,QAAQ,0BAA0B;AAC5E,SAASD,OAAO,IAAIE,kBAAkB,QAAQ,sBAAsB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"interface.js","names":["PropTypes","optionsShape","config","object","isRequired","serviceShape","logInfo","func","logError","service","configure","LoggingService","options","checkPropTypes","infoStringOrErrorObject","customAttributes","errorStringOrObject","setCustomAttribute","name","value","getLoggingService","Error","resetLoggingService"],"sources":["../../src/logging/interface.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform/logging**\n *\n * Contains a shared interface for logging information. (The default implementation is in\n * NewRelicLoggingService.js.) When in development mode, all messages will instead be sent to the console.\n *\n * The `initialize` function performs much of the logging configuration for you. If, however,\n * you're not using the `initialize` function, logging (via New Relic) can be configured via:\n *\n * ```\n * import { configure, NewRelicLoggingService, logInfo, logError } from '@edx/frontend-platform/logging';\n * import { geConfig } from '@edx/frontend-platform';\n *\n * configureLogging(NewRelicLoggingService, {\n * config: getConfig(),\n * });\n *\n * logInfo('Just so you know...');\n * logInfo(new Error('Unimportant error'), { type: 'unimportant' });\n * logError('Uhoh!');\n * logError(new Error('Uhoh error!'));\n * ```\n *\n * As shown in this example, logging depends on the configuration document.\n *\n * @module Logging\n */\n\nimport PropTypes from 'prop-types';\n\nconst optionsShape = {\n config: PropTypes.object.isRequired,\n};\n\nconst serviceShape = {\n logInfo: PropTypes.func.isRequired,\n logError: PropTypes.func.isRequired,\n};\n\nlet service = null;\n\n/**\n *\n */\nexport function configure(LoggingService, options) {\n PropTypes.checkPropTypes(optionsShape, options, 'property', 'Logging');\n service = new LoggingService(options);\n PropTypes.checkPropTypes(serviceShape, service, 'property', 'LoggingService');\n return service;\n}\n\n/**\n * Logs a message to the 'info' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} infoStringOrErrorObject\n * @param {Object} [customAttributes={}]\n */\nexport function logInfo(infoStringOrErrorObject, customAttributes) {\n return service.logInfo(infoStringOrErrorObject, customAttributes);\n}\n\n/**\n * Logs a message to the 'error' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} errorStringOrObject\n * @param {Object} [customAttributes={}]\n */\nexport function logError(errorStringOrObject, customAttributes) {\n return service.logError(errorStringOrObject, customAttributes);\n}\n\n/**\n * Sets a custom attribute that will be included with all subsequent log messages.\n *\n * @param {string} name\n * @param {string|number|null} value\n */\nexport function setCustomAttribute(name, value) {\n return service.setCustomAttribute(name, value);\n}\n\n/**\n *\n * @throws {Error} Thrown if the logging service has not yet been configured via {@link configure}.\n * @returns {LoggingService}\n */\nexport function getLoggingService() {\n if (!service) {\n throw Error('You must first configure the logging service.');\n }\n return service;\n}\n\n/**\n * Sets the configured logging service back to null.\n *\n */\nexport function resetLoggingService() {\n service = null;\n}\n\n/**\n * @name LoggingService\n * @interface\n * @memberof module:Logging\n * @property {function} logError\n * @property {function} logInfo\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,YAAY;AAElC,IAAMC,YAAY,GAAG;EACnBC,MAAM,EAAEF,SAAS,CAACG,MAAM,CAACC;AAC3B,CAAC;AAED,IAAMC,YAAY,G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;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"file":"interface.js","names":["PropTypes","optionsShape","config","object","isRequired","serviceShape","logInfo","func","logError","service","configure","LoggingService","options","checkPropTypes","infoStringOrErrorObject","customAttributes","errorStringOrObject","setCustomAttribute","name","value","getLoggingService","Error","resetLoggingService"],"sources":["../../src/logging/interface.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform/logging**\n *\n * Contains a shared interface for logging information. (The default implementation is in\n * NewRelicLoggingService.js.) When in development mode, all messages will instead be sent to the console.\n *\n * The `initialize` function performs much of the logging configuration for you. If, however,\n * you're not using the `initialize` function, logging (via New Relic) can be configured via:\n *\n * ```\n * import { configure, NewRelicLoggingService, logInfo, logError } from '@edx/frontend-platform/logging';\n * import { geConfig } from '@edx/frontend-platform';\n *\n * configureLogging(NewRelicLoggingService, {\n * config: getConfig(),\n * });\n *\n * logInfo('Just so you know...');\n * logInfo(new Error('Unimportant error'), { type: 'unimportant' });\n * logError('Uhoh!');\n * logError(new Error('Uhoh error!'));\n * ```\n *\n * As shown in this example, logging depends on the configuration document.\n *\n * @module Logging\n */\n\nimport PropTypes from 'prop-types';\n\nconst optionsShape = {\n config: PropTypes.object.isRequired,\n};\n\nconst serviceShape = {\n logInfo: PropTypes.func.isRequired,\n logError: PropTypes.func.isRequired,\n};\n\nlet service = null;\n\n/**\n *\n */\nexport function configure(LoggingService, options) {\n PropTypes.checkPropTypes(optionsShape, options, 'property', 'Logging');\n service = new LoggingService(options);\n PropTypes.checkPropTypes(serviceShape, service, 'property', 'LoggingService');\n return service;\n}\n\n/**\n * Logs a message to the 'info' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} infoStringOrErrorObject\n * @param {Object} [customAttributes={}]\n */\nexport function logInfo(infoStringOrErrorObject, customAttributes) {\n return service.logInfo(infoStringOrErrorObject, customAttributes);\n}\n\n/**\n * Logs a message to the 'error' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} errorStringOrObject\n * @param {Object} [customAttributes={}]\n */\nexport function logError(errorStringOrObject, customAttributes) {\n return service.logError(errorStringOrObject, customAttributes);\n}\n\n/**\n * Sets a custom attribute that will be included with all subsequent log messages.\n *\n * @param {string} name\n * @param {string|number|null} value\n */\nexport function setCustomAttribute(name, value) {\n return service.setCustomAttribute(name, value);\n}\n\n/**\n *\n * @throws {Error} Thrown if the logging service has not yet been configured via {@link configure}.\n * @returns {LoggingService}\n */\nexport function getLoggingService() {\n if (!service) {\n throw Error('You must first configure the logging service.');\n }\n return service;\n}\n\n/**\n * Sets the configured logging service back to null.\n *\n */\nexport function resetLoggingService() {\n service = null;\n}\n\n/**\n * @name LoggingService\n * @interface\n * @memberof module:Logging\n * @property {function} logError\n * @property {function} logInfo\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,YAAY;AAElC,IAAMC,YAAY,GAAG;EACnBC,MAAM,EAAEF,SAAS,CAACG,MAAM,CAACC;AAC3B,CAAC;AAED,IAAMC,YAAY,GAAG;EACnBC,OAAO,EAAEN,SAAS,CAACO,IAAI,CAACH,UAAU;EAClCI,QAAQ,EAAER,SAAS,CAACO,IAAI,CAACH;AAC3B,CAAC;AAED,IAAIK,OAAO,GAAG,IAAI;;AAElB;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,cAAc,EAAEC,OAAO,EAAE;EACjDZ,SAAS,CAACa,cAAc,CAACZ,YAAY,EAAEW,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC;EACtEH,OAAO,GAAG,IAAIE,cAAc,CAACC,OAAO,CAAC;EACrCZ,SAAS,CAACa,cAAc,CAACR,YAAY,EAAEI,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC;EAC7E,OAAOA,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASH,OAAOA,CAACQ,uBAAuB,EAAEC,gBAAgB,EAAE;EACjE,OAAON,OAAO,CAACH,OAAO,CAACQ,uBAAuB,EAAEC,gBAAgB,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASP,QAAQA,CAACQ,mBAAmB,EAAED,gBAAgB,EAAE;EAC9D,OAAON,OAAO,CAACD,QAAQ,CAACQ,mBAAmB,EAAED,gBAAgB,CAAC;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,kBAAkBA,CAACC,IAAI,EAAEC,KAAK,EAAE;EAC9C,OAAOV,OAAO,CAACQ,kBAAkB,CAACC,IAAI,EAAEC,KAAK,CAAC;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EAClC,IAAI,CAACX,OAAO,EAAE;IACZ,MAAMY,KAAK,CAAC,+CAA+C,CAAC;EAC9D;EACA,OAAOZ,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASa,mBAAmBA,CAAA,EAAG;EACpCb,OAAO,GAAG,IAAI;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-platform",
3
- "version": "7.1.3",
3
+ "version": "8.0.0",
4
4
  "description": "Foundational application framework for Open edX micro-frontend applications.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -35,13 +35,13 @@
35
35
  "devDependencies": {
36
36
  "@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
37
37
  "@edx/browserslist-config": "1.2.0",
38
- "@openedx/frontend-build": "13.0.29",
39
- "@openedx/paragon": "22.1.1",
38
+ "@openedx/frontend-build": "14.0.3",
39
+ "@openedx/paragon": "22.2.2",
40
40
  "@testing-library/jest-dom": "6.4.2",
41
41
  "@testing-library/react": "12.1.5",
42
42
  "@testing-library/react-hooks": "^8.0.1",
43
43
  "axios-mock-adapter": "^1.21.3",
44
- "core-js": "3.36.1",
44
+ "core-js": "3.37.0",
45
45
  "husky": "8.0.3",
46
46
  "jsdoc": "^4.0.0",
47
47
  "nodemon": "3.1.0",
@@ -57,7 +57,7 @@
57
57
  "@cospired/i18n-iso-languages": "4.2.0",
58
58
  "@formatjs/intl-pluralrules": "4.3.3",
59
59
  "@formatjs/intl-relativetimeformat": "10.0.1",
60
- "axios": "0.27.2",
60
+ "axios": "0.28.0",
61
61
  "axios-cache-interceptor": "0.10.7",
62
62
  "form-urlencoded": "4.1.4",
63
63
  "glob": "7.2.3",
@@ -71,11 +71,11 @@
71
71
  "lodash.merge": "4.6.2",
72
72
  "lodash.snakecase": "4.1.1",
73
73
  "pubsub-js": "1.9.4",
74
- "react-intl": "6.6.3",
74
+ "react-intl": "6.6.5",
75
75
  "universal-cookie": "4.0.4"
76
76
  },
77
77
  "peerDependencies": {
78
- "@openedx/frontend-build": ">= 13.0.15",
78
+ "@openedx/frontend-build": ">= 14.0.0",
79
79
  "@openedx/paragon": ">= 21.5.7 < 23.0.0",
80
80
  "prop-types": "^15.7.2",
81
81
  "react": "^16.9.0 || ^17.0.0",
package/pubSub.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"pubSub.js","names":["PubSub","subscribe","type","callback","unsubscribe","token","publish","data"],"sources":["../src/pubSub.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The PubSub module is a thin wrapper around the base functionality of\n * [PubSubJS](https://github.com/mroderick/PubSubJS). For the sake of simplicity and not relying\n * too heavily on implementation-specific features, it maintains a fairly simple API (subscribe,\n * unsubscribe, and publish).\n *\n * Publish/Subscribe events should be used mindfully, especially in relation to application UI\n * frameworks like React. Given React's unidirectional data flow and prop/state management\n * capabilities, using a pub/sub mechanism is at odds with that framework's best practices.\n *\n * That said, we use pub/sub in our application initialization sequence to allow applications to\n * hook into the initialization lifecycle, and we also use them to publish when the application\n * state has changed, i.e., when the config document or user's authentication state have changed.\n *\n * @module PubSub\n */\n\nimport PubSub from 'pubsub-js';\n\n/**\n *\n * @param {string} type\n * @param {function} callback\n * @returns {string} A subscription token that can be passed to `unsubscribe`\n */\nexport function subscribe(type, callback) {\n return PubSub.subscribe(type, callback);\n}\n\n/**\n *\n * @param {string} token A subscription token provided by `subscribe`\n */\nexport function unsubscribe(token) {\n return PubSub.unsubscribe(token);\n}\n\n/**\n *\n * @param {string} type\n * @param {Object} data\n */\nexport function publish(type, data) {\n return PubSub.publish(type, data);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,WAAW;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,IAAI,EAAEC,QAAQ,EAAE;EACxC,OAAOH,MAAM,CAACC,SAAS,CAACC,IAAI,EAAEC,QAAQ,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACC,KAAK,EAAE;EACjC,OAAOL,MAAM,CAACI,WAAW,CAACC,KAAK,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CAACJ,IAAI,EAAEK,IAAI,EAAE;EAClC,OAAOP,MAAM,CAACM,OAAO,CAACJ,IAAI,EAAEK,IAAI,CAAC;AACnC"}
1
+ {"version":3,"file":"pubSub.js","names":["PubSub","subscribe","type","callback","unsubscribe","token","publish","data"],"sources":["../src/pubSub.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The PubSub module is a thin wrapper around the base functionality of\n * [PubSubJS](https://github.com/mroderick/PubSubJS). For the sake of simplicity and not relying\n * too heavily on implementation-specific features, it maintains a fairly simple API (subscribe,\n * unsubscribe, and publish).\n *\n * Publish/Subscribe events should be used mindfully, especially in relation to application UI\n * frameworks like React. Given React's unidirectional data flow and prop/state management\n * capabilities, using a pub/sub mechanism is at odds with that framework's best practices.\n *\n * That said, we use pub/sub in our application initialization sequence to allow applications to\n * hook into the initialization lifecycle, and we also use them to publish when the application\n * state has changed, i.e., when the config document or user's authentication state have changed.\n *\n * @module PubSub\n */\n\nimport PubSub from 'pubsub-js';\n\n/**\n *\n * @param {string} type\n * @param {function} callback\n * @returns {string} A subscription token that can be passed to `unsubscribe`\n */\nexport function subscribe(type, callback) {\n return PubSub.subscribe(type, callback);\n}\n\n/**\n *\n * @param {string} token A subscription token provided by `subscribe`\n */\nexport function unsubscribe(token) {\n return PubSub.unsubscribe(token);\n}\n\n/**\n *\n * @param {string} type\n * @param {Object} data\n */\nexport function publish(type, data) {\n return PubSub.publish(type, data);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,WAAW;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,IAAI,EAAEC,QAAQ,EAAE;EACxC,OAAOH,MAAM,CAACC,SAAS,CAACC,IAAI,EAAEC,QAAQ,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,WAAWA,CAACC,KAAK,EAAE;EACjC,OAAOL,MAAM,CAACI,WAAW,CAACC,KAAK,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CAACJ,IAAI,EAAEK,IAAI,EAAE;EAClC,OAAOP,MAAM,CAACM,OAAO,CAACJ,IAAI,EAAEK,IAAI,CAAC;AACnC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"AppContext.js","names":["React","AppContext","createContext","authenticatedUser","config"],"sources":["../../src/react/AppContext.jsx"],"sourcesContent":["import React from 'react';\n\n/**\n * `AppContext` provides data from `App` in a way that React components can readily consume, even\n * if it's mutable data. `AppContext` contains the following data structure:\n *\n * ```\n * {\n * authenticatedUser: <THE App.authenticatedUser OBJECT>,\n * config: <THE App.config OBJECT>\n * }\n * ```\n * If the `App.authenticatedUser` or `App.config` data changes, `AppContext` will be updated\n * accordingly and pass those changes onto React components using the context.\n *\n * `AppContext` is used in a React application like any other `[React Context](https://reactjs.org/docs/context.html)\n * @memberof module:React\n */\nconst AppContext = React.createContext({\n authenticatedUser: null,\n config: {},\n});\n\nexport default AppContext;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,UAAU,gBAAGD,KAAK,CAACE,aAAa,CAAC;EACrCC,iBAAiB,EAAE,IAAI;EACvBC,MAAM,EAAE,CAAC;AACX,CAAC,CAAC;AAEF,eAAeH,UAAU"}
1
+ {"version":3,"file":"AppContext.js","names":["React","AppContext","createContext","authenticatedUser","config"],"sources":["../../src/react/AppContext.jsx"],"sourcesContent":["import React from 'react';\n\n/**\n * `AppContext` provides data from `App` in a way that React components can readily consume, even\n * if it's mutable data. `AppContext` contains the following data structure:\n *\n * ```\n * {\n * authenticatedUser: <THE App.authenticatedUser OBJECT>,\n * config: <THE App.config OBJECT>\n * }\n * ```\n * If the `App.authenticatedUser` or `App.config` data changes, `AppContext` will be updated\n * accordingly and pass those changes onto React components using the context.\n *\n * `AppContext` is used in a React application like any other `[React Context](https://reactjs.org/docs/context.html)\n * @memberof module:React\n */\nconst AppContext = React.createContext({\n authenticatedUser: null,\n config: {},\n});\n\nexport default AppContext;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,UAAU,gBAAGD,KAAK,CAACE,aAAa,CAAC;EACrCC,iBAAiB,EAAE,IAAI;EACvBC,MAAM,EAAE,CAAC;AACX,CAAC,CAAC;AAEF,eAAeH,UAAU","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"AppProvider.js","names":["React","useState","useMemo","PropTypes","BrowserRouter","Router","OptionalReduxProvider","ErrorBoundary","AppContext","useAppEvent","useTrackColorSchemeChoice","getAuthenticatedUser","AUTHENTICATED_USER_CHANGED","getConfig","CONFIG_CHANGED","getLocale","getMessages","IntlProvider","LOCALE_CHANGED","basename","AppProvider","_ref","store","children","wrapWithRouter","_useState","_useState2","_slicedToArray","config","setConfig","_useState3","_useState4","authenticatedUser","setAuthenticatedUser","_useState5","_useState6","locale","setLocale","appContextValue","createElement","messages","Provider","value","propTypes","object","node","isRequired","bool","defaultProps"],"sources":["../../src/react/AppProvider.jsx"],"sourcesContent":["import React, { useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport OptionalReduxProvider from './OptionalReduxProvider';\n\nimport ErrorBoundary from './ErrorBoundary';\nimport AppContext from './AppContext';\nimport { useAppEvent, useTrackColorSchemeChoice } from './hooks';\nimport { getAuthenticatedUser, AUTHENTICATED_USER_CHANGED } from '../auth';\nimport { getConfig } from '../config';\nimport { CONFIG_CHANGED } from '../constants';\nimport {\n getLocale,\n getMessages,\n IntlProvider,\n LOCALE_CHANGED,\n} from '../i18n';\nimport { basename } from '../initialize';\n\n/**\n * A wrapper component for React-based micro-frontends to initialize a number of common data/\n * context providers.\n *\n * ```\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider>\n * <HelloWorld />\n * </AppProvider>\n * )\n * });\n * ```\n *\n * This will provide the following to HelloWorld:\n * - An error boundary as described above.\n * - An `AppContext` provider for React context data.\n * - IntlProvider for @edx/frontend-i18n internationalization\n * - Optionally a redux `Provider`. Will only be included if a `store` property is passed to\n * `AppProvider`.\n * - A `Router` for react-router.\n *\n * @param {Object} props\n * @param {Object} [props.store] A redux store.\n * @memberof module:React\n */\nexport default function AppProvider({ store, children, wrapWithRouter }) {\n const [config, setConfig] = useState(getConfig());\n const [authenticatedUser, setAuthenticatedUser] = useState(getAuthenticatedUser());\n const [locale, setLocale] = useState(getLocale());\n\n useTrackColorSchemeChoice();\n\n useAppEvent(AUTHENTICATED_USER_CHANGED, () => {\n setAuthenticatedUser(getAuthenticatedUser());\n });\n\n useAppEvent(CONFIG_CHANGED, () => {\n setConfig(getConfig());\n });\n\n useAppEvent(LOCALE_CHANGED, () => {\n setLocale(getLocale());\n });\n\n const appContextValue = useMemo(() => ({ authenticatedUser, config, locale }), [authenticatedUser, config, locale]);\n\n return (\n <IntlProvider locale={locale} messages={getMessages()}>\n <ErrorBoundary>\n <AppContext.Provider\n value={appContextValue}\n >\n <OptionalReduxProvider store={store}>\n {wrapWithRouter ? (\n <Router basename={basename}>\n <div data-testid=\"browser-router\">\n {children}\n </div>\n </Router>\n ) : children}\n </OptionalReduxProvider>\n </AppContext.Provider>\n </ErrorBoundary>\n </IntlProvider>\n );\n}\n\nAppProvider.propTypes = {\n // eslint-disable-next-line react/forbid-prop-types\n store: PropTypes.object,\n children: PropTypes.node.isRequired,\n wrapWithRouter: PropTypes.bool,\n};\n\nAppProvider.defaultProps = {\n store: null,\n wrapWithRouter: true,\n};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,QAAQ,OAAO;AAChD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,IAAIC,MAAM,QAAQ,kBAAkB;AAE1D,OAAOC,qBAAqB,MAAM,yBAAyB;AAE3D,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,WAAW,EAAEC,yBAAyB,QAAQ,SAAS;AAChE,SAASC,oBAAoB,EAAEC,0BAA0B,QAAQ,SAAS;AAC1E,SAASC,SAAS,QAAQ,WAAW;AACrC,SAASC,cAAc,QAAQ,cAAc;AAC7C,SACEC,SAAS,EACTC,WAA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OAAO,CAAC;IAAA,OAAO;MAAE8B,iBAAiB,EAAjBA,iBAAiB;MAAEJ,MAAM,EAANA,MAAM;MAAEQ,MAAM,EAANA;IAAO,CAAC;EAAA,CAAC,EAAE,CAACJ,iBAAiB,EAAEJ,MAAM,EAAEQ,MAAM,CAAC,CAAC;EAEnH,oBACEpC,KAAA,CAAAuC,aAAA,CAACtB,YAAY;IAACmB,MAAM,EAAEA,MAAO;IAACI,QAAQ,EAAExB,WAAW,CAAC;EAAE,gBACpDhB,KAAA,CAAAuC,aAAA,CAAChC,aAAa,qBACZP,KAAA,CAAAuC,aAAA,CAAC/B,UAAU,CAACiC,QAAQ;IAClBC,KAAK,EAAEJ;EAAgB,gBAEvBtC,KAAA,CAAAuC,aAAA,CAACjC,qBAAqB;IAACgB,KAAK,EAAEA;EAAM,GACjCE,cAAc,gBACbxB,KAAA,CAAAuC,aAAA,CAAClC,MAAM;IAACc,QAAQ,EAAEA;EAAS,gBACzBnB,KAAA,CAAAuC,aAAA;IAAK,eAAY;EAAgB,GAC9BhB,QACE,CACC,CAAC,GACPA,QACiB,CACJ,CACR,CACH,CAAC;AAEnB;AAEAH,WAAW,CAACuB,SAAS,GAAG;EACtB;EACArB,KAAK,EAAEnB,SAAS,CAACyC,MAAM;EACvBrB,QAAQ,EAAEpB,SAAS,CAAC0C,IAAI,CAACC,UAAU;EACnCtB,cAAc,EAAErB,SAAS,CAAC4C;AAC5B,CAAC;AAED3B,WAAW,CAAC4B,YAAY,GAAG;EACzB1B,KAAK,EAAE,IAAI;EACXE,cAAc,EAAE;AAClB,CAAC"}
1
+ {"version":3,"file":"AppProvider.js","names":["React","useState","useMemo","PropTypes","BrowserRouter","Router","OptionalReduxProvider","ErrorBoundary","AppContext","useAppEvent","useTrackColorSchemeChoice","getAuthenticatedUser","AUTHENTICATED_USER_CHANGED","getConfig","CONFIG_CHANGED","getLocale","getMessages","IntlProvider","LOCALE_CHANGED","basename","AppProvider","_ref","store","children","wrapWithRouter","_useState","_useState2","_slicedToArray","config","setConfig","_useState3","_useState4","authenticatedUser","setAuthenticatedUser","_useState5","_useState6","locale","setLocale","appContextValue","createElement","messages","Provider","value","propTypes","object","node","isRequired","bool","defaultProps"],"sources":["../../src/react/AppProvider.jsx"],"sourcesContent":["import React, { useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { BrowserRouter as Router } from 'react-router-dom';\n\nimport OptionalReduxProvider from './OptionalReduxProvider';\n\nimport ErrorBoundary from './ErrorBoundary';\nimport AppContext from './AppContext';\nimport { useAppEvent, useTrackColorSchemeChoice } from './hooks';\nimport { getAuthenticatedUser, AUTHENTICATED_USER_CHANGED } from '../auth';\nimport { getConfig } from '../config';\nimport { CONFIG_CHANGED } from '../constants';\nimport {\n getLocale,\n getMessages,\n IntlProvider,\n LOCALE_CHANGED,\n} from '../i18n';\nimport { basename } from '../initialize';\n\n/**\n * A wrapper component for React-based micro-frontends to initialize a number of common data/\n * context providers.\n *\n * ```\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider>\n * <HelloWorld />\n * </AppProvider>\n * )\n * });\n * ```\n *\n * This will provide the following to HelloWorld:\n * - An error boundary as described above.\n * - An `AppContext` provider for React context data.\n * - IntlProvider for @edx/frontend-i18n internationalization\n * - Optionally a redux `Provider`. Will only be included if a `store` property is passed to\n * `AppProvider`.\n * - A `Router` for react-router.\n *\n * @param {Object} props\n * @param {Object} [props.store] A redux store.\n * @memberof module:React\n */\nexport default function AppProvider({ store, children, wrapWithRouter }) {\n const [config, setConfig] = useState(getConfig());\n const [authenticatedUser, setAuthenticatedUser] = useState(getAuthenticatedUser());\n const [locale, setLocale] = useState(getLocale());\n\n useTrackColorSchemeChoice();\n\n useAppEvent(AUTHENTICATED_USER_CHANGED, () => {\n setAuthenticatedUser(getAuthenticatedUser());\n });\n\n useAppEvent(CONFIG_CHANGED, () => {\n setConfig(getConfig());\n });\n\n useAppEvent(LOCALE_CHANGED, () => {\n setLocale(getLocale());\n });\n\n const appContextValue = useMemo(() => ({ authenticatedUser, config, locale }), [authenticatedUser, config, locale]);\n\n return (\n <IntlProvider locale={locale} messages={getMessages()}>\n <ErrorBoundary>\n <AppContext.Provider\n value={appContextValue}\n >\n <OptionalReduxProvider store={store}>\n {wrapWithRouter ? (\n <Router basename={basename}>\n <div data-testid=\"browser-router\">\n {children}\n </div>\n </Router>\n ) : children}\n </OptionalReduxProvider>\n </AppContext.Provider>\n </ErrorBoundary>\n </IntlProvider>\n );\n}\n\nAppProvider.propTypes = {\n // eslint-disable-next-line react/forbid-prop-types\n store: PropTypes.object,\n children: PropTypes.node.isRequired,\n wrapWithRouter: PropTypes.bool,\n};\n\nAppProvider.defaultProps = {\n store: null,\n wrapWithRouter: true,\n};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,QAAQ,OAAO;AAChD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,IAAIC,MAAM,QAAQ,kBAAkB;AAE1D,OAAOC,qBAAqB,MAAM,yBAAyB;AAE3D,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,WAAW,EAAEC,yBAAyB,QAAQ,SAAS;AAChE,SAASC,oBAAoB,EAAEC,0BAA0B,QAAQ,SAAS;AAC1E,SAASC,SAAS,QAAQ,WAAW;AACrC,SAASC,cAAc,QAAQ,cAAc;AAC7C,SACEC,SAAS,EACTC,WAAW,EACXC,YAAY,EACZC,cAAc,QACT,SAAS;AAChB,SAASC,QAAQ,QAAQ,eAAe;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAAC,IAAA,EAAsC;EAAA,IAAnCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAA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AA,CAAChC,aAAa,qBACZP,KAAA,CAAAuC,aAAA,CAAC/B,UAAU,CAACiC,QAAQ;IAClBC,KAAK,EAAEJ;EAAgB,gBAEvBtC,KAAA,CAAAuC,aAAA,CAACjC,qBAAqB;IAACgB,KAAK,EAAEA;EAAM,GACjCE,cAAc,gBACbxB,KAAA,CAAAuC,aAAA,CAAClC,MAAM;IAACc,QAAQ,EAAEA;EAAS,gBACzBnB,KAAA,CAAAuC,aAAA;IAAK,eAAY;EAAgB,GAC9BhB,QACE,CACC,CAAC,GACPA,QACiB,CACJ,CACR,CACH,CAAC;AAEnB;AAEAH,WAAW,CAACuB,SAAS,GAAG;EACtB;EACArB,KAAK,EAAEnB,SAAS,CAACyC,MAAM;EACvBrB,QAAQ,EAAEpB,SAAS,CAAC0C,IAAI,CAACC,UAAU;EACnCtB,cAAc,EAAErB,SAAS,CAAC4C;AAC5B,CAAC;AAED3B,WAAW,CAAC4B,YAAY,GAAG;EACzB1B,KAAK,EAAE,IAAI;EACXE,cAAc,EAAE;AAClB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"AuthenticatedPageRoute.js","names":["React","useContext","PropTypes","AppContext","PageWrap","getLoginRedirectUrl","AuthenticatedPageRoute","_ref","redirectUrl","children","_useContext","authenticatedUser","destination","global","location","href","assign","createElement","propTypes","string","node","isRequired","defaultProps"],"sources":["../../src/react/AuthenticatedPageRoute.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\n\nimport AppContext from './AppContext';\nimport PageWrap from './PageWrap';\nimport { getLoginRedirectUrl } from '../auth';\n\n/**\n * A react-router route that redirects to the login page when the route becomes active and the user\n * is not authenticated. If the application has been initialized with `requireAuthenticatedUser`\n * false, an authenticatedPageRoute can be used to protect a subset of the application's routes,\n * rather than the entire application.\n *\n * It can optionally accept an override URL to redirect to instead of the login page.\n *\n * Like a `PageWrap`, also calls `sendPageEvent` when the route becomes active.\n *\n * @see PageWrap\n * @see {@link module:frontend-platform/analytics~sendPageEvent}\n * @memberof module:React\n * @param {Object} props\n * @param {string} props.redirectUrl The URL anonymous users should be redirected to, rather than\n * viewing the route's contents.\n */\nexport default function AuthenticatedPageRoute({ redirectUrl, children }) {\n const { authenticatedUser } = useContext(AppContext);\n if (authenticatedUser === null) {\n const destination = redirectUrl || getLoginRedirectUrl(global.location.href);\n global.location.assign(destination);\n\n return null;\n }\n\n return (\n <PageWrap>\n {children}\n </PageWrap>\n );\n}\n\nAuthenticatedPageRoute.propTypes = {\n redirectUrl: PropTypes.string,\n children: PropTypes.node.isRequired,\n};\n\nAuthenticatedPageRoute.defaultProps = {\n redirectUrl: null,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,QAAQ,MAAM,YAAY;AACjC,SAASC,mBAAmB,QAAQ,SAAS;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,sBAAsBA,CAAAC,IAAA,EAA4B;EAAA,IAAzBC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EACpE,IAAAC,WAAA,GAA8BT,UAAU,CAACE,UAAU,CAAC;IAA5CQ,iBAAiB,GAAAD,WAAA,CAAjBC,iBAAiB;EACzB,IAAIA,iBAAiB,KAAK,IAAI,EAAE;IAC9B,IAAMC,WAAW,GAAGJ,WAAW,IAAIH,mBAAmB,CAACQ,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC;IAC5EF,MAAM,CAACC,QAAQ,CAACE,MAAM,CAACJ,WAAW,CAAC;IAEnC,OAAO,IAAI;EACb;EAEA,oBACEZ,KAAA,CAAAiB,aAAA,CAACb,QAAQ,QACNK,QACO,CAAC;AAEf;AAEAH,sBAAsB,CAACY,SAAS,GAAG;EACjCV,WAAW,EAAEN,SAAS,CAACiB,MAAM;EAC7BV,QAAQ,EAAEP,SAAS,CAACkB,IAAI,CAACC;AAC3B,CAAC;AAEDf,sBAAsB,CAACgB,YAAY,GAAG;EACpCd,WAAW,EAAE;AACf,CAAC"}
1
+ {"version":3,"file":"AuthenticatedPageRoute.js","names":["React","useContext","PropTypes","AppContext","PageWrap","getLoginRedirectUrl","AuthenticatedPageRoute","_ref","redirectUrl","children","_useContext","authenticatedUser","destination","global","location","href","assign","createElement","propTypes","string","node","isRequired","defaultProps"],"sources":["../../src/react/AuthenticatedPageRoute.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\n\nimport AppContext from './AppContext';\nimport PageWrap from './PageWrap';\nimport { getLoginRedirectUrl } from '../auth';\n\n/**\n * A react-router route that redirects to the login page when the route becomes active and the user\n * is not authenticated. If the application has been initialized with `requireAuthenticatedUser`\n * false, an authenticatedPageRoute can be used to protect a subset of the application's routes,\n * rather than the entire application.\n *\n * It can optionally accept an override URL to redirect to instead of the login page.\n *\n * Like a `PageWrap`, also calls `sendPageEvent` when the route becomes active.\n *\n * @see PageWrap\n * @see {@link module:frontend-platform/analytics~sendPageEvent}\n * @memberof module:React\n * @param {Object} props\n * @param {string} props.redirectUrl The URL anonymous users should be redirected to, rather than\n * viewing the route's contents.\n */\nexport default function AuthenticatedPageRoute({ redirectUrl, children }) {\n const { authenticatedUser } = useContext(AppContext);\n if (authenticatedUser === null) {\n const destination = redirectUrl || getLoginRedirectUrl(global.location.href);\n global.location.assign(destination);\n\n return null;\n }\n\n return (\n <PageWrap>\n {children}\n </PageWrap>\n );\n}\n\nAuthenticatedPageRoute.propTypes = {\n redirectUrl: PropTypes.string,\n children: PropTypes.node.isRequired,\n};\n\nAuthenticatedPageRoute.defaultProps = {\n redirectUrl: null,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,QAAQ,MAAM,YAAY;AACjC,SAASC,mBAAmB,QAAQ,SAAS;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,sBAAsBA,CAAAC,IAAA,EAA4B;EAAA,IAAzBC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EACpE,IAAAC,WAAA,GAA8BT,UAAU,CAACE,UAAU,CAAC;IAA5CQ,iBAAiB,GAAAD,WAAA,CAAjBC,iBAAiB;EACzB,IAAIA,iBAAiB,KAAK,IAAI,EAAE;IAC9B,IAAMC,WAAW,GAAGJ,WAAW,IAAIH,mBAAmB,CAACQ,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC;IAC5EF,MAAM,CAACC,QAAQ,CAACE,MAAM,CAACJ,WAAW,CAAC;IAEnC,OAAO,IAAI;EACb;EAEA,oBACEZ,KAAA,CAAAiB,aAAA,CAACb,QAAQ,QACNK,QACO,CAAC;AAEf;AAEAH,sBAAsB,CAACY,SAAS,GAAG;EACjCV,WAAW,EAAEN,SAAS,CAACiB,MAAM;EAC7BV,QAAQ,EAAEP,SAAS,CAACkB,IAAI,CAACC;AAC3B,CAAC;AAEDf,sBAAsB,CAACgB,YAAY,GAAG;EACpCd,WAAW,EAAE;AACf,CAAC","ignoreList":[]}
@@ -2,15 +2,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
3
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
4
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
8
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
9
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
8
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
11
9
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
12
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
11
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
12
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
14
  import React, { Component } from 'react';
15
15
  import PropTypes from 'prop-types';
16
16
  import { logError } from '../logging';
@@ -24,11 +24,10 @@ import ErrorPage from './ErrorPage';
24
24
  */
25
25
  var ErrorBoundary = /*#__PURE__*/function (_Component) {
26
26
  _inherits(ErrorBoundary, _Component);
27
- var _super = _createSuper(ErrorBoundary);
28
27
  function ErrorBoundary(props) {
29
28
  var _this;
30
29
  _classCallCheck(this, ErrorBoundary);
31
- _this = _super.call(this, props);
30
+ _this = _callSuper(this, ErrorBoundary, [props]);
32
31
  _this.state = {
33
32
  hasError: false
34
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","names":["React","Component","PropTypes","logError","ErrorPage","ErrorBoundary","_Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","state","hasError","_createClass","key","value","componentDidCatch","error","info","stack","componentStack","render","fallbackComponent","createElement","children","getDerivedStateFromError","propTypes","node","defaultProps","undefined"],"sources":["../../src/react/ErrorBoundary.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { logError } from '../logging';\n\nimport ErrorPage from './ErrorPage';\n\n/**\n * Error boundary component used to log caught errors and display the error page.\n *\n * @memberof module:React\n * @extends {Component}\n */\nclass ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError() {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n componentDidCatch(error, info) {\n logError(error, { stack: info.componentStack });\n }\n\n render() {\n if (this.state.hasError) {\n return this.props.fallbackComponent || <ErrorPage />;\n }\n return this.props.children;\n }\n}\n\nErrorBoundary.propTypes = {\n children: PropTypes.node,\n fallbackComponent: PropTypes.node,\n};\n\nErrorBoundary.defaultProps = {\n children: null,\n fallbackComponent: undefined,\n};\n\nexport default ErrorBoundary;\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,YAAY;AAErC,OAAOC,SAAS,MAAM,aAAa;;AAEnC;AACA;AACA;AACA;AACA;AACA;AALA,IAMMC,aAAa,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,aAAA;EACjB,SAAAA,cAAYK,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,aAAA;IACjBM,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IACXC,KAAA,CAAKG,KAAK,GAAG;MAAEC,QAAQ,EAAE;IAAM,CAAC;IAAC,OAAAJ,KAAA;EACnC;EAACK,YAAA,CAAAX,aAAA;IAAAY,GAAA;IAAAC,KAAA,EAOD,SAAAC,kBAAkBC,KAAK,EAAEC,IAAI,EAAE;MAC7BlB,QAAQ,CAACiB,KAAK,EAAE;QAAEE,KAAK,EAAED,IAAI,CAACE;MAAe,CAAC,CAAC;IACjD;EAAC;IAAAN,GAAA;IAAAC,KAAA,EAED,SAAAM,OAAA,EAAS;MACP,IAAI,IAAI,CAACV,KAAK,CAACC,QAAQ,EAAE;QACvB,OAAO,IAAI,CAACL,KAAK,CAACe,iBAAiB,iBAAIzB,KAAA,CAAA0B,aAAA,CAACtB,SAAS,MAAE,CAAC;MACtD;MACA,OAAO,IAAI,CAACM,KAAK,CAACiB,QAAQ;IAC5B;EAAC;IAAAV,GAAA;IAAAC,KAAA,EAdD,SAAAU,yBAAA,EAAkC;MAChC;MACA,OAAO;QAAEb,QAAQ,EAAE;MAAK,CAAC;IAC3B;EAAC;EAAA,OAAAV,aAAA;AAAA,EATyBJ,SAAS;AAuBrCI,aAAa,CAACwB,SAAS,GAAG;EACxBF,QAAQ,EAAEzB,SAAS,CAAC4B,IAAI;EACxBL,iBAAiB,EAAEvB,SAAS,CAAC4B;AAC/B,CAAC;AAEDzB,aAAa,CAAC0B,YAAY,GAAG;EAC3BJ,QAAQ,EAAE,IAAI;EACdF,iBAAiB,EAAEO;AACrB,CAAC;AAED,eAAe3B,aAAa"}
1
+ {"version":3,"file":"ErrorBoundary.js","names":["React","Component","PropTypes","logError","ErrorPage","ErrorBoundary","_Component","_inherits","props","_this","_classCallCheck","_callSuper","state","hasError","_createClass","key","value","componentDidCatch","error","info","stack","componentStack","render","fallbackComponent","createElement","children","getDerivedStateFromError","propTypes","node","defaultProps","undefined"],"sources":["../../src/react/ErrorBoundary.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { logError } from '../logging';\n\nimport ErrorPage from './ErrorPage';\n\n/**\n * Error boundary component used to log caught errors and display the error page.\n *\n * @memberof module:React\n * @extends {Component}\n */\nclass ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError() {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n componentDidCatch(error, info) {\n logError(error, { stack: info.componentStack });\n }\n\n render() {\n if (this.state.hasError) {\n return this.props.fallbackComponent || <ErrorPage />;\n }\n return this.props.children;\n }\n}\n\nErrorBoundary.propTypes = {\n children: PropTypes.node,\n fallbackComponent: PropTypes.node,\n};\n\nErrorBoundary.defaultProps = {\n children: null,\n fallbackComponent: undefined,\n};\n\nexport default ErrorBoundary;\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,YAAY;AAErC,OAAOC,SAAS,MAAM,aAAa;;AAEnC;AACA;AACA;AACA;AACA;AACA;AALA,IAMMC,aAAa,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,UAAA;EACjB,SAAAD,cAAYG,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAL,aAAA;IACjBI,KAAA,GAAAE,UAAA,OAAAN,aAAA,GAAMG,KAAK;IACXC,KAAA,CAAKG,KAAK,GAAG;MAAEC,QAAQ,EAAE;IAAM,CAAC;IAAC,OAAAJ,KAAA;EACnC;EAACK,YAAA,CAAAT,aAAA;IAAAU,GAAA;IAAAC,KAAA,EAOD,SAAAC,kBAAkBC,KAAK,EAAEC,IAAI,EAAE;MAC7BhB,QAAQ,CAACe,KAAK,EAAE;QAAEE,KAAK,EAAED,IAAI,CAACE;MAAe,CAAC,CAAC;IACjD;EAAC;IAAAN,GAAA;IAAAC,KAAA,EAED,SAAAM,OAAA,EAAS;MACP,IAAI,IAAI,CAACV,KAAK,CAACC,QAAQ,EAAE;QACvB,OAAO,IAAI,CAACL,KAAK,CAACe,iBAAiB,iBAAIvB,KAAA,CAAAwB,aAAA,CAACpB,SAAS,MAAE,CAAC;MACtD;MACA,OAAO,IAAI,CAACI,KAAK,CAACiB,QAAQ;IAC5B;EAAC;IAAAV,GAAA;IAAAC,KAAA,EAdD,SAAAU,yBAAA,EAAkC;MAChC;MACA,OAAO;QAAEb,QAAQ,EAAE;MAAK,CAAC;IAC3B;EAAC;EAAA,OAAAR,aAAA;AAAA,EATyBJ,SAAS;AAuBrCI,aAAa,CAACsB,SAAS,GAAG;EACxBF,QAAQ,EAAEvB,SAAS,CAAC0B,IAAI;EACxBL,iBAAiB,EAAErB,SAAS,CAAC0B;AAC/B,CAAC;AAEDvB,aAAa,CAACwB,YAAY,GAAG;EAC3BJ,QAAQ,EAAE,IAAI;EACdF,iBAAiB,EAAEO;AACrB,CAAC;AAED,eAAezB,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorPage.js","names":["React","useState","PropTypes","Button","Container","Row","Col","useAppEvent","FormattedMessage","IntlProvider","getMessages","getLocale","LOCALE_CHANGED","ErrorPage","_ref","message","_useState","_useState2","_slicedToArray","locale","setLocale","reload","global","location","createElement","messages","fluid","className","id","defaultMessage","description","role","onClick","propTypes","string","defaultProps"],"sources":["../../src/react/ErrorPage.jsx"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Button, Container, Row, Col,\n} from '@openedx/paragon';\n\nimport { useAppEvent } from './hooks';\nimport {\n FormattedMessage,\n IntlProvider,\n getMessages,\n getLocale,\n LOCALE_CHANGED,\n} from '../i18n';\n\n/**\n * An error page that displays a generic message for unexpected errors. Also contains a \"Try\n * Again\" button to refresh the page.\n *\n * @memberof module:React\n * @extends {Component}\n */\nfunction ErrorPage({\n message,\n}) {\n const [locale, setLocale] = useState(getLocale());\n\n useAppEvent(LOCALE_CHANGED, () => {\n setLocale(getLocale());\n });\n\n /* istanbul ignore next */\n const reload = () => {\n global.location.reload();\n };\n\n return (\n <IntlProvider locale={locale} messages={getMessages()}>\n <Container fluid className=\"py-5 justify-content-center align-items-start text-center\" data-testid=\"error-page\">\n <Row>\n <Col>\n <p className=\"text-muted\">\n <FormattedMessage\n id=\"unexpected.error.message.text\"\n defaultMessage=\"An unexpected error occurred. Please click the button below to refresh the page.\"\n description=\"error message when an unexpected error occurs\"\n />\n </p>\n {message && (\n <div role=\"alert\" className=\"my-4\">\n <p>{message}</p>\n </div>\n )}\n <Button onClick={reload}>\n <FormattedMessage\n id=\"unexpected.error.button.text\"\n defaultMessage=\"Try again\"\n description=\"text for button that tries to reload the app by refreshing the page\"\n />\n </Button>\n </Col>\n </Row>\n </Container>\n </IntlProvider>\n );\n}\n\nErrorPage.propTypes = {\n message: PropTypes.string,\n};\n\nErrorPage.defaultProps = {\n message: null,\n};\n\nexport default ErrorPage;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,SACEC,MAAM,EAAEC,SAAS,EAAEC,GAAG,EAAEC,GAAG,QACtB,kBAAkB;AAEzB,SAASC,WAAW,QAAQ,SAAS;AACrC,SACEC,gBAAgB,EAChBC,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,cAAc,QACT,SAAS;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,SAASA,CAAAC,IAAA,EAEf;EAAA,IADDC,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAEP,IAAAC,SAAA,GAA4Bf,QAAQ,CAACU,SAAS,CAAC,CAAC,CAAC;IAAAM,UAAA,GAAAC,cAAA,CAAAF,SAAA;IAA1CG,MAAM,GAAAF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AY,GAAG;EACvBpB,OAAO,EAAE;AACX,CAAC;AAED,eAAeF,SAAS"}
1
+ {"version":3,"file":"ErrorPage.js","names":["React","useState","PropTypes","Button","Container","Row","Col","useAppEvent","FormattedMessage","IntlProvider","getMessages","getLocale","LOCALE_CHANGED","ErrorPage","_ref","message","_useState","_useState2","_slicedToArray","locale","setLocale","reload","global","location","createElement","messages","fluid","className","id","defaultMessage","description","role","onClick","propTypes","string","defaultProps"],"sources":["../../src/react/ErrorPage.jsx"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Button, Container, Row, Col,\n} from '@openedx/paragon';\n\nimport { useAppEvent } from './hooks';\nimport {\n FormattedMessage,\n IntlProvider,\n getMessages,\n getLocale,\n LOCALE_CHANGED,\n} from '../i18n';\n\n/**\n * An error page that displays a generic message for unexpected errors. Also contains a \"Try\n * Again\" button to refresh the page.\n *\n * @memberof module:React\n * @extends {Component}\n */\nfunction ErrorPage({\n message,\n}) {\n const [locale, setLocale] = useState(getLocale());\n\n useAppEvent(LOCALE_CHANGED, () => {\n setLocale(getLocale());\n });\n\n /* istanbul ignore next */\n const reload = () => {\n global.location.reload();\n };\n\n return (\n <IntlProvider locale={locale} messages={getMessages()}>\n <Container fluid className=\"py-5 justify-content-center align-items-start text-center\" data-testid=\"error-page\">\n <Row>\n <Col>\n <p className=\"text-muted\">\n <FormattedMessage\n id=\"unexpected.error.message.text\"\n defaultMessage=\"An unexpected error occurred. Please click the button below to refresh the page.\"\n description=\"error message when an unexpected error occurs\"\n />\n </p>\n {message && (\n <div role=\"alert\" className=\"my-4\">\n <p>{message}</p>\n </div>\n )}\n <Button onClick={reload}>\n <FormattedMessage\n id=\"unexpected.error.button.text\"\n defaultMessage=\"Try again\"\n description=\"text for button that tries to reload the app by refreshing the page\"\n />\n </Button>\n </Col>\n </Row>\n </Container>\n </IntlProvider>\n );\n}\n\nErrorPage.propTypes = {\n message: PropTypes.string,\n};\n\nErrorPage.defaultProps = {\n message: null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c,EAAC,kFAAkF;IACjGC,WAAW,EAAC;EAA+C,CAC5D,CACA,CAAC,EACHf,OAAO,iBACNf,KAAA,CAAAwB,aAAA;IAAKO,IAAI,EAAC,OAAO;IAACJ,SAAS,EAAC;EAAM,gBAChC3B,KAAA,CAAAwB,aAAA,YAAIT,OAAW,CACZ,CACN,eACDf,KAAA,CAAAwB,aAAA,CAACrB,MAAM;IAAC6B,OAAO,EAAEX;EAAO,gBACtBrB,KAAA,CAAAwB,aAAA,CAAChB,gBAAgB;IACfoB,EAAE,EAAC,8BAA8B;IACjCC,cAAc,EAAC,WAAW;IAC1BC,WAAW,EAAC;EAAqE,CAClF,CACK,CACL,CACF,CACI,CACC,CAAC;AAEnB;AAEAjB,SAAS,CAACoB,SAAS,GAAG;EACpBlB,OAAO,EAAEb,SAAS,CAACgC;AACrB,CAAC;AAEDrB,SAAS,CAACsB,YAAY,GAAG;EACvBpB,OAAO,EAAE;AACX,CAAC;AAED,eAAeF,SAAS","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"LoginRedirect.js","names":["useEffect","redirectToLogin","LoginRedirect","global","location","href"],"sources":["../../src/react/LoginRedirect.jsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { redirectToLogin } from '../auth';\n\n/**\n * A React component that, when rendered, redirects to the login page as a side effect. Uses\n * `redirectToLogin` to perform the redirect.\n *\n * @see {@link module:frontend-platform/auth~redirectToLogin}\n * @memberof module:React\n */\nexport default function LoginRedirect() {\n useEffect(() => {\n redirectToLogin(global.location.href);\n }, []);\n return null;\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,eAAe,QAAQ,SAAS;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,aAAaA,CAAA,EAAG;EACtCF,SAAS,CAAC,YAAM;IACdC,eAAe,CAACE,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC;EACvC,CAAC,EAAE,EAAE,CAAC;EACN,OAAO,IAAI;AACb"}
1
+ {"version":3,"file":"LoginRedirect.js","names":["useEffect","redirectToLogin","LoginRedirect","global","location","href"],"sources":["../../src/react/LoginRedirect.jsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { redirectToLogin } from '../auth';\n\n/**\n * A React component that, when rendered, redirects to the login page as a side effect. Uses\n * `redirectToLogin` to perform the redirect.\n *\n * @see {@link module:frontend-platform/auth~redirectToLogin}\n * @memberof module:React\n */\nexport default function LoginRedirect() {\n useEffect(() => {\n redirectToLogin(global.location.href);\n }, []);\n return null;\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,eAAe,QAAQ,SAAS;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,aAAaA,CAAA,EAAG;EACtCF,SAAS,CAAC,YAAM;IACdC,eAAe,CAACE,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC;EACvC,CAAC,EAAE,EAAE,CAAC;EACN,OAAO,IAAI;AACb","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"OptionalReduxProvider.js","names":["React","PropTypes","Provider","OptionalReduxProvider","_ref","store","children","createElement","propTypes","object","node","isRequired","defaultProps"],"sources":["../../src/react/OptionalReduxProvider.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Provider } from 'react-redux';\n\n/**\n * @memberof module:React\n * @param {Object} props\n */\nexport default function OptionalReduxProvider({ store, children }) {\n if (store === null) {\n return children;\n }\n\n return (\n <Provider store={store}>\n <div data-testid=\"redux-provider\">\n {children}\n </div>\n </Provider>\n );\n}\n\nOptionalReduxProvider.propTypes = {\n store: PropTypes.object, // eslint-disable-line\n children: PropTypes.node.isRequired,\n};\n\nOptionalReduxProvider.defaultProps = {\n store: null,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,aAAa;;AAEtC;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAAC,IAAA,EAAsB;EAAA,IAAnBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EAC7D,IAAID,KAAK,KAAK,IAAI,EAAE;IAClB,OAAOC,QAAQ;EACjB;EAEA,oBACEN,KAAA,CAAAO,aAAA,CAACL,QAAQ;IAACG,KAAK,EAAEA;EAAM,gBACrBL,KAAA,CAAAO,aAAA;IAAK,eAAY;EAAgB,GAC9BD,QACE,CACG,CAAC;AAEf;AAEAH,qBAAqB,CAACK,SAAS,GAAG;EAChCH,KAAK,EAAEJ,SAAS,CAACQ,MAAM;EAAE;EACzBH,QAAQ,EAAEL,SAAS,CAACS,IAAI,CAACC;AAC3B,CAAC;AAEDR,qBAAqB,CAACS,YAAY,GAAG;EACnCP,KAAK,EAAE;AACT,CAAC"}
1
+ {"version":3,"file":"OptionalReduxProvider.js","names":["React","PropTypes","Provider","OptionalReduxProvider","_ref","store","children","createElement","propTypes","object","node","isRequired","defaultProps"],"sources":["../../src/react/OptionalReduxProvider.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Provider } from 'react-redux';\n\n/**\n * @memberof module:React\n * @param {Object} props\n */\nexport default function OptionalReduxProvider({ store, children }) {\n if (store === null) {\n return children;\n }\n\n return (\n <Provider store={store}>\n <div data-testid=\"redux-provider\">\n {children}\n </div>\n </Provider>\n );\n}\n\nOptionalReduxProvider.propTypes = {\n store: PropTypes.object, // eslint-disable-line\n children: PropTypes.node.isRequired,\n};\n\nOptionalReduxProvider.defaultProps = {\n store: null,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,aAAa;;AAEtC;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAAC,IAAA,EAAsB;EAAA,IAAnBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EAC7D,IAAID,KAAK,KAAK,IAAI,EAAE;IAClB,OAAOC,QAAQ;EACjB;EAEA,oBACEN,KAAA,CAAAO,aAAA,CAACL,QAAQ;IAACG,KAAK,EAAEA;EAAM,gBACrBL,KAAA,CAAAO,aAAA;IAAK,eAAY;EAAgB,GAC9BD,QACE,CACG,CAAC;AAEf;AAEAH,qBAAqB,CAACK,SAAS,GAAG;EAChCH,KAAK,EAAEJ,SAAS,CAACQ,MAAM;EAAE;EACzBH,QAAQ,EAAEL,SAAS,CAACS,IAAI,CAACC;AAC3B,CAAC;AAEDR,qBAAqB,CAACS,YAAY,GAAG;EACnCP,KAAK,EAAE;AACT,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"PageWrap.js","names":["React","useEffect","useLocation","sendPageEvent","PageWrap","_ref","children","location","pathname"],"sources":["../../src/react/PageWrap.jsx"],"sourcesContent":["/* eslint-disable react/prop-types */\n// eslint-disable-next-line no-unused-vars\nimport React, { useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\n\nimport { sendPageEvent } from '../analytics';\n\n/**\n * A Wrapper component that calls `sendPageEvent` when it becomes active.\n *\n * @see {@link module:frontend-platform/analytics~sendPageEvent}\n * @memberof module:React\n * @param {Object} props\n */\nexport default function PageWrap({ children }) {\n const location = useLocation();\n\n useEffect(() => {\n sendPageEvent();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [location.pathname]);\n\n return children;\n}\n"],"mappings":"AAAA;AACA;AACA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,WAAW,QAAQ,kBAAkB;AAE9C,SAASC,aAAa,QAAQ,cAAc;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,QAAQA,CAAAC,IAAA,EAAe;EAAA,IAAZC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EACzC,IAAMC,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAE9BD,SAAS,CAAC,YAAM;IACdE,aAAa,CAAC,CAAC;IACjB;EACA,CAAC,EAAE,CAACI,QAAQ,CAACC,QAAQ,CAAC,CAAC;EAEvB,OAAOF,QAAQ;AACjB"}
1
+ {"version":3,"file":"PageWrap.js","names":["React","useEffect","useLocation","sendPageEvent","PageWrap","_ref","children","location","pathname"],"sources":["../../src/react/PageWrap.jsx"],"sourcesContent":["/* eslint-disable react/prop-types */\n// eslint-disable-next-line no-unused-vars\nimport React, { useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\n\nimport { sendPageEvent } from '../analytics';\n\n/**\n * A Wrapper component that calls `sendPageEvent` when it becomes active.\n *\n * @see {@link module:frontend-platform/analytics~sendPageEvent}\n * @memberof module:React\n * @param {Object} props\n */\nexport default function PageWrap({ children }) {\n const location = useLocation();\n\n useEffect(() => {\n sendPageEvent();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [location.pathname]);\n\n return children;\n}\n"],"mappings":"AAAA;AACA;AACA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,WAAW,QAAQ,kBAAkB;AAE9C,SAASC,aAAa,QAAQ,cAAc;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,QAAQA,CAAAC,IAAA,EAAe;EAAA,IAAZC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EACzC,IAAMC,QAAQ,GAAGL,WAAW,CAAC,CAAC;EAE9BD,SAAS,CAAC,YAAM;IACdE,aAAa,CAAC,CAAC;IACjB;EACA,CAAC,EAAE,CAACI,QAAQ,CAACC,QAAQ,CAAC,CAAC;EAEvB,OAAOF,QAAQ;AACjB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","names":["useEffect","subscribe","unsubscribe","sendTrackEvent","useAppEvent","type","callback","subscriptionToken","cleanup","useTrackColorSchemeChoice","_window$matchMedia","_window","trackColorSchemeChoice","_ref","matches","preferredColorScheme","colorSchemeQuery","window","matchMedia","call","addEventListener","removeEventListener"],"sources":["../../src/react/hooks.js"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nimport { useEffect } from 'react';\nimport { subscribe, unsubscribe } from '../pubSub';\nimport { sendTrackEvent } from '../analytics';\n\n/**\n * A React hook that allows functional components to subscribe to application events. This should\n * be used sparingly - for the most part, Context should be used higher-up in the application to\n * provide necessary data to a given component, rather than utilizing a non-React-like Pub/Sub\n * mechanism.\n *\n * @memberof module:React\n * @param {string} type\n * @param {function} callback\n */\nexport const useAppEvent = (type, callback) => {\n useEffect(() => {\n const subscriptionToken = subscribe(type, callback);\n\n return function cleanup() {\n unsubscribe(subscriptionToken);\n };\n }, [callback, type]);\n};\n\n/**\n * A React hook that tracks user's preferred color scheme (light or dark) and sends respective\n * event to the tracking service.\n *\n * @memberof module:React\n */\nexport const useTrackColorSchemeChoice = () => {\n useEffect(() => {\n const trackColorSchemeChoice = ({ matches }) => {\n const preferredColorScheme = matches ? 'dark' : 'light';\n sendTrackEvent('openedx.ui.frontend-platform.prefers-color-scheme.selected', { preferredColorScheme });\n };\n const colorSchemeQuery = window.matchMedia?.('(prefers-color-scheme: dark)');\n if (colorSchemeQuery) {\n // send user's initial choice\n trackColorSchemeChoice(colorSchemeQuery);\n colorSchemeQuery.addEventListener('change', trackColorSchemeChoice);\n }\n return () => {\n if (colorSchemeQuery) {\n colorSchemeQuery.removeEventListener('change', trackColorSchemeChoice);\n }\n };\n }, []);\n};\n"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,SAAS,EAAEC,WAAW,QAAQ,WAAW;AAClD,SAASC,cAAc,QAAQ,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAIC,IAAI,EAAEC,QAAQ,EAAK;EAC7CN,SAAS,CAAC,YAAM;IACd,IAAMO,iBAAiB,GAAGN,SAAS,CAACI,IAAI,EAAEC,QAAQ,CAAC;IAEnD,OAAO,SAASE,OAAOA,CAAA,EAAG;MACxBN,WAAW,CAACK,iBAAiB,CAAC;IAChC,CAAC;EACH,CAAC,EAAE,CAACD,QAAQ,EAAED,IAAI,CAAC,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMI,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAA,EAAS;EAC7CT,SAAS,CAAC,YAAM;IAAA,IAAAU,kBAAA,EAAAC,OAAA;IACd,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAAC,IAAA,EAAoB;MAAA,IAAdC,OAAO,GAAAD,IAAA,CAAPC,OAAO;MACvC,IAAMC,oBAAoB,GAAGD,OAAO,GAAG,MAAM,GAAG,OAAO;MACvDX,cAAc,CAAC,4DAA4D,EAAE;QAAEY,oBAAoB,EAApBA;MAAqB,CAAC,CAAC;IACxG,CAAC;IACD,IAAMC,gBAAgB,IAAAN,kBAAA,GAAG,CAAAC,OAAA,GAAAM,MAAM,EAACC,UAAU,cAAAR,kBAAA,uBAAjBA,kBAAA,CAAAS,IAAA,CAAAR,OAAA,EAAoB,8BAA8B,CAAC;IAC5E,IAAIK,gBAAgB,EAAE;MACpB;MACAJ,sBAAsB,CAACI,gBAAgB,CAAC;MACxCA,gBAAgB,CAACI,gBAAgB,CAAC,QAAQ,EAAER,sBAAsB,CAAC;IACrE;IACA,OAAO,YAAM;MACX,IAAII,gBAAgB,EAAE;QACpBA,gBAAgB,CAACK,mBAAmB,CAAC,QAAQ,EAAET,sBAAsB,CAAC;MACxE;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC"}
1
+ {"version":3,"file":"hooks.js","names":["useEffect","subscribe","unsubscribe","sendTrackEvent","useAppEvent","type","callback","subscriptionToken","cleanup","useTrackColorSchemeChoice","_window$matchMedia","_window","trackColorSchemeChoice","_ref","matches","preferredColorScheme","colorSchemeQuery","window","matchMedia","call","addEventListener","removeEventListener"],"sources":["../../src/react/hooks.js"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nimport { useEffect } from 'react';\nimport { subscribe, unsubscribe } from '../pubSub';\nimport { sendTrackEvent } from '../analytics';\n\n/**\n * A React hook that allows functional components to subscribe to application events. This should\n * be used sparingly - for the most part, Context should be used higher-up in the application to\n * provide necessary data to a given component, rather than utilizing a non-React-like Pub/Sub\n * mechanism.\n *\n * @memberof module:React\n * @param {string} type\n * @param {function} callback\n */\nexport const useAppEvent = (type, callback) => {\n useEffect(() => {\n const subscriptionToken = subscribe(type, callback);\n\n return function cleanup() {\n unsubscribe(subscriptionToken);\n };\n }, [callback, type]);\n};\n\n/**\n * A React hook that tracks user's preferred color scheme (light or dark) and sends respective\n * event to the tracking service.\n *\n * @memberof module:React\n */\nexport const useTrackColorSchemeChoice = () => {\n useEffect(() => {\n const trackColorSchemeChoice = ({ matches }) => {\n const preferredColorScheme = matches ? 'dark' : 'light';\n sendTrackEvent('openedx.ui.frontend-platform.prefers-color-scheme.selected', { preferredColorScheme });\n };\n const colorSchemeQuery = window.matchMedia?.('(prefers-color-scheme: dark)');\n if (colorSchemeQuery) {\n // send user's initial choice\n trackColorSchemeChoice(colorSchemeQuery);\n colorSchemeQuery.addEventListener('change', trackColorSchemeChoice);\n }\n return () => {\n if (colorSchemeQuery) {\n colorSchemeQuery.removeEventListener('change', trackColorSchemeChoice);\n }\n };\n }, []);\n};\n"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,SAAS,EAAEC,WAAW,QAAQ,WAAW;AAClD,SAASC,cAAc,QAAQ,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAIC,IAAI,EAAEC,QAAQ,EAAK;EAC7CN,SAAS,CAAC,YAAM;IACd,IAAMO,iBAAiB,GAAGN,SAAS,CAACI,IAAI,EAAEC,QAAQ,CAAC;IAEnD,OAAO,SAASE,OAAOA,CAAA,EAAG;MACxBN,WAAW,CAACK,iBAAiB,CAAC;IAChC,CAAC;EACH,CAAC,EAAE,CAACD,QAAQ,EAAED,IAAI,CAAC,CAAC;AACtB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMI,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAA,EAAS;EAC7CT,SAAS,CAAC,YAAM;IAAA,IAAAU,kBAAA,EAAAC,OAAA;IACd,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAAC,IAAA,EAAoB;MAAA,IAAdC,OAAO,GAAAD,IAAA,CAAPC,OAAO;MACvC,IAAMC,oBAAoB,GAAGD,OAAO,GAAG,MAAM,GAAG,OAAO;MACvDX,cAAc,CAAC,4DAA4D,EAAE;QAAEY,oBAAoB,EAApBA;MAAqB,CAAC,CAAC;IACxG,CAAC;IACD,IAAMC,gBAAgB,IAAAN,kBAAA,GAAG,CAAAC,OAAA,GAAAM,MAAM,EAACC,UAAU,cAAAR,kBAAA,uBAAjBA,kBAAA,CAAAS,IAAA,CAAAR,OAAA,EAAoB,8BAA8B,CAAC;IAC5E,IAAIK,gBAAgB,EAAE;MACpB;MACAJ,sBAAsB,CAACI,gBAAgB,CAAC;MACxCA,gBAAgB,CAACI,gBAAgB,CAAC,QAAQ,EAAER,sBAAsB,CAAC;IACrE;IACA,OAAO,YAAM;MACX,IAAII,gBAAgB,EAAE;QACpBA,gBAAgB,CAACK,mBAAmB,CAAC,QAAQ,EAAET,sBAAsB,CAAC;MACxE;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","AppContext","AppProvider","AuthenticatedPageRoute","ErrorBoundary","ErrorPage","LoginRedirect","PageWrap","useAppEvent"],"sources":["../../src/react/index.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform/react**\n * The React module provides a variety of React components, hooks, and contexts for use in an\n * application.\n *\n * @module React\n */\n\nexport { default as AppContext } from './AppContext';\nexport { default as AppProvider } from './AppProvider';\nexport { default as AuthenticatedPageRoute } from './AuthenticatedPageRoute';\nexport { default as ErrorBoundary } from './ErrorBoundary';\nexport { default as ErrorPage } from './ErrorPage';\nexport { default as LoginRedirect } from './LoginRedirect';\nexport { default as PageWrap } from './PageWrap';\nexport { useAppEvent } from './hooks';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc;AACpD,SAASD,OAAO,IAAIE,WAAW,QAAQ,eAAe;AACtD,SAASF,OAAO,IAAIG,sBAAsB,QAAQ,0BAA0B;AAC5E,SAASH,OAAO,IAAII,aAAa,QAAQ,iBAAiB;AAC1D,SAASJ,OAAO,IAAIK,SAAS,QAAQ,aAAa;AAClD,SAASL,OAAO,IAAIM,aAAa,QAAQ,iBAAiB;AAC1D,SAASN,OAAO,IAAIO,QAAQ,QAAQ,YAAY;AAChD,SAASC,WAAW,QAAQ,SAAS"}
1
+ {"version":3,"file":"index.js","names":["default","AppContext","AppProvider","AuthenticatedPageRoute","ErrorBoundary","ErrorPage","LoginRedirect","PageWrap","useAppEvent"],"sources":["../../src/react/index.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform/react**\n * The React module provides a variety of React components, hooks, and contexts for use in an\n * application.\n *\n * @module React\n */\n\nexport { default as AppContext } from './AppContext';\nexport { default as AppProvider } from './AppProvider';\nexport { default as AuthenticatedPageRoute } from './AuthenticatedPageRoute';\nexport { default as ErrorBoundary } from './ErrorBoundary';\nexport { default as ErrorPage } from './ErrorPage';\nexport { default as LoginRedirect } from './LoginRedirect';\nexport { default as PageWrap } from './PageWrap';\nexport { useAppEvent } from './hooks';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc;AACpD,SAASD,OAAO,IAAIE,WAAW,QAAQ,eAAe;AACtD,SAASF,OAAO,IAAIG,sBAAsB,QAAQ,0BAA0B;AAC5E,SAASH,OAAO,IAAII,aAAa,QAAQ,iBAAiB;AAC1D,SAASJ,OAAO,IAAIK,SAAS,QAAQ,aAAa;AAClD,SAASL,OAAO,IAAIM,aAAa,QAAQ,iBAAiB;AAC1D,SAASN,OAAO,IAAIO,QAAQ,QAAQ,YAAY;AAChD,SAASC,WAAW,QAAQ,SAAS","ignoreList":[]}
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
3
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
4
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  /**
8
8
  * @implements {GoogleAnalyticsLoader}
9
9
  * @memberof module:GoogleAnalytics
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleAnalyticsLoader.js","names":["GoogleAnalyticsLoader","_ref","config","_classCallCheck","analyticsId","GOOGLE_ANALYTICS_4_ID","_createClass","key","value","loadScript","global","googleAnalytics","_global","invoked","load","options","scriptSrc","document","createElement","type","async","src","concat","scriptGtag","innerHTML","first","getElementsByTagName","parentNode","insertBefore","_loadOptions"],"sources":["../../src/scripts/GoogleAnalyticsLoader.js"],"sourcesContent":["/**\n * @implements {GoogleAnalyticsLoader}\n * @memberof module:GoogleAnalytics\n */\nclass GoogleAnalyticsLoader {\n constructor({ config }) {\n this.analyticsId = config.GOOGLE_ANALYTICS_4_ID;\n }\n\n loadScript() {\n if (!this.analyticsId) {\n return;\n }\n\n global.googleAnalytics = global.googleAnalytics || [];\n const { googleAnalytics } = global;\n\n // If the snippet was invoked do nothing.\n if (googleAnalytics.invoked) {\n return;\n }\n\n // Invoked flag, to make sure the snippet\n // is never invoked twice.\n googleAnalytics.invoked = true;\n\n googleAnalytics.load = (key, options) => {\n const scriptSrc = document.createElement('script');\n scriptSrc.type = 'text/javascript';\n scriptSrc.async = true;\n scriptSrc.src = `https://www.googletagmanager.com/gtag/js?id=${key}`;\n\n const scriptGtag = document.createElement('script');\n scriptGtag.innerHTML = `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${key}');\n `;\n\n // Insert our scripts next to the first script element.\n const first = document.getElementsByTagName('script')[0];\n first.parentNode.insertBefore(scriptSrc, first);\n first.parentNode.insertBefore(scriptGtag, first);\n googleAnalytics._loadOptions = options; // eslint-disable-line no-underscore-dangle\n };\n\n // Load GoogleAnalytics with your key.\n googleAnalytics.load(this.analyticsId);\n }\n}\n\nexport default GoogleAnalyticsLoader;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAHA,IAIMA,q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;;MAED;MACAJ,eAAe,CAACG,IAAI,CAAC,IAAI,CAACV,WAAW,CAAC;IACxC;EAAC;EAAA,OAAAJ,qBAAA;AAAA;AAGH,eAAeA,qBAAqB"}
1
+ {"version":3,"file":"GoogleAnalyticsLoader.js","names":["GoogleAnalyticsLoader","_ref","config","_classCallCheck","analyticsId","GOOGLE_ANALYTICS_4_ID","_createClass","key","value","loadScript","global","googleAnalytics","_global","invoked","load","options","scriptSrc","document","createElement","type","async","src","concat","scriptGtag","innerHTML","first","getElementsByTagName","parentNode","insertBefore","_loadOptions"],"sources":["../../src/scripts/GoogleAnalyticsLoader.js"],"sourcesContent":["/**\n * @implements {GoogleAnalyticsLoader}\n * @memberof module:GoogleAnalytics\n */\nclass GoogleAnalyticsLoader {\n constructor({ config }) {\n this.analyticsId = config.GOOGLE_ANALYTICS_4_ID;\n }\n\n loadScript() {\n if (!this.analyticsId) {\n return;\n }\n\n global.googleAnalytics = global.googleAnalytics || [];\n const { googleAnalytics } = global;\n\n // If the snippet was invoked do nothing.\n if (googleAnalytics.invoked) {\n return;\n }\n\n // Invoked flag, to make sure the snippet\n // is never invoked twice.\n googleAnalytics.invoked = true;\n\n googleAnalytics.load = (key, options) => {\n const scriptSrc = document.createElement('script');\n scriptSrc.type = 'text/javascript';\n scriptSrc.async = true;\n scriptSrc.src = `https://www.googletagmanager.com/gtag/js?id=${key}`;\n\n const scriptGtag = document.createElement('script');\n scriptGtag.innerHTML = `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${key}');\n `;\n\n // Insert our scripts next to the first script element.\n const first = document.getElementsByTagName('script')[0];\n first.parentNode.insertBefore(scriptSrc, first);\n first.parentNode.insertBefore(scriptGtag, first);\n googleAnalytics._loadOptions = options; // eslint-disable-line no-underscore-dangle\n };\n\n // Load GoogleAnalytics with your key.\n googleAnalytics.load(this.analyticsId);\n }\n}\n\nexport default GoogleAnalyticsLoader;\n"],"mappings":";;;;;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AAGd,OAAO,CAAC,CAAC;MAC1C,CAAC;;MAED;MACAJ,eAAe,CAACG,IAAI,CAAC,IAAI,CAACV,WAAW,CAAC;IACxC;EAAC;EAAA,OAAAJ,qBAAA;AAAA;AAGH,eAAeA,qBAAqB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","GoogleAnalyticsLoader"],"sources":["../../src/scripts/index.js"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nexport { default as GoogleAnalyticsLoader } from './GoogleAnalyticsLoader';\n"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,qBAAqB,QAAQ,yBAAyB"}
1
+ {"version":3,"file":"index.js","names":["default","GoogleAnalyticsLoader"],"sources":["../../src/scripts/index.js"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\nexport { default as GoogleAnalyticsLoader } from './GoogleAnalyticsLoader';\n"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,qBAAqB,QAAQ,yBAAyB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","initializeMockApp","mockMessages"],"sources":["../../src/testing/index.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform/testing**\n * The testing module provides helpers for writing tests in Jest.\n *\n * @module Testing\n */\n\nexport { default as initializeMockApp } from './initializeMockApp';\nexport { default as mockMessages } from './mockMessages';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,qBAAqB;AAClE,SAASD,OAAO,IAAIE,YAAY,QAAQ,gBAAgB"}
1
+ {"version":3,"file":"index.js","names":["default","initializeMockApp","mockMessages"],"sources":["../../src/testing/index.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform/testing**\n * The testing module provides helpers for writing tests in Jest.\n *\n * @module Testing\n */\n\nexport { default as initializeMockApp } from './initializeMockApp';\nexport { default as mockMessages } from './mockMessages';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,qBAAqB;AAClE,SAASD,OAAO,IAAIE,YAAY,QAAQ,gBAAgB","ignoreList":[]}
@@ -2,8 +2,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { configure as configureAnalytics, MockAnalyticsService } from '../analytics';
8
8
  import { configure as configureI18n } from '../i18n';
9
9
  import { configure as configureLogging, MockLoggingService } from '../logging';
@@ -1 +1 @@
1
- {"version":3,"file":"initializeMockApp.js","names":["configure","configureAnalytics","MockAnalyticsService","configureI18n","configureLogging","MockLoggingService","configureAuth","MockAuthService","getConfig","mockMessages","initializeMockApp","_ref","arguments","length","undefined","_ref$messages","messages","_ref$authenticatedUse","authenticatedUser","loggingService","config","authService","_objectSpread","analyticsService","httpClient","getAuthenticatedHttpClient"],"sources":["../../src/testing/initializeMockApp.js"],"sourcesContent":["import { configure as configureAnalytics, MockAnalyticsService } from '../analytics';\nimport { configure as configureI18n } from '../i18n';\nimport { configure as configureLogging, MockLoggingService } from '../logging';\nimport { configure as configureAuth, MockAuthService } from '../auth';\nimport { getConfig } from '../config';\nimport mockMessages from './mockMessages';\n\n/**\n * Initializes a mock application for component testing. The mock application includes\n * mock analytics, auth, and logging services, and the real i18n service.\n *\n * See MockAnalyticsService, MockAuthService, and MockLoggingService for mock implementation\n * details. For the most part, the analytics and logging services just implement their functions\n * with jest.fn() and do nothing else, whereas the MockAuthService actually has some behavior\n * implemented, it just doesn't make any HTTP calls.\n *\n * Note that this mock application is not sufficient for testing the full application lifecycle or\n * initialization callbacks/custom handlers as described in the 'initialize' function's\n * documentation. It exists merely to set up the mock services that components themselves tend to\n * interact with most often. It could be extended to allow for setting up custom handlers fairly\n * easily, as this functionality would be more-or-less identical to what the real initialize\n * function does.\n *\n * Example:\n *\n * ```\n * import { initializeMockApp } from '@edx/frontend-platform/testing';\n * import { logInfo } from '@edx/frontend-platform/logging';\n *\n * describe('initializeMockApp', () => {\n * it('mocks things correctly', () => {\n * const { loggingService } = initializeMockApp();\n * logInfo('test', {});\n * expect(loggingService.logInfo).toHaveBeenCalledWith('test', {});\n * });\n * });\n * ```\n *\n * @param {Object} [options]\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {UserData|null} [options.authenticatedUser] A UserData object representing the\n * authenticated user. This is passed directly to MockAuthService.\n * @memberof module:Testing\n */\nexport default function initializeMockApp({\n messages = mockMessages,\n authenticatedUser = null,\n} = {}) {\n const loggingService = configureLogging(MockLoggingService, {\n config: getConfig(),\n });\n\n const authService = configureAuth(MockAuthService, {\n config: { ...getConfig(), authenticatedUser },\n loggingService,\n });\n\n const analyticsService = configureAnalytics(MockAnalyticsService, {\n config: getConfig(),\n httpClient: authService.getAuthenticatedHttpClient(),\n loggingService,\n });\n\n // The i18n service configure function has no return value, since there isn't a service class.\n configureI18n({\n config: getConfig(),\n loggingService,\n messages,\n });\n\n return {\n analyticsService,\n authService,\n loggingService,\n };\n}\n"],"mappings":";;;;;;AAAA,SAASA,SAAS,IAAIC,kBAAkB,EAAEC,oBAAoB,QAAQ,cAAc;AACpF,SAASF,SAAS,IAAIG,aAAa,QAAQ,SAAS;AACpD,SAASH,SAAS,IAAII,gBAAgB,EAAEC,kBAAkB,QAAQ,YAAY;AAC9E,SAASL,SAAS,IAAIM,aAAa,EAAEC,eAAe,QAAQ,SAAS;AACrE,SAASC,SAAS,QAAQ,WAAW;AACrC,OAAOC,YAAY,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAAA,EAGjC;EAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAJ,CAAC,CAAC;IAAAG,aAAA,GAAAJ,IAAA,CAFJK,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAGN,YAAY,GAAAM,aAAA;IAAAE,qBAAA,GAAAN,IAAA,CACvBO,iBAAiB;IAAjBA,iBAAiB,GAAAD,qBAAA,cAAG,IAAI,GAAAA,qBAAA;EAExB,IAAME,cAAc,GAAGf,gBAAgB,CAACC,kBAAkB,EAAE;IAC1De,MAAM,EAAEZ,SAAS,CAAC;EACpB,CAAC,CAAC;EAEF,IAAMa,WAAW,GAAGf,aAAa,CAACC,eAAe,EAAE;IACjDa,MAAM,EAAAE,aAAA,CAAAA,aAAA,KAAOd,SAAS,CAAC,CAAC;MAAEU,iBAAiB,EAAjBA;IAAiB,EAAE;IAC7CC,cAAc,EAAdA;EACF,CAAC,CAAC;EAEF,IAAMI,gBAAgB,GAAGtB,kBAAkB,CAACC,oBAAoB,EAAE;IAChEkB,MAAM,EAAEZ,SAAS,CAAC,CAAC;IACnBgB,UAAU,EAAEH,WAAW,CAACI,0BAA0B,CAAC,CAAC;IACpDN,cAAc,EAAdA;EACF,CAAC,CAAC;;EAEF;EACAhB,aAAa,CAAC;IACZiB,MAAM,EAAEZ,SAAS,CAAC,CAAC;IACnBW,cAAc,EAAdA,cAAc;IACdH,QAAQ,EAARA;EACF,CAAC,CAAC;EAEF,OAAO;IACLO,gBAAgB,EAAhBA,gBAAgB;IAChBF,WAAW,EAAXA,WAAW;IACXF,cAAc,EAAdA;EACF,CAAC;AACH"}
1
+ {"version":3,"file":"initializeMockApp.js","names":["configure","configureAnalytics","MockAnalyticsService","configureI18n","configureLogging","MockLoggingService","configureAuth","MockAuthService","getConfig","mockMessages","initializeMockApp","_ref","arguments","length","undefined","_ref$messages","messages","_ref$authenticatedUse","authenticatedUser","loggingService","config","authService","_objectSpread","analyticsService","httpClient","getAuthenticatedHttpClient"],"sources":["../../src/testing/initializeMockApp.js"],"sourcesContent":["import { configure as configureAnalytics, MockAnalyticsService } from '../analytics';\nimport { configure as configureI18n } from '../i18n';\nimport { configure as configureLogging, MockLoggingService } from '../logging';\nimport { configure as configureAuth, MockAuthService } from '../auth';\nimport { getConfig } from '../config';\nimport mockMessages from './mockMessages';\n\n/**\n * Initializes a mock application for component testing. The mock application includes\n * mock analytics, auth, and logging services, and the real i18n service.\n *\n * See MockAnalyticsService, MockAuthService, and MockLoggingService for mock implementation\n * details. For the most part, the analytics and logging services just implement their functions\n * with jest.fn() and do nothing else, whereas the MockAuthService actually has some behavior\n * implemented, it just doesn't make any HTTP calls.\n *\n * Note that this mock application is not sufficient for testing the full application lifecycle or\n * initialization callbacks/custom handlers as described in the 'initialize' function's\n * documentation. It exists merely to set up the mock services that components themselves tend to\n * interact with most often. It could be extended to allow for setting up custom handlers fairly\n * easily, as this functionality would be more-or-less identical to what the real initialize\n * function does.\n *\n * Example:\n *\n * ```\n * import { initializeMockApp } from '@edx/frontend-platform/testing';\n * import { logInfo } from '@edx/frontend-platform/logging';\n *\n * describe('initializeMockApp', () => {\n * it('mocks things correctly', () => {\n * const { loggingService } = initializeMockApp();\n * logInfo('test', {});\n * expect(loggingService.logInfo).toHaveBeenCalledWith('test', {});\n * });\n * });\n * ```\n *\n * @param {Object} [options]\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {UserData|null} [options.authenticatedUser] A UserData object representing the\n * authenticated user. This is passed directly to MockAuthService.\n * @memberof module:Testing\n */\nexport default function initializeMockApp({\n messages = mockMessages,\n authenticatedUser = null,\n} = {}) {\n const loggingService = configureLogging(MockLoggingService, {\n config: getConfig(),\n });\n\n const authService = configureAuth(MockAuthService, {\n config: { ...getConfig(), authenticatedUser },\n loggingService,\n });\n\n const analyticsService = configureAnalytics(MockAnalyticsService, {\n config: getConfig(),\n httpClient: authService.getAuthenticatedHttpClient(),\n loggingService,\n });\n\n // The i18n service configure function has no return value, since there isn't a service class.\n configureI18n({\n config: getConfig(),\n loggingService,\n messages,\n });\n\n return {\n analyticsService,\n authService,\n loggingService,\n };\n}\n"],"mappings":";;;;;;AAAA,SAASA,SAAS,IAAIC,kBAAkB,EAAEC,oBAAoB,QAAQ,cAAc;AACpF,SAASF,SAAS,IAAIG,aAAa,QAA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AAC;IACZiB,MAAM,EAAEZ,SAAS,CAAC,CAAC;IACnBW,cAAc,EAAdA,cAAc;IACdH,QAAQ,EAARA;EACF,CAAC,CAAC;EAEF,OAAO;IACLO,gBAAgB,EAAhBA,gBAAgB;IAChBF,WAAW,EAAXA,WAAW;IACXF,cAAc,EAAdA;EACF,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"mockMessages.js","names":["messages","ar","fa","fr","ca","he","id","pl","ru","th","uk"],"sources":["../../src/testing/mockMessages.js"],"sourcesContent":["/**\n * An empty messages object suitable for fulfilling the i18n service's contract.\n * @memberof module:Testing\n */\nconst messages = {\n ar: {},\n 'es-419': {},\n fa: {},\n 'fa-ir': {},\n fr: {},\n 'zh-cn': {},\n ca: {},\n he: {},\n id: {},\n 'ko-kr': {},\n pl: {},\n 'pt-br': {},\n ru: {},\n th: {},\n uk: {},\n};\n\nexport default messages;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,IAAMA,QAAQ,GAAG;EACfC,EAAE,EAAE,CAAC,CAAC;EACN,QAAQ,EAAE,CAAC,CAAC;EACZC,EAAE,EAAE,CAAC,CAAC;EACN,OAAO,EAAE,CAAC,CAAC;EACXC,EAAE,EAAE,CAAC,CAAC;EACN,OAAO,EAAE,CAAC,CAAC;EACXC,EAAE,EAAE,CAAC,CAAC;EACNC,EAAE,EAAE,CAAC,CAAC;EACNC,EAAE,EAAE,CAAC,CAAC;EACN,OAAO,EAAE,CAAC,CAAC;EACXC,EAAE,EAAE,CAAC,CAAC;EACN,OAAO,EAAE,CAAC,CAAC;EACXC,EAAE,EAAE,CAAC,CAAC;EACNC,EAAE,EAAE,CAAC,CAAC;EACNC,EAAE,EAAE,CAAC;AACP,CAAC;AAED,eAAeV,QAAQ"}
1
+ {"version":3,"file":"mockMessages.js","names":["messages","ar","fa","fr","ca","he","id","pl","ru","th","uk"],"sources":["../../src/testing/mockMessages.js"],"sourcesContent":["/**\n * An empty messages object suitable for fulfilling the i18n service's contract.\n * @memberof module:Testing\n */\nconst messages = {\n ar: {},\n 'es-419': {},\n fa: {},\n 'fa-ir': {},\n fr: {},\n 'zh-cn': {},\n ca: {},\n he: {},\n id: {},\n 'ko-kr': {},\n pl: {},\n 'pt-br': {},\n ru: {},\n th: {},\n uk: {},\n};\n\nexport default messages;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,IAAMA,QAAQ,GAAG;EACfC,EAAE,EAAE,CAAC,CAAC;EACN,QAAQ,EAAE,CAAC,CAAC;EACZC,EAAE,EAAE,CAAC,CAAC;EACN,OAAO,EAAE,CAAC,CAAC;EACXC,EAAE,EAAE,CAAC,CAAC;EACN,OAAO,EAAE,CAAC,CAAC;EACXC,EAAE,EAAE,CAAC,CAAC;EACNC,EAAE,EAAE,CAAC,CAAC;EACNC,EAAE,EAAE,CAAC,CAAC;EACN,OAAO,EAAE,CAAC,CAAC;EACXC,EAAE,EAAE,CAAC,CAAC;EACN,OAAO,EAAE,CAAC,CAAC;EACXC,EAAE,EAAE,CAAC,CAAC;EACNC,EAAE,EAAE,CAAC,CAAC;EACNC,EAAE,EAAE,CAAC;AACP,CAAC;AAED,eAAeV,QAAQ","ignoreList":[]}
package/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
3
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
3
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
5
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
6
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
package/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["camelCase","snakeCase","modifyObjectKeys","object","modify","undefined","_typeof","Array","isArray","map","value","result","Object","entries","forEach","_ref","_ref2","_slicedToArray","key","camelCaseObject","snakeCaseObject","convertKeyNames","nameMap","transformer","parseURL","url","document","parser","createElement","href","getPath","_parseURL","pathname","getQueryParameters","search","arguments","length","global","location","keyValueFragments","slice","indexOf","split","filter","hash","reduce","params","keyValueFragment","assign","_defineProperty","decodeURIComponent","ensureDefinedConfig","requester","keys","console","warn","concat"],"sources":["../src/utils.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * @module Utilities\n */\nimport camelCase from 'lodash.camelcase';\nimport snakeCase from 'lodash.snakecase';\n\n/**\n * This is the underlying function used by camelCaseObject, snakeCaseObject, and convertKeyNames\n * above.\n *\n * Given an object (or array) and a modification function, will perform the function on each key it\n * encounters on the object and its tree of children.\n *\n * The modification function must take a string as an argument and returns a string.\n *\n * Example:\n *\n * ```\n * (key) => {\n * if (key === 'edX') {\n * return 'Open edX';\n * }\n * return key;\n * }\n * ```\n *\n * This function will turn any key that matches 'edX' into 'Open edX'. All other keys will be\n * passed through unmodified.\n *\n * Can accept arrays as well as objects, and will perform its conversion on any objects it finds in\n * the array.\n *\n * @param {Object} object\n * @param {function} modify\n * @returns {Object}\n */\nexport function modifyObjectKeys(object, modify) {\n // If the passed in object is not an Object, return it.\n if (\n object === undefined\n || object === null\n || (typeof object !== 'object' && !Array.isArray(object))\n ) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map(value => modifyObjectKeys(value, modify));\n }\n\n // Otherwise, process all its keys.\n const result = {};\n Object.entries(object).forEach(([key, value]) => {\n result[modify(key)] = modifyObjectKeys(value, modify);\n });\n return result;\n}\n\n/**\n * Performs a deep conversion to camelCase on all keys in the provided object and its tree of\n * children. Uses [lodash.camelcase](https://lodash.com/docs/4.17.15#camelCase) on each key. This\n * is commonly used to convert snake_case keys in models from a backend server into camelCase keys\n * for use in the JavaScript client.\n *\n * Can accept arrays as well as objects, and will perform its conversion on any objects it finds in\n * the array.\n *\n * @param {Array|Object} object\n * @returns {Array|Object}\n */\nexport function camelCaseObject(object) {\n return modifyObjectKeys(object, camelCase);\n}\n\n/**\n * Performs a deep conversion to snake_case on all keys in the provided object and its tree of\n * children. Uses [lodash.snakecase](https://lodash.com/docs/4.17.15#snakeCase) on each key. This\n * is commonly used to convert camelCase keys from the JavaScript app into snake_case keys expected\n * by backend servers.\n *\n * Can accept arrays as well as objects, and will perform its conversion on any objects it finds in\n * the array.\n *\n * @param {Array|Object} object\n * @returns {Array|Object}\n */\nexport function snakeCaseObject(object) {\n return modifyObjectKeys(object, snakeCase);\n}\n\n/**\n * Given a map of key-value pairs, performs a deep conversion key names in the specified object\n * _from_ the key _to_ the value. This is useful for updating names in an API request to the names\n * used throughout a client application if they happen to differ. It can also be used in the\n * reverse - formatting names from the client application to names expected by an API.\n *\n * ```\n * import { convertKeyNames } from '@edx/frontend-base';\n *\n * // This object can be of any shape or depth with subobjects/arrays.\n * const myObject = {\n * myKey: 'my value',\n * }\n *\n * const result = convertKeyNames(myObject, { myKey: 'their_key' });\n *\n * console.log(result) // { their_key: 'my value' }\n * ```\n *\n * Can accept arrays as well as objects, and will perform its conversion on any objects it finds in\n * the array.\n *\n * @param {Array|Object} object\n * @param {Object} nameMap\n * @returns {Array|Object}\n */\nexport function convertKeyNames(object, nameMap) {\n const transformer = key => (nameMap[key] === undefined ? key : nameMap[key]);\n\n return modifyObjectKeys(object, transformer);\n}\n\n/**\n * Given a string URL return an element that has been parsed via href.\n * This element has the possibility to return different part of the URL.\n parser.protocol; // => \"http:\"\n parser.hostname; // => \"example.com\"\n parser.port; // => \"3000\"\n parser.pathname; // => \"/pathname/\"\n parser.search; // => \"?search=test\"\n parser.hash; // => \"#hash\"\n parser.host; // => \"example.com:3000\"\n * https://gist.github.com/jlong/2428561\n *\n * @param {string}\n * @returns {Object}\n */\nexport function parseURL(url) {\n if (typeof document !== 'undefined') {\n const parser = document.createElement('a');\n parser.href = url;\n return parser;\n }\n\n return {};\n}\n\n/**\n * Given a string URL return the path of the URL\n *\n *\n * @param {string}\n * @returns {string}\n */\nexport function getPath(url) {\n return typeof document !== 'undefined' ? parseURL(url)?.pathname : '';\n}\n\n/**\n * *Deprecated*: A method which converts the supplied query string into an object of\n * key-value pairs and returns it. Defaults to the current query string - should perform like\n * [window.searchParams](https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams)\n *\n * @deprecated\n * @param {string} [search=global.location.search]\n * @returns {Object}\n */\nexport function getQueryParameters(search = global.location.search) {\n const keyValueFragments = search\n .slice(search.indexOf('?') + 1)\n .split('&')\n .filter(hash => hash !== '');\n\n return keyValueFragments.reduce((params, keyValueFragment) => {\n const split = keyValueFragment.indexOf('=');\n const key = keyValueFragment.slice(0, split);\n const value = keyValueFragment.slice(split + 1);\n return Object.assign(params, { [key]: decodeURIComponent(value) });\n }, {});\n}\n\n/**\n * This function helps catch a certain class of misconfiguration in which configuration variables\n * are not properly defined and/or supplied to a consumer that requires them. Any key that exists\n * is still set to \"undefined\" indicates a misconfiguration further up in the application, and\n * should be flagged as an error, and is logged to 'warn'.\n *\n * Keys that are intended to be falsy should be defined using null, 0, false, etc.\n *\n * @param {Object} object\n * @param {string} requester A human-readable identifier for the code which called this function.\n * Used when throwing errors to aid in debugging.\n */\nexport function ensureDefinedConfig(object, requester) {\n Object.keys(object).forEach((key) => {\n if (object[key] === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`Module configuration error: ${key} is required by ${requester}.`);\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,kBAAkB;AACxC,OAAOC,SAAS,MAAM,kBAAkB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,MAAM,EAAEC,MAAM,EAAE;EAC/C;EACA,IACED,MAAM,KAAKE,SAAS,IACjBF,MAAM,KAAK,IAAI,IACdG,OAAA,CAAOH,MAAM,MAAK,QAAQ,IAAI,CAACI,KAAK,CAACC,OAAO,CAACL,MAAM,CAAE,EACzD;IACA,OAAOA,MAAM;EACf;EAEA,IAAII,KAAK,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;IACzB,OAAOA,MAAM,CAACM,GAAG,CAAC,UAAAC,KAAK;MAAA,OAAIR,gBAAgB,CAACQ,KAAK,EAAEN,MAAM,CAAC;IAAA,EAAC;EAC7D;;EAEA;EACA,IAAMO,MAAM,GAAG,CAAC,CAAC;EACjBC,MAAM,CAACC,OAAO,CAACV,MAAM,CAAC,CAACW,OAAO,CAAC,UAAAC,IAAA,EAAkB;IAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,IAAA;MAAhBG,GAAG,GAAAF,KAAA;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MAAM,EAAEiD,SAAS,EAAE;EACrDxC,MAAM,CAACyC,IAAI,CAAClD,MAAM,CAAC,CAACW,OAAO,CAAC,UAACI,GAAG,EAAK;IACnC,IAAIf,MAAM,CAACe,GAAG,CAAC,KAAKb,SAAS,EAAE;MAC7B;MACAiD,OAAO,CAACC,IAAI,gCAAAC,MAAA,CAAgCtC,GAAG,sBAAAsC,MAAA,CAAmBJ,SAAS,MAAG,CAAC;IACjF;EACF,CAAC,CAAC;AACJ"}
1
+ {"version":3,"file":"utils.js","names":["camelCase","snakeCase","modifyObjectKeys","object","modify","undefined","_typeof","Array","isArray","map","value","result","Object","entries","forEach","_ref","_ref2","_slicedToArray","key","camelCaseObject","snakeCaseObject","convertKeyNames","nameMap","transformer","parseURL","url","document","parser","createElement","href","getPath","_parseURL","pathname","getQueryParameters","search","arguments","length","global","location","keyValueFragments","slice","indexOf","split","filter","hash","reduce","params","keyValueFragment","assign","_defineProperty","decodeURIComponent","ensureDefinedConfig","requester","keys","console","warn","concat"],"sources":["../src/utils.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * @module Utilities\n */\nimport camelCase from 'lodash.camelcase';\nimport snakeCase from 'lodash.snakecase';\n\n/**\n * This is the underlying function used by camelCaseObject, snakeCaseObject, and convertKeyNames\n * above.\n *\n * Given an object (or array) and a modification function, will perform the function on each key it\n * encounters on the object and its tree of children.\n *\n * The modification function must take a string as an argument and returns a string.\n *\n * Example:\n *\n * ```\n * (key) => {\n * if (key === 'edX') {\n * return 'Open edX';\n * }\n * return key;\n * }\n * ```\n *\n * This function will turn any key that matches 'edX' into 'Open edX'. All other keys will be\n * passed through unmodified.\n *\n * Can accept arrays as well as objects, and will perform its conversion on any objects it finds in\n * the array.\n *\n * @param {Object} object\n * @param {function} modify\n * @returns {Object}\n */\nexport function modifyObjectKeys(object, modify) {\n // If the passed in object is not an Object, return it.\n if (\n object === undefined\n || object === null\n || (typeof object !== 'object' && !Array.isArray(object))\n ) {\n return object;\n }\n\n if (Array.isArray(object)) {\n return object.map(value => modifyObjectKeys(value, modify));\n }\n\n // Otherwise, process all its keys.\n const result = {};\n Object.entries(object).forEach(([key, value]) => {\n result[modify(key)] = modifyObjectKeys(value, modify);\n });\n return result;\n}\n\n/**\n * Performs a deep conversion to camelCase on all keys in the provided object and its tree of\n * children. Uses [lodash.camelcase](https://lodash.com/docs/4.17.15#camelCase) on each key. This\n * is commonly used to convert snake_case keys in models from a backend server into camelCase keys\n * for use in the JavaScript client.\n *\n * Can accept arrays as well as objects, and will perform its conversion on any objects it finds in\n * the array.\n *\n * @param {Array|Object} object\n * @returns {Array|Object}\n */\nexport function camelCaseObject(object) {\n return modifyObjectKeys(object, camelCase);\n}\n\n/**\n * Performs a deep conversion to snake_case on all keys in the provided object and its tree of\n * children. Uses [lodash.snakecase](https://lodash.com/docs/4.17.15#snakeCase) on each key. This\n * is commonly used to convert camelCase keys from the JavaScript app into snake_case keys expected\n * by backend servers.\n *\n * Can accept arrays as well as objects, and will perform its conversion on any objects it finds in\n * the array.\n *\n * @param {Array|Object} object\n * @returns {Array|Object}\n */\nexport function snakeCaseObject(object) {\n return modifyObjectKeys(object, snakeCase);\n}\n\n/**\n * Given a map of key-value pairs, performs a deep conversion key names in the specified object\n * _from_ the key _to_ the value. This is useful for updating names in an API request to the names\n * used throughout a client application if they happen to differ. It can also be used in the\n * reverse - formatting names from the client application to names expected by an API.\n *\n * ```\n * import { convertKeyNames } from '@edx/frontend-base';\n *\n * // This object can be of any shape or depth with subobjects/arrays.\n * const myObject = {\n * myKey: 'my value',\n * }\n *\n * const result = convertKeyNames(myObject, { myKey: 'their_key' });\n *\n * console.log(result) // { their_key: 'my value' }\n * ```\n *\n * Can accept arrays as well as objects, and will perform its conversion on any objects it finds in\n * the array.\n *\n * @param {Array|Object} object\n * @param {Object} nameMap\n * @returns {Array|Object}\n */\nexport function convertKeyNames(object, nameMap) {\n const transformer = key => (nameMap[key] === undefined ? key : nameMap[key]);\n\n return modifyObjectKeys(object, transformer);\n}\n\n/**\n * Given a string URL return an element that has been parsed via href.\n * This element has the possibility to return different part of the URL.\n parser.protocol; // => \"http:\"\n parser.hostname; // => \"example.com\"\n parser.port; // => \"3000\"\n parser.pathname; // => \"/pathname/\"\n parser.search; // => \"?search=test\"\n parser.hash; // => \"#hash\"\n parser.host; // => \"example.com:3000\"\n * https://gist.github.com/jlong/2428561\n *\n * @param {string}\n * @returns {Object}\n */\nexport function parseURL(url) {\n if (typeof document !== 'undefined') {\n const parser = document.createElement('a');\n parser.href = url;\n return parser;\n }\n\n return {};\n}\n\n/**\n * Given a string URL return the path of the URL\n *\n *\n * @param {string}\n * @returns {string}\n */\nexport function getPath(url) {\n return typeof document !== 'undefined' ? parseURL(url)?.pathname : '';\n}\n\n/**\n * *Deprecated*: A method which converts the supplied query string into an object of\n * key-value pairs and returns it. Defaults to the current query string - should perform like\n * [window.searchParams](https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams)\n *\n * @deprecated\n * @param {string} [search=global.location.search]\n * @returns {Object}\n */\nexport function getQueryParameters(search = global.location.search) {\n const keyValueFragments = search\n .slice(search.indexOf('?') + 1)\n .split('&')\n .filter(hash => hash !== '');\n\n return keyValueFragments.reduce((params, keyValueFragment) => {\n const split = keyValueFragment.indexOf('=');\n const key = keyValueFragment.slice(0, split);\n const value = keyValueFragment.slice(split + 1);\n return Object.assign(params, { [key]: decodeURIComponent(value) });\n }, {});\n}\n\n/**\n * This function helps catch a certain class of misconfiguration in which configuration variables\n * are not properly defined and/or supplied to a consumer that requires them. Any key that exists\n * is still set to \"undefined\" indicates a misconfiguration further up in the application, and\n * should be flagged as an error, and is logged to 'warn'.\n *\n * Keys that are intended to be falsy should be defined using null, 0, false, etc.\n *\n * @param {Object} object\n * @param {string} requester A human-readable identifier for the code which called this function.\n * Used when throwing errors to aid in debugging.\n */\nexport function ensureDefinedConfig(object, requester) {\n Object.keys(object).forEach((key) => {\n if (object[key] === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`Module configuration error: ${key} is required by ${requester}.`);\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,kBAAkB;AACxC,OAAOC,SAAS,MAAM,kBAAkB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,MAAM,EAAEC,MAAM,EAAE;EAC/C;EACA,IACED,MAAM,KAAKE,SAAS,IACjBF,MAAM,KAAK,IAAI,IACdG,OAAA,CAAOH,MAAM,MAAK,QAAQ,IAAI,CAACI,KAAK,CAACC,OAAO,CAACL,MAAM,CAAE,EACzD;IACA,OAAOA,MAAM;EACf;EAEA,IAAII,KAAK,CAACC,OAAO,CAACL,MAAM,CAAC,EAAE;IACzB,OAAOA,MAAM,CAACM,GAAG,CAAC,UAAAC,KAAK;MAAA,OAAIR,gBAAgB,CAACQ,KAAK,EAAEN,MAAM,CAAC;IAAA,EAAC;EAC7D;;EAEA;EACA,IAAMO,MAAM,GAAG,CAAC,CAAC;EACjBC,MAAM,CAACC,OAAO,CAACV,MAAM,CAAC,CAACW,OAAO,CAAC,UAAAC,IAAA,EAAkB;IAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,IAAA;MAAhBG,GAAG,GAAAF,KAAA;MAAEN,KAAK,GAAAM,KAAA;IACzCL,MAAM,CAACP,MAAM,CAACc,GAAG,CAAC,CAAC,GAAGhB,gBAAgB,CAACQ,KAAK,EAAEN,MAAM,CAAC;EACvD,CAAC,CAAC;EACF,OAAOO,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASQ,eAAeA,CAAChB,MAAM,EAAE;EACtC,OAAOD,gBAAgB,CAACC,MAAM,EAAEH,SAAS,CAA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