{"version":3,"sources":["webpack:///./src/model/record/checkInModel.js","webpack:///./src/mixins/shared/user/userMixin.js"],"names":["createCheckInOption","comment","draft","ocr","checkInComment","isCheckInDraft","isCheckInOCR","checkInOptionName","Object","freeze","checkInOptions","name","label","description","findCheckInOption","find","el","toLowerCaseSafe","UploadFileCheckInOptionModel","extension","insertOption","insertFileOption","afterLastPage","Extension","Comments","Enqueue","Draft","InsertFileOption","CheckInOptionModel","UploadOptionModel","mapState","mapGetters","mapActions","createNamespacedHelpers","userMixin","mixins","principalMixin","computed","currentUser","repositories","categoryTypes","actorName","userCategories","userFields","formFields","findUserField","findFormField","countUserFields","isPersistentField","isSystemField","countUserCategories","findCategory","isAllowedViewField","createRecordCategories","createRecordCategoriesByCategoryType","updateRecordCategories","updateRecordCategoriesByCategoryType","isAllowedModifyField","isAllowedSystemOperation","isUserLoggedIn","repository","allowedAccessWFProjects","this","systemOperations","accessWFProjects","allowedAccessClerkModule","accessClerkModule","methods","setFormField"],"mappings":"kHAAA,wOAUA,MAAMA,EAAsBA,CAACC,EAAU,GAAIC,GAAQ,EAAOC,GAAM,KACvD,CACLC,eAAuB,OAAPH,QAAO,IAAPA,IAAW,GAC3BI,eAAqB,OAALH,QAAK,IAALA,KAChBI,aAAiB,OAAHH,QAAG,IAAHA,OAsCZI,EAAoBC,OAAOC,OAAO,CACtCR,QAAS,UACTC,MAAO,QACPC,IAAK,QAODO,EAAiBF,OAAOC,OAAO,CACnC,CACEE,KAAMJ,EAAkBN,QACxBW,MAAO,UACPC,YAAa,6BAEf,CACEF,KAAMJ,EAAkBL,MACxBU,MAAO,QACPC,YAAa,4BAEf,CACEF,KAAMJ,EAAkBJ,IACxBS,MAAO,gCACPC,YACE,6FASAC,EAAoBH,GACxBD,EAAeK,KACbC,GAAMC,eAAkB,OAAFD,QAAE,IAAFA,OAAE,EAAFA,EAAIL,QAAUM,eAAgBN,IAalDO,EAA+BA,CACnCC,EACAlB,EAAU,GACVE,GAAM,EACND,GAAQ,EACRkB,EAAeC,OAAiBC,iBAEzB,CACLC,UAAWJ,EACXK,SAAiB,OAAPvB,QAAO,IAAPA,IAAW,GACrBwB,QAAStB,EACTuB,MAAOxB,EACPyB,iBAAkBP,IAahBQ,EAAqBA,CACzBT,EACAlB,EAAU,GACVE,GAAM,EACND,GAAQ,KAED,CACLqB,UAAWJ,EACXK,SAAUvB,EACVwB,QAAStB,EACTuB,MAAOxB,IAYL2B,EAAoBA,CACxB5B,EAAU,GACVE,GAAM,EACND,GAAQ,EACRkB,EAAeC,OAAiBC,iBAEzB,CACLE,SAAUvB,EACVwB,QAAStB,EACTuB,MAAOxB,EACPyB,iBAAkBP,K,kCC9JtB,0EAEA,MAAM,SAAEU,EAAQ,WAAEC,EAAU,WAAEC,GAAeC,eAAwB,QAQxDC,EAAY,CACvBC,OAAQ,CAACC,QACTC,SAAU,IACLP,EAAS,CACVQ,YAAa,OACbC,aAAc,eACdC,cAAe,qBAEdT,EAAW,CACZU,UAAW,YACXC,eAAgB,aAChBC,WAAY,SACZC,WAAY,aACZC,cAAe,YACfC,cAAe,gBACfC,gBAAiB,cACjBC,kBAAmB,oBACnBC,cAAe,gBACfC,oBAAqB,kBACrBC,aAAc,eACdC,mBAAoB,qBACpBC,uBAAwB,yBACxBC,qCACE,uCACFC,uBAAwB,yBACxBC,qCACE,uCACFC,qBAAsB,uBACtBC,yBAA0B,2BAC1BC,eAAgB,iBAChBC,WAAY,eAOdC,0BACE,QAASC,KAAKJ,yBAAyBK,OAAiBC,mBAO1DC,2BACE,QAASH,KAAKJ,yBACZK,OAAiBG,qBASvBC,QAAS,IACJnC,EAAW,CAAEoC,aAAc","file":"js/chunk-2691ddd1.181f069c.js","sourcesContent":["import { toLowerCaseSafe } from \"@/utils\";\r\nimport { insertFileOption } from \"@/model/record/fileModel\";\r\n\r\n/**\r\n * create Check In Option\r\n * @param {string} comment Check In comment\r\n * @param {boolean} draft Check In as draft\r\n * @param {boolean} ocr Optically recognize text of an image\r\n * @return {{isCheckInDraft: boolean, isCheckInOCR : boolean, checkInComment : string}}\r\n */\r\nconst createCheckInOption = (comment = \"\", draft = false, ocr = true) => {\r\n return {\r\n checkInComment: comment ?? \"\",\r\n isCheckInDraft: draft ?? false,\r\n isCheckInOCR: ocr ?? false\r\n };\r\n};\r\n\r\n/**\r\n * create CheckIn Model\r\n * @param {boolean} isFileChanged\r\n * @param {number} filePageCount\r\n * @param {boolean} visibleCheckInProgress\r\n * @param {string} currentError\r\n * @param {string} checkInExtensionKey\r\n * @param {string} checkInExtensionValue\r\n * @return {{currentError: undefined, isFileChanged: boolean, visibleCheckInProgress: boolean, filePageCount: number, checkInExtension: {value: undefined, key: undefined}}}\r\n */\r\nconst createCheckInModel = (\r\n isFileChanged = false,\r\n filePageCount = -1,\r\n visibleCheckInProgress = false,\r\n currentError = undefined,\r\n checkInExtensionKey = undefined,\r\n checkInExtensionValue = undefined\r\n) => {\r\n return {\r\n isFileChanged: isFileChanged,\r\n filePageCount: filePageCount,\r\n visibleCheckInProgress: visibleCheckInProgress,\r\n currentError: currentError,\r\n checkInExtension: {\r\n key: checkInExtensionKey,\r\n value: checkInExtensionValue\r\n }\r\n };\r\n};\r\n\r\n/**\r\n * Available Check In Option names\r\n * @type {Readonly<{draft: string, comment: string, ocr: string}>}\r\n */\r\nconst checkInOptionName = Object.freeze({\r\n comment: \"comment\",\r\n draft: \"draft\",\r\n ocr: \"ocr\"\r\n});\r\n\r\n/**\r\n * check In Options\r\n * @type {({name: string, description: string, label: string})[]}\r\n */\r\nconst checkInOptions = Object.freeze([\r\n {\r\n name: checkInOptionName.comment,\r\n label: \"Comment\",\r\n description: \"Check In optional comment\"\r\n },\r\n {\r\n name: checkInOptionName.draft,\r\n label: \"Draft\",\r\n description: \"Check In file as a draft\"\r\n },\r\n {\r\n name: checkInOptionName.ocr,\r\n label: \"OCR and Index Recognized Text\",\r\n description:\r\n \"Perform Optical Character Recognition and index recognized text to make text searchable\"\r\n }\r\n]);\r\n\r\n/**\r\n * find Check In Option by its name\r\n * @param {string} name Check In Option name\r\n * @return {{name: string, description: string, label: string}}\r\n */\r\nconst findCheckInOption = name =>\r\n checkInOptions.find(\r\n el => toLowerCaseSafe(el?.name) === toLowerCaseSafe(name)\r\n );\r\n\r\n/**\r\n * Create UploadFileCheckInOption Model\r\n * @param {string|undefined} extension\r\n * @param {string|undefined} comment\r\n * @param {boolean} ocr\r\n * @param {boolean} draft\r\n * @param {{afterLastPage: number, beforeFirstPage: number, overwrite: number}} insertOption\r\n * @return {{Extension: (string|undefined), Draft: boolean, InsertFileOption: {afterLastPage: number, beforeFirstPage: number, overwrite: number}, Comments: (string|string), Enqueue: boolean}}\r\n * @constructor\r\n */\r\nconst UploadFileCheckInOptionModel = (\r\n extension = undefined,\r\n comment = \"\",\r\n ocr = false,\r\n draft = false,\r\n insertOption = insertFileOption.afterLastPage\r\n) => {\r\n return {\r\n Extension: extension,\r\n Comments: comment ?? \"\",\r\n Enqueue: ocr,\r\n Draft: draft,\r\n InsertFileOption: insertOption\r\n };\r\n};\r\n\r\n/**\r\n * Create CheckInOption Model\r\n * @param {string|undefined} extension\r\n * @param {string|undefined} comment\r\n * @param {boolean} ocr\r\n * @param {boolean} draft\r\n * @return {{Extension: undefined, Draft: boolean, Comments: string, Enqueue: boolean}}\r\n * @constructor\r\n */\r\nconst CheckInOptionModel = (\r\n extension = undefined,\r\n comment = \"\",\r\n ocr = false,\r\n draft = false\r\n) => {\r\n return {\r\n Extension: extension,\r\n Comments: comment,\r\n Enqueue: ocr,\r\n Draft: draft\r\n };\r\n};\r\n\r\n/**\r\n * Create CheckInOption Model\r\n * @param {string|undefined} comment\r\n * @param {boolean} ocr\r\n * @param {boolean} draft\r\n * @param {{afterLastPage: number, beforeFirstPage: number, overwrite: number}} insertOption\r\n * @return {{ Draft: boolean, Comments: string, Enqueue: boolean,InsertFileOption: {afterLastPage: number, beforeFirstPage: number, overwrite: number}}}\r\n */\r\nconst UploadOptionModel = (\r\n comment = \"\",\r\n ocr = false,\r\n draft = false,\r\n insertOption = insertFileOption.afterLastPage\r\n) => {\r\n return {\r\n Comments: comment,\r\n Enqueue: ocr,\r\n Draft: draft,\r\n InsertFileOption: insertOption\r\n };\r\n};\r\n\r\nexport {\r\n createCheckInOption,\r\n createCheckInModel,\r\n checkInOptionName,\r\n checkInOptions,\r\n findCheckInOption,\r\n CheckInOptionModel,\r\n UploadFileCheckInOptionModel,\r\n UploadOptionModel\r\n};\r\n","// vuex\r\nimport { createNamespacedHelpers } from \"vuex\";\r\nconst { mapState, mapGetters, mapActions } = createNamespacedHelpers(\"user\");\r\n\r\nimport { principalMixin } from \"@/mixins/shared/user/principalMixin\";\r\nimport { systemOperations } from \"@/model/user/userModel\";\r\n\r\n/**\r\n * Encapsulate Questys current user\r\n */\r\nexport const userMixin = {\r\n mixins: [principalMixin],\r\n computed: {\r\n ...mapState({\r\n currentUser: \"user\",\r\n repositories: \"repositories\",\r\n categoryTypes: \"categoryTypes\"\r\n }),\r\n ...mapGetters({\r\n actorName: \"actorName\",\r\n userCategories: \"categories\",\r\n userFields: \"fields\",\r\n formFields: \"formFields\",\r\n findUserField: \"findField\",\r\n findFormField: \"findFormField\",\r\n countUserFields: \"countFields\",\r\n isPersistentField: \"isPersistentField\",\r\n isSystemField: \"isSystemField\",\r\n countUserCategories: \"countCategories\",\r\n findCategory: \"findCategory\",\r\n isAllowedViewField: \"isAllowedViewField\",\r\n createRecordCategories: \"createRecordCategories\",\r\n createRecordCategoriesByCategoryType:\r\n \"createRecordCategoriesByCategoryType\",\r\n updateRecordCategories: \"updateRecordCategories\",\r\n updateRecordCategoriesByCategoryType:\r\n \"updateRecordCategoriesByCategoryType\",\r\n isAllowedModifyField: \"isAllowedModifyField\",\r\n isAllowedSystemOperation: \"isAllowedSystemOperation\",\r\n isUserLoggedIn: \"isUserLoggedIn\",\r\n repository: \"repository\"\r\n }),\r\n\r\n /**\r\n * compute whether current user is allowed Access WF Projects\r\n * @return {boolean} true if current user is allowed to Access/Mange workflow Projects\r\n */\r\n allowedAccessWFProjects() {\r\n return !!this.isAllowedSystemOperation(systemOperations.accessWFProjects);\r\n },\r\n\r\n /**\r\n * compute whether current user is allowed to access Agenda Clerk Module\r\n * @return {boolean} true if current user is allowed to access/Mange workflow Projects\r\n */\r\n allowedAccessClerkModule() {\r\n return !!this.isAllowedSystemOperation(\r\n systemOperations.accessClerkModule\r\n );\r\n }\r\n\r\n /**\r\n * insert here allowed systemOperations on demand\r\n * ...\r\n */\r\n },\r\n methods: {\r\n ...mapActions({ setFormField: \"setFormField\" })\r\n }\r\n};\r\n"],"sourceRoot":""}