{"version":3,"sources":["webpack:///../WCC.UI/App/components/editors/thread/text/managers/content.ts","webpack:///../WCC.UI/App/components/editors/thread/text/textThread.scss?1547","webpack:///../WCC.UI/App/components/editors/thread/text/textThread.ts","webpack:///../WCC.UI/App/components/editors/thread/text/textThreadBody.html?7abd","webpack:///../WCC.UI/App/components/editors/thread/text/textThreadBody.scss?29dc","webpack:///../WCC.UI/App/components/editors/thread/text/textThreadBody.ts","webpack:///../WCC.UI/App/components/editors/thread/text/textThreadInlineFooter.html?d1ca","webpack:///../WCC.UI/App/components/editors/thread/text/textThreadInlineFooter.scss?9bca","webpack:///../WCC.UI/App/components/editors/thread/text/textThreadInlineFooter.ts","webpack:///../WCC.UI/App/components/editors/thread/text/whisperButton.html?957c","webpack:///../WCC.UI/App/components/editors/thread/text/whisperButton.scss?3903","webpack:///../WCC.UI/App/components/editors/thread/text/whisperButton.ts","webpack:///../WCC.UI/App/managers/ideation.ts","webpack:///../WCC.UI/App/managers/topic/comment/replies.ts","webpack:///../WCC.UI/App/managers/topic/contentPlaceholders.ts","webpack:///../WCC.UI/App/managers/topic/votes.ts","webpack:///../WCC.UI/App/models/threadVote.ts","webpack:///../WCC.UI/App/components/editors/thread/text/textThread.scss","webpack:///../WCC.UI/App/components/editors/thread/text/textThreadBody.scss","webpack:///../WCC.UI/App/components/editors/thread/text/textThreadInlineFooter.scss","webpack:///../WCC.UI/App/components/editors/thread/text/whisperButton.scss","webpack:///../WCC.UI/App/components/editors/thread/text/textThreadBody.html","webpack:///../WCC.UI/App/components/editors/thread/text/textThreadInlineFooter.html","webpack:///../WCC.UI/App/components/editors/thread/text/whisperButton.html"],"names":["TextThreadEditorContentManager","constructor","topic","user","threadOwner","isReply","forcedTextMode","allowedMediaTypes","ko","pureComputed","this","getAllowedMediaTypes","textIsAllowed","checkIfTextIsAllowed","imagesAreAllowed","includes","enums","ThreadMediaTypes","Images","value","filesAreAllowed","Files","videoIsAllowed","Video","audioIsAllowed","Audio","mediaIsRequired","checkIfMediaIsRequired","isRegular","isMediaOnly","isDocumentsCollection","isVoxPop","participantsReplyType","ParticipantsReplyTypes","OnlyVideo","shouldApplyMediaRulesToComments","topicContentType","TopicContentTypes","TextComments","MultipleComments","MediaOnly","CollectionOfDocuments","Ideation","shouldApplyMediaRulesToReplies","Survey","VirtualPinBoard","HeatMap","VideoPresentation","person","undefined","checkIfMediaIsRequiredForVoxPop","isThreadMediaMandatory","isSurvey","isPinBoard","participantsCommentType","ParticipantsCommentTypes","_this$getAllowedMedia","parsedAllowedMediaTypes","getAllowedMediaTypesForVoxPop","isScreenRecording","api","content","__esModule","default","module","i","options","exports","locals","components","registerLocal","require","TextThreadEditorVM","ThreadEditorVM","config","info","storage","ctx","effects","super","errorsShown","observable","isForcedTextMode","titleEditor","textEditor","isTitleEditorNeeded","checkIfTitleEditorNeeded","isCaptionEditorNeeded","checkIfCaptionEditorNeeded","isVoxPopMessageNeeded","checkIfVoxPopMessageNeeded","isMaterialUIShowing","materialUIEnabled","pickContent","type","onPickContent","pickImage","attachmentsManager","pickFiles","pickVideo","pickAudio","uploadImage","fileOrBlob","uploadFile","uploadVideo","removeAttachment","attachment","isFocusedOnRender","flattenComputed","focus","initialTitle","thread","pluck","th","title","titleAllowed","length","placeholdersManager","get","TopicContentPlaceholdersManager","topicId","contentManager","isReplyEditor","register","TopicMediaManager","attachments","images","videos","uploads","titlePlaceholder","m","read","_this$titleEditor$con","_this$titleEditor","write","_this$titleEditor2","setContent","extend","validate","validateTitle","textPlaceholder","replyPlaceholder","commentPlaceholder","text","_this$textEditor$cont","_this$textEditor","_this$textEditor2","validateText","noMediaAllowed","textMode","imagesMode","filesMode","videoMode","allowedFilesExtensions","allowedAttachmentExtensions","isUserAModerator","isUserAnObserver","hasMedia","checkIfHasMedia","applyBindingsToNode","element","showText","pick","validateMedia","reduce","result","error","checkIfReady","_this$placeholdersMan","_this$placeholdersMan2","_this$titleEditor3","_this$textEditor3","ready","isReady","checkIfBusy","checkIfHasChanges","checkIfTextIsMandatory","reset","getSaveData","getState","state","Title","ThreadContent","Attachments","map","a","toJson","ThreadTypes","Text","setState","_state$Attachments","_state$ThreadContent","_state$Title","attachmentsFactory","createAttachment","whenNotNull","then","editor","when","getStateFromThread","trim","messages","TitleCantBeEmpty","MessageCantBeEmpty","InvalidRequest","YouMustAttachAtleastSomethingToThisPost","isMediaCaptionRequired","every","AttachmentShouldHaveTitle","TextHelpers","checkIfHasAllowedMedia","video","mediaCaptionType","ThreadMediaCaptionTypes","Nothing","hasSpecialCommentForm","parentThreadId","__decorate","injectable","__param","inject","wccModules","componentConfig","componentInfo","servicesContext","expose","Keyboard","Quill","import","preload","TextThreadEditorBodyVM","id","_","uniqueId","labels","isImageDropareaShown","isFilesDropareaShown","isVideoDropareaShown","isDropAreaShown","forceTextMode","emojisAllowed","emojis","mediaSize","titleEditorPlaceHolder","titleEditorFocusNeeded","titleEditorConfig","placeholder","formats","noBorder","bindings","key","keys","TAB","handler","textEditorPlaceholder","textEditorFocusNeeded","textEditorConfig","background","toolbar","right","tools","push","EmojisTool","icon","insertEmoji","isPinned","placement","mediaManager","media","any","imageDroparea","onDrop","file","filesDroparea","videoDroparea","disabled","settings","addPipeEnabled","proxyTaskResources","click","onBodyClick","hasFocus","TextThreadEditorInlineFooterVM","_ref","allowToSave","allowToCancel","save","cancel","parentThread","isPrivate","_parentThread","visibleToId","TextThreadEditorWhisperButtonVM","hasPeopleToWhisper","whisperList","saveWhisper","allowToWhisper","saveAdvanced","Visibility","ThreadVisibility","Private","saveDirectWhisper","VisibleToId","personId","VisibleToFullName","fullName","threadOwnerId","parentThreadRepliesCount","parentThreadHasNoReplies","userManager","CurrentUserManager","discussionId","userReady","loading","userId","u","userName","nicknameOrName","isModerator","repliesManager","CommentRepliesManager","commentId","isEmpty","view","isLoadingReplies","allReplies","replies","ideationManager","IdeationManager","ideationReady","isIdeation","isRankingStage","isRatingStage","concat","list","isObserver","some","item","postedById","creatorName","imageURL","creatorImageUrl","isSelected","isRegularUser","TopicManager","t","stage","ideationStage","upvotesCount","ideationUpvotes","downvotesCount","ideationDownvotes","votesManager","TopicVotesManager","loadingVotes","votes","personUpvotes","filter","v","personDownvotes","usedUpvotes","r","availableUpvotes","usedDownvotes","availableDownvotes","hasUpvotes","is","count","hasDownvotes","IdeationStages","IdeaRating","isDoneVoting","isVotingStage","managerConfig","signalREvents","source","busy","requestsProcessed","updating","CollectionDataSource","load","bind","update","mapper","jsonThread","TopicThread","TopicThreadsEventsManager","commentsService","events","newTopicReply","on","onNewReply","replyAdded","onLocalReplyAdded","replyUpdated","onLocalReplyUpdated","replyDeleted","onLocalReplyDeleted","queries","commentReplies","addArgs","toArrayPost","reply","getThread","threadId","important","firstOrDefault","Error","parenThreadId","add","each","isInToDoList","replyId","findSync","isDeleted","storageDefaults","storageIgnore","task","TaskManager","taskId","strictComputed","_this$getTitlePlaceho","getTitlePlaceholder","getCommentPlaceholder","getReplyPlaceholder","GiveYourIdeaATitle","WhatIsYourIdea","WhatWouldYouLikeToSay","ideation","CommentOnThisPost","WhyDidYouVoteThisWay","isHomework","AnythingElseYouWouldLikeToAdd","topicsService","jsonVote","ThreadVote","withEffect","toArray","WCCEntity","json","createField","linkedThreadId","___CSS_LOADER_API_IMPORT___"],"mappings":"2QAIc,MAAOA,EAWjBC,YACYC,EACAC,EACAC,EACAC,EACAC,GAJA,KAAAJ,QACA,KAAAC,OACA,KAAAC,cACA,KAAAC,UACA,KAAAC,iBAfJ,KAAAC,kBAAoBC,EAAGC,aAAa,IAAMC,KAAKC,wBAEvD,KAAAC,cAAgBJ,EAAGC,aAAa,IAAMC,KAAKG,wBAC3C,KAAAC,iBAAmBN,EAAGC,aAAa,IAAMC,KAAKH,oBAAoBQ,SAASC,EAAMC,iBAAiBC,OAAOC,QACzG,KAAAC,gBAAkBZ,EAAGC,aAAa,IAAMC,KAAKH,oBAAoBQ,SAASC,EAAMC,iBAAiBI,MAAMF,QACvG,KAAAG,eAAiBd,EAAGC,aAAa,IAAMC,KAAKH,oBAAoB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A,EAAAC,YAAOC,IAAWjJ,UAClB+I,EAAA,EAAAC,YAAOC,IAAWoN,gBAClBtN,EAAA,EAAAC,YAAOC,IAAW/I,WAbNmR,W,yIChBrB,4EASc,MAAOkF,UAAmBG,IAMpCrb,YAAYsb,GACRxW,QAEArE,KAAKqS,SAAWrS,KAAK8a,YAAYD,EAAM,YACvC7a,KAAK0Y,SAAW1Y,KAAK8a,YAAYD,EAAM,YACvC7a,KAAKS,MAAQT,KAAK8a,YAAYD,EAAM,YAAa,GACjD7a,KAAK+a,eAAiB/a,KAAK8a,YAAYD,EAAM,qB,6KCpBrDpX,EADkC,EAAQ,wDAChCuX,EAA4B,IAE9BrL,KAAK,CAACrM,EAAOC,EAAI,utBAAwtB,KAEjvBD,EAAOG,QAAUA,G,iLCJjBA,EADkC,EAAQ,wDAChCuX,EAA4B,IAE9BrL,KAAK,CAACrM,EAAOC,EAAI,iOAAoO,KAE7PD,EAAOG,QAAUA,G,yLCJjBA,EADkC,EAAQ,wDAChCuX,EAA4B,IAE9BrL,KAAK,CAACrM,EAAOC,EAAI,smBAAumB,KAEhoBD,EAAOG,QAAUA,G,gLCJjBA,EADkC,EAAQ,wDAChCuX,EAA4B,IAE9BrL,KAAK,CAACrM,EAAOC,EAAI,GAAI,KAE7BD,EAAOG,QAAUA,G,iICHjBH,EAAOG,QAFI,8oH,yICEXH,EAAOG,QAFI,oyC,gICEXH,EAAOG,QAFI","file":"9.22d5baf8812a78cbd313.js","sourcesContent":["import { Subscribable } from 'knockout';\r\nimport { Person } from 'models/person';\r\nimport { Topic } from 'models/topic';\r\n\r\nexport default class TextThreadEditorContentManager {\r\n private allowedMediaTypes = ko.pureComputed(() => this.getAllowedMediaTypes()); \r\n\r\n textIsAllowed = ko.pureComputed(() => this.checkIfTextIsAllowed())\r\n imagesAreAllowed = ko.pureComputed(() => this.allowedMediaTypes().includes(enums.ThreadMediaTypes.Images.value));\r\n filesAreAllowed = ko.pureComputed(() => this.allowedMediaTypes().includes(enums.ThreadMediaTypes.Files.value));\r\n videoIsAllowed = ko.pureComputed(() => this.allowedMediaTypes().includes(enums.ThreadMediaTypes.Video.value));\r\n audioIsAllowed = ko.pureComputed(() => this.allowedMediaTypes().includes(enums.ThreadMediaTypes.Audio.value));\r\n\r\n mediaIsRequired = ko.pureComputed(() => this.checkIfMediaIsRequired());\r\n\r\n constructor(\r\n private topic: Subscribable,\r\n private user: Subscribable,\r\n private threadOwner: Subscribable,\r\n private isReply: Subscribable,\r\n private forcedTextMode: Subscribable\r\n ) { }\r\n\r\n private checkIfTextIsAllowed() {\r\n var topic = this.topic(),\r\n threadOwner = this.threadOwner();\r\n\r\n if (topic != null && threadOwner != null) {\r\n if (!threadOwner.isRegular() || this.forcedTextMode())\r\n return true;\r\n\r\n if (topic.isMediaOnly() || topic.isDocumentsCollection())\r\n return this.isReply();\r\n\r\n if (topic.isVoxPop())\r\n return this.isReply() && topic.participantsReplyType() !== enums.ParticipantsReplyTypes.OnlyVideo.value;\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private shouldApplyMediaRulesToComments(topic: Topic) {\r\n switch (topic.topicContentType()) {\r\n case enums.TopicContentTypes.TextComments.value:\r\n case enums.TopicContentTypes.MultipleComments.value:\r\n case enums.TopicContentTypes.MediaOnly.value:\r\n case enums.TopicContentTypes.CollectionOfDocuments.value:\r\n case enums.TopicContentTypes.Ideation.value:\r\n return true;\r\n\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n private shouldApplyMediaRulesToReplies(topic: Topic) {\r\n switch (topic.topicContentType()) {\r\n case enums.TopicContentTypes.TextComments.value:\r\n case enums.TopicContentTypes.MultipleComments.value:\r\n case enums.TopicContentTypes.Survey.value:\r\n case enums.TopicContentTypes.MediaOnly.value:\r\n case enums.TopicContentTypes.CollectionOfDocuments.value:\r\n case enums.TopicContentTypes.VirtualPinBoard.value:\r\n case enums.TopicContentTypes.HeatMap.value:\r\n return true;\r\n\r\n case enums.TopicContentTypes.VideoPresentation.value:\r\n return false; //true if presentationType === WCC.Enums.VideoPresentationTypes.PresentationAndSurvey.value\r\n\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n private checkIfMediaIsRequired() {\r\n const topic = this.topic();\r\n const person = this.threadOwner();\r\n\r\n if (topic != undefined && person != undefined) {\r\n if (!person.isRegular())\r\n return false;\r\n\r\n if (topic.isVoxPop())\r\n return this.checkIfMediaIsRequiredForVoxPop(topic);\r\n\r\n if (!topic.isThreadMediaMandatory())\r\n return false;\r\n\r\n return !this.isReply() && !(topic.isSurvey() || topic.isPinBoard());\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private checkIfMediaIsRequiredForVoxPop(topic: Topic) {\r\n if (!this.isReply())\r\n return topic.participantsCommentType() == enums.ParticipantsCommentTypes.OnlyVideo.value || !this.forcedTextMode();\r\n\r\n return false;\r\n }\r\n\r\n private getAllowedMediaTypes() {\r\n const topic = this.topic();\r\n const threadOwner = this.threadOwner();\r\n const user = this.user();\r\n\r\n if (topic != undefined && threadOwner != undefined && user != undefined) {\r\n if (!threadOwner.isRegular())\r\n return topic.parsedAllowedMediaTypes();\r\n\r\n if (topic.isVoxPop())\r\n return this.getAllowedMediaTypesForVoxPop(topic) ?? [];\r\n\r\n if (topic.isScreenRecording() && !user.isRegular() && threadOwner.isRegular())\r\n return [enums.ThreadMediaTypes.Video.value];\r\n\r\n var apply = !this.isReply() && this.shouldApplyMediaRulesToComments(topic) ||\r\n this.isReply() && this.shouldApplyMediaRulesToReplies(topic);\r\n\r\n if (apply)\r\n return topic.parsedAllowedMediaTypes();\r\n }\r\n\r\n return [];\r\n }\r\n\r\n private getAllowedMediaTypesForVoxPop(topic: Topic) {\r\n if (!this.isReply()) {\r\n return this.forcedTextMode() ? [] : [enums.ThreadMediaTypes.Video.value];\r\n } else {\r\n return topic.participantsReplyType() === enums.ParticipantsReplyTypes.OnlyVideo.value ?\r\n [enums.ThreadMediaTypes.Video.value] :\r\n topic.parsedAllowedMediaTypes();\r\n }\r\n }\r\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!./textThread.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 { IChatEditorVM } from 'components/editors/chat/chat.interfaces';\r\nimport { ThreadContentTypes } from 'enums/comments/contentTypes';\r\nimport { wccModules } from 'enums/wccModules';\r\nimport attachmentsFactory from 'factories/attachments';\r\nimport { TextHelpers } from 'helpers/text';\r\nimport { BlobWrapper } from 'interfaces/blobWrapper';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Observable, ObservableArray, Subscribable, SubscribableOrNullableValue } from 'knockout';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport TopicContentPlaceholdersManager from 'managers/topic/contentPlaceholders';\r\nimport TopicMediaManager from 'managers/topic/media';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport WCCAttachment from 'models/attachments/attachment';\r\nimport WCCImage from 'models/attachments/image';\r\nimport WCCVideo from 'models/attachments/video';\r\nimport { JSONTopicThread, TopicThread } from 'models/topicThread';\r\nimport WCCUpload from 'models/upload';\r\nimport { ServicesContext } from 'services/context';\r\nimport ThreadEditorVM from '../thread';\r\nimport { ThreadEditorVMConfig } from '../thread.interfaces';\r\nimport TextThreadEditorContentManager from './managers/content';\r\nimport './textThread.scss';\r\n\r\ncomponents\r\n .registerLocal('thread-editor-text-body', () => require('./textThreadBody'))\r\n .registerLocal('thread-editor-text-inline-footer', () => require('./textThreadInlineFooter'))\r\n .registerLocal('thread-editor-text-whisper-button', () => require('./whisperButton'));\r\n\r\nexport interface TextThreadEditorVMConfig extends ThreadEditorVMConfig {\r\n focus?: SubscribableOrNullableValue\r\n title?: SubscribableOrNullableValue\r\n}\r\n\r\n@injectable()\r\nexport default class TextThreadEditorVM extends ThreadEditorVM {\r\n private placeholdersManager: Subscribable\r\n private contentManager: TextThreadEditorContentManager\r\n\r\n private hasMedia: Subscribable\r\n\r\n errorsShown = ko.observable(false);\r\n isForcedTextMode = ko.observable(false);\r\n\r\n attachmentsManager: TopicMediaManager\r\n attachments: ObservableArray\r\n images: Subscribable>\r\n videos: Subscribable>\r\n uploads: Subscribable>\r\n\r\n titleEditor = ko.observable();\r\n titlePlaceholder: Subscribable\r\n title: Observable\r\n\r\n textEditor = ko.observable();\r\n textPlaceholder: Subscribable\r\n text: Observable \r\n \r\n isFocusedOnRender: Subscribable\r\n\r\n titleAllowed: Subscribable\r\n textIsAllowed: Subscribable\r\n imagesAreAllowed: Subscribable\r\n filesAreAllowed: Subscribable\r\n videoIsAllowed: Subscribable\r\n audioIsAllowed: Subscribable\r\n noMediaAllowed: Subscribable\r\n mediaIsRequired: Subscribable\r\n\r\n textMode: Subscribable\r\n imagesMode: Subscribable\r\n filesMode: Subscribable\r\n videoMode: Subscribable\r\n\r\n allowedFilesExtensions: Subscribable>\r\n\r\n isTitleEditorNeeded = ko.pureComputed(() => this.checkIfTitleEditorNeeded())\r\n isCaptionEditorNeeded = ko.pureComputed(() => this.checkIfCaptionEditorNeeded())\r\n isVoxPopMessageNeeded = ko.pureComputed(() => this.checkIfVoxPopMessageNeeded())\r\n isMaterialUIShowing = ko.pureComputed(() => this.materialUIEnabled());\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) config: TextThreadEditorVMConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\r\n @inject(wccModules.storage) storage: IWCCStorageManager,\r\n @inject(wccModules.servicesContext) ctx: ServicesContext,\r\n @inject(wccModules.effects) effects: EffectsContainer\r\n ) {\r\n super(config, info, storage, ctx, effects);\r\n\r\n this.isFocusedOnRender = ko.flattenComputed(config.focus, false);\r\n\r\n const initialTitle = this.thread.pluck(th => th.title, '');\r\n const titleAllowed = ko.flattenComputed(config.title, false);\r\n this.titleAllowed = ko.pureComputed(() => titleAllowed() || initialTitle().length > 0);\r\n\r\n this.placeholdersManager = storage.get(TopicContentPlaceholdersManager, { topicId: this.topicId });\r\n\r\n this.contentManager = new TextThreadEditorContentManager(this.topic, this.user, this.threadOwner, this.isReplyEditor, this.isForcedTextMode);\r\n this.attachmentsManager = effects.register(new TopicMediaManager({ topic: this.topic }));\r\n\r\n this.attachments = this.attachmentsManager.attachments;\r\n this.images = this.attachmentsManager.images;\r\n this.videos = this.attachmentsManager.videos;\r\n this.uploads = this.attachmentsManager.uploads;\r\n\r\n this.titlePlaceholder = this.placeholdersManager.pluck(m => m.titlePlaceholder, '');\r\n this.title = ko.pureComputed({\r\n read: () => this.titleEditor()?.content() ?? '',\r\n write: value => this.titleEditor()?.setContent(value, false)\r\n }).extend({ validate: () => this.validateTitle() });\r\n\r\n this.textPlaceholder = this.placeholdersManager.pluck(m => this.isReplyEditor() ? m.replyPlaceholder() : m.commentPlaceholder(), '');\r\n this.text = ko.pureComputed({\r\n read: () => this.textEditor()?.content() ?? '',\r\n write: value => this.textEditor()?.setContent(value, false)\r\n }).extend({ validate: () => this.validateText() });\r\n \r\n this.textIsAllowed = this.contentManager.textIsAllowed;\r\n this.imagesAreAllowed = this.contentManager.imagesAreAllowed;\r\n this.filesAreAllowed = this.contentManager.filesAreAllowed;\r\n this.videoIsAllowed = this.contentManager.videoIsAllowed;\r\n this.audioIsAllowed = this.contentManager.audioIsAllowed;\r\n this.noMediaAllowed = ko.pureComputed(() => !this.imagesAreAllowed() && !this.filesAreAllowed() && !this.videoIsAllowed() && !this.audioIsAllowed());\r\n this.mediaIsRequired = this.contentManager.mediaIsRequired;\r\n\r\n this.textMode = ko.pureComputed(() => this.textIsAllowed());\r\n this.imagesMode = ko.pureComputed(() => !this.textMode() && this.imagesAreAllowed());\r\n this.filesMode = ko.pureComputed(() => !this.textMode() && !this.imagesMode() && this.filesAreAllowed());\r\n this.videoMode = ko.pureComputed(() => !this.textMode() && !this.imagesMode() && !this.filesMode() && this.videoIsAllowed());\r\n\r\n this.allowedFilesExtensions = this.topic.pluck(topic => topic.allowedAttachmentExtensions, []);\r\n\r\n const isUserAModerator = this.threadOwner.pluck('isModerator', false);\r\n const isUserAnObserver = this.threadOwner.pluck('isObserver', false);\r\n\r\n this.hasMedia = ko.pureComputed(() => this.checkIfHasMedia());\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'css': {\r\n 'moderator': isUserAModerator,\r\n 'observer': isUserAnObserver\r\n }\r\n }, this);\r\n } \r\n\r\n pickContent = (type: ThreadContentTypes) => {\r\n this.onPickContent(type);\r\n }\r\n\r\n pickImage = () => {\r\n return this.attachmentsManager.pickImage();\r\n }\r\n\r\n pickFiles = () => {\r\n return this.attachmentsManager.pickFiles();\r\n }\r\n\r\n pickVideo = () => {\r\n return this.attachmentsManager.pickVideo();\r\n }\r\n\r\n pickAudio = () => {\r\n return this.attachmentsManager.pickAudio();\r\n }\r\n\r\n uploadImage = (fileOrBlob: File | BlobWrapper) => {\r\n return this.attachmentsManager.uploadImage(fileOrBlob);\r\n }\r\n\r\n uploadFile = (fileOrBlob: File | BlobWrapper) => {\r\n return this.attachmentsManager.uploadFile(fileOrBlob);\r\n }\r\n\r\n uploadVideo = (fileOrBlob: File | BlobWrapper) => {\r\n return this.attachmentsManager.uploadVideo(fileOrBlob);\r\n }\r\n\r\n removeAttachment = (attachment: WCCAttachment) => {\r\n this.attachmentsManager.removeAttachment(attachment);\r\n }\r\n\r\n protected showText() { };\r\n\r\n protected onPickContent(type: ThreadContentTypes) {\r\n switch (type) {\r\n case 'text':\r\n this.showText();\r\n break;\r\n default:\r\n this.attachmentsManager.pick(type);\r\n }\r\n }\r\n\r\n protected validate() {\r\n this.errorsShown(false);\r\n this.errorsShown(true);\r\n\r\n return [\r\n this.validateTitle(),\r\n this.validateText(),\r\n this.validateMedia()\r\n ].reduce((result, error) => result ?? error, undefined);\r\n }\r\n\r\n protected override checkIfReady() {\r\n return super.checkIfReady() &&\r\n (this.placeholdersManager()?.ready() ?? false) &&\r\n (!this.isTitleEditorNeeded() || this.titleEditor()?.isReady() || false) &&\r\n this.attachmentsManager.isReady() &&\r\n (!this.textIsAllowed() || this.textEditor()?.isReady() || false);\r\n }\r\n\r\n protected override checkIfBusy() {\r\n return this.uploads().length > 0;\r\n }\r\n\r\n protected override checkIfHasChanges() {\r\n return super.checkIfHasChanges() ||\r\n this.title().length > 0 ||\r\n this.text().length > 0 ||\r\n this.attachments().length > 0 ||\r\n this.uploads().length > 0 ||\r\n this.isForcedTextMode();\r\n }\r\n\r\n protected checkIfTextIsMandatory() {\r\n return false;\r\n }\r\n\r\n protected override reset() {\r\n super.reset();\r\n\r\n this.title('');\r\n this.text('');\r\n this.attachments([]);\r\n this.isForcedTextMode(false);\r\n this.errorsShown(false);\r\n }\r\n\r\n protected getSaveData() {\r\n return this.getState();\r\n }\r\n\r\n protected getState() {\r\n const topic = this.topic();\r\n\r\n const state: JSONTopicThread = {\r\n Title: this.title(),\r\n ThreadContent: this.text(),\r\n Attachments: this.attachments().map(a => a.toJson())\r\n }\r\n\r\n if (topic != undefined) {\r\n if (topic.isVoxPop())\r\n state['ThreadType'] = this.videoMode() ? enums.ThreadTypes.Video.value : enums.ThreadTypes.Text.value;\r\n }\r\n\r\n return state;\r\n }\r\n\r\n protected setState(state: JSONTopicThread) {\r\n const topic = this.topic();\r\n\r\n const attachments = (state.Attachments ?? []).map(a => attachmentsFactory.createAttachment(a));\r\n const text = state.ThreadContent ?? '';\r\n const title = state.Title ?? '';\r\n\r\n if (topic?.isVoxPop())\r\n this.isForcedTextMode(text.length > 0);\r\n\r\n //We might just enabled text so we need to wait for editor to get rendered\r\n if (this.textIsAllowed()) {\r\n this.textEditor.whenNotNull().then(editor => editor.isReady.when()).then(() => this.text(text));\r\n\r\n if (this.isTitleEditorNeeded())\r\n this.titleEditor.whenNotNull().then(editor => editor.isReady.when()).then(() => this.title(title));\r\n }\r\n \r\n this.attachments(attachments); \r\n }\r\n\r\n protected getStateFromThread(thread: TopicThread) {\r\n return thread.toJson();\r\n }\r\n\r\n private validateTitle() {\r\n if (this.isTitleEditorNeeded() && this.title().trim().length === 0)\r\n return messages.TitleCantBeEmpty;\r\n }\r\n\r\n private validateText() {\r\n if (this.textIsAllowed() && this.text().trim().length === 0 && (this.checkIfTextIsMandatory() || !this.hasMedia()))\r\n return messages.MessageCantBeEmpty;\r\n }\r\n\r\n private validateMedia() {\r\n const topic = this.topic();\r\n const threadOwner = this.threadOwner();\r\n\r\n if (topic != undefined && threadOwner != undefined) {\r\n if (this.mediaIsRequired()) {\r\n var hasMedia = this.hasMedia();\r\n\r\n if (!hasMedia)\r\n return messages.YouMustAttachAtleastSomethingToThisPost;\r\n }\r\n\r\n if (this.isCaptionEditorNeeded() && topic.isMediaCaptionRequired()) {\r\n var captionsAreValid = this.attachments().length === 0 || this.attachments().every(a => a.title().length > 0);\r\n\r\n if (!captionsAreValid)\r\n return messages.AttachmentShouldHaveTitle;\r\n }\r\n } else {\r\n return messages.InvalidRequest;\r\n }\r\n }\r\n\r\n private checkIfHasMedia() {\r\n return this.attachments().length > 0 ||\r\n TextHelpers.checkIfHasAllowedMedia(this.text(), { images: this.imagesAreAllowed(), video: this.videoIsAllowed() });\r\n }\r\n\r\n private checkIfTitleEditorNeeded() {\r\n return this.textIsAllowed() && this.titleAllowed();\r\n }\r\n\r\n private checkIfCaptionEditorNeeded() {\r\n var topic = this.topic(),\r\n threadOwner = this.threadOwner();\r\n\r\n if (topic != undefined && threadOwner != undefined) {\r\n if (!threadOwner.isRegular())\r\n return false;\r\n\r\n if (topic.mediaCaptionType() === enums.ThreadMediaCaptionTypes.Nothing.value)\r\n return false;\r\n\r\n if (topic.isVoxPop())\r\n return this.isReplyEditor() && topic.participantsReplyType() !== enums.ParticipantsReplyTypes.OnlyVideo.value;\r\n\r\n return topic.hasSpecialCommentForm() ? this.isReplyEditor() : !this.isReplyEditor();\r\n }\r\n\r\n return false;\r\n } \r\n\r\n private checkIfVoxPopMessageNeeded() {\r\n var topic = this.topic(),\r\n threadOwner = this.threadOwner();\r\n\r\n if (topic != undefined && threadOwner != undefined) {\r\n return topic.isVoxPop() &&\r\n threadOwner.isRegular() &&\r\n this.parentThreadId() == undefined &&\r\n topic.participantsCommentType() !== enums.ParticipantsCommentTypes.OnlyVideo.value &&\r\n !this.isForcedTextMode() &&\r\n this.uploads().length === 0 &&\r\n this.attachments().length === 0;\r\n }\r\n\r\n return false;\r\n }\r\n}","define([\n \"!!../../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./textThreadBody.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!./textThreadBody.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 { DropAreaVMConfig } from 'components/droparea/droparea';\r\nimport { ChatEditorVMConfig, IChatEditorVM } from 'components/editors/chat/chat.interfaces';\r\nimport { EmojisTool } from 'components/editors/chat/tools/emojis/emojis';\r\nimport { Tool } from 'components/editors/chat/tools/tool';\r\nimport { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Observable, Subscribable, SubscribableOrNullableValue } from 'knockout';\r\nimport TopicMediaManager from 'managers/topic/media';\r\nimport Quill from 'quill';\r\nimport TextThreadEditorVM from './textThread';\r\nimport './textThreadBody.html';\r\nimport './textThreadBody.scss';\r\n\r\nconst Keyboard = Quill.import('modules/keyboard');\r\n\r\ncomponents.preload('chat-editor', 'wcc-droparea', 'thread-media');\r\n\r\ninterface TextThreadEditorBodyVMConfig {\r\n editor: TextThreadEditorVM,\r\n mediaSize: SubscribableOrNullableValue\r\n emojis: SubscribableOrNullableValue\r\n}\r\n\r\n@injectable()\r\nexport default class TextThreadEditorBodyVM {\r\n private editor: TextThreadEditorVM\r\n\r\n id = _.uniqueId('text-thread-editor-body-')\r\n labels = labels\r\n\r\n errorsShown: Observable\r\n\r\n titleEditorConfig: ChatEditorVMConfig\r\n titleEditor: Observable\r\n title: Observable\r\n\r\n textEditorConfig: ChatEditorVMConfig\r\n textEditor: Observable\r\n text: Observable\r\n\r\n imageDroparea: DropAreaVMConfig\r\n filesDroparea: DropAreaVMConfig\r\n videoDroparea: DropAreaVMConfig\r\n\r\n mediaManager: TopicMediaManager\r\n mediaSize: SubscribableOrNullableValue\r\n hasMedia: Subscribable\r\n\r\n textIsAllowed: Subscribable\r\n\r\n textMode: Subscribable\r\n imagesMode: Subscribable\r\n filesMode: Subscribable\r\n videoMode: Subscribable\r\n\r\n isTitleEditorNeeded: Subscribable\r\n isCaptionEditorNeeded: Subscribable\r\n isVoxPopMessageNeeded: Subscribable\r\n isMaterialUIShowing: Subscribable\r\n\r\n isImageDropareaShown = ko.pureComputed(() => this.imagesMode());\r\n isFilesDropareaShown = ko.pureComputed(() => this.filesMode());\r\n isVideoDropareaShown = ko.pureComputed(() => this.videoMode() && !this.hasMedia());\r\n isDropAreaShown = ko.pureComputed(() => this.isImageDropareaShown() || this.isFilesDropareaShown() || this.isVideoDropareaShown());\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) config: TextThreadEditorBodyVMConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo\r\n ) {\r\n const emojisAllowed = ko.flattenComputed(config.emojis, true);\r\n this.mediaSize = config.mediaSize;\r\n\r\n this.editor = config.editor;\r\n this.errorsShown = this.editor.errorsShown;\r\n\r\n this.textIsAllowed = this.editor.textIsAllowed;\r\n\r\n this.textMode = this.editor.textMode;\r\n this.imagesMode = this.editor.imagesMode;\r\n this.filesMode = this.editor.filesMode;\r\n this.videoMode = this.editor.videoMode;\r\n\r\n this.isTitleEditorNeeded = this.editor.isTitleEditorNeeded;\r\n this.isCaptionEditorNeeded = this.editor.isCaptionEditorNeeded;\r\n this.isVoxPopMessageNeeded = this.editor.isVoxPopMessageNeeded;\r\n this.isMaterialUIShowing = this.editor.isMaterialUIShowing;\r\n\r\n this.titleEditor = this.editor.titleEditor;\r\n this.title = this.editor.title;\r\n\r\n const titleEditorPlaceHolder = this.editor.titlePlaceholder;\r\n const titleEditorFocusNeeded = ko.pureComputed(() => this.isTitleEditorNeeded() && this.editor.isFocusedOnRender());\r\n\r\n this.titleEditorConfig = {\r\n placeholder: titleEditorPlaceHolder,\r\n focus: titleEditorFocusNeeded,\r\n formats: [],\r\n noBorder: true,\r\n\r\n bindings: {\r\n 'tab': { key: Keyboard.keys.TAB, handler: () => true }\r\n }\r\n }\r\n\r\n this.textEditor = this.editor.textEditor;\r\n this.text = this.editor.text;\r\n\r\n const textEditorPlaceholder = this.editor.textPlaceholder;\r\n const textEditorFocusNeeded = ko.pureComputed(() => !this.isTitleEditorNeeded() && this.editor.isFocusedOnRender());\r\n\r\n this.textEditorConfig = {\r\n placeholder: textEditorPlaceholder,\r\n focus: textEditorFocusNeeded,\r\n background: false,\r\n noBorder: true,\r\n\r\n formats: ['wcc-emoji'],\r\n\r\n bindings: {\r\n //'handleShiftEnter': { key: Keyboard.keys.ENTER, shiftKey: true, handler: () => this.editor.save() },\r\n 'tab': { key: Keyboard.keys.TAB, handler: () => true }\r\n },\r\n\r\n toolbar: {\r\n right: [\r\n {\r\n tools: editor => {\r\n const tools: Array = [];\r\n\r\n if (emojisAllowed())\r\n tools.push(new EmojisTool({ icon: 'far fa-smile', pick: editor.insertEmoji }));\r\n\r\n return tools;\r\n },\r\n\r\n isPinned: true\r\n }\r\n ],\r\n\r\n placement: 'top'\r\n }\r\n }\r\n\r\n this.mediaManager = this.editor.attachmentsManager;\r\n this.hasMedia = this.mediaManager.media.any();\r\n\r\n this.imageDroparea = {\r\n onDrop: file => this.editor.uploadImage(file)\r\n }\r\n\r\n this.filesDroparea = {\r\n onDrop: file => this.editor.uploadFile(file)\r\n }\r\n\r\n this.videoDroparea = {\r\n onDrop: file => this.editor.uploadVideo(file),\r\n disabled: settings.addPipeEnabled && !settings.proxyTaskResources\r\n }\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'click': () => this.onBodyClick(),\r\n\r\n 'css': {\r\n 'thread-editor-text-body': true\r\n }\r\n }, this);\r\n }\r\n\r\n pickImage = () => {\r\n this.editor.pickImage();\r\n }\r\n\r\n pickFiles = () => {\r\n this.editor.pickFiles();\r\n }\r\n\r\n pickVideo = () => {\r\n this.editor.pickVideo();\r\n }\r\n\r\n forceTextMode = () => {\r\n this.editor.isForcedTextMode(true);\r\n }\r\n\r\n private onBodyClick() {\r\n const hasFocus = this.titleEditor()?.hasFocus() || this.textEditor()?.hasFocus() || false;\r\n\r\n if (!hasFocus) {\r\n if (this.isTitleEditorNeeded())\r\n this.titleEditor()?.focus();\r\n else\r\n this.textEditor()?.focus();\r\n }\r\n }\r\n}","define([\n \"!!../../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./textThreadInlineFooter.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!./textThreadInlineFooter.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 TextThreadEditorVM from './textThread';\r\nimport './textThreadInlineFooter.html';\r\nimport './textThreadInlineFooter.scss';\r\n\r\ninterface TextThreadEditorInlineFooterVMConfig {\r\n editor: TextThreadEditorVM\r\n}\r\n\n@injectable()\nexport default class TextThreadEditorInlineFooterVM {\n labels = labels\n\n editor: TextThreadEditorVM\n\n imagesAreAllowed = ko.pureComputed(() => this.editor.imagesAreAllowed());\n videoIsAllowed = ko.pureComputed(() => this.editor.videoIsAllowed());\n audioIsAllowed = ko.pureComputed(() => this.editor.audioIsAllowed());\n \n allowToSave = ko.pureComputed(() => this.editor.allowToSave());\n allowToCancel = ko.pureComputed(() => this.editor.allowToCancel());\n\n constructor(\n @inject(wccModules.componentConfig) { editor }: TextThreadEditorInlineFooterVMConfig,\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo\n ) {\n this.editor = editor;\n\n const { parentThread } = editor;\n\n const isReady = ko.pureComputed(() => editor.isReady());\n const isPrivate = ko.pureComputed(() => parentThread()?.visibleToId() != undefined);\n\n ko.applyBindingsToNode(info.element, {\n 'visible': isReady,\n\n 'css': {\r\n 'thread-editor-text-inline-footer': true,\r\n 'thread-editor-text-inline-footer--private': isPrivate\r\n }\r\n }, this);\n }\n\n save = () => this.editor.save()\n cancel = () => this.editor.cancel()\n\n pickImage = () => {\r\n this.editor.pickImage();\n }\n\n pickVideo = () => {\n this.editor.pickVideo();\n }\n\n pickAudio = () => {\n this.editor.pickAudio();\r\n }\n}","define([\n \"!!../../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./whisperButton.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!./whisperButton.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 { Observable, Subscribable } from 'knockout';\r\nimport { CurrentUserManager } from 'managers/currentUser';\r\nimport IdeationManager from 'managers/ideation';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport CommentRepliesManager from 'managers/topic/comment/replies';\r\nimport { TopicThread } from 'models/topicThread';\r\nimport TextThreadEditorVM from './textThread';\r\nimport './whisperButton.html';\r\nimport './whisperButton.scss';\r\n\r\ncomponents.preload('wcc-list');\r\n\r\ninterface WhisperToPerson {\r\n fullName: Subscribable\r\n imageURL: Subscribable\r\n personId: Subscribable\r\n isSelected: Observable\r\n}\r\n\r\ninterface TextThreadEditorWhisperButtonVMConfig {\r\n editor: TextThreadEditorVM\r\n}\r\n\n@injectable()\nexport default class TextThreadEditorWhisperButtonVM {\n private editor: TextThreadEditorVM\n private parentThread: Subscribable\n\n private allowToWhisper: Subscribable\n\n labels = labels\n\n userId: Subscribable\n userName: Subscribable\n\n whisperList: Subscribable>\n hasPeopleToWhisper = ko.pureComputed(() => this.whisperList().length > 0) \n\n allowToSave = ko.pureComputed(() => this.editor.allowToSave())\n\n constructor(\n @inject(wccModules.componentConfig) { editor }: TextThreadEditorWhisperButtonVMConfig,\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\n @inject(wccModules.storage) storage: IWCCStorageManager\n ) {\n this.editor = editor;\n\n const { threadOwnerId, topicId, topic, parentThread } = editor;\n\n this.parentThread = parentThread;\n const parentThreadId = parentThread.pluck('id');\n const parentThreadRepliesCount = parentThread.pluck('repliesCount', 0);\n const parentThreadHasNoReplies = ko.pureComputed(() => parentThreadRepliesCount() === 0);\n\n const userManager = storage.get(CurrentUserManager, { discussionId: settings.discussionId });\n const userReady = userManager.pluck(m => !m.loading(), false);\n const user = userManager.pluck(m => m.person);\n this.userId = user.pluck(u => u.personId);\n this.userName = user.pluck(u => u.nicknameOrName, '');\n const isModerator = user.pluck(u => u.isModerator, false);\n\n const repliesManager = storage.get(CommentRepliesManager, { topicId, commentId: parentThreadId, isEmpty: parentThreadHasNoReplies, view: 'all' });\n const isLoadingReplies = repliesManager.pluck('loading', true);\n const allReplies = repliesManager.pluck(m => m.replies, []);\n\n const ideationManager = storage.get(IdeationManager, { topicId });\n const ideationReady = ideationManager.pluck(m => m.isReady, false);\n const isIdeation = ideationManager.pluck(m => m.isIdeation, false);\n const isRankingStage = ideationManager.pluck(m => m.isRatingStage, false);\n\n const isReady = ko.pureComputed(() => {\n return isModerator() &&\n editor.isReady() &&\n userReady() &&\n ideationReady() &&\n (parentThread() == undefined || !isLoadingReplies());\n });\n\n this.allowToWhisper = ko.pureComputed(() => {\n const currentTopic = topic();\n\n if (currentTopic != undefined) {\n return isReady() &&\r\n isModerator() &&\r\n this.userId() == threadOwnerId() &&\r\n this.parentThread() != undefined &&\r\n (!isIdeation() || isRankingStage());\r\n }\r\n\r\n return false;\r\n });\n\n this.whisperList = ko.pureComputed(() => {\n const parentThread = this.parentThread();\n\n if (parentThread == undefined)\n return [];\n\n return [parentThread].concat(allReplies()).reduce((list, thread) => {\n const isValid = !thread.isModerator() &&\n !thread.isObserver() &&\n !list.some(item => item.personId() === thread.postedById());\n\n if (isValid)\n list.push({\n fullName: thread.creatorName,\r\n imageURL: thread.creatorImageUrl,\r\n personId: thread.postedById,\r\n isSelected: ko.observable(thread.postedById() === parentThread.visibleToId())\r\n });\n\n return list;\r\n }, [] as Array);\n });\n\n ko.applyBindingsToNode(info.element, {\n 'visible': this.allowToWhisper,\n\n 'css': {\r\n 'thread-editor-text-whisper-button': true\r\n }\r\n }, this);\n }\n\n saveWhisper = () => {\n if (this.allowToWhisper()) {\n this.editor.saveAdvanced({\n Visibility: enums.ThreadVisibility.Private.value\n });\n }\n }\n\n saveDirectWhisper = (person: WhisperToPerson) => {\n if (this.allowToWhisper()) {\n this.editor.saveAdvanced({\n Visibility: enums.ThreadVisibility.Private.value,\r\n VisibleToId: person.personId(),\r\n VisibleToFullName: person.fullName()\r\n });\n }\n }\n}","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { PureComputed, Subscribable } from 'knockout';\r\nimport { CurrentUserManager } from 'managers/currentUser';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport { TopicManager } from 'managers/topic';\r\nimport TopicVotesManager from './topic/votes';\r\n\r\nexport interface TopicVotesManagerConfig {\r\n topicId: string\r\n}\r\n\r\n@injectable()\r\nexport default class IdeationManager {\r\n stage: Subscribable\r\n\r\n availableUpvotes: Subscribable\r\n availableDownvotes: Subscribable\r\n\r\n hasUpvotes: Subscribable\r\n hasDownvotes: Subscribable\r\n\r\n isIdeation: Subscribable\r\n isRatingStage: Subscribable\r\n isVotingStage: Subscribable\r\n isDoneVoting: Subscribable\r\n\r\n isReady: Subscribable\r\n\r\n constructor(\r\n @inject(wccModules.managerConfig) { topicId }: TopicVotesManagerConfig,\r\n @inject(wccModules.storage) storage: IWCCStorageManager\r\n ) {\r\n const userManager = storage.get(CurrentUserManager, { discussionId: settings.discussionId });\r\n const user = userManager.pluck(m => m.person);\r\n const isRegularUser = user.pluck(u => u.isRegular, false);\r\n\r\n const topicManager = storage.get(TopicManager, { topicId });\r\n const topic = topicManager.pluck(m => m.topic);\r\n this.isIdeation = topic.pluck(t => t.isIdeation, false);\r\n this.stage = topic.pluck(t => t.ideationStage, 0);\r\n const upvotesCount = topic.pluck(t => t.ideationUpvotes, 0);\r\n const downvotesCount = topic.pluck(t => t.ideationDownvotes, 0);\r\n\r\n const votesManager = storage.get(TopicVotesManager, { topicId: topicId });\r\n const loadingVotes = votesManager.pluck(m => m.loading, true);\r\n const votes = votesManager.pluck(m => m.votes, []);\r\n\r\n const personUpvotes = votes.filter(v => v.value() > 0);\r\n const personDownvotes = votes.filter(v => v.value() < 0);\r\n\r\n const usedUpvotes = personUpvotes.reduce((r, v) => r + v.value(), () => 0);\r\n this.availableUpvotes = ko.pureComputed(() => isRegularUser() ? upvotesCount() - usedUpvotes() : 0);\r\n\r\n const usedDownvotes = personDownvotes.reduce((r, v) => r - v.value(), () => 0);\r\n this.availableDownvotes = ko.pureComputed(() => isRegularUser() ? downvotesCount() - usedDownvotes() : 0);\r\n\r\n this.hasUpvotes = this.availableUpvotes.is(count => count > 0);\r\n this.hasDownvotes = this.availableDownvotes.is(count => count > 0);\r\n\r\n this.isRatingStage = ko.pureComputed(() => this.stage() === enums.IdeationStages.IdeaRating.value);\r\n this.isDoneVoting = this.availableUpvotes.is(0);\r\n\r\n this.isVotingStage = ko.pureComputed(() => this.isIdeation() && isRegularUser() && this.isRatingStage() && !this.isDoneVoting());\r\n\r\n this.isReady = ko.pureComputed(() => !this.isIdeation() || user() != undefined && topic() != undefined && !loadingVotes());\r\n } \r\n}","import storageDefaults from 'decorators/storageDefaults';\r\nimport storageIgnore from 'decorators/storageIgnore';\r\nimport { RepliesViews } from 'enums/replies/views';\r\nimport { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { CollectionDataSource } from 'managers/datasources/collection';\r\nimport events from 'managers/events';\r\nimport SignalREventsManager from 'managers/signalR/events';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport { JSONTopicThread, TopicThread } from 'models/topicThread';\r\nimport { ServicesContext } from 'services/context';\r\nimport TopicThreadsEventsManager from '../threads/eventsProcessor';\r\n\r\nexport interface CommentRepliesManagerConfig {\r\n topicId: string\r\n commentId: string\r\n view: RepliesViews\r\n isEmpty: boolean\r\n}\r\n\r\n@injectable()\n@storageDefaults(>{ view: 'all' })\n@storageIgnore('isEmpty')\nexport default class CommentRepliesManager {\n private source: CollectionDataSource\n\n private topicId: string\n private commentId: string\n private view: RepliesViews\n\n replies = ko.pureComputed(() => this.source.list());\n\n busy = ko.pureComputed(() => this.source.busy());\n loading = ko.pureComputed(() => this.source.busy() && this.source.requestsProcessed() === 0);\n updating = ko.pureComputed(() => this.source.busy() && this.source.requestsProcessed() > 0);\n\n constructor(\n @inject(wccModules.managerConfig) { topicId, commentId, view, isEmpty }: CommentRepliesManagerConfig,\n @inject(wccModules.servicesContext) private ctx: ServicesContext,\n @inject(wccModules.storage) storage: IWCCStorageManager,\n @inject(wccModules.signalREvents) signalREvents: SignalREventsManager,\n @inject(wccModules.effects) effects: EffectsContainer\n ) {\n this.topicId = topicId;\n this.commentId = commentId;\n this.view = view;\n\n this.source = effects.register(new CollectionDataSource({\n key: 'id',\n load: this.load.bind(this),\n update: this.update.bind(this),\n mapper: jsonThread => new TopicThread(jsonThread),\n isEmpty: isEmpty\n }));\n\n effects.register(new TopicThreadsEventsManager({\n topicId: this.topicId,\n source: this.source\n }, ctx, storage, signalREvents));\n\n ctx.commentsService.events.newTopicReply.on(this.onNewReply.bind(this)); \n\n effects.register([\n events.replyAdded.on(this.onLocalReplyAdded.bind(this)),\n events.replyUpdated.on(this.onLocalReplyUpdated.bind(this)),\n events.replyDeleted.on(this.onLocalReplyDeleted.bind(this))\n ]); \r\n }\n\n private load() {\r\n return this.ctx\r\n .commentsService\r\n .queries\r\n .commentReplies(this.commentId)\r\n .addArgs({ '$orderby': 'TopicThreadId asc', 'view': this.view })\r\n .background()\r\n .toArrayPost({ '': this.replies().map(r => r.id()) });\r\n }\r\n\r\n private async update(reply: TopicThread) {\r\n reply.update(await this.getThread(reply.id()));\r\n }\n\n private async getThread(threadId?: string) {\n if (threadId)\n return await this.ctx.commentsService.queries.thread(threadId).important().firstOrDefault();\n else\n throw new Error(messages.InvalidRequest);\r\n }\n\n private onNewReply(threadId: string, parenThreadId: string, topicId: string) {\n if (this.topicId === topicId && this.commentId === parenThreadId)\n this.source.load(true);\n } \n\n private onLocalReplyAdded(topicId: string, commentId: string, jsonThread: JSONTopicThread) {\n if (this.topicId === topicId && this.commentId === commentId) {\n this.source.add(jsonThread);\n _(this.replies()).each(reply => reply.isInToDoList(false));\n }\n }\n\n private onLocalReplyUpdated(topicId: string, commentId: string, replyId: string, jsonThread: JSONTopicThread) {\n if (this.topicId === topicId && this.commentId === commentId)\n this.source.findSync(replyId, reply => reply.update(jsonThread));\n }\n\n private onLocalReplyDeleted(topicId: string, commentId: string, replyId: string) {\n if (this.topicId === topicId && this.commentId === commentId)\n this.source.findSync(replyId, reply => reply.isDeleted(true));\n } \n}","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { PureComputed } from 'knockout';\r\nimport { CurrentUserManager } from 'managers/currentUser';\r\nimport IdeationManager from 'managers/ideation';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport TaskManager from 'managers/task';\r\nimport { TopicManager } from 'managers/topic';\r\nimport { Person } from 'models/person';\r\nimport Task from 'models/task';\r\nimport { Topic } from 'models/topic';\r\n\r\nconst { discussionId } = settings;\r\n\r\nexport interface TopicContentPlaceholdersManagerConfig {\r\n topicId: string\r\n}\r\n\r\n@injectable()\r\nexport default class TopicContentPlaceholdersManager {\r\n titlePlaceholder: PureComputed\r\n commentPlaceholder: PureComputed\r\n replyPlaceholder: PureComputed\r\n\r\n ready: PureComputed\r\n\r\n constructor(\r\n @inject(wccModules.managerConfig) { topicId }: TopicContentPlaceholdersManagerConfig,\r\n @inject(wccModules.storage) storage: IWCCStorageManager\r\n ) {\r\n const userManager = storage.get(CurrentUserManager, { discussionId });\r\n const user = userManager.pluck(m => m.person);\r\n\r\n const taskManager = storage.get(TaskManager, { taskId: discussionId });\r\n const task = taskManager.pluck(m => m.task);\r\n\r\n const topicManager = storage.get(TopicManager, { topicId });\r\n const topic = topicManager.pluck(m => m.topic);\r\n\r\n const ideationManager = storage.get(IdeationManager, { topicId });\r\n\r\n this.titlePlaceholder = ko.strictComputed((user, topic) => {\r\n if (user != undefined && topic != undefined)\r\n return this.getTitlePlaceholder(user, topic) ?? '';\r\n\r\n return '';\r\n }, [user, topic]);\r\n\r\n this.commentPlaceholder = ko.strictComputed((user, topic) => {\r\n if (user != undefined && topic != undefined)\r\n return this.getCommentPlaceholder(user, topic);\r\n\r\n return '';\r\n }, [user, topic]);\r\n\r\n this.replyPlaceholder = ko.strictComputed((user, task, topic, ideationManager) => {\r\n if (user != undefined && task != undefined && topic != undefined && ideationManager != undefined)\r\n return this.getReplyPlaceholder(user, task, topic, ideationManager);\r\n\r\n return '';\r\n }, [user, task, topic, ideationManager]);\r\n\r\n this.ready = ko.pureComputed(() => user() != undefined && task() != undefined && topic() != undefined);\r\n }\r\n\r\n private getTitlePlaceholder(user: Person, topic: Topic) {\r\n let result = topic.titlePlaceholder();\r\n\r\n if (result == undefined && topic.isIdeation() && user.isRegular())\r\n return labels.GiveYourIdeaATitle;\r\n\r\n return result;\r\n }\r\n\r\n private getCommentPlaceholder(user: Person, topic: Topic) {\r\n let result = topic.commentPlaceholder();\r\n\r\n if (result == undefined || user.isModerator() || user.isObserver()) {\r\n if (topic.isIdeation() && user.isRegular())\r\n return labels.WhatIsYourIdea;\r\n else\r\n return labels.WhatWouldYouLikeToSay;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n private getReplyPlaceholder(user: Person, task: Task, topic: Topic, ideation: IdeationManager) {\r\n let result = topic.replyPlaceholder();\r\n\r\n if (result == undefined || user.isModerator() || user.isObserver()) {\r\n if (topic.isIdeation()) {\r\n if (ideation.isVotingStage() && !user.isModerator() && !user.isObserver())\r\n return labels.WhyDidYouVoteThisWay;\r\n else\r\n return labels.CommentOnThisPost;\r\n } else if (task.isHomework()) {\r\n return labels.AnythingElseYouWouldLikeToAdd;\r\n } else {\r\n return labels.CommentOnThisPost;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { PureComputed, Subscribable } from 'knockout';\r\nimport { CollectionDataSource } from 'managers/datasources/collection';\r\nimport events from 'managers/events';\r\nimport IdeationManager from 'managers/ideation';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport { withEffect } from 'mixins/withEffect';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport ThreadVote, { JSONThreadVote } from 'models/threadVote';\r\nimport { TopicsService } from 'services/topics';\r\n\r\nexport interface TopicVotesManagerConfig {\r\n topicId: string\r\n}\r\n\r\n@injectable()\r\nexport default class TopicVotesManager {\r\n private topicId: string\r\n private source: CollectionDataSource\r\n\r\n votes: Subscribable>\r\n\r\n loading: PureComputed\r\n updating: PureComputed\r\n\r\n constructor(\r\n @inject(wccModules.managerConfig) { topicId }: TopicVotesManagerConfig,\r\n @inject(wccModules.storage) storage: IWCCStorageManager,\r\n @inject(wccModules.topicsService) private topicsService: TopicsService,\r\n @inject(wccModules.effects) effects: EffectsContainer,\r\n ) {\r\n this.topicId = topicId;\r\n\r\n this.source = effects.register(new CollectionDataSource({\r\n load: this.load.bind(this),\r\n mapper: jsonVote => new ThreadVote(jsonVote)\r\n }));\r\n\r\n this.votes = this.source.list; \r\n\r\n this.loading = ko.pureComputed(() => this.source.busy() && this.source.requestsProcessed() === 0);\r\n this.updating = ko.pureComputed(() => this.source.busy() && this.source.requestsProcessed() > 0);\r\n\r\n const ideationManager = storage.get(IdeationManager, { topicId: topicId });\r\n const isVotingStage = ideationManager.pluck(m => m.isVotingStage, false);\r\n\r\n //we're inside voting stage so any replies changes require votes update\r\n effects.register(isVotingStage => {\r\n if (isVotingStage) {\r\n return withEffect([\r\n events.replyAdded.on(this.onLocalReplyAdded.bind(this)),\r\n events.replyUpdated.on(this.onLocalReplyUpdated.bind(this)),\r\n events.replyDeleted.on(this.onLocalReplyDeleted.bind(this))\r\n ]);\r\n }\r\n }, [isVotingStage]);\r\n }\r\n\r\n update() {\r\n this.source.load();\r\n }\r\n\r\n private load() {\r\n return this.topicsService.queries.votes(this.topicId).toArray();\r\n }\r\n\r\n private onLocalReplyAdded(topicId: string) {\r\n if (this.topicId == topicId)\r\n this.update();\r\n }\r\n\r\n private onLocalReplyUpdated(topicId: string) {\r\n if (this.topicId == topicId)\r\n this.update();\r\n }\r\n\r\n private onLocalReplyDeleted(topicId: string) {\r\n if (this.topicId == topicId)\r\n this.update();\r\n }\r\n}","import { Observable } from 'knockout';\r\nimport WCCEntity from './entity';\r\n\r\nexport interface JSONThreadVote {\r\n PersonId: string,\r\n ThreadId: string,\r\n VoteValue: number,\r\n LinkedThreadId: string\r\n}\r\n\r\nexport default class ThreadVote extends WCCEntity {\r\n personId: Observable\r\n threadId: Observable\r\n value: Observable\r\n linkedThreadId: Observable\r\n\r\n constructor(json: JSONThreadVote) {\r\n super();\r\n\r\n this.personId = this.createField(json, 'PersonId');\r\n this.threadId = this.createField(json, 'ThreadId');\r\n this.value = this.createField(json, 'VoteValue', 0);\r\n this.linkedThreadId = this.createField(json, 'LinkedThreadId');\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-usercontent-standalone .thread-editor-text-body{min-height:70px}.topic-usercontent-inline--compact .chat-editor.chat-editor--noborder-theme.chat-editor--compact.chat-editor--toolbar-top .chat-editor__quill .ql-editor,.topic-usercontent-inline--compact .chat-editor.chat-editor--noborder-theme.chat-editor--compact.chat-editor--toolbar-bottom .chat-editor__quill .ql-editor{padding:8px}.topic-usercontent-inline--compact .chat-editor.chat-editor--noborder-theme.chat-editor--compact.chat-editor--toolbar-top .chat-editor__quill .ql-editor:before,.topic-usercontent-inline--compact .chat-editor.chat-editor--noborder-theme.chat-editor--compact.chat-editor--toolbar-bottom .chat-editor__quill .ql-editor:before{left:8px}\", \"\"]);\n// Exports\nmodule.exports = exports;\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, \".thread-editor-text-body{display:block}.thread-editor-text-body__title{position:relative}.thread-editor-text-body__title:after{content:\\\"\\\";position:absolute;bottom:0;left:15px;right:15px;height:1px;background-color:#c6c6c6}\", \"\"]);\n// Exports\nmodule.exports = exports;\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, \".thread-editor-text-inline-footer{display:flex;justify-content:space-between;background-color:#f8f8f7;border-top:1px solid #c6c6c6;border-bottom-left-radius:4px;border-bottom-right-radius:4px;line-height:100%}.thread-editor-text-inline-footer .btn{height:22px}.thread-editor-text-inline-footer--private .thread-editor-text-inline-footer__whisper-link{font-weight:500}.thread-editor-text-inline-footer__section{display:flex}.thread-editor-text-inline-footer__whisper-to--selected .thread-editor-text-inline-footer__whisper-to__name{font-weight:500}.thread-editor-text-inline-footer__whisper-to__image{width:30px}\", \"\"]);\n// Exports\nmodule.exports = exports;\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, \"\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Module\nvar code = \"\\r\\n\\r\\n\";\n// Exports\nmodule.exports = code;","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;"],"sourceRoot":""}