{"version":3,"sources":["webpack:///../WCC.UI/App/components/topic/commentsFilters/commentsFilters.html?4ce1","webpack:///../WCC.UI/App/components/topic/commentsFilters/commentsFilters.scss?abfe","webpack:///../WCC.UI/App/components/topic/commentsFilters/commentsFilters.ts","webpack:///../WCC.UI/App/components/topic/commentsFilters/filter.ts","webpack:///../WCC.UI/App/components/topic/commentsFilters/filterHeader.html?a50e","webpack:///../WCC.UI/App/components/topic/commentsFilters/filterHeader.ts","webpack:///../WCC.UI/App/components/topic/commentsFilters/tagsFilter.html?94d0","webpack:///../WCC.UI/App/components/topic/commentsFilters/tagsFilter.ts","webpack:///../WCC.UI/App/components/topic/commentsFilters/tagsGroup.ts","webpack:///../WCC.UI/App/components/topic/commentsFilters/textFilter.html?2839","webpack:///../WCC.UI/App/components/topic/commentsFilters/textFilter.ts","webpack:///../WCC.UI/App/managers/tags/postsFiltering.ts","webpack:///../WCC.UI/App/webpack/runtime/htmlExposer.js","webpack:///../WCC.UI/App/components/topic/commentsFilters/commentsFilters.scss","webpack:///../WCC.UI/App/components/topic/commentsFilters/commentsFilters.html","webpack:///../WCC.UI/App/components/topic/commentsFilters/filterHeader.html","webpack:///../WCC.UI/App/components/topic/commentsFilters/tagsFilter.html","webpack:///../WCC.UI/App/components/topic/commentsFilters/textFilter.html"],"names":["content","expose","__esModule","default","api","module","i","options","exports","locals","components","registerLocal","require","preload","TopicCommentsFiltersVM","constructor","config","info","storage","effects","labels","filtersConfigs","ko","observableArray","filters","isActive","observable","isInactive","this","not","toggle","allowToToggle","applyChanges","forEach","f","reset","filtersObj","flattenComputed","searchString","mapNotNull","read","write","value","user","get","CurrentUserManager","pluck","m","person","userReady","isNotNull","discussion","DiscussionManager","discussionReady","postsFilteringType","pureComputed","_user","_discussion","_discussion2","_discussion3","status","enums","MembershipStatusTypes","Moderator","postsFilteringTypeForModerators","Observer","postsFilteringTypeForObservers","Member","postsFilteringTypeForParticipants","PostsFilteringTypes","NoFiltering","peopleTags","loadingPeopleTags","isReady","isVisible","length","extend","deferred","activeFiltersCount","reduce","result","filter","hasActiveFilters","is","v","hasChanges","any","filtersHaveChangesOrActive","register","undefined","FilterByText","push","title","ContentTextSearch","icon","type","placeholder","SearchContent","FilterByTags","PersonTags","peopleTagsIDs","tags","postsFilteringTagsManager","PostsFilteringTagsManager","settings","discussionId","withEffect","loading","applyBindingsToNode","element","__decorate","injectable","__param","inject","wccModules","componentConfig","componentInfo","TopicCommentFilterVM","defaultValue","outerValue","_","clone","compare","subscribe","left","right","unmanaged","TopicCommentsFilterHeaderVM","_ref","regularTagsGroupName","Other","TopicCommentsFiltersVMTagsFilterVM","super","tagsPickers","allowMultiple","tagsGroups","mapSingle","buildTagsGroups","sortBy","g","id","pickers","map","picker","selectedTag","subscribeNotNull","otherPicker","clear","selectedTagsIDs","concat","selectedTags","t","contentTagId","tagIDs","CollectionsHelpers","compareCollections","p","select","newTagIDs","DOMHelpers","onNodeEvent","document","body","e","onKeyDown","originalEvent","onKeyUp","window","keyCode","groups","tag","isComplex","group","find","tagRoot","TopicCommentsFiltersVMTagsGroup","add","internalTags","StringHelpers","toFirstCharUpperString","tagValue","TopicCommentsFiltersVMTextFilterVM","TagsManagerBase","memberStatus","addTag","jsonTag","Error","removeTag","ctx","tagsService","queries","moderatorPostsFilteringTags","toArray","observersPostsFilteringTags","system","SystemHelpers","html","getTemplatesAndResources","node","head","appendChild","___CSS_LOADER_API_IMPORT___"],"mappings":"yJAAA,UAAO,CACC,yHACA,wDAIC,KAJ4C,EAAF,SAAYA,EAASC,GAG5D,OADAA,EADAD,EAAUA,EAAQE,WAAaF,EAAQG,QAAUH,GAE1CA,GACV,4B,sFCNT,IAAII,EAAM,EAAQ,gFACFJ,EAAU,EAAQ,oKAIC,iBAFvBA,EAAUA,EAAQE,WAAaF,EAAQG,QAAUH,KAG/CA,EAAU,CAAC,CAACK,EAAOC,EAAIN,EAAS,MAG9C,IAAIO,EAAU,CAEd,OAAiB,OACjB,WAAoB,GAEPH,EAAIJ,EAASO,G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GAC3BnK,SAAQ,SAAUqK,GAAQrC,SAASsC,KAAKC,YAAYF,QAEhE,+B,oLCLD9L,EADkC,EAAQ,wDAChCiM,EAA4B,IAE9B9G,KAAK,CAACtF,EAAOC,EAAI,wzDAAyzD,KAEl1DD,EAAOG,QAAUA,G,oICHjBH,EAAOG,QAFI,k1D,iICEXH,EAAOG,QAFI,6nB,+HCEXH,EAAOG,QAFI,q6B,+HCEXH,EAAOG,QAFI","file":"130.9dfd8c7254cba488aa73.js","sourcesContent":["define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./commentsFilters.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./commentsFilters.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable, SubscribableOrNullableValue } from 'knockout';\r\nimport { CurrentUserManager } from 'managers/currentUser';\r\nimport DiscussionManager from 'managers/discussion';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport PostsFilteringTagsManager from 'managers/tags/postsFiltering';\r\nimport { withEffect } from 'mixins/withEffect';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport CommentsFilters from 'models/commentsFilters';\r\nimport { Tag } from 'models/tag';\r\nimport './commentsFilters.html';\r\nimport './commentsFilters.scss';\r\nimport TopicCommentFilterVM, { TopicCommentsFilterVMConfig } from './filter';\r\nimport { TopicCommentsFiltersVMTagsFilterConfig } from './tagsFilter';\r\nimport { TopicCommentsFiltersVMTextFilterConfig } from './textFilter';\r\n\r\ncomponents\r\n .registerLocal('topic-comments-text-filter', () => require('./textFilter'))\r\n .registerLocal('topic-comments-tags-filter', () => require('./tagsFilter'))\r\n .registerLocal('topic-comments-filter-header', () => require('./filterHeader'))\r\n .preload('sliding-container', 'tag-picker');\r\n\r\nexport interface TopicCommentsFiltersVMConfig {\r\n filters: SubscribableOrNullableValue\r\n}\r\n\r\n@injectable()\r\nexport default class TopicCommentsFiltersVM {\r\n labels = labels;\r\n\r\n filtersConfigs = ko.observableArray();\r\n filters = ko.observableArray();\r\n\r\n searchString: Subscribable\r\n activeFiltersCount: Subscribable\r\n\r\n isActive = ko.observable(false);\r\n isInactive = this.isActive.not();\r\n\r\n hasChanges: Subscribable\r\n hasActiveFilters: Subscribable\r\n allowToToggle: Subscribable\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) config: TopicCommentsFiltersVMConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\r\n @inject(wccModules.storage) storage: IWCCStorageManager,\r\n @inject(wccModules.effects) effects: EffectsContainer\r\n ) {\r\n const filtersObj = ko.flattenComputed(config.filters);\r\n\r\n this.searchString = filtersObj.mapNotNull({\r\n read: filters => filters.searchString(),\r\n write: (filters, value) => filters.searchString(value)\r\n });\r\n\r\n const userManager = storage.get(CurrentUserManager, { });\r\n const user = userManager.pluck(m => m.person);\r\n const userReady = user.isNotNull();\r\n\r\n const discussionManager = storage.get(DiscussionManager, {});\r\n const discussion = discussionManager.pluck(m => m.discussion);\r\n const discussionReady = discussion.isNotNull();\r\n\r\n const postsFilteringType = ko.pureComputed(() => {\r\n switch (user()?.status()) {\r\n case enums.MembershipStatusTypes.Moderator.value: return discussion()?.postsFilteringTypeForModerators();\r\n case enums.MembershipStatusTypes.Observer.value: return discussion()?.postsFilteringTypeForObservers();\r\n case enums.MembershipStatusTypes.Member.value: return discussion()?.postsFilteringTypeForParticipants();\r\n }\r\n }).default(enums.PostsFilteringTypes.NoFiltering.value);\r\n\r\n const peopleTags = ko.observableArray();\r\n const loadingPeopleTags = ko.observable(false);\r\n\r\n const isReady = ko.pureComputed(() => userReady() && discussionReady() && !loadingPeopleTags());\r\n const isVisible = ko.pureComputed(() => isReady() && this.filtersConfigs().length > 0).extend({ deferred: true });\r\n\r\n this.activeFiltersCount = this.filters.reduce((result, filter) => filter.isActive() ? result + 1 : result, () => 0);\r\n this.hasActiveFilters = this.activeFiltersCount.is(v => v > 0);\r\n\r\n this.hasChanges = this.filters.any(f => f.hasChanges());\r\n const filtersHaveChangesOrActive = this.filters.any(f => f.hasChanges() || f.isActive());\r\n this.allowToToggle = ko.pureComputed(() => !filtersHaveChangesOrActive());\r\n\r\n effects.register((filtersHaveChangesOrActive) => {\r\n if (filtersHaveChangesOrActive)\r\n this.isActive(true);\r\n }, [filtersHaveChangesOrActive]);\r\n\r\n effects.register((isReady, filtersObj, user, discussion, peopleTags) => {\r\n if (isReady && filtersObj != undefined && user != undefined && discussion != undefined) {\r\n const filtersConfigs = >[];\r\n\r\n if (postsFilteringType() & enums.PostsFilteringTypes.FilterByText.value) {\r\n filtersConfigs.push({\r\n title: labels.ContentTextSearch,\r\n icon: 'far fa-comment-alt-lines',\r\n type: 'topic-comments-text-filter',\r\n value: filtersObj.searchString,\r\n placeholder: labels.SearchContent\r\n });\r\n }\r\n\r\n if (postsFilteringType() & enums.PostsFilteringTypes.FilterByTags.value) {\r\n filtersConfigs.push({\r\n title: labels.PersonTags,\r\n icon: 'far fa-user',\r\n type: 'topic-comments-tags-filter',\r\n value: filtersObj.peopleTagsIDs,\r\n tags: peopleTags\r\n });\r\n }\r\n\r\n this.filtersConfigs(filtersConfigs);\r\n } else {\r\n this.filtersConfigs([]);\r\n }\r\n }, [isReady, filtersObj, user, discussion, peopleTags]);\r\n\r\n //load posts filtering tags\r\n effects.register(user => {\r\n peopleTags([]);\r\n loadingPeopleTags(true);\r\n\r\n //wait for user. we need to know user status\r\n if (user != undefined) {\r\n const postsFilteringTagsManager = new PostsFilteringTagsManager(settings.discussionId, user.status());\r\n\r\n return [\r\n postsFilteringTagsManager, //dispose manager on component dispose\r\n\r\n withEffect((loading, tags) => {\r\n peopleTags(loading ? [] : tags); //load tags into component array\r\n loadingPeopleTags(loading);\r\n }, [postsFilteringTagsManager.loading, postsFilteringTagsManager.tags])\r\n ];\r\n }\r\n }, [user]);\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'visible': isVisible,\r\n\r\n 'css': {\r\n 'wcc-not-selectable': true,\r\n 'topic-comments-filters': true,\r\n 'topic-comments-filters--toggable': this.allowToToggle,\r\n 'topic-comments-filters--active': this.isActive,\r\n 'topic-comments-filters--inactive': this.isInactive\r\n }\r\n });\r\n }\r\n\r\n toggle = () => {\r\n if (this.allowToToggle())\r\n this.isActive.toggle();\r\n } \r\n\r\n applyChanges = () => {\r\n this.filters().forEach(f => f.applyChanges());\r\n }\r\n\r\n reset = () => {\r\n this.filters().forEach(f => {\r\n f.reset();\r\n f.applyChanges();\r\n });\r\n }\r\n}","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable, unmanaged } from 'inversify';\r\nimport { Observable, PureComputed, Subscribable } from 'knockout';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport { TopicCommentsFilterType } from './filterTypes';\r\n\r\nexport interface TopicCommentsFilterVMConfig {\r\n title: string\r\n icon: string\r\n type: TopicCommentsFilterType\r\n value: Observable\r\n}\r\n\r\n@injectable()\r\nexport default abstract class TopicCommentFilterVM {\r\n protected outerValue: Observable\r\n\r\n labels = labels\r\n\r\n title: string\r\n icon: string\r\n\r\n value: Observable\r\n\r\n hasChanges = ko.observable(false);\r\n isActive: Subscribable\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) public config: TopicCommentsFilterVMConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\r\n @inject(wccModules.effects) effects: EffectsContainer, \r\n @unmanaged() private defaultValue: T\r\n ) {\r\n this.outerValue = config.value;\r\n\r\n this.title = config.title;\r\n this.icon = config.icon;\r\n\r\n this.value = ko.observable(_.clone(this.outerValue()));\r\n\r\n this.isActive = this.value.is(value => !this.compare(value, defaultValue));\r\n\r\n effects.register([\r\n this.outerValue.subscribe(value => {\r\n if (!this.compare(this.value(), value))\r\n this.value(_.clone(value));\r\n\r\n this.hasChanges(false);\r\n }),\r\n\r\n this.value.subscribe(value => {\r\n this.hasChanges(!this.compare(value, this.outerValue()));\r\n }) \r\n ]);\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'css': {\r\n 'topic-comments-filters__filter': true,\r\n 'topic-comments-filters__filter--active': this.isActive\r\n }\r\n });\r\n }\r\n\r\n applyChanges = () => {\r\n if (this.hasChanges())\r\n this.outerValue(_.clone(this.value()));\r\n }\r\n\r\n reset = () => {\r\n this.value(_.clone(this.defaultValue));\r\n }\r\n\r\n protected compare(left: T, right: T) {\r\n return left == right;\r\n }\r\n}","define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./filterHeader.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable } from 'knockout';\r\nimport TopicCommentFilterVM from './filter';\r\nimport './filterHeader.html';\r\n\r\nexport interface TopicCommentsFilterHeaderVMConfig {\r\n filter: TopicCommentFilterVM\r\n}\r\n\r\n@injectable()\r\nexport default class TopicCommentsFilterHeaderVM {\r\n private filter: TopicCommentFilterVM\r\n\r\n title: string\r\n icon: string\r\n\r\n isActive: Subscribable\r\n \r\n constructor(\r\n @inject(wccModules.componentConfig) { filter }: TopicCommentsFilterHeaderVMConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\r\n ) {\r\n this.filter = filter;\r\n\r\n this.title = filter.title;\r\n this.icon = filter.icon;\r\n\r\n this.isActive = filter.isActive;\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'css': {\r\n 'topic-comments-filters__filter__header': true\r\n }\r\n });\r\n }\r\n\r\n reset = () => {\r\n this.filter.reset();\r\n }\r\n}","define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./tagsFilter.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","import TagsPickerVM from 'components/tags/picker/picker';\r\nimport { wccModules } from 'enums/wccModules';\r\nimport { DOMHelpers } from 'helpers/dom';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable, SubscribableOrNullableValue } from 'knockout';\r\nimport { withEffect } from 'mixins/withEffect';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport { Tag } from 'models/tag';\r\nimport { CollectionsHelpers } from '../../../helpers/collections';\r\nimport TopicCommentFilterVM, { TopicCommentsFilterVMConfig } from './filter';\r\nimport './tagsFilter.html';\r\nimport TopicCommentsFiltersVMTagsGroup from './tagsGroup';\r\n\r\nconst regularTagsGroupName = labels.Other;\r\nconst shiftKeyCode = 16;\r\n\r\nexport interface TopicCommentsFiltersVMTagsFilterConfig extends TopicCommentsFilterVMConfig> {\r\n tags: SubscribableOrNullableValue>\r\n}\r\n\r\n@injectable()\r\nexport default class TopicCommentsFiltersVMTagsFilterVM extends TopicCommentFilterVM> {\r\n tagsPickers = ko.observableArray();\r\n tagsGroups: Subscribable>\r\n\r\n allowMultiple = ko.observable(false);\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) config: TopicCommentsFiltersVMTagsFilterConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\r\n @inject(wccModules.effects) effects: EffectsContainer\r\n ) {\r\n super(config, info, effects, []);\r\n\r\n const tags = ko.flattenComputed(config.tags, []);\r\n\r\n this.tagsGroups = tags.mapSingle(tags => this.buildTagsGroups(tags)).sortBy(g => g.title).sortBy(g => g.id == regularTagsGroupName);\r\n\r\n const isReady = ko.pureComputed(() => tags().length > 0);\r\n\r\n //we need to sync pickers in case we don't allow to select multiple picker\r\n effects.register((pickers, allowMultiple) => {\r\n if (!allowMultiple) {\r\n //track every picker selection change\r\n return pickers.map(picker => picker.selectedTag.subscribeNotNull(() => {\r\n //on change we clear other pickers so only one tag will be selected\r\n pickers.forEach(otherPicker => {\r\n if (otherPicker != picker)\r\n otherPicker.clear();\r\n });\r\n }));\r\n }\r\n }, [this.tagsPickers, this.allowMultiple]);\r\n\r\n //We need to wire all our pickers to value field\r\n effects.register((tagsGroups, tagsPickers) => {\r\n //when pickers are ready\r\n if (tagsPickers.length > 0 && tagsPickers.length == tagsGroups.length) {\r\n const selectedTagsIDs = ko.pureComputed(() => tagsPickers.reduce((result, picker) => result.concat(picker.selectedTags().map(t => t.contentTagId())), >[]));\r\n\r\n return [\r\n //load IDs into pickers on value field change\r\n withEffect(tagIDs => {\r\n if (!CollectionsHelpers.compareCollections(tagIDs, selectedTagsIDs()))\r\n tagsPickers.forEach(p => p.select(tagIDs));\r\n }, [this.value]),\r\n\r\n //and on pickers selection change we write it into value field\r\n withEffect(newTagIDs => {\r\n if (!CollectionsHelpers.compareCollections(newTagIDs, this.value()))\r\n this.value(newTagIDs);\r\n }, [selectedTagsIDs])\r\n ];\r\n }\r\n }, [this.tagsGroups, this.tagsPickers]);\r\n\r\n effects.register([\r\n DOMHelpers.onNodeEvent(document.body, 'keydown', e => this.onKeyDown(e.originalEvent)),\r\n DOMHelpers.onNodeEvent(document.body, 'keyup', e => this.onKeyUp(e.originalEvent)),\r\n DOMHelpers.onNodeEvent(window, 'blur', () => this.allowMultiple(false))\r\n ]);\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'visible': isReady,\r\n\r\n 'css': {\r\n 'topic-comments-filters__tags-filter': true\r\n }\r\n });\r\n }\r\n\r\n protected override compare(left: Array, right: Array) {\r\n return CollectionsHelpers.compareCollections(left, right);\r\n }\r\n\r\n private onKeyDown(e: KeyboardEvent) {\r\n if (e.keyCode == shiftKeyCode)\r\n this.allowMultiple(true);\r\n }\r\n\r\n private onKeyUp(e: KeyboardEvent) {\r\n if (e.keyCode == shiftKeyCode)\r\n this.allowMultiple(false);\r\n }\r\n\r\n /**\r\n * builds groups from tags\r\n * @param tags tags list\r\n */\r\n private buildTagsGroups(tags: Array) {\r\n return tags.reduce((groups, tag) => {\r\n if (tag.isComplex()) {\r\n //each complex tag create it's own group with root as group name\r\n\r\n let group = groups.find(g => g.id == tag.tagRoot());\r\n\r\n if (group == undefined) {\r\n group = new TopicCommentsFiltersVMTagsGroup(tag.tagRoot());\r\n groups.push(group);\r\n }\r\n\r\n group.add(tag);\r\n } else {\r\n //regular tags go in \"Other\" group\r\n\r\n let group = groups.find(g => g.id == regularTagsGroupName);\r\n\r\n if (group == undefined) {\r\n group = new TopicCommentsFiltersVMTagsGroup(regularTagsGroupName);\r\n groups.push(group);\r\n }\r\n\r\n group.add(tag);\r\n }\r\n\r\n return groups;\r\n }, >[]);\r\n }\r\n}","import { StringHelpers } from 'helpers/string';\r\nimport { Subscribable } from 'knockout';\r\nimport { Tag } from 'models/tag';\r\n\r\nexport default class TopicCommentsFiltersVMTagsGroup {\n private internalTags = ko.observableArray([]);\n\n title: string\r\n tags: Subscribable>\r\n\r\n constructor(public id: string) {\r\n this.title = StringHelpers.toFirstCharUpperString(id);\r\n this.tags = this.internalTags.sortBy(t => t.tagValue());\r\n }\r\n\r\n add(tag: Tag) {\r\n this.internalTags.push(tag);\r\n }\r\n}","define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./textFilter.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable, SubscribableOrNullableValue } from 'knockout';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport TopicCommentFilterVM, { TopicCommentsFilterVMConfig } from './filter';\r\nimport './textFilter.html';\r\n\r\nexport interface TopicCommentsFiltersVMTextFilterConfig extends TopicCommentsFilterVMConfig {\r\n placeholder: SubscribableOrNullableValue\r\n}\r\n\r\n@injectable()\r\nexport default class TopicCommentsFiltersVMTextFilterVM extends TopicCommentFilterVM {\r\n placeholder: Subscribable\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) config: TopicCommentsFiltersVMTextFilterConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\r\n @inject(wccModules.effects) effects: EffectsContainer\r\n ) {\r\n super(config, info, effects, '');\r\n\r\n this.placeholder = ko.flattenComputed(config.placeholder); \r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'css': {\r\n 'topic-comments-filters__text-filter': true\r\n }\r\n });\r\n }\r\n}","import { JSONTag, Tag } from 'models/tag';\r\nimport TagsManagerBase from './base';\r\n\r\nexport default class PostsFilteringTagsManager extends TagsManagerBase {\r\n constructor(private discussionId: string, private memberStatus: number) {\r\n super();\r\n }\r\n\r\n addTag(jsonTag: JSONTag): Promise {\r\n throw new Error('Unsupported operation');\r\n }\r\n\r\n removeTag(tag: Tag): Promise {\r\n throw new Error('Unsupported operation');\r\n }\r\n\r\n protected async load() {\r\n switch (this.memberStatus) {\r\n case enums.MembershipStatusTypes.Moderator.value: return this.ctx.tagsService.queries.moderatorPostsFilteringTags(this.discussionId).toArray();\r\n case enums.MembershipStatusTypes.Observer.value: return this.ctx.tagsService.queries.observersPostsFilteringTags(this.discussionId).toArray();\r\n default: return [];\r\n }\r\n }\r\n}","define(function () {\r\n const system = require('helpers/system').SystemHelpers;\r\n\r\n return function (html) {\r\n system.getTemplatesAndResources(html)\r\n .forEach(function (node) { document.head.appendChild(node) });\r\n }\r\n});","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".topic-comments-filters{display:block;background-color:#fff;border-radius:4px}.topic-comments-filters.topic-comments-filters--inactive .topic-comments-filters__header{border-radius:4px}.topic-comments-filters--toggable .topic-comments-filters__header{cursor:pointer}.topic-comments-filters__header{font-weight:bold;display:flex;justify-content:space-between;align-items:center;height:40px;padding:0 10px;border-bottom:1px solid #c6c6c6}.topic-comments-filters__header__content{display:flex;align-items:center;gap:10px}.topic-comments-filters__header__controls{display:flex;align-items:center;gap:5px}.topic-comments-filters__header__toggle{margin-left:15px}.topic-comments-filters__header__toggle .fa-chevron-down{transition:transform 250ms ease-in-out}.topic-comments-filters__header__icon{font-size:16px}.topic-comments-filters__filter{display:block;background-color:transparent;transition:background-color ease-in-out 450ms;border-bottom:1px solid #c6c6c6}.topic-comments-filters__filter:last-child{border-bottom:none}.topic-comments-filters__filter--active{background-color:#d5f1d8}.topic-comments-filters__filter__header,.topic-comments-filters__filter__body{position:relative}.topic-comments-filters__filter__header{font-size:12px;font-weight:bold;display:flex;align-items:center;justify-content:space-between;padding:3px 30px 3px 50px;border-bottom:1px dashed #c6c6c6;line-height:36px}.topic-comments-filters__filter__header__icon{position:absolute;top:0;right:calc(100% - 40px);bottom:0;display:flex;align-items:center;font-size:18px}.topic-comments-filters__filter__body{padding:10px 30px 10px 50px}.topic-comments-filters__tags-filters-group{margin-bottom:10px}.topic-comments-filters__tags-filters-group__title{margin-bottom:3px;font-weight:bold;font-size:12px}.topic-comments-filters__filter__help-text{color:#7a7a7a;margin-top:15px}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;"],"sourceRoot":""}