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vB,GAAQS,EAAAA,GAAoBe,cAC5BxB,GAAQS,EAAAA,GAAoBgB,MAE5B,GAAI1B,EAAQuB,wBAA0BvB,EAAQ2B,iBAAkB,CAE5D,MAAMZ,QAAe,sDACrBV,EAAUE,EAAWC,YAAc,IAAIO,EAAOC,QAC1CC,OAAOC,OAAOlB,EAASO,GAE/B,OACG,GAAIN,GAAQS,EAAAA,GAAoBkB,aACnC,GAAI5B,EAAQE,IAAIoB,mCAAqCtB,EAAQuB,uBAAwB,CAEjF,MAAMR,QAAe,uDACrBV,EAAUE,EAAWC,YAAc,IAAIO,EAAOC,QAC1CC,OAAOC,OAAOlB,EAASO,GAE/B,KAAO,CAEH,MAAMQ,QAAe,+BACrBV,EAAUE,EAAWC,YAAc,IAAIO,EAAOC,QAC1CC,OAAOC,OAAOlB,EAASO,GAE/B,MACG,GAAIN,GAAQS,EAAAA,GAAoBmB,WAAY,CAE/C,MAAMd,QAAe,8BACrBV,EAAUE,EAAWC,YAAc,IAAIO,EAAOC,QAC1CC,OAAOC,OAAOlB,EAASO,GAG/B,MAAO,GAAIN,IAASS,EAAAA,GAAoBoB,KAAM,CAE1C,MAAMf,QAAe,+BACrBV,EAAUE,EAAWC,YAAc,IAAIO,EAAOC,QAC1CC,OAAOC,OAAOlB,EAASO,GAE/B,KAAO,CAEH,MAAMQ,QAAe,+BACrBV,EAAUE,EAAWC,YAAc,IAAIO,EAAOC,QAC1CC,OAAOC,OAAOlB,EAASO,GAE/B,CAEA,OADAwB,EAAAA,EAAAA,GAAM,oBAAoBC,KAAKC,UAAU1B,MAClCF,EAAUE,EAAWC,WAChC,CAEA0B,OAAAA,GACI5B,KAAKD,UAAY,CAAC,CACtB,E,qBC5GJ,IAJ4B,CACxBS,UAAW,EACXqB,eAAgB,E","sources":["webpack://apexchatwidgets/./widgets/questiontypes/QuestionTypeRendererFactory.js","webpack://apexchatwidgets/./widgets/questiontypes/QuestionTypeVersion.js"],"sourcesContent":["/*\r\n * A factory class used to create renderers for a specific Question type\r\n */\r\nimport QuestionTypeVersion from './QuestionTypeVersion';\r\nimport { ScriptsQuestionType } from '../core/enums/Enum';\r\nimport logIt from '../../logIt';\r\n\r\nexport default class QuestionTypeRendererFactory {\r\n async create(options) {\r\n if (!options) throw 'must specify valid options of QR Renderer to create';\r\n const type = options.msg.questionType;\r\n if (!type && !options.msg.agentScriptDocuments) throw 'must specify which type of QR Renderer to create';\r\n const renderers = this.renderers || (this.renderers = {});\r\n const uniqueness = {\r\n rendererId: `${type}_${options.msg.id}`\r\n };\r\n // if (renderers[uniqueness.rendererId])\r\n // return renderers[uniqueness.rendererId];\r\n if (type == ScriptsQuestionType.TrueOrFalse) {\r\n if (options.version == QuestionTypeVersion.Classical) {\r\n\r\n const module = await import(/* webpackChunkName: \"trueFalseMessageRenderer\" */ './TrueFalseMessageRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n } else {\r\n\r\n const module = await import(/* webpackChunkName: \"rDTrueFalseMessageRenderer\" */ './RDTrueFalseMessageRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n }\r\n } else if (type == ScriptsQuestionType.Text) {\r\n\r\n // if (options.version !== ApexChat.QuestionTypeVersion.Classical) {\r\n // TODO: Proper check required to run the contact info form, I will handle that in integration related ticket\r\n const module = await import(/* webpackChunkName: \"contactInfoMessageRenderer\" */ './ContactInfoMessageRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n // }\r\n } else if (type == ScriptsQuestionType.AppointmentScheduler) {\r\n\r\n const module = await import(/* webpackChunkName: \"appointmentScheduleRenderer\" */ './AppointmentScheduleRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n } else if (type == ScriptsQuestionType.MultipleChoice) {\r\n if (options.msg.questionTypeDisplayListForVisitor && options.isBottomSheetSupported) {\r\n\r\n const module = await import(/* webpackChunkName: \"mcBottomListMessageRenderer\" */ './MCBottomListMessageRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n } else {\r\n const module = await import(/* webpackChunkName: \"mcListMessageRenderer\" */ './MCListMessageRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n }\r\n } else if (\r\n type == ScriptsQuestionType.TimeCalendar ||\r\n type == ScriptsQuestionType.CalendarDate ||\r\n type == ScriptsQuestionType.Time\r\n ) {\r\n if (options.isBottomSheetSupported && options.applyNewDateTime) {\r\n\r\n const module = await import(/* webpackChunkName: \"dateTimeBottomListMessageRenderer\" */ './DateTimeBottomListMessageRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n }\r\n } else if (type == ScriptsQuestionType.AllThatApply) {\r\n if (options.msg.questionTypeDisplayListForVisitor && options.isBottomSheetSupported) {\r\n\r\n const module = await import(/* webpackChunkName: \"ataBottomListMessageRenderer\" */ './ATABottomListMessageRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n } else {\r\n\r\n const module = await import(/* webpackChunkName: \"ataMessageRenderer\" */ './ATAMessageRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n }\r\n } else if (type == ScriptsQuestionType.VideoGreet) {\r\n\r\n const module = await import(/* webpackChunkName: \"greetVideoRenderer\" */ './GreetVideoRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n\r\n } else if (type === ScriptsQuestionType.None) { // QT None renderer in files/documents attached case\r\n\r\n const module = await import(/* webpackChunkName: \"guestionTypeNoneRenderer\" */ './QuestionTypeNoneRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n } else {\r\n // return default renderer if type is not known Or is of type: Plain text\r\n const module = await import(/* webpackChunkName: \"qtMessageRenderer\" */ './QTMessageRenderer')\r\n renderers[uniqueness.rendererId] = new module.default(\r\n Object.assign(options, uniqueness)\r\n );\r\n }\r\n logIt(`renderer created:${JSON.stringify(uniqueness)}`);\r\n return renderers[uniqueness.rendererId];\r\n }\r\n\r\n destroy() {\r\n this.renderers = {};\r\n }\r\n}\r\n","const QuestionTypeVersion = {\r\n Classical: 0,\r\n RoundedDynamic: 1\r\n};\r\nexport default QuestionTypeVersion;\r\n"],"names":["QuestionTypeRendererFactory","create","options","type","msg","questionType","agentScriptDocuments","renderers","this","uniqueness","rendererId","id","ScriptsQuestionType","TrueOrFalse","version","QuestionTypeVersion","Classical","module","default","Object","assign","Text","AppointmentScheduler","MultipleChoice","questionTypeDisplayListForVisitor","isBottomSheetSupported","TimeCalendar","CalendarDate","Time","applyNewDateTime","AllThatApply","VideoGreet","None","logIt","JSON","stringify","destroy","RoundedDynamic"],"sourceRoot":""}