{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/components/mutes/post_card_sns_user_mute_component.js","webpack:///./app/frontend/packs/pages/announcements/index.js","webpack:///./app/frontend/javascripts/category_modal_mobile.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","SELECTORS","card","info","caption","content","unmuteCardButton","muteCardButton","_toggleCard","isMute","map","selector","querySelector","isTwoColumnsMobile","_isTwoColumnsMobile","classList","remove","add","_toggleMuteCardButton","dataset","_getCardsByUserId","userId","rootElement","document","querySelectorAll","muteByUserId","forEach","unmuteByUserId","constructor","this","_setEvent","_setUnmuteCardEvent","_setMuteCardEvent","addEventListener","e","preventDefault","closest","addMuteUserEvent","node","muteUserBtn","$","modal","close","id","addUnmuteUserEvent","unmuteUserBtn","mutationObserver","observeTarget","categorySearch","statusSearch","CategoryModalView","PostCardSnsUserMuteComponent","MutationObserver","mutations","mutation","Array","from","addedNodes","filter","nodeType","Node","ELEMENT_NODE","body","observe","childList","$modal","$openButton","$closeButton","show","hide"],"mappings":"aACE,IAAIA,EAAmB,CAAC,EAGxB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,CAAC,GAUX,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,OACf,CAIAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,GAEhE,EAGAZ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AAKqC,YAAYjC,iBAAiB,SAAS,kBAAM,EAAKmC,MAAX,IAC3CvC,KAAKsC,aAAalC,iBAAiB,SAAS,kBAAM,EAAKoC,MAAX,IAC7C,C,UAVH,O,EAAA,G,EAAA,8BAaIxC,KAAKoC,OAAOlD,UAAUE,IAAI,SAC3B,GAdH,6BAiBIY,KAAKoC,OAAOlD,UAAUC,OAAO,SAC9B,M,2BAlBH,I","file":"js/pages/announcements/index-b332794729ffb505de7b.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1072);\n","const SELECTORS = {\n card: \".js-post-card-sns-user-mute\",\n info: \".js-post-card-sns-user-mute-info\",\n caption: \".js-post-card-sns-user-mute-caption\",\n content: \".js-post-card-sns-user-mute-content\",\n unmuteCardButton: \".js-post-card-sns-user-mute-unmute-card-btn\",\n muteCardButton: \".js-post-card-sns-user-mute-mute-card-btn\",\n};\n\nclass PostCardSnsUserMuteComponent {\n constructor(rootElement = document) {\n this._setEvent(rootElement);\n }\n\n _setEvent(rootElement) {\n this._setUnmuteCardEvent(rootElement);\n this._setMuteCardEvent(rootElement);\n }\n\n _setUnmuteCardEvent(rootElement) {\n rootElement.querySelectorAll(SELECTORS.card).forEach((card) => {\n const unmuteCardButton = card.querySelector(SELECTORS.unmuteCardButton);\n unmuteCardButton.addEventListener(\"click\", (e) => {\n e.preventDefault();\n _toggleCard(card, false)\n });\n });\n }\n\n _setMuteCardEvent(rootElement) {\n rootElement.querySelectorAll(SELECTORS.muteCardButton).forEach((muteCardButton) => {\n const card = muteCardButton.closest(SELECTORS.card);\n muteCardButton.addEventListener(\"click\", (e) => {\n e.preventDefault();\n _toggleCard(card, true);\n });\n });\n }\n}\n\nconst _toggleCard = (card, isMute) => {\n const [info, caption, content] = [\n SELECTORS.info,\n SELECTORS.caption,\n SELECTORS.content,\n ].map((selector) => card.querySelector(selector));\n\n\n const isTwoColumnsMobile = _isTwoColumnsMobile(card);\n if (isMute) {\n isTwoColumnsMobile ? info.classList.remove(\"hidden\") : info.classList.add(\"hidden\", \"md:block\");\n caption.classList.remove(\"hidden\");\n content.classList.add(\"hidden\");\n } else {\n info.classList.add(\"hidden\");\n info.classList.remove(\"md:block\");\n caption.classList.add(\"hidden\");\n content.classList.remove(\"hidden\");\n }\n};\n\nconst _toggleMuteCardButton = (card, isMute) => {\n const muteCardButton = card.querySelector(SELECTORS.muteCardButton);\n\n if (isMute) {\n muteCardButton.classList.remove(\"hidden\");\n } else {\n muteCardButton.classList.add(\"hidden\");\n }\n};\n\nconst _isTwoColumnsMobile = (card) => {\n return card.dataset.isTwoColumnsMobile === \"true\";\n};\n\nconst _getCardsByUserId = (userId, rootElement = document) => {\n return rootElement.querySelectorAll(`${SELECTORS.card}[data-user-id=\"${userId}\"]`);\n}\n\nconst muteByUserId = (userId, rootElement = document) => {\n _getCardsByUserId(userId, rootElement).forEach((card) => {\n _toggleCard(card, true)\n _toggleMuteCardButton(card, true);\n });\n};\n\nconst unmuteByUserId = (userId, rootElement = document) => {\n _getCardsByUserId(userId, rootElement).forEach((card) => {\n _toggleCard(card, false)\n _toggleMuteCardButton(card, false);\n });\n}\n\nexport default PostCardSnsUserMuteComponent;\nexport { muteByUserId, unmuteByUserId };\n","import { CategoryModalView } from '../../../javascripts/category_modal_mobile';\nimport PostCardSnsUserMuteComponent, { muteByUserId, unmuteByUserId } from '../../../../components/mutes/post_card_sns_user_mute_component';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const categorySearch = document.querySelector(\"#announcement-category-search\");\n const statusSearch = document.querySelector(\"#announcement-status-search\");\n\n if (categorySearch) new CategoryModalView(categorySearch);\n if (statusSearch) new CategoryModalView(statusSearch);\n\n new PostCardSnsUserMuteComponent();\n addMuteUserEvent(document);\n addUnmuteUserEvent(document);\n initializeToggleMuteComponentMutationObserver();\n});\n\n// ユーザーをミュートした場合、ユーザーが投稿した他の投稿もミュートするイベントを登録する\nfunction addMuteUserEvent(node) {\n node.querySelectorAll('.js-mute-btn[data-type=\"User\"]').forEach((muteUserBtn) => {\n muteUserBtn.addEventListener('click', () => {\n $.modal.close();\n const userId = muteUserBtn.dataset.id;\n muteByUserId(userId);\n });\n });\n}\n\n// ユーザーをミュートを解除した場合、ユーザーが投稿した他の投稿もミュート解除するイベントを登録する\nfunction addUnmuteUserEvent(node) {\n node.querySelectorAll('.js-unmute-btn[data-type=\"User\"]').forEach((unmuteUserBtn) => {\n unmuteUserBtn.addEventListener('click', () => {\n $.modal.close();\n const userId = unmuteUserBtn.dataset.id;\n unmuteByUserId(userId);\n });\n });\n}\n\nfunction initializeToggleMuteComponentMutationObserver() {\n const mutationObserver = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n Array.from(mutation.addedNodes)\n .filter(node => node.nodeType === Node.ELEMENT_NODE)\n .forEach(node => {\n addMuteUserEvent(node);\n addUnmuteUserEvent(node);\n });\n });\n });\n const observeTarget = document.body;\n mutationObserver.observe(observeTarget, { childList: true });\n}\n","// TODO: statusの絞り込みにも使うので名前を変える\nexport class CategoryModalView {\n constructor(rootElement = document) {\n this.$modal = rootElement.querySelector('.js-category-modal');\n if (!this.$modal) return;\n\n this.$openButton = rootElement.querySelector('.js-open-category-modal');\n this.$closeButton = this.$modal.querySelector('.close');\n\n this.$openButton.addEventListener('click', () => this.show());\n this.$closeButton.addEventListener('click', () => this.hide());\n }\n\n show() {\n this.$modal.classList.add('isOpen');\n }\n\n hide() {\n this.$modal.classList.remove('isOpen');\n }\n}\n"],"sourceRoot":""}