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,EAAAA,EAAAA,IAAA,gCAE+DC,EAAAZ,sBAAiB,EAC1Ea,EAAAA,EAAAA,IAEM,OAFAH,OAHZC,EAAAA,EAAAA,IAAA,iBAGqCC,EAAAnB,QAAI,EACjCqB,EAAAA,EAAAA,IAA+BC,EAAAC,OAAA,0BAAAhI,GAAA,aAJvC+G,EAAAA,EAAAA,IAAA,UAAAD,EAAA,MCO4E,CAAC,YAAY,oB","sources":["webpack://agra/./app/javascript/helpers/ajax.js","webpack://agra/./app/javascript/helpers/transform-object-keys.js","webpack://agra/./app/javascript/helpers/url-params.js","webpack://agra/./node_modules/vue-loader/dist/exportHelper.js","webpack://agra/./app/javascript/components/ajax-error-toast.vue","webpack://agra/./app/javascript/components/ajax-error-toast.vue?40c4","webpack://agra/./app/javascript/components/toast.vue","webpack://agra/./app/javascript/components/toast.vue?dead"],"sourcesContent":["import { objectKeysToCamelCase } from './transform-object-keys'\nimport { urlWithParams } from './url-params'\n\nconst STATUS_ERROR = 'error'\nconst GET_VERB = 'GET'\nconst POST_VERB = 'POST'\nconst PATCH_VERB = 'PATCH'\nconst PUT_VERB = 'PUT'\nconst DELETE_VERB = 'DELETE'\nconst PARAMS_IN_BODY_METHODS = [POST_VERB, PATCH_VERB, PUT_VERB, DELETE_VERB]\n\nfunction get(options) {\n return ajaxBase({...options, method: GET_VERB})\n}\n\nfunction post(options) {\n return ajaxBase({...options, method: POST_VERB})\n}\n\nfunction patch(options) {\n return ajaxBase({...options, method: PATCH_VERB})\n}\n\nfunction put(options) {\n return ajaxBase({...options, method: PUT_VERB})\n}\n\nconst errorTypes = {\n FETCH_FAILED: 'fetchFailed',\n NOT_OK_HTTP_STATUS: 'nonOkHttpStatus'\n}\n\nasync function ajaxBase({url, params, method, headers, data: requestData, acceptContentType='application/json',\n successHandler, errorHandler = null, throwOnFailure = false, camelCaseResponse = true}) {\n // If we're doing a GET, encode the params in the URL. Otherwise, we'll encode into the request body\n const parameterizedUrl = (method === GET_VERB) ? urlWithParams(url, params || {}) : url\n\n // By default, do not set the `body` parameter. For GET and other methods that do not accept a body,\n // even setting `body: null` can cause errors in some browsers.\n const maybeBody = {}\n\n // by default, communicate with the server via json\n let contentType = 'application/json;charset=UTF-8'\n\n if (PARAMS_IN_BODY_METHODS.includes(method)) {\n if (requestData === undefined) {\n // We need to do send as URL encoded data, since we accept arbitrary params.\n maybeBody.body = new URLSearchParams(params).toString()\n contentType = 'application/x-www-form-urlencoded'\n } else {\n // Need to JSON.stringify the bodyData here or it will be serialized\n // as [object Object] by default\n maybeBody.body = JSON.stringify(requestData)\n }\n }\n\n let response = null\n try {\n response = await fetch(parameterizedUrl, {\n method,\n headers: {\n ...headers,\n ...maybeCsrfToken(),\n 'Accept': acceptContentType,\n 'Content-Type': contentType,\n credentials: 'same-origin'\n },\n ...maybeBody\n })\n } catch (e) {\n if (throwOnFailure) {\n throw e\n } else {\n document.dispatchEvent(new CustomEvent('agra:ajax-error', {detail: {errorType: errorTypes.FETCH_FAILED}}))\n return\n }\n }\n\n // Check that HTTP status is OK\n if (!response.ok) {\n let errorBody\n try {\n errorBody = await response.json()\n } catch {\n // couldn't parse JSON\n errorBody = {error: `Response status was ${response.status}`}\n }\n\n if (throwOnFailure) {\n throw errorBody\n } else {\n document.dispatchEvent(new CustomEvent('agra:ajax-error', {\n detail: {\n errorType: errorTypes.NOT_OK_HTTP_STATUS,\n httpStatusCode: response.status,\n message: errorBody.message\n }\n }))\n return\n }\n }\n\n // Parse the response body\n if (response.status === 204) {\n // No response body to parse. Call the provided success handler function and we're done.\n if (successHandler) {\n successHandler(null)\n }\n return\n }\n\n // Parse body as JSON if that's the expected response\n const jsonRegexContentType = /json/i\n if (jsonRegexContentType.test(acceptContentType)) {\n const jsonResponse = await response.json()\n\n const transformedResponse = camelCaseResponse ? objectKeysToCamelCase(jsonResponse) : jsonResponse\n\n if (Array.isArray(jsonResponse)) {\n // Send the array data to the provided success handler function\n if (successHandler) {\n successHandler(transformedResponse)\n }\n return\n }\n\n // If we get here, we can assume that the JSON data is a hash. Extract common fields from it.\n const { status, message, data, ...rest } = transformedResponse\n\n // If the response has \"status\": \"error\", that's a 'business logic' error that the caller should handle.\n // Send it to the provided error handler function. If we were not provided an error handler function,\n // throw an exception.\n if (status === STATUS_ERROR) {\n if (errorHandler) {\n errorHandler({ message, info: rest })\n return\n } else {\n let error = new Error(message)\n error.info = rest\n throw error\n }\n }\n\n // Send the body, minus the 'status', to the provided success handler function\n if (successHandler) {\n successHandler({ message, data, ...rest })\n }\n } else {\n // Send the body as unparsed text to the provided success handler function\n const bodyText = await response.text()\n if (successHandler) {\n successHandler(bodyText)\n }\n }\n}\n\nfunction maybeCsrfToken() {\n const tokenElement = document.querySelector('meta[name=\"csrf-token\"]')\n if (tokenElement) {\n return {\n 'X-CSRF-Token': tokenElement.getAttribute('content')\n }\n }\n else {\n return {}\n }\n}\n\nexport default {\n get,\n post,\n // We inline the delete method here because `delete` is a JS keyword\n delete: options => {\n return ajaxBase({...options, method: DELETE_VERB})\n },\n put,\n patch,\n\n errorTypes\n}\n","import forEach from 'lodash/forEach' // this works on JS objects in addition to arrays\nimport isPlainObject from 'lodash/isPlainObject'\nimport camelCase from 'lodash/camelCase'\nimport snakeCase from 'lodash/snakeCase'\n\n// Warning: Only for serializable javascript objects without recursive references\n// otherwise will have infinite recursion + stack overflow.\n\nfunction makeObjectTransformer(transformWithFunction) {\n return function transformObjectKeys(sourceObject) {\n let transformedObject = {}\n if (Array.isArray(sourceObject)) {\n transformedObject = []\n }\n\n forEach(\n sourceObject,\n function(value, key) {\n if (isPlainObject(value) || Array.isArray(value)) { // checks that a value is a plain object or an array - for recursive key conversion\n value = transformObjectKeys(value) // recursively update keys of any values that are also objects\n }\n transformedObject[transformWithFunction(key)] = value\n }\n )\n return transformedObject\n }\n}\n\nconst objectKeysToCamelCase = makeObjectTransformer(camelCase)\nconst objectKeysToSnakeCase = makeObjectTransformer(snakeCase)\n\nexport {\n // For a plain JS object or array with snake_case keys,\n // recursively transform the keys to be camelCase instead.\n // Returns the transformed version.\n objectKeysToCamelCase,\n\n // For a plain JS object or array with camelCase keys,\n // recursively transform the keys to be snake_case instead.\n // Returns the transformed version.\n objectKeysToSnakeCase\n}\n","function urlWithParams(baseUrl, searchParamsMap) {\n const urlObj = new URL(baseUrl, window.location.origin)\n const urlSearchParams = urlObj.searchParams\n Object.entries(searchParamsMap).forEach(([k, v]) => {\n const stringValue = typeof v === 'string' ? v : JSON.stringify(v)\n urlSearchParams.append(k, stringValue)\n })\n\n // Deterministic ordering of url params. This is useful for when we check\n // the url with params in tests.\n urlSearchParams.sort()\n return urlObj.toString()\n}\n\nfunction urlParamsWithNamespace(paramsMap, namespace) {\n const newParamsMap = {}\n Object.entries(paramsMap).forEach(([k, v]) => {\n newParamsMap[`${namespace}[${k}]`] = v\n })\n return newParamsMap\n}\n\nexport {\n urlParamsWithNamespace,\n urlWithParams\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// runtime helper for setting properties on components\n// in a tree-shakable way\nexports.default = (sfc, props) => {\n const target = sfc.__vccOpts || sfc;\n for (const [key, val] of props) {\n target[key] = val;\n }\n return target;\n};\n","<template>\n <div>\n <toast v-if=\"active\" kind=\"error\">\n <template #message-content>\n {{ errorMessage }}\n </template>\n </toast>\n </div>\n</template>\n\n<script>\nimport ajax from '@/helpers/ajax'\nimport { inject } from 'vue'\nimport Toast from '@/components/toast'\n\nconst TOAST_TIMEOUT = 5000\n\nexport default {\n components: { Toast },\n\n props: {\n messageForNonOkHttpStatus: {\n type: String,\n required: false,\n default: function() { return inject('i18n').t('errors.ajax.server_error') }\n }\n },\n\n data() {\n return {\n active: false,\n errorDetail: {\n errorType: null\n }\n }\n },\n\n computed: {\n errorMessage() {\n switch (this.errorDetail.errorType) {\n case ajax.errorTypes.FETCH_FAILED:\n return this.i18n.t('errors.ajax.network_failure')\n case ajax.errorTypes.NOT_OK_HTTP_STATUS:\n if (this.errorDetail.httpStatusCode === 422 && this.errorDetail.message === 'Invalid authenticity token') {\n return this.i18n.t('errors.ajax.invalid_authenticity_token')\n } else {\n return this.messageForNonOkHttpStatus\n }\n default:\n return this.i18n.t('errors.something_wrong')\n }\n }\n },\n\n mounted() {\n document.addEventListener('agra:ajax-error', (evt) => {\n this.errorDetail = evt.detail\n this.active = true\n\n setTimeout(() => {\n this.active = false\n }, TOAST_TIMEOUT)\n })\n }\n}\n</script>\n","import { render } from \"./ajax-error-toast.vue?vue&type=template&id=1f60e4a5\"\nimport script from \"./ajax-error-toast.vue?vue&type=script&lang=js\"\nexport * from \"./ajax-error-toast.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","<template>\n <transition name=\"slide-fade\" appear>\n <div v-if=\"show\" :class=\"['toast-container', {'top-right': showFixedTopRight}]\">\n <div :class=\"['toast-element', kind]\">\n <slot name=\"message-content\" />\n </div>\n </div>\n </transition>\n</template>\n\n<script>\nexport default {\n props: {\n kind: {\n type: String,\n required: false,\n default: 'success'\n },\n showFixedTopRight: {\n type: Boolean,\n required: false,\n default: true\n },\n showOnMount: {\n type: Boolean,\n default: true\n }\n },\n\n data() {\n return {\n show: false\n }\n },\n\n mounted() {\n if (this.showOnMount) {\n this.showToast()\n }\n },\n\n methods: {\n removeToast() {\n this.show = false\n },\n\n showToast() {\n this.show = true\n setTimeout(() => {\n this.removeToast()\n }, 4000)\n }\n }\n}\n\n</script>\n\n<style lang=\"scss\" scoped>\n @use \"~common_styles/breakpoints\" as breakpoints;\n @use \"~friendship_styles/colors\" as colors;\n @use \"~friendship_styles/zindex\" as zindex;\n\n .toast-container {\n // Positioning\n\n // By default, display at the element parent's location without taking space, this is overriden\n // if the toast is meant to be displayed at the top right of the screen.\n position: absolute;\n\n &.top-right {\n position: fixed;\n z-index: zindex.$toast-z-index;\n top: 10%;\n right: 7%;\n }\n\n // toast element styling\n // Not using the class name `toast` to avoid using unrelated bootstrap class.\n .toast-element {\n top: 35px;\n width: auto;\n clear: both;\n margin-top: 10px;\n position: relative;\n max-width: 100%;\n height: auto;\n word-break: normal;\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: inherit;\n padding: 15px;\n color: colors.$black;\n border-radius: 5px;\n }\n\n // This class is dynamically applied based on a prop\n /* eslint-disable-next-line vue-scoped-css/no-unused-selector */\n .success {\n background-color: colors.$alert-success-bg;\n border: 1px solid colors.$alert-success-fg;\n }\n\n // This class is dynamically applied based on a prop\n /* eslint-disable-next-line vue-scoped-css/no-unused-selector */\n .error {\n background-color: colors.$alert-danger-bg;\n border: 1px solid colors.$alert-danger-fg;\n }\n }\n\n @include breakpoints.screen-mobile-only {\n .toast-container {\n max-width: 86%;\n width: 100%;\n\n &.top-right {\n top: 0;\n float: none;\n }\n }\n }\n\n .slide-fade-enter-active {\n transition: all .3s ease;\n }\n .slide-fade-leave-active {\n transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);\n }\n .slide-fade-enter-from {\n transform: translateY(-30px);\n opacity: 0;\n }\n .slide-fade-leave-to {\n opacity: 0;\n }\n</style>\n","import { render } from \"./toast.vue?vue&type=template&id=b2f9da20&scoped=true\"\nimport script from \"./toast.vue?vue&type=script&lang=js\"\nexport * from \"./toast.vue?vue&type=script&lang=js\"\n\nimport \"./toast.vue?vue&type=style&index=0&id=b2f9da20&lang=scss&scoped=true\"\n\nimport exportComponent from \"../../../node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-b2f9da20\"]])\n\nexport default __exports__"],"names":["POST_VERB","PATCH_VERB","DELETE_VERB","PARAMS_IN_BODY_METHODS","errorTypes","FETCH_FAILED","NOT_OK_HTTP_STATUS","async","ajaxBase","url","params","method","headers","data","requestData","acceptContentType","successHandler","errorHandler","throwOnFailure","camelCaseResponse","parameterizedUrl","urlWithParams","maybeBody","contentType","includes","undefined","body","URLSearchParams","toString","JSON","stringify","response","fetch","maybeCsrfToken","credentials","e","document","dispatchEvent","CustomEvent","detail","errorType","ok","errorBody","json","error","status","httpStatusCode","message","test","jsonResponse","transformedResponse","objectKeysToCamelCase","Array","isArray","rest","info","Error","bodyText","text","tokenElement","querySelector","getAttribute","get","options","post","delete","put","patch","makeObjectTransformer","transformWithFunction","transformObjectKeys","sourceObject","transformedObject","forEach","value","key","isPlainObject","camelCase","objectKeysToSnakeCase","snakeCase","baseUrl","searchParamsMap","urlObj","URL","window","location","origin","urlSearchParams","searchParams","Object","entries","k","v","stringValue","append","sort","urlParamsWithNamespace","paramsMap","namespace","newParamsMap","exports","sfc","props","target","__vccOpts","val","components","Toast","messageForNonOkHttpStatus","type","String","required","default","inject","t","active","errorDetail","computed","errorMessage","this","ajax","i18n","mounted","addEventListener","evt","setTimeout","_createElementBlock","$data","_createBlock","_component_toast","kind","_withCtx","_createTextVNode","_toDisplayString","$options","_","_createCommentVNode","showFixedTopRight","Boolean","showOnMount","show","showToast","methods","removeToast","_Transition","name","appear","class","_normalizeClass","$props","_createElementVNode","_renderSlot","_ctx","$slots"],"sourceRoot":""}