1"use strict";(self["webpackChunkcyrisk"]=self["webpackChunkcyrisk"]||[]).push([[7776],{70396:function(e,t,i){i.d(t,{A:function(){return h}});var o=i(96913);const a={class:"string-array"},n={class:"input-wrap"},s={class:"dxtxt-wrap"},l=["id","name","aria-label","onClick"];function r(e,t,i,r,c,d){const m=(0,o.resolveComponent)("DxCustomRule"),u=(0,o.resolveComponent)("dx-string-length-rule"),p=(0,o.resolveComponent)("DxValidator"),h=(0,o.resolveComponent)("DxTextBox");return(0,o.openBlock)(),(0,o.createElementBlock)("div",a,[(0,o.createElementVNode)("div",n,[(0,o.createElementVNode)("div",s,[((0,o.openBlock)(),(0,o.createBlock)(h,{ref:"stringArrayinput",modelValue:c.input,"onUpdate:modelValue":t[0]||(t[0]=e=>c.input=e),id:"string-input-dx","input-attr":{name:"string-input",id:"string-input","aria-label":"enter string-input"},key:c.counter,onEnterKey:d.updateInput,valueChangeEvent:"keyup","show-clear-button":!0,placeholder:"Start Typing..."},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(p,null,{default:(0,o.withCtx)(()=>[(0,o.createVNode)(m,{"validation-callback":d.customValidation,message:d.errorMessage,reevaluate:!0},null,8,["validation-callback","message"]),(0,o.createVNode)(u,{reevaluate:!0,max:255,message:"Please limit to no more than 255 characters"})],void 0,!0),_:1})],void 0,!0),_:1},8,["modelValue","onEnterKey"]))]),(0,o.createElementVNode)("div",{id:"add-item",name:"add-item","aria-label":"add-item",role:"button",onClick:t[1]||(t[1]=(...e)=>d.update&&d.update(...e)),class:"ml-1 smallish white-button"}," Add ")]),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(d.displayValues,(e,i)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{class:"array-item",key:i},[(0,o.createElementVNode)("label",null,[(0,o.createTextVNode)((0,o.toDisplayString)(e)+" ",1),(0,o.createElementVNode)("span",{"data-toggle":"tooltip",title:"Delete Item",id:"delete-item-"+i,name:"delete-item-"+i,"aria-label":"delete-item-"+i,role:"button",onClick:e=>d.deleteString(i),class:"pointer"},[...t[2]||(t[2]=[(0,o.createElementVNode)("i",{class:"error fas fa-times-circle"},null,-1)])],8,l)])]))),128))])}i(74423),i(44114);var c=i(22440),d=i(97043),m={components:{DxTextBox:c.HA,DxValidator:d.Z2,DxCustomRule:d.CC,DxStringLengthRule:d.Wx},props:{values:{type:Array,default:()=>[]},required:{type:Boolean,default:!1},reqMsg:{type:String,default:""},emailMode:{type:Boolean,default:!1}},data(){return{counter:0,input:"",stringsArray:[],group:null,validEmail:!1}},computed:{displayValues(){return this.values},errorMessage(){return this.emailMode&&!this.validEmail?"Email is invalid":this.required&&!this.values.length?this.reqMsg:null}},methods:{customValidation(e){return!(e.value&&this.emailMode&&(this.validEmail=this.validateEmail(e),!this.validEmail))&&(!this.required||this.handleRequired())},handleRequired(){return!(!this.values||!this.values.length)},updateInput(e){e.component._changedValue&&(this.input=e.component._changedValue,this.update())},deleteString(e){this.stringsArray=this.values,this.stringsArray.splice(e,1),this.$emit("update",this.stringsArray)},update(){this.stringsArray=this.values,(this.emailMode&&this.validEmail||!this.emailMode)&&(this.input&&(this.stringsArray||(this.stringsArray=[]),this.stringsArray.includes(this.input)||this.stringsArray.push(this.input)),this.$emit("update",this.stringsArray),this.input="",this.counter++)}}},u=i(66262);const p=(0,u.A)(m,[["render",r],["__scopeId","data-v-dfb003b4"]]);var h=p},30625:function(e,t,i){i.d(t,{A:function(){return no}});var o=i(96913);const a={id:"requirement-editor",ref:"wrapper"},n={class:"tweik-wrapper"},s={class:"uploads-container"};function l(e,t,i,l,r,c){const d=(0,o.resolveComponent)("preloader"),m=(0,o.resolveComponent)("requirements-progress"),u=(0,o.resolveComponent)("tweik"),p=(0,o.resolveComponent)("assesssments-upload-progress"),h=(0,o.resolveComponent)("dx-scroll-view"),g=(0,o.resolveComponent)("dx-popup");return(0,o.openBlock)(),(0,o.createElementBlock)("div",a,[r.loading?((0,o.openBlock)(),(0,o.createBlock)(d,{key:0})):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("div",null,[r.loading?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createBlock)(m,{ref:"requirementsProgress",key:r.progressKey,onChangeSection:c.changeSection,onComplete:c.completeHandler,onSetFocus:c.setFocusOverride,onMounted:c.rpMounted,page:r.sectionIndex,requirementsIn:r.requirementData},null,8,["onChangeSection","onComplete","onSetFocus","onMounted","page","requirementsIn"]))]),(0,o.createElementVNode)("div",n,[r.loading?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createBlock)(u,{key:0,scroll:!1,isItemEditable:!0,treeviewSectionKeys:["label"],treeviewItemKeys:["title"],treeDelimiter:" - ",tweikID:i.targetID,sectionIndex:r.sectionIndex,progressive:!1,tweikData:c.currentSection,requirementData:r.requirementData,releaseKey:r.releaseKey,status:r.status,focusOverride:r.focusOverride,onOpenUnmet:t[0]||(t[0]=t=>e.$emit("openUnmet")),onSaveChanges:c.sectionSubmitted,onCancel:c.cancel,onDownload:c.downloadFile,onAddFile:c.addToFileQue,onDelFile:c.deleteFile,onUpdateData:c.updateLocalData,onChangeSection:c.changeSection,progressKey:r.progressKey},null,8,["tweikID","sectionIndex","tweikData","requirementData","releaseKey","status","focusOverride","onSaveChanges","onCancel","onDownload","onAddFile","onDelFile","onUpdateData","onChangeSection","progressKey"]))]),(0,o.createVNode)(g,{key:"uploadPopup",height:e.gPopupHeight(300),width:e.gPopupWidth(500),visible:r.uploading,"onUpdate:visible":t[1]||(t[1]=e=>r.uploading=e),title:"Uploading Files",showCloseButton:!1,showTitle:!1},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(h,null,{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",s,[t[2]||(t[2]=(0,o.createElementVNode)("label",null,null,-1)),r.uploading?((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,{key:0},(0,o.renderList)(c.filteredFileQue,(e,t)=>((0,o.openBlock)(),(0,o.createBlock)(p,{key:t,item:e.item,file:e.file,onComplete:c.fileUploadsComplete,inProccessSection:r.inProccessSection}
1,null,8,["item","file","onComplete","inProccessSection"]))),128)):(0,o.createCommentVNode)("",!0)])],void 0,!0),_:1})],void 0,!0),_:1},8,["height","width","visible"])],512)}i(44114),i(18111),i(22489),i(20116),i(14603),i(47566),i(98721);const r={class:"row no-pad h-100 transition-wrapper"},c={class:"tweik-nav text-left"},d=["title"],m={ref:"tweikInnerDiv"},u={class:"tweik-inner"};function p(e,t,i,a,n,s){const l=(0,o.resolveComponent)("DxTreeView"),p=(0,o.resolveComponent)("dx-scroll-view"),h=(0,o.resolveComponent)("font-awesome-icon"),g=(0,o.resolveComponent)("tweik-edit-section");return(0,o.openBlock)(),(0,o.createElementBlock)("div",{class:"tweik",key:i.tweikID},[(0,o.createElementVNode)("div",r,[(0,o.createElementVNode)("div",{class:(0,o.normalizeClass)([n.isTreeViewShriked?"col-0":"col-3"])},[(0,o.createElementVNode)("div",c,[((0,o.openBlock)(),(0,o.createBlock)(p,{id:i.tweikID+"_navScroll",key:i.tweikID+"_navScroll","scroll-by-content":!0,"scroll-by-thumb":!0,height:s.computeHeight},{default:(0,o.withCtx)(()=>
1[((0,o.openBlock)(),(0,o.createBlock)(l,{key:i.tweikID+"navTreeView",items:i.requirementData,displayExpr:"label",onItemClick:s.selectItem,"search-enabled":!0},{item:(0,o.withCtx)(e=>[(0,o.createElementVNode)("div",{style:(0,o.normalizeStyle)([s.isHidden(e.data)?{opacity:"1"}:{opacity:"0.5"}])},[(0,o.createElementVNode)("span",{class:"align-baseline","data-toggle":"tool-tip",title:e.data.label?e.data.label:""},(0,o.toDisplayString)(s.treeDisplay(e.data)),9,d)],4)]),_:1},8,["items","onItemClick"]))],void 0,!0),_:1},8,["id","height"]))]),(0,o.createElementVNode)("span",{id:"toggle-treeview-shrink",name:"toggle-treeview-shrink","aria-label":"toggle treeview shrink",role:"button",onClick:t[0]||(t[0]=(...e)=>s.toggleTreeViewShrink&&s.toggleTreeViewShrink(...e)),class:"collapse-btn"},[(0,o.createVNode)(h,{icon:["fas",n.isTreeViewShriked?"caret-right":"caret-left"]},null,8,["icon"])])],2),(0,o.createElementVNode)("div",{class:(0,o.normalizeClass)([n.isTreeViewShriked?"col-12 tweik-col":"col-9 tweik-col"])},[((0,o.openBlock)(),(0,o.createElementBlock)("div",{class:"tweik-wrapper",ref:i.tweikID+"detailRef",key:i.sectionIndex+"-tweik"},[((0,o.openBlock)(),(0,o.createBlock)(p,{onInitialized:s.saveScroll,"scroll-by-content":!0,"scroll-by-thumb":!0,height:s.computeHeight,key:i.tweikI
1D+"mainScroll",onScroll:s.onScrollTweik},{default:(0,o.withCtx)(()=>[t[3]||(t[3]=(0,o.createElementVNode)("div",{id:"top-to-scroll"},null,-1)),(0,o.createElementVNode)("div",m,[(0,o.createElementVNode)("div",u,[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(i.tweikData,(a,l)=>((0,o.openBlock)(),(0,o.createBlock)(g,{changeTracker:n.changeTracker,sectionID:i.tweikID+"_"+l,tweikID:i.tweikID,onSaveChanges:s.saveChanges,onAddFile:s.addFile,onDelFile:s.delFile,onCancel:s.cancel,key:i.tweikID+"_"+l,sectionIn:a,focusItem:n.focusItem,releaseKey:i.releaseKey,progressive:i.progressive,onDownload:s.download,status:i.status,onOpenUnmet:t[1]||(t[1]=t=>e.$emit("openUnmet")),onUpdateSection:s.updateSection,onSetActiveSection:s.setActiveSection,isItemEditable:i.isItemEditable},null,8,["changeTracker","sectionID","tweikID","onSaveChanges","onAddFile","onDelFile","onCancel","sectionIn","focusItem","releaseKey","progressive","onDownload","status","onUpdateSection","onSetActiveSection","isItemEditable"]))),128))])],512),n.isBackToTopVisible?((0,o.openBlock)(),(0,o.createElementBlock)("button",{key:0,class:"back-to-top blu-button",onClick:t[2]||(t[2]=(...e)=>s.scrollToTweikTop&&s.scrollToTweikTop(...e)),name:"scroll-top-top",id:"scroll-top-top","aria-label":"scroll to top button"}," Back to Top ")):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1},8,["onInitialized","height","onScroll"]))]))],2)])])}var h=i(7628),g=i(22440);const v={key:0},k={class:"row no-pad"},y={class:"col text-left"},f=["id"],b={key:0,class:"col text-right"},V={key:0,class:"row no-pad"},w={class:"col text-right"},N={id:"consent-modal"},E={class:"consent-buttons"};function x(e,t,i,a,n,s){const l=(0,o.resolveComponent)("font-awesome-icon"),r=(0,o.resolveComponent)("tweik-item"),c=(0,o.resolveComponent)("collapse-transition"),d=(0,o.resolveComponent)("DxValidationSummary"),m=(0,o.resolveComponent)("DxValidationGroup"),u=(0,o.resolveComponent)("dx-popup"),p=(0,o.resolveComponent)("preloader");return(0,o.openBlock)(),(0,o.createElementBlock)("div",{class:(0,o.normalizeClass)(["tweik-section text-left",{highlighted:s.highlighted}]),key:n.itemKey},[n.loading?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("div",v,[(0,o.createElementVNode)("div",k,[(0,o.createElementVNode)("div",y,[(0,o.createElementVNode)("label",null,[(0,o.createElementVNode)("strong",{id:s.makeID},(0,o.toDisplayString)(n.section.label),9,f)])]),i.isItemEditable?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("div",b,[n.editMode?((0,o.openBlock)(),(0,o.createElementBlock)("span",{key:1,id:"cancel-edit",name:"cancel-edit","aria-label":"cancel edit",onClick:t[1]||(t[1]=e=>n.editEnd=!0),role:"button"},[(0,o.createVNode)(l,{class:"error edit-button",icon:"times-circle","data-toggle":"tooltip",title:"Cancel Edit"})])):((0,o.openBlock)(),(0,o.createElementBlock)("span",{key:0,id:"edit-section",name:"edit-section","aria-label":"edit section",onClick:t[0]||(t[0]=(...e)=>s.openEdit&&s.openEdit(...e)),role:"button"},[(0,o.createVNode)(l,{class:"darkBlue edit-button",icon:"edit","data-toggle":"tooltip",title:"Edit Section"})]))]))]),(0,o.createVNode)(m,{id:"tweikGroup"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(c,{group:""},{default:(0,o.withCtx)(()=>[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(s.visibleItems,(a,l)=>((0,o.openBlock)(),(0,o.createBlock)(r,{class:"tweik-item-component",editMode:n.editMode,isItemEditable:i.isItemEditable,onValueChanged:s.update,releaseKey:i.releaseKey,key:i.sectionID+"_"+l+a.question_id+n.itemKey,itemId:i.sectionID+"_"+l,item:a,tweikID:i.tweikI
1D,focusItem:i.focusItem,onAddFile:s.addFile,onDelFile:s.delFile,onCancel:s.cancel,onDownload:s.download,isUnmet:s.isUnmet(a),onOpenUnmet:t[2]||(t[2]=t=>e.$emit("openUnmet")),onSaveChanges:s.save,onSetActiveSection:s.setActiveSection},null,8,["editMode","isItemEditable","onValueChanged","releaseKey","itemId","item","tweikID","focusItem","onAddFile","onDelFile","onCancel","onDownload","isUnmet","onSaveChanges","onSetActiveSection"]))),128))],void 0,!0),_:1}),(0,o.createVNode)(d,{class:"validation-summary",validationGroup:"tweikGroup"})],void 0,!0),_:1}),n.editMode?((0,o.openBlock)(),(0,o.createElementBlock)("div",V,[(0,o.createElementVNode)("div",w,[(0,o.createElementVNode)("span",{id:"save-edits",name:"save-edits","aria-label":"save edits",role:"button",onClick:t[3]||(t[3]=(...e)=>s.save&&s.save(...e)),class:"save-button white-button"},"save edits"),(0,o.createElementVNode)("span",{id:"cancel-edits",name:"cancel-edits","aria-label":"cancel edits",role:"button",onClick:t[4]||(t[4]=e=>n.editEnd=!0),class:"cancel-button white-button"},"cancel")])])):(0,o.createCommentVNode)("",!0),(0,o.createVNode)(u,{height:e.gPopupHeight(300),width:e.gPopupWidth(500),hideOnOutsideClick:!0,"show-title":!1,visible:n.editEnd,"onUpdate:visible":t[7]||(t[7]=e=>n.editEnd=e)},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",N,[t[8]||(t[8]=(0,o.createElementVNode)("p",null," You have unsaved changes. If you cancel now they will be lost. Do you want to discard the current changes? ",-1)),(0,o.createElementVNode)("div",E,[(0,o.createElementVNode)("div",{id:"discard-changes",name:"discard-changes","aria-label":"discard changes",role:"button",onClick:t[5]||(t[5]=(...e)=>s.cancel&&s.cancel(...e)),class:"blank-button"}," Yes "),(0,o.createElementVNode)("div",{id:"continue-change",name:"continue-change","aria-label":"continue change",role:"button",onClick:t[6]||(t[6]=e=>n.editEnd=!1),class:"blank-button"}," No ")])])],void 0,!0),_:1},8,["height","width","visible"])])),n.loading?((0,o.openBlock)(),(0,o.createBlock)(p,{key:1,size:.6})):(0,o.createCommentVNode)("",!0)],2)}i(74423),i(69112),i(33110);const I={class:"tweik-item"},C=["id"],_={key:1},B={key:0,class:"col text-right"},D={class:"item-label"},S={class:"requirement-title"},F={key:0,class:"blue"},T={class:"requirement-label"},A={class:"value-display"},q={key:0},U={key:0},P={key:1},O={key:0},$={key:1},R={key:0},M={key:1},L={class:"meta-field-wrap"},j={key:0,class:"meta-field"},K=["onClick"],W={class:"url-text mr-3 d-block"},H={class:"file-link d-inline mr-3 no-breaks"},z={key:1,class:"meta-field"},G={class:"ml-2"},Q={key:0,class:"row no-pad py-2"},J={class:"col"},Y={class:"col"},Z={class:"col"},X={class:"row no-pad"},ee={class:"col"},te={key:0,class:"edit-wrapper"},ie={key:2,class:"row no-pad"},oe={class:"col text-right"},ae={id:"consent-modal"},ne={class:"consent-buttons"};function se(e,t,i,a,n,s){const l=(0,o.resolveComponent)("preloader"),r=(0,o.resolveComponent)("font-awesome-icon"),c=(0,o.resolveComponent)("infos"),d=(0,o.resolveComponent)("external-link"),m=(0,o.resolveComponent)("tweik-edit"),u=(0,o.resolveComponent)("DxValidationSummary"),p=(0,o.resolveComponent)("DxValidationGroup"),h=(0,o.resolveComponent)("collapse-transition"),g=(0,o.resolveComponent)("dx-popup"),v=(0,o.resolveDirective)("clipboard");return(0,o.openBlock)(),(0,o.createElementBlock)("div",I,[(0,o.createVNode)(o.Transition,{name:"fade",mode:"out-in"},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",{class:(0,o.normalizeClass)(["tweik-item-inner",{highlighted:s.highlighted,complete:i.item.submitted}]),id:i.tweikID+"_"+i.item.id},[n.loading?((0,o.openBlock)(),(0,o.createBlock)(l,{key:0,size:.5,padding:1e-4})):(0,o.createCommentVNode)("",!0),n.loading?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("div",_,[i.isItemEditable?((0,o.openBlock)(),(0,o.createElementBlock)("div",B,[n.isItemBeingEdited?((0,o.openBlock)(),(0,o.createElementBlock)("span",{key:1,id:"cancel-item-edit",name:"cancel-item-edit","aria-label":"cancel item edit",onClick:t[1]||(t[1]=(...e)=>s.toggleEditEnd&&s.toggleEditEnd(...e)),role:"button"},[(0,o.createVNode)(r,{class:"error edit-button",icon:"times-circle","data-toggle":"tooltip",title:"Cancel Edit"})])):((0,o.openBlock)(),(0,o.createElementBlock)("span",{key:0,onClick:t[0]||(t[0]=(...e)=>s.toggleItemEdit&&s.toggleItemEdit(...e)),id:"item-edit",name:"item-edit","aria-label":"item edit",role:"button"},[(0,o.createVNode)(r,{class:"darkBlue edit-button",icon:"edit","data-toggle":"tooltip",title:"Edit Item"})]))])):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("label",D,[i.isUnmet?((0,o.openBlock)(),(0,o.createElementBlock)("span",{key:0,id:"open-unmet",name:"open-unmet","aria-label":"open unmet",role:"button",onClick:t[2]||(t[2]=t=>e.$emit("openUnmet"))},[...t[8]||(t[8]=[(0,o.createElementVNode)("i",{class:"error fas fa-exclamation-triangle pointer mr-1","data-toggle":"tooltip",title:"Requirement Unmet!"},null,-1)])])):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("span",S,[i.item.info?((0,o.openBlock)(),(0,o.createElementBlock)("span",F,[(0,o.createVNode)(c,{width:900,height:600},{default:(0,o.withCtx)(()=>[(0,o.createTextVNode)((0,o.toDisplayString)(i.item.info),1)],void 0,!0),_:1})])):(0,o.createCommentVNode)("",!0),(0,o.createTextVNode)((0,o.toDisplayString)(i.item.title),
11)]),(0,o.createElementVNode)("span",T,(0,o.toDisplayString)(i.item.label),1)]),n.isItemBeingEdited?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[(0,o.createElementVNode)("div",A,["boolean"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[s.hydratedSelectedAnswers.length>0?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createTextVNode)((0,o.toDisplayString)(s.hydratedSelectedAnswers[0].answer_text||"No"),1)],64)):(0,o.createCommentVNode)("",!0)],64)):(0,o.createCommentVNode)("",!0),"date"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[i.item.submitted_value?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createTextVNode)((0,o.toDisplayString)(s.prettyDate(i.item.submitted_value)),1)],64)):((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[(0,o.createTextVNode)(" not provided")],64))],64)):(0,o.createCommentVNode)("",!0),"select"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:2},[i.item.selected_answers?.length?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createTextVNode)((0,o.toDisplayString)(s.hydratedSelectedAnswers[0].answer_text),1)],64)):((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[(0,o.createTextVNode)(" not provided")],64))],64)):(0,o.createCommentVNode)("",!0),"address"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:3},[(0,o.createTextVNode)((0,o.toDisplayString)(s.addressDisplay),1)],64)):(0,o.createCommentVNode)("",!0),"string"===i.item.type||"number"===i.item.type||"email"===i.item.type||"textarea"===i.item.type||"postal_code"===i.item.type||"year"===i.item.type||"percent"===i.item.type||"maturity"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:4},[i.item.submitted_value?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},["number"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createTextVNode)((0,o.toDisplayString)(s.formatText(i.item.submitted_value,["numberCommas"])),1)],64)):(0,o.createCommentVNode)("",!0),"maturity"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[(0,o.createTextVNode)("Policy: "+(0,o.toDisplayString)(i.item.submitted_value[0])+"% Procedure: "+(0,o.toDisplayString)(i.item.submitted_value[1])+"% Implemented: "+(0,o.toDisplayString)(i.item.submitted_value[2])+"% Measured: "+(0,o.toDisplayString)(i.item.submitted_value[3])+"% Managed: "+(0,o.toDisplayString)(i.item.submitted_value[4])+"% ",1)],64)):((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:2},[(0,o.createTextVNode)((0,o.toDisplayString)(i.item.submitted_value)+" ",1),"percent"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)("span",q,"%")):(0,o.createCommentVNode)("",!0)],64))],64)):((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[(0,o.createTextVNode)(" not provided")],64))],64)):(0,o.createCommentVNode)("",!0),"phone"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:5},[i.item.submitted_value?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createTextVNode)((0,o.toDisplayString)(s.maskPhone(i.item.submitted_value)),1)],64)):((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[(0,o.createTextVNode)(" not provided")],64))],64)):(0,o.createCommentVNode)("",!0),"currency"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:6},[i.item.submitted_value?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createTextVNode)((0,o.toDisplayString)(s.formatCurrency(i.item.submitted_value)),1)],64)):((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[(0,o.createTextVNode)(" not provided")],64))],64)):(0,o.createCommentVNode)("",!0),"domain ip"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:7},[(0,o.createTextVNode)((0,o.toDisplayString)(s.formatText(n.value)),1)],64)):(0,o.createCommentVNode)("",!0),"multi select"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:8},[i.item.selected_answers?.length?((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,{key:0},(0,o.renderList)(s.hydratedSelectedAnswers,(e,t)=>((0,o.openBlock)(),(0,o.createElementBlock)("span",{key:t},[i.item?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createTextVNode)((0,o.toDisplayString)(e.answer_text),1),i.item.selected_answers.length>1&&t<i.item.selected_answers.length-1?((0,o.openBlock)(),(0,o.createElementBlock)("span",U,", ")):(0,o.createCommentVNode)("",!0)],64)):(0,o.createCommentVNode)("",!0)]))),128)):((0,o.openBlock)(),(0,o.createElementBlock)("span",P," not provided "))],64)):(0,o.createCommentVNode)("",!0),"string array"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:9},[i.item.submitted_value?.length?((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,{key:0},(0,o.renderList)(i.item.submitted_value,(e,t)=>((0,o.openBlock)(),(0,o.createElementBlock)("span",{key:t},[e?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createTextVNode)((0,o.toDisplayString)(e),1),i.item.submitted_value.length>1&&t<i.item.submitted_value.length-1?((0,o.openBlock)(),(0,o.createElementBlock)("span",O,", ")):(0,o.createCommentVNode)("",!0)],64)):(0,o.createCommentVNode)("",!0)]))),128)):((0,o.openBlock)(),(0,o.createElementBlock)("span",$," not provided "))],64)):(0,o.createCommentVNode)("",!0),"time frame"===i.item.type?((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:10},[i.item.submitted_value&&i.item.submitted_value.length?((0,o.openBlock)(),(0,o.createElementBlock)("span",R,(0,o.toDisplayString)(i.item.submitted_value[0])+" "+(0,o.toDisplayString)(i.item.submitted_value[1]),1)):((0,o.openBlock)(),(0,o.createElementBlock)("span",M,"Not Provided"))],64)):(0,o.createCommentVNode)("",!0)]),(0,o.createElementVNode)("div",L,[i.item.associated_files&&i.item.associated_files.length||i.item.associated_urls&&i.item.associated_urls.length?((0,o.openBlock)(),(0,o.createElementBlock)("div",j,[t[11]||(t[11]=(0,o.createElementVNode)("label",null,[(0,o.createElementVNode)("i",{class:"fas fa-paperclip blue"}),(0,o.createTextVNode)(" attachments: ")],-1)),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(i.item.associated_files,(e,i)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{class:"file-item",key:i+"-file"},[(0,o.createTextVNode)((0,o.toDisplayString)(e.name)+" ",1),(0,o.createElementVNode)("span",{id:"file-download",name:"file-download","aria-label":"file download",role:"button",class:"file-link",onClick:t=>s.emitFileDownload(e)},[...t[9]||(t[9]=[(0,o.createElementVNode)("i",{class:"d-inline fas fa-file-download"},null,-1),(0,o.createTextVNode)(" download file ",-1)])],8,K)]))),128)),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(i.item.associated_urls,(i,a)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{class:"file-item",key:a+"-url"},[(0,o.createElementVNode)("span",W,(0,o.toDisplayString)(e.truncate(i,60)),1),(0,o.withDirectives)(((0,o.openBlock)(),(0,o.createElementBlock)("span",H,[...t[10]||(t[10]=[(0,o.createElementVNode)("i",{class:"fas fa-copy"},null,-1),(0,o.createTextVNode)(" copy to clipboard ",-1)])])),[[v,i,"copy"],[v,s.onCopy,"success"],[v,s.onError,"error"]]),(0,o.createVNode)(d,{class:"d-inline-block",url:i},null,8,["url"])]))),128))])):(0,o.createCommentVNode)("",!0),i.item.comments?((0,o.openBlock)(),(0,o.createElementBlock)("div",z,[t[12]||(t[12]=(0,o.createElementVNode)("label",null,[(0,o.createElementVNode)("i",{class:"fas fa-comment blue"}),(0,o.createTextVNode)(" comments:")],-1)),(0,o.createElementVNode)("p",G,(0,o.toDisplayString)(i.item.comments),1)])):(0,o.createCommentVNode)("",!0)]),i.item.impact_rating?((0,o.openBlock)(),(0,o.createElementBlock)("div",Q,[(0,o.createElementVNode)("div",J,[t[13]||(t[13]=(0,o.createElementVNode)("label",{class:"score-label"},"Impact Rating: ",-1)),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(e.parseScores(i.item.impact_rating)),1)]),(0,o.createElementVNode)("div",Y,[t[14]||(t[14]=(0,o.createElementVNode)("label",{class:"score-label"},"Maturity Rating: ",-1)),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(e.parseScores(i.item.maturity_rating,2)),1)]),(0,o.createElementVNode)("div",Z,[t[15]||(t[15]=(0,o.createElementVNode)("label",{class:"score-label"},"Risk Impact Score: ",-1)),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(e.parseScores(i.item.risk_impact_score,2)),1)])])):(0,o.createCommentVNode)("",!0)],64)),(0,o.createElementVNode)("div",X,[(0,o.createElementVNode)("div",ee,[(0,o.createVNode)(h,null,{default:(0,o.withCtx)(()=>[n.isItemBeingEdited||i.editMode?((0,o.openBlock)(),(0,o.createElementBlock)("div",te,[(0,o.createVNode)(p,{id:"tweikGroup"},{default:(0,o.withCtx)(()=>[n.isItemBeingEdited||i.editMode?((0,o.openBlock)(),(0,o.createBlock)(m,{tweikID:i.tweikI
1D,itemID:i.itemID,key:i.itemID,item:i.item,itemIn:i.item,onAddFile:s.addFile,onDelFile:s.delFile,onValueChanged:s.valueChanged},null,8,["tweikID","itemID","item","itemIn","onAddFile","onDelFile","onValueChanged"])):(0,o.createCommentVNode)("",!0),(0,o.createVNode)(u,{class:"validation-summary",validationGroup:"tweikGroup"})],void 0,!0),_:1})])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1})])]),n.isItemBeingEdited?((0,o.openBlock)(),(0,o.createElementBlock)("div",ie,[(0,o.createElementVNode)("div",oe,[(0,o.createElementVNode)("span",{id:"save-edit",name:"save-edit","aria-label":"save edit",role:"button",onClick:t[3]||(t[3]=(...e)=>s.saveItem&&s.saveItem(...e)),class:"save-button white-button"},"save edits"),(0,o.createElementVNode)("span",{id:"cancel-edit-popup",name:"cancel-edit-popup","aria-label":"cancel edit popup",role:"button",onClick:t[4]||(t[4]=(...e)=>s.toggleEditEnd&&s.toggleEditEnd(...e)),class:"cancel-button white-button ml-2"},"cancel")])])):(0,o.createCommentVNode)("",!0),(0,o.createVNode)(g,{height:e.gPopupHeight(300),width:e.gPopupWidth(500),hideOnOutsideClick:!0,"show-title":!1,visible:n.editEnd,"onUpdate:visible":t[7]||(t[7]=e=>n.editEnd=e)},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",ae,[t[16]||(t[16]=(0,o.createElementVNode)("p",null," You have unsaved changes. If you cancel now they will be lost. Do you want to discard the current changes? ",-1)),(0,o.createElementVNode)("div",ne,[(0,o.createElementVNode)("div",{id:"cancel-edit",name:"cancel-edit","aria-label":"cancel edit",role:"button",onClick:t[5]||(t[5]=(...e)=>s.cancelEdit&&s.cancelEdit(...e)),class:"blank-button"}," Yes "),(0,o.createElementVNode)("div",{id:"continue-edit",name:"continue-edit","aria-label":"continue edit",role:"button",onClick:t[6]||(t[6]=(...e)=>s.toggleEditEnd&&s.toggleEditEnd(...e)),class:"blank-button"}," No ")])])],void 0,!0),_:1},8,["height","width","visible"])]))],10,C)],void 0,!0),_:1})])}var le=i(78313);const re={class:"tweik-edit"},ce={class:"row no-pad pt-2"},de={class:"col-12"},me={class:"meta-field-wrap"},ue={key:0,class:"meta-field"},pe={class:"meta-field"},he={class:"comments"},ge={key:0,class:"risk-maturity-selector row no-pad"},ve={class:"col-4"},ke={class:"col-4 px-2"},ye={class:"col-4 pl-2"};function fe(e,t,i,a,n,s){const l=(0,o.resolveComponent)("dx-required-rule"),r=(0,o.resolveComponent)("dx-string-length-rule"),c=(0,o.resolveComponent)("DxCustomRule"),d=(0,o.resolveComponent)("DxValidator"),m=(0,o.resolveComponent)("DxTextBox"),u=(0,o.resolveComponent)("DxTextArea"),p=(0,o.resolveComponent)("dx-pattern-rule"),h=(0,o.resolveComponent)("dx-custom-rule"),g=(0,o.resolveComponent)("dx-number-box"),v=(0,o.resolveComponent)("DxSelectBox"),k=(0,o.resolveComponent)("DxPatternRule"),y=(0,o.resolveComponent)("DxDateBox"),f=(0,o.resolveComponent)("DxTreeView"),b=(0,o.resolveComponent)("DxDropDownBox"),V=(0,o.resolveComponent)("string-array"),w=(0,o.resolveComponent)("nist-item"),N=(0,o.resolveComponent)("domain-ip"),E=(0,o.resolveComponent)("time-frame"),x=(0,o.resolveComponent)("international-address"),I=(0,o.resolveComponent)("file-uploader"),C=(0,o.resolveComponent)("collapse-transition");return(0,o.openBlock)(),(0,o.createElementBlock)("div",re,[(0,o.createElementVNode)("div",ce,[(0,o.createElementVNode)("div",de,["string"===n.isoItem.type||"email"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(m,{key:0,value:n.isoItem.submitted_value,onValueChanged:s.dxUpdate,id:n.isoItem.id+"-dx","input-attr":{name:n.isoItem.id,id:n.isoItem.id,"aria-label":"enter "+n.isoItem.label}},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(d,{validationGroup:"tweikGroup"},{default:(0,o.withCtx)(()=>[n.isoItem.required?((0,o.openBlock)(),(0,o.createBlock)(l,{key:0,message:s.makeReqMsg},null,8,["message"])):(0,o.createCommentVNode)("",!0),(0,o.createVNode)(r,{max:255,message:"Maximum characters exceeded"}),"email"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(c,{key:1,validationCallback:e.validateEmail,message:"Email is invalid"},null,8,["validationCallback"])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1})],void 0,!0),_:1},8,["value","onValueChanged","id","input-attr"])):(0,o.createCommentVNode)("",!0),"textarea"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(u,{key:1,id:n.isoItem.id+"-dx","input-attr":{name:n.isoItem.id,id:n.isoItem.id,"aria-label":"enter "+n.isoItem.label},value:n.isoItem.submitted_value,onValueChanged:s.dxUpdate},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(d,{validationGroup:"tweikGroup"},{default:(0,o.withCtx)(()=>[n.isoItem.required?((0,o.openBlock)(),(0,o.createBlock)(l,{key:0,message:s.makeReqMsg},null,8,["message"])):(0,o.createCommentVNode)("",!0),(0,o.createVNode)(r,{max:4096,message:"Maximum characters exceeded"})],void 0,!0),_:1})],void 0,!0),_:1},8,["id","input-attr","value","onValueChanged"])):(0,o.createCommentVNode)("",!0),"number"===n.isoItem.type||"postal_code"===n.isoItem.type||"year"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(g,{key:2,onValueChanged:s.dxUpdate,value:parseInt(n.value),id:n.isoItem.id+"-dx","input-attr":{name:n.isoItem.id,id:n.isoItem.id,"aria-label":"enter "+n.isoItem.label},format:s.numberFormat(n.isoItem.type),max:2147483647,min:0,valueChangeEvent:"keyup"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(d,{validationGroup:"tweikGroup"},{default:(0,o.withCtx)(()=>[n.isoItem.required?((0,o.openBlock)(),(0,o.createBlock)(l,{key:0,message:s.makeReqMsg},null,8,["message"])):(0,o.createCommentVNode)("",!0),(0,o.createVNode)(p,{pattern:n.numberPattern,message:"Maximum value exceeded"},null,8,["pattern"]),"postal_code"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(p,{key:1,pattern:n.zipPattern,message:"Invalid zip code"},null,8,["pattern"])):(0,o.createCommentVNode)("",!0),"year"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(h,{key:2,type:"custom",reevaluate:!0,validationCallback:s.validYear,message:"Invalid year"},null,8,["validationCallback"])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1})],void 0,!0),_:1},8,["onValueChanged","value","id","input-attr","format"])):(0,o.createCommentVNode)("",!0),"currency"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(g,{key:3,onValueChanged:s.dxUpdate,i
1d:n.isoItem.id+"-dx","input-attr":{name:n.isoItem.id,id:n.isoItem.id,"aria-label":"enter "+n.isoItem.label},value:parseInt(n.value),format:"$ #,##0.##",max:2147483649,min:0},null,8,["onValueChanged","id","input-attr","value"])):(0,o.createCommentVNode)("",!0),"percent"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(g,{key:4,onValueChanged:s.dxUpdate,id:n.isoItem.id+"-dx","input-attr":{name:n.isoItem.id,id:n.isoItem.id,"aria-label":"enter "+n.isoItem.label},value:parseInt(n.value),format:"###.#####'%'",max:100,min:0},null,8,["onValueChanged","id","input-attr","value"])):(0,o.createCommentVNode)("",!0),"select"===n.isoItem.type||"boolean"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(v,{key:5,onValueChanged:s.dxUpdate,id:n.isoItem.id+"-dx","input-attr":{name:n.isoItem.id,id:n.isoItem.id,"aria-label":"enter "+n.isoItem.label},items:n.isoItem.answers,"display-expr":"answer_text","value-expr":"id",value:n.isoItem.selected_answers?.[0]},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(d,{validationGroup:"tweikGroup"},{default:(0,o.withCtx)(()=>[n.isoItem.required?((0,o.openBlock)(),(0,o.createBlock)(l,{key:0,message:s.makeReqMsg},null,8,["message"])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1})],void 0,!0),_:1},8,["onValueChanged","id","input-attr","items","value"])):(0,o.createCommentVNode)("",!0),"phone"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(m,{key:6,onValueChanged:s.dxUpdate,id:n.isoItem.id+"-dx","input-attr":{name:n.isoItem.id,id:n.isoItem.id,"aria-label":"enter "+n.isoItem.label},"mask-rules":n.phoneRules,"use-masked-value":!1,mask:"+1 (000) 000-0000","mask-invalid-message":"The phone must have a correct USA phone format",value:n.isoItem.submitted_value,ref:"phoneInput"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(d,{validationGroup:"tweikGroup",ref:"phoneValidator"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(k,{pattern:n.phonePattern,message:"The phone must have a correct USA phone format"},null,8,["pattern"]),n.isoItem.required?((0,o.openBlock)(),(0,o.createBlock)(l,{key:0,message:s.makeReqMsg},null,8,["message"])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1},512)],void 0,!0),_:1},8,["onValueChanged","id","input-attr","mask-rules","value"])):(0,o.createCommentVNode)("",!0),"date"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(y,{key:7,value:n.isoItem.submitted_value,name:n.isoItem.id+"-dx",id:n.isoItem.id+"-dx","input-attr":{name:n.isoItem.id,id:n.isoItem.id,"aria-label":"enter "+n.isoItem.label},onValueChanged:s.dxUpdate},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(d,{validationGroup:"tweikGroup"},{default:(0,o.withCtx)(()=>[n.isoItem.required?((0,o.openBlock)(),(0,o.createBlock)(l,{key:0,message:s.makeReqMsg},null,8,["message"])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1})],void 0,!0),_:1},8,["value","name","id","input-attr","onValueChanged"])):(0,o.createCommentVNode)("",!0),"multi select"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(b,{key:8,value:n.isoItem.selected_answers,"onUpdate:value":t[2]||(t[2]=e=>n.isoItem.selected_answers=e),"show-clear-button":!0,name:n.isoItem.id+"-dx",id:n.isoItem.id+"-dx","input-attr":{name:n.isoItem.id,id:n.isoItem.id,"aria-label":"enter "+n.isoItem.label},items:n.isoItem.answers,"value-expr":"id","display-expr":"answer_text",placeholder:"Select a value...",onValueChanged:t[3]||(t[3]=e=>s.syncTreeViewSelection(e))},{content:(0,o.withCtx)(()=>[(0,o.createVNode)(f,{ref:n.treeViewName,"data-source":n.isoItem.answers,"select-by-click":!0,"select-nodes-recursive":!1,"data-structure":"plain","key-expr":"id","value-expr":"id","display-expr":"answer_text","selection-mode":"multiple","show-check-boxes-mode":"normal",onContentReady:t[0]||(t[0]=e=>s.syncTreeViewSelection(e)),onSelectionChanged:t[1]||(t[1]=e=>s.treeView_itemSelectionChanged(e))},null,8,["data-source"])]),default:(0,o.withCtx)(()=>[(0,o.createVNode)(d,{validationGroup:"tweikGroup"},{default:(0,o.withCtx)(()=>[n.isoItem.required?((0,o.openBlock)(),(0,o.createBlock)(l,{key:0,message:s.makeReqMsg},null,8,["message"])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1})],void 0,!0),_:1},8,["value","name","id","input-attr","items"])):(0,o.createCommentVNode)("",!0),"string array"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(V,{key:9,required:n.isoItem.required,reqMsg:s.makeReqMsg,onUpdate:s.update,
1name:n.isoItem.id,id:n.isoItem.id,"aria-label":"enter "+n.isoItem.id,values:n.isoItem.submitted_value,emailMode:!1},null,8,["required","reqMsg","onUpdate","name","id","aria-label","values"])):(0,o.createCommentVNode)("",!0),"maturity"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(w,{key:10,itemIn:n.isoItem,onNistUpdate:s.nistUpdate,onAddFile:s.addFile,onDelFile:s.delFile},null,8,["itemIn","onNistUpdate","onAddFile","onDelFile"])):(0,o.createCommentVNode)("",!0),"domain ip"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(N,{key:11,parentHasError:n.domainValidationError,initialDomains:n.isoItem.submitted_value,item:n.isoItem,onUpdateDoms:s.update},null,8,["parentHasError","initialDomains","item","onUpdateDoms"])):(0,o.createCommentVNode)("",!0),"time frame"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(E,{key:12,item:n.isoItem,onUpdate:s.update},null,8,["item","onUpdate"])):(0,o.createCommentVNode)("",!0),"address"===n.isoItem.type?((0,o.openBlock)(),(0,o.createBlock)(x,{key:13,addressIn:n.isoItem.submitted_value,onUpdate:s.update},null,8,["addressIn","onUpdate"])):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("div",me,[n.isoItem.attach_files?((0,o.openBlock)(),(0,o.createElementBlock)("div",ue,[t[4]||(t[4]=(0,o.createElementVNode)("label",null,[(0,o.createElementVNode)("i",{class:"fas fa-paperclip blue"}),(0,o.createTextVNode)(" attachments ")],-1)),(0,o.createVNode)(C,null,{default:(0,o.withCtx)(()=>[(0,o.createVNode)(I,{onAddFile:s.addFile,onDelFile:s.delFile,onAddUrl:s.addUrl,onDelUrl:s.delUrl,parentValue:n.isoItem.associated_urls,item:n.isoItem,isSingleFile:!1},null,8,["onAddFile","onDelFile","onAddUrl","onDelUrl","parentValue","item"])],void 0,!0),_:1})])):(0,o.createCommentVNode)("",!0),(0,o.createElementVNode)("div",pe,[t[5]||(t[5]=(0,o.createElementVNode)("label",null,[(0,o.createElementVNode)("i",{class:"fas fa-comment blue"}),(0,o.createTextVNode)(" comments ")],-1)),(0,o.createVNode)(C,null,{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",he,[(0,o.createVNode)(u,{id:n.isoItem.id+"-comments-dx","input-attr":{name:n.isoItem.id+"-comments",id:n.isoItem.id+"-comments","aria-label":"enter comments "+n.isoItem.id},value:n.isoItem.comments,onValueChanged:s.updateComments},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(d,{validationGroup:"tweikGroup"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(r,{max:4096,message:"Maximum characters exceeded"})],void 0,!0),_:1})],void 0,!0),_:1},8,["id","input-attr","value","onValueChanged"])])],void 0,!0),_:1})])])])]),"maturity"!=this.isoItem.type&&this.isoItem.impact_rating?((0,o.openBlock)(),(0,o.createElementBlock)("div",ge,[(0,o.createElementVNode)("div",ve,[t[6]||(t[6]=(0,o.createElementVNode)("label",null,[(0,o.createElementVNode)("strong",null,"Impact Rating")],-1)),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(n.isoItem.impact_rating),1)]),(0,o.createElementVNode)("div",ke,[t[7]||(t[7]=(0,o.createElementVNode)("label",null,[(0,o.createElementVNode)("i",{class:"fas fa-asterisk blue"}),(0,o.createElementVNode)("strong",null," Maturity Rating ")],-1)),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(n.isoItem.maturity_rating),1)]),(0,o.createElementVNode)("div",ye,[t[8]||(t[8]=(0,o.createElementVNode)("label",null,[(0,o.createElementVNode)("strong",null,"Risk Impact Score")],-1)),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(e.parseScores(n.isoItem.risk_impact_score,2)),1)])])):(0,o.createCommentVNode)("",!0)])}i(7588),i(61701),i(18237);var be=i(97043);const Ve={class:"maturity-item"},we={class:"impact-rating"},Ne={class:"bold col-4"},Ee={class:"py-3"},xe={key:0},Ie={class:"secondary-question"},Ce={class:"row"},_e={class:"col-4"},Be={class:"col"},De={class:"col"},Se={class:"col-4"},Fe={class:"col"},Te={class:"col"},Ae={class:"col-4"},qe={class:"col"};function Ue(e,t,i,a,n,s){const l=(0,o.resolveComponent)("DxSwitch"),r=(0,o.resolveComponent)("infos"),c=(0,o.resolveComponent)("nistSelectBox"),d=(0,o.resolveComponent)("zoom-y-transition");return(0,o.openBlock)(),(0,o.createElementBlock)("div",Ve,[(0,o.createElementVNode)("div",we,[(0,o.createElementVNode)("p",Ne,[(0,o.createVNode)(l,{width:"70px",name:"mat_switch_dx",id:"mat_switch_dx","input-attr":{name:"mat_switch",id:"mat_switch","aria-label":"enter mat_switch"},switchedOnText:"Yes",switchedOffText:"No",value:n.mat_switch,"onUpdate:value":t[0]||(t[0]=e=>n.mat_switch=e),onValueChanged:s.updateItem},null,8,["value","onValueChanged"])])]),(0,o.createElementVNode)("div",Ee,[(0,o.createVNode)(d,null,{default:(0,o.withCtx)(()=>[n.mat_switch?((0,o.openBlock)(),(0,o.createElementBlock)("div",xe,[(0,o.createElementVNode)("div",Ie,[(0,o.createElementVNode)("div",Ce,[(0,o.createElementVNode)("div",_e,[(0,o.createElementVNode)("div",Be,[(0,o.createElementVNode)("label",null,[t[2]||(t[2]=(0,o.createTextVNode)("Policy",-1)),(0,o.createVNode)(r,{width:900},{default:(0,o.withCtx)(()=>[...t[1]||(t[1]=[(0,o.createElementVNode)("p",null,' Security policies are a formal set of rules which is issued by an organization to ensure that the user who are authorized to access company technology and information assets comply with rules and guidelines related to the security of information. It is a written document in the organization which is responsible for how to protect the organizations from threats and how to handles them when they will occur. A security policy also considered to be a "living document" which means that the document is never finished, but it is continuously updated as requirements of the technology and employee changes. ',-1)])],void 0,!0),_:1})]),(0,o.createVNode)(c,{itemId:"string"===typeof n.item.id?n.item.id:JSON.stringify(n.item.id),value:n.answers[0],name:"policy",onUpdate:s.updateItem},null,8,["itemId","value","onUpdate"])]),(0,o.createElementVNode)("div",De,[(0,o.createElementVNode)("label",null,[t[4]||(t[4]=(0,o.createTextVNode)("Measurement ",-1)),(0,o.createVNode)(r,{width:900},{default:(0,o.withCtx)(()=>[...t[3]||(t[3]=[(0,o.createElementVNode)("p",null," Quantitative evaluations normally addressed by management in the organizationâs computer security program. ",-1)])],void 0,!0),_:1})]),(0,o.createVNode)(c,{itemId:"string"===typeof n.item.id?n.item.id:JSON.stringify(n.item.id),value:n.answers[3],name:"measured",onUpdate:s.updateItem},null,8,["itemId","value","onUpdate"])])]),(0,o.createElementVNode)("div",Se,[(0,o.createElementVNode)("div",Fe,[(0,o.createElementVNode)("label",null,[t[6]||(t[6]=(0,o.createTextVNode)("Procedure ",-1)),(0,o.createVNode)(r,{width:900},{default:(0,o.withCtx)(()=>[...t[5]||(t[5]=[(0,o.createElementVNode)("p",{class:"mb-2"}," Businesses should use different cybersecurity procedures to keep their business data, cash flow, and customers safe online. These measures should aim to prevent risks from various sources, including: ",-1),(0,o.createElementVNode)("ul",null,[(0,o.createElementVNode)("li",{class:"mb-2"}," internet-borne attacks, eg spyware or malware "),(0,o.createElementVNode)("li",{class:"mb-2"}
1," user generated weaknesses, eg easily guessed password or misplaced information "),(0,o.createElementVNode)("li",{class:"mb-2"}," inherent system or software flaws and vulnerabilities "),(0,o.createElementVNode)("li",{class:"mb-2"}," subvert system or software features ")],-1)])],void 0,!0),_:1})]),(0,o.createVNode)(c,{itemId:"string"===typeof n.item.id?n.item.id:JSON.stringify(n.item.id),value:n.answers[1],name:"procedure",onUpdate:s.updateItem},null,8,["itemId","value","onUpdate"])]),(0,o.createElementVNode)("div",Te,[(0,o.createElementVNode)("label",null,[t[8]||(t[8]=(0,o.createTextVNode)("Management ",-1)),(0,o.createVNode)(r,{width:900},{default:(0,o.withCtx)(()=>[...t[7]||(t[7]=[(0,o.createElementVNode)("p",null," Techniques and concerns normally addressed by management in the organizationâs computer security program. They focus on managing the computer security program and the risk within the organization. ",-1)])],void 0,!0),_:1})]),(0,o.createVNode)(c,{itemId:"string"===typeof n.item.id?n.item.id:JSON.stringify(n.item.id),value:n.answers[4],name:"managed",onUpdate:s.updateItem},null,8,["itemId","value","onUpdate"])])]),(0,o.createElementVNode)("div",Ae,[(0,o.createElementVNode)("div",qe,[(0,o.createElementVNode)("label",null,[t[10]||(t[10]=(0,o.createTextVNode)("Implementation ",-1)),(0,o.createVNode)(r,{width:900},{default:(0,o.withCtx)(()=>[...t[9]||(t[9]=[(0,o.createElementVNode)("p",null," Cybersecurity controls, safeguards or countermeasures implemented by an organization to protect itself from an incident that may result in the compromise of electronic information. When discussing cybersecurity, a compromise of electronic information means any event that reduces the confidentiality, integrity, or availability of that electronic information. In a rapidly evolving technology and cybersecurity landscape, the conventional wisdom is that any organization can and will suffer a security incidentâitâs a matter of when, not if. This very premise is what makes the strategic and effective implementation of cybersecurity controls so important. ",-1)])],void 0,!0),_:1})]),(0,o.createVNode)(c,{itemId:"string"===typeof n.item.id?n.item.id:JSON.stringify(n.item.id),value:n.answers[2],name:"implemented",onUpdate:s.updateItem},null,8,["itemId","value","onUpdate"])])])])])])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1})])])}var Pe=i(17113);const Oe={id:"questionnaire-select-box"},$e={class:"custom-item"},Re={class:"product-name"};function Me(e,t,i,a,n,s){const l=(0,o.resolveComponent)("DxSelectBox");return(0,o.openBlock)(),(0,o.createElementBlock)("div",Oe,[(0,o.createVNode)(l,{id:i.itemId+"-"+e.dx,"input-attr":{name:i.itemId+"-q",id:i.itemId+"-q","aria-label":"enter "+i.itemId},items:n.scores,value:s.parseValue(i.value),"item-template":"customItem",onValueChanged:s.update},{customItem:(0,o.withCtx)(e=>[(0,o.createElementVNode)("div",$e,[(0,o.createElementVNode)("div",Re,(0,o.toDisplayString)(e.data)+"%",1)])]),_:1},8,["id","input-attr","items","value","onValueChanged"])])}var Le={props:{itemId:String,name:String,value:[Number,String]},components:{DxSelectBox:g.ad},methods:{update(e){this.$emit("update",{name:this.name,value:e.value})},parseValue(e){try{return parseInt(e)}catch(t){return console.log(t),0}}},data(){return{scores:[0,25,50,75,100]}}},je=i(66262);const Ke=(0,je.A)(Le,[["render",Me]]);var We=Ke,He=i(66028),ze={name:"nist-item",props:{itemIn:[Object,Array]},components:{nistSelectBox:We,DxSwitch:Pe.n,infos:He.A,ZoomYTransition:le.WB},data(){return{item:null,mat_switch:!1,scores:[0,25,50,75,100],answers:["0","0","0","0","0","false"]}},methods:{updateItem(e){if(e.name){const t=["policy","procedure","implemented","measured","managed"];this.answers[t.indexOf(e.name)]=e.value}this.answers[5]=this.mat_switch.toString(),this.mat_switch||(this.answers[0]="0",this.answers[1]="0",this.answers[2]="0",this.answers[3]="0",this.answers[4]="0"),this.item.submitted_value=this.answers,this.$emit("nistUpdate",this.item)}},created(){this.item=JSON.parse(JSON.stringify(this.itemIn)),this.item.submitted&&this.item.submitted_value?(this.answers=this.item.submitted_value,this.mat_switch="true"===this.item.submitted_value[5]):this.item.submitted_value=this.answers}};const Ge=(0,je.A)(ze,[["render",Ue],["__scopeId","data-v-817d0bec"]]);
1var Qe=Ge,Je=i(70396);const Ye={class:"questionnaire-file-uploader"},Ze={key:0},Xe={key:1},et={key:"existing-files"},tt=["id","name","aria-label","onClick"],it=["id","name","aria-label","onClick"],ot={key:"open-edit",class:"mt-3"},at={key:"edit-url",class:"edit-url mt-3"},nt={class:"row no-pad"},st={class:"col"},lt={class:"col"},rt={key:0,class:"error mt-2"},ct={key:"browse-file",class:"uploading mt-3"},dt={class:"row no-pad"},mt={class:"col"},ut={key:"no-file",class:"file-input-wrap"},pt={key:"show-file-name",class:"file-name"},ht={id:"errors"},gt={id:"delete-consent"},vt={class:"text-center"},kt={key:0},yt={key:1},ft={key:2},bt={key:3},Vt={id:"consent-button-wrap"};function wt(e,t,i,a,n,s){const l=(0,o.resolveComponent)("font-awesome-icon"),r=(0,o.resolveComponent)("DxTextBox"),c=(0,o.resolveComponent)("fade-transition"),d=(0,o.resolveComponent)("dx-popup");return(0,o.openBlock)(),(0,o.createElementBlock)("div",Ye,[i.isSingleFile&&s.attachAvailable?((0,o.openBlock)(),(0,o.createElementBlock)("label",Ze,"You may attach one document or URL below")):(0,o.createCommentVNode)("",!0),i.isSingleFile?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("label",Xe,[...t[10]||(t[10]=[(0,o.createTextVNode)("You may attach ",-1),(0,o.createElementVNode)("strong",null,"multiple",-1),(0,o.createTextVNode)(" documents or URLs below",-1)])])),(0,o.createVNode)(c,{group:""},{default:(0,o.withCtx)(()=>[s.currentFiles&&s.currentFiles.length>0||i.parentValue&&i.parentValue.length>0?((0,o.openBlock)(),(0,o.createElementBlock)("div",et,[(0,o.createElementVNode)("label",null,[t[11]||(t[11]=(0,o.createTextVNode)("Attached File",-1)),i.isSingleFile?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createTextVNode)("s")],64))]),(0,o.createElementVNode)("ul",null,[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(s.currentFiles,(e,t)=>((0,o.openBlock)(),(0,o.createElementBlock)("li",{key:t,class:"close-edit","data-toggle":"tooltip","data-placement":"top",title:"Delete Document"},[(0,o.createElementVNode)("span",{id:"delete-doc-consent"+t,name:"delete-doc-consent"+t,"aria-label":"delete document consent "+t,onClick:t=>s.openFileDeleteConsent(e),role:"button"},[(0,o.createVNode)(l,{class:"error",icon:"times-circle","data-toggle":"tooltip",title:"Delete Document"})],8,tt),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(e.name),1)]))),128)),i.parentValue&&i.parentValue.length?((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,{key:0},(0,o.renderList)(i.parentValue,(e,t)=>((0,o.openBlock)(),(0,o.createElementBlock)("li",{key:"url_"+t,class:"close-edit","data-toggle":"tooltip","data-placement":"top",title:"Delete Url"},[(0,o.createElementVNode)("span",{id:"url-delete-consent-"+t,name:"url-delete-consent-"+t,"aria-label":"url delete consent "+t,onClick:i=>s.openUrlDeleteConsent(t,e),role:"button"},[(0,o.createVNode)(l,{class:"error",icon:"times-circle","data-toggle":"tooltip",title:"Delete Url"})],8,it),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(e),1)]))),128)):(0,o.createCommentVNode)("",!0)])])):(0,o.createCommentVNode)("",!0),s.attachAvailable?((0,o.openBlock)(),(0,o.createElementBlock)("div",ot,[(0,o.createElementVNode)("div",{onClick:t[0]||(t[0]=(...e)=>s.openUpload&&s.openUpload(...e)),class:"blank-button"},"Upload File"),(0,o.createElementVNode)("div",{onClick:t[1]||(t[1]=(...e)=>s.openUrlEdit&&s.openUrlEdit(...e)),class:"blank-button ml-3"},"Submit URL")])):(0,o.createCommentVNode)("",!0),n.urlEditing?((0,o.openBlock)(),(0,o.createElementBlock)("div",at,[(0,o.createElementVNode)("div",nt,[(0,o.createElementVNode)("div",st,[(0,o.createVNode)(r,{id:"url-input-dx","input-attr":{name:"url-input",id:"url-input","aria-label":"enter url-input"},modelValue:n.urlInput,"onUpdate:modelValue":t[2]||(t[2]=e=>n.urlInput=e),placeholder:"url"},null,8,["modelValue"])]),(0,o.createElementVNode)("div",lt,[(0,o.createElementVNode)("div",{id:"submit-url",name:"submit-url","aria-label":"submit url",role:"button",onClick:t[3]||(t[3]=(...e)=>s.submitUrl&&s.submitUrl(...e)),class:"blank-button ml-3"}," Submit "),(0,o.createElementVNode)("div",{id:"cancel-url",name:"cancel-url","aria-label":"cancel url",role:"button",onClick:t[4]||(t[4]=e=>s.cancelUrl()),class:"blank-button ml-3"}," Cancel ")])]),n.urlError?((0,o.openBlock)(),(0,o.createElementBlock)("label",rt,"invali
1d url")):(0,o.createCommentVNode)("",!0)])):(0,o.createCommentVNode)("",!0),n.uploading?((0,o.openBlock)(),(0,o.createElementBlock)("div",ct,[(0,o.createElementVNode)("div",dt,[(0,o.createElementVNode)("div",mt,[(0,o.createVNode)(c,{group:""},{default:(0,o.withCtx)(()=>[n.file?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("div",ut,[(0,o.createElementVNode)("input",{type:"file",class:"file",ref:"file",onChange:t[5]||(t[5]=e=>s.selectFile()),name:"tweik-file-upload",id:"tweik-file-upload","aria-label":"tweik file upload"},null,544),n.file?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:0,id:"close-edit",name:"close-edit","aria-label":"close edit",role:"button",onClick:t[6]||(t[6]=(...e)=>s.closeEdit&&s.closeEdit(...e)),class:"blank-button mr-3"}," Cancel "))])),n.file?((0,o.openBlock)(),(0,o.createElementBlock)("div",pt,[(0,o.createElementVNode)("label",null,(0,o.toDisplayString)(n.file.name),1)])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1})]),t[12]||(t[12]=(0,o.createElementVNode)("div",{class:"col"},null,-1))])])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1}),(0,o.createElementVNode)("ul",ht,[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(n.errors,e=>((0,o.openBlock)(),(0,o.createElementBlock)("li",{class:"error text-left py-2",key:e.key},(0,o.toDisplayString)(e),1))),128))]),t[17]||(t[17]=(0,o.createElementVNode)("label",{class:"note mt-2"},"Note: Uploading does not occur until item is saved",-1)),(0,o.createVNode)(d,{id:"q-file-consent-modal",height:s.popupHeight,width:s.popupWidth,visible:n.consentOpen,"onUpdate:visible":t[9]||(t[9]=e=>n.consentOpen=e),"show-title":!1},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",gt,[(0,o.createElementVNode)("p",vt,[t[13]||(t[13]=(0,o.createTextVNode)(" Are you sure you want to delete ",-1)),n.delUrl?((0,o.openBlock)(),(0,o.createElementBlock)("span",kt,(0,o.toDisplayString)(n.delUrl),1)):((0,o.openBlock)(),(0,o.createElementBlock)("span",yt,(0,o.toDisplayString)(n.delFile.name),1)),t[14]||(t[14]=(0,o.createTextVNode)("?",-1)),t[15]||(t[15]=(0,o.createElementVNode)("br",null,null,-1)),t[16]||(t[16]=(0,o.createElementVNode)("br",null,null,-1)),n.delUrl?((0,o.openBlock)(),(0,o.createElementBlock)("span",ft," Note: deletion of URLs will not take place until item is saved. ")):((0,o.openBlock)(),(0,o.createElementBlock)("span",bt," Note: deletion of files is permanent and occurs immediately. "))]),(0,o.createElementVNode)("div",Vt,[(0,o.createElementVNode)("a",{id:"delete",name:"delete","aria-label":"delete",role:"button",onClick:t[7]||(t[7]=(...e)=>s.delFileUrl&&s.delFileUrl(...e)),class:"delete-button"},"Delete"),(0,o.createElementVNode)("a",{id:"cancel-delete",name:"cancel-delete","aria-label":"cancel delete",role:"button",onClick:t[8]||(t[8]=(...e)=>s.closeConsent&&s.closeConsent(...e)),class:"delete-button"},"Cancel")])])],void 0,!0),_:1},8,["height","width","visible"])])}var Nt=i(679),Et=i(16498),xt={components:{FadeTransition:le.AV,DxPopup:Nt.jF,DxTextBox:Et.Ay},data(){return{delUrlIndex:null,delUrl:null,urlError:!1,urlEditing:!1,delFile:{name:"",id:null},consentOpen:!1,existingFiles:[],newFiles:[],uploading:!1,errors:[],file:null,targetID:null,newFileID:0,urlInput:null}},props:{item:Object,isSingleFile:Boolean,parentValue:[Array,Object]},computed:{attachAvailable(){return!this.uploading&&!this.urlEditing&&(!this.isSingleFile||!(this.currentFiles&&this.currentFiles.length||this.parentValue&&this.parentValue.length))},currentFiles(){return this.existingFiles.concat(this.newFiles)},popupWidth(){return this.$store.getters.windowWidth,this.gPopupWidth(600)},popupHeight(){return this.$store.getters.windowHeight,this.gPopupHeight(200)}},methods:{init(){this.item.associated_files&&(this.existingFiles=this.item.associated_files)},validUrl(e){const t=new RegExp(/^(http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/,"i");return e.match(t)},cancelUrl(){this.urlEditing=!1},submitUrl(){if(this.urlInput){this.urlError=!1;const e=this.validUrl(this.urlInput);e?(e.includes("http://")||e.includes("https://")||(this.urlInput="http://"+this.urlInput),this.$emit("addUrl",this.urlInput),this.urlEditing=!1):this.urlError=!0}},openUrlEdit(){this.urlEditing=!0},openUrlDeleteConsent(e,t){this.delUrlIndex=e,this.delUrl=t,this.consentOpen=!0},openFileDeleteConsent(e){this.delUrlIndex=null,this.delUrl=null,this.delFile=e,this.consentOpen=!0},closeConsent(){this.consentOpen=!1},updateNewFiles(e){e["id"]=this.item.id+this.newFileID,this.newFileID++,this.newFiles.push(e),this.uploading=!1,this.file=null},openUpload(){this.uploading=!0},closeEdit(){this.errors=[],this.uploading=!1},delFileUrl(){if(null!==this.delUrlIndex)this.$emit("delUrl",this.delUrlIndex);else{if("Object"===this.delFile.constructor.name){const e=this.existingFiles.map(function(e){return e.id}).indexOf(this.delFile.id);this.existingFiles.splice(e,1),this.$emit("delFile",{item:this.item,fileID:this.delFile.id,isNew:!1})}else{const e=this.newFiles.map(function(e){return e.id}).indexOf(this.delFile.id);this.newFiles.splice(e,1)}this.$emit("delFile",{item:this.item,fileID:this.delFile.id,isNew:!0})}this.consentOpen=!1},getExtension(e){const t=e.split(".");return t[t.length-1]},selectFile(){this.errors=[],this.file=this.$refs.file.files[0];const e=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],t=this.getExtension(this.file.name),i=["doc","docx","pdf","DOC","DOCX","PDF"];e.includes(this.file.type)&&i.includes(t)||this.errors.push("Error: File must be an accepted format ( pdf, doc, or docx )"),this.file.size>4194304&&this.errors.push("Error: File may not exceed 4MB in size"),0===this.errors.length?(this.fileName=this.file.name,this.$emit("addFile",{item:this.item,file:this.file}),this.updateNewFiles(this.file)):this.file=null}},created(){this.init()},beforeUnmount(){this.newFiles=[]}};const It=(0,je.A)(xt,[["render",wt],["__scopeId","data-v-4d5f5f54"]]);var Ct=It;const _t={class:"customDomainEditor"},Bt=["value"],Dt=["id","name","aria-label","onClick"],St={class:"domIP-input"},Ft={class:"dxtxt-wrap"},Tt={class:"www-consent-wrapper"};function At(e,t,i,a,n,s){const l=(0,o.resolveComponent)("DxCustomRule"),r=(0,o.resolveComponent)("DxValidator"),c=(0,o.resolveComponent)("DxTextBox"),d=(0,o.resolveComponent)("DxScrollView"),m=(0,o.resolveComponent)("DxPopup");return(0,o.openBlock)(),(0,o.createElementBlock)("div",_t,[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(n.domArray,(e,i)=>((0,o.openBlock)(),(0,o.createElementBlock)("li",{key:i,value:e},[(0,o.createTextVNode)((0,o.toDisplayString)(e)+" ",1),(0,o.createElementVNode)("span",{id:"delete-ip-"+i,name:"delete-ip-"+i,"aria-label":"delete domain ip "+i,onClick:e=>s.deleteDomIP(i,"dom"),role:"button"},[...t[5]||(t[5]=[(0,o.createElementVNode)("i",{class:"fas fa-times-circle"},null,-1)])],8,Dt)],8,Bt))),128)),(0,o.createElementVNode)("div",St,[(0,o.createElementVNode)("div",Ft,[((0,o.openBlock)(),(0,o.createBlock)(c,{modelValue:n.domIPInput,"onUpdate:modelValue":t[0]||(t[0]=e=>n.domIPInput=e),id:"dom-input-dx","input-attr":{name:"domIPInput",id:"domIPInput","aria-label":"enter domIPInput"}
1,key:n.counter,onEnterKey:s.updateInput,valueChangeEvent:"keyup","show-clear-button":!0,placeholder:"Type Domain Or IP"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(r,{type:"custom"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(l,{"validation-callback":s.customValidation,message:"At least one domain or IPv4 is required. Hit enter or click plus icon to add."},null,8,["validation-callback"])],void 0,!0),_:1})],void 0,!0),_:1},8,["modelValue","onEnterKey"]))]),(0,o.createElementVNode)("span",{id:"validate-domain",name:"validate-domain","aria-label":"validate domain",onClick:t[1]||(t[1]=(...e)=>s.validateDomain&&s.validateDomain(...e)),role:"button"},[...t[6]||(t[6]=[(0,o.createElementVNode)("i",{class:"fas fa-plus-circle"},null,-1)])])]),(0,o.createElementVNode)("p",{class:(0,o.normalizeClass)([{error:n.messageErrorClass},"message"])},(0,o.toDisplayString)(n.message),3),(0,o.createVNode)(m,{id:"",visible:n.alertOpen,"onUpdate:visible":t[4]||(t[4]=e=>n.alertOpen=e),"drag-enabled":!0,hideOnOutsideClick:!0,"show-title":!0,width:s.popupWidth,height:s.popupHeight,title:"Warning!"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(d,null,{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",Tt,[t[7]||(t[7]=(0,o.createElementVNode)("p",null,' You have prefixed your domain with "www," which will exclude all domains and subdomains without this prefix, and may lead to inaccurate results. Unless you intend to focus only on these results, we advise you to remove this part of the URL. ',-1)),(0,o.createElementVNode)("a",{id:"remove-www",name:"remove-www","aria-label":"remove-www",role:"button",onClick:t[2]||(t[2]=e=>s.removeWWW()),class:"www-consent-button"},'Proceed without "www"'),(0,o.createElementVNode)("a",{id:"keep-www",name:"keep-www","aria-label":"keep www",role:"button",onClick:t[3]||(t[3]=e=>s.keepWWW()),class:"www-consent-button"},'Keep "www"')])],void 0,!0),_:1})],void 0,!0),_:1},8,["visible","width","height"])])}var qt=i(43809),Ut=i.n(qt),Pt={name:"domIPeditor",components:{DxPopup:Nt.jF,DxScrollView:h.$,DxTextBox:g.HA,DxValidator:be.Z2,DxCustomRule:be.CC},props:{initialDomains:null,item:Object},data(){return{counter:0,alertOpen:!1,domIPInput:"",message:"",messageErrorClass:!1,domArray:[]}},computed:{popupWidth(){return this.$store.getters.windowWidth>400?400:this.$store.getters.windowWidth-50},popupHeight(){return this.$store.getters.windowHeight>300?300:this.$store.getters.windowHeight-50}},created(){this.initialDomains&&(this.domArray=this.initialDomains)},beforeUnmount(){this.domArray=[]},methods:{customValidation(){return!(this.item.required&&!this.domArray.length)},updateInput(e){e.component._options.text&&(this.domIPInput=e.component._options.text,this.validateDomain())},deleteDomIP:function(e){this.domArray.splice(e,1),this.emitChange()},validateIPaddress(e){if(/^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$/.test(e)){const t=e.split("/");if(t.length>1){const e=t[1];return!(parseInt(e)<24)}return!0}return!1},checkWWW(){const e=this.domIPInput.split(".");return"www"===e[0]},removeWWW(){this.domIPInput=this.domIPInput.replace("www.",""),this.validateDomain(),this.alertOpen=!1},keepWWW(){this.addDomain("dom"),this.alertOpen=!1},validateDomain(){Ut()(this.domIPInput)?this.checkWWW()?this.alertOpen=!0:this.addDomain("dom"):this.validateIPaddress(this.domIPInput)?this.addDomain("ip"):(this.message='That domain or IPv4 address appears invalid, please do not include "http://" or any subdirectories in domains. If using CIDR notation for an IP, the subnet mask ( /xx ) must be greater than 23',this.messageErrorClass=!0)},addDomain(){this.domArray.includes(this.domIPInput)?(this.message="That domain or IP "+this.domIPInput+" is already in use for this target",this.messageErrorClass=!0):(this.domArray.push(this.domIPInput),this.domIPInput="",this.message="Domain added",this.messageErrorClass=!1,this.emitChange(),this.counter++)},fixCIDR(e){const t=[];for(let i of e)i.includes("/")||(i+="/32"),t.push(i);return t},emitChange(){this.$emit("updateDoms",this.domArray)}}};
1const Ot=(0,je.A)(Pt,[["render",At],["__scopeId","data-v-780c056a"]]);var $t=Ot,Rt=i(29280);const Mt={class:"time-frame"},Lt={class:"row no-pad"},jt={class:"col pr-3"},Kt={class:"col pl-3"};function Wt(e,t,i,a,n,s){const l=(0,o.resolveComponent)("dx-required-rule"),r=(0,o.resolveComponent)("DxValidator"),c=(0,o.resolveComponent)("DxSelectBox"),d=(0,o.resolveComponent)("dx-number-box");return(0,o.openBlock)(),(0,o.createElementBlock)("div",Mt,[(0,o.createElementVNode)("div",Lt,[(0,o.createElementVNode)("div",jt,[t[2]||(t[2]=(0,o.createElementVNode)("label",null,"Unit of Measure",-1)),(0,o.createVNode)(c,{items:i.item.values,modelValue:n.unit,"onUpdate:modelValue":t[0]||(t[0]=e=>n.unit=e),id:"unit-measure-dx","input-attr":{name:"unit-measure",id:"unit-measure","aria-label":"enter unit-measure"},onValueChanged:s.emitChange},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(r,null,{default:(0,o.withCtx)(()=>[(0,o.createVNode)(l,{message:"Unit of Measure required"})],void 0,!0),_:1})],void 0,!0),_:1},8,["items","modelValue","onValueChanged"])]),(0,o.createElementVNode)("div",Kt,[t[3]||(t[3]=(0,o.createElementVNode)("label",null,"Number of Units",-1)),(0,o.createVNode)(d,{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=e=>n.value=e),id:"number-units-dx","input-attr":{name:"number-of-units",id:"number-of-units","aria-label":"enter number-of-units"},min:1,max:2147483649,format:"####0",onValueChanged:s.emitChange},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(r,null,{default:(0,o.withCtx)(()=>[(0,o.createVNode)(l,{message:"Number of Units is required"})],void 0,!0),_:1})],void 0,!0),_:1},8,["modelValue","onValueChanged"])])])])}var Ht={components:{DxSelectBox:g.ad,DxNumberBox:g.py,DxValidator:be.Z2,DxRequiredRule:be.az},props:{item:Object},data(){return{value:1,unit:null}},methods:{init(){2===this.item.selected_answers?.length&&(this.value=parseInt(this.item.selected_answers[0]),this.unit=this.item.selected_answers[1])},emitChange(){this.$emit("update",[this.value,this.unit])}},created(){this.init()}};const zt=(0,je.A)(Ht,[["render",Wt]]);var Gt=zt,Qt={components:{DxTextBox:g.HA,DxTextArea:g.R$,DxNumberBox:g.py,DxValidator:be.Z2,DxSelectBox:g.ad,DxDateBox:g.oq,DxDropDownBox:g.v7,DxTreeView:g.mq,fileUploader:Ct,DxRequiredRule:be.az,DxPatternRule:be.zu,DxStringLengthRule:be.Wx,DxCustomRule:be.CC,stringArray:Je.A,domainIp:$t,nistItem:Qe,internationalAddress:Rt.A,timeFrame:Gt,CollapseTransition:le.ZQ},props:{itemIn:Object,itemID:String},data(){return{isoItem:null,valueBackup:null,value:null,comments:null,show:!1,treeViewName:this.itemID+"-tree-view",phoneRules:{X:/[02-9]/},phonePattern:/^\d{10}$/,numberPattern:/^.{0,13}$/,zipPattern:/^\d{5}$/,isValid:!0,yearPattern:/^\d{4}$/,domainValidationError:0,legacyRequirementTypes:["phone","email","string","number","percent","currency","time_frame","date","year","postal_code","textarea","string array","maturity"],protectRequirementTypes:["select","boolean","multi select"]}},computed:{makeReqMsg(){return this.isoItem.label+" is required"}},created(){this.isoItem=this.itemIn;const e=["file","multi file"];e.includes(this.isoItem.type)&&(this.filesOpen=!0)},methods:{numberFormat(e){return"number"===e?"#,##0":null},validYear(e){if(e.value){const t=(new Date).getFullYear(),i=new RegExp(this.yearPattern).test(e.value);return!!(i&&e.value<=t)}return!0},addUrl(e){this.isoItem.associated_urls&&Array.isArray(this.isoItem.associated_urls)?this.isoItem.associated_urls.push(e):this.isoItem.associated_urls=[e],this.emitChange()},delUrl(e){this.isoItem.associated_urls.splice(e,1),this.emitChange()},addFile(e){this.$emit("addFile",e)},delFile(e){this.$emit("delFile",e)},handleFileValidation(e){this.isValid=e},emitChange(){this.$store.dispatch("updateTweikItem",this.isoItem),this.$emit("valueChanged")},updateComments(e){this.isoItem.comments=e.value,this.emitChange()},updateImpactRating(e){this.isoItem.impact_rating=e.value,this.emitChange()},dxUpdate(e){this.protectRequirementTypes.includes(this.isoItem.type)?"boolean"===this.isoItem.type||"select"===this.isoItem.type?(console.log("dxUpdate"+e.value),this.isoItem.selected_answers=[e.value]):this.isoItem.selected_answers=e.value:this.isoItem.submitted_value=e.value,this.isoItem.submitted=this.evaluateSubmission(),this.setMaturityRating(),this.setRiskImpactScore(),this.emitChange()},update(e){this.isoItem.submitted_value=e,this.isoItem.submitted=this.evaluateSubmission(),this.emitChange()},nistUpdate(e){this.isoItem.submitted_value=e.submitted_value,this.isoItem.submitted=this.evaluateSubmission(),this.setMaturityRating(),this.setRiskImpactScore(),this.emitChange()},syncTreeViewSelection(e){const t=e.component.selectItem&&e.component||this.$refs[this.treeViewName]&&this.$refs[this.treeViewName].instance;if(t)if(null===e.value)t.unselectAll();else{const i=e.value||this.isoItem.selected_answers;
1i&&i.forEach(function(e){t.selectItem(e)}),console.log("syncTreeViewSelection",i)}this.setMaturityRating(),this.setRiskImpactScore(),this.emitChange()},treeView_itemSelectionChanged(e){this.isoItem.selected_answers=e.component.getSelectedNodeKeys(),this.isoItem.submitted=this.evaluateSubmission(),this.emitChange()},evaluateSubmission(){const e=this.isoItem.submitted_value;if(this.protectRequirementTypes.includes(this.isoItem.type))return!!this.isoItem.selected_answers?.length;if(Array.isArray(e)&&e.length){const t=e.map(e=>"string"===typeof e?e:JSON.stringify(e));return this.isoItem.submitted_value=t,!0}return!("string"!==typeof e||!e.length)||("number"===typeof e||"boolean"===typeof e||"object"===typeof e&&null!==e)},setMaturityRating(){const e=this.isoItem.answers,t=this.isoItem.submitted_value;if("maturity"===this.isoItem.type)Array.isArray(t)&&6==t.length&&(this.isoItem.maturity_rating=.25*t[0]+.25*t[1]+.25*t[2]+.15*t[3]+.1*t[4]);else if("boolean"===this.isoItem.type||"select"===this.isoItem.type||"multi select"===this.isoItem.type){if(0===e.length)return void(this.isoItem.maturity_rating=0);const t=this.isoItem.selected_answers.map(t=>{const i=e.find(e=>String(e.id)===String(t));return i?i.maturity_value:0});this.isoItem.maturity_rating=t.reduce((e,t)=>parseInt(e)+parseInt(t),0)}else this.isoItem.maturity_rating=e?.find(({answer_text:e})=>e===this.isoItem.submitted_value)?.maturity_value},setRiskImpactScore(){this.isoItem.impact_rating&&this.isoItem.maturity_rating?this.isoItem.risk_impact_score=(100-this.isoItem.maturity_rating)/100*(25*(this.isoItem.impact_rating-(1===this.isoItem.impact_rating?.1:1))):this.isoItem.risk_impact_score=100}},mounted(){this.emitChange()}};const Jt=(0,je.A)(Qt,[["render",fe],["__scopeId","data-v-7b91ce31"]]);var Yt=Jt,Zt=i(72279);const Xt={class:"external-link"},ei={id:"consent-modal"},ti={class:"consent-buttons"},ii=["href"];function oi(e,t,i,a,n,s){const l=(0,o.resolveComponent)("dx-popup");return(0,o.openBlock)(),(0,o.createElementBlock)("div",Xt,[(0,o.createElementVNode)("span",{id:"open-external-link",name:"open-external-link","aria-label":"open external link",role:"button",onClick:t[0]||(t[0]=e=>n.popup=!0),class:"link-text d-inline-block no-breaks"},[...t[3]||(t[3]=[(0,o.createElementVNode)("i",{class:"fas fa-external-link-square"},null,-1),(0,o.createTextVNode)(" open external link",-1)])]),(0,o.createVNode)(l,{key:"uploadPopup",height:e.gPopupHeight(300),width:e.gPopupWidth(500),visible:n.popup,"onUpdate:visible":t[2]||(t[2]=e=>n.popup=e),title:"Uploading Files",showCloseButton:!0},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",ei,[t[4]||(t[4]=(0,o.createElementVNode)("h6",{class:"grande"},[(0,o.createElementVNode)("i",{class:"fas fa-exclamation-triangle error"}),(0,o.createTextVNode)(" Warning ")],-1)),t[5]||(t[5]=(0,o.createElementVNode)("p",null," You are now leaving CyRisk. We do not control the content of the page you will be visiting ",-1)),(0,o.createElementVNode)("div",ti,[(0,o.createElementVNode)("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",class:"blank-button"},"Proceed",8,ii),(0,o.createElementVNode)("div",{onClick:t[1]||(t[1]=e=>n.popup=!1),id:"close-popup",name:"close-popup","aria-label":"close popup",role:"button",class:"blank-button"}," Cancel ")])])],void 0,!0),_:1},8,["height","width","visible"])])}var ai={components:{DxPopup:Nt.jF},data(){return{popup:!1}},props:{url:String},methods:{close(){this.$emit("close")}}};const ni=(0,je.A)(ai,[["render",oi],["__scopeId","data-v-3346ae06"]]);var si=ni,li=i(40464),ri=i(18017),ci=i(40925),di={components:{CollapseTransition:le.ZQ,tweikEdit:Yt,preloader:Zt.A,externalLink:si,infos:He.A,DxValidationSummary:g.US,DxValidationGroup:li.A,DxPopup:Nt.jF},props:{isItemEditable:{type:Boolean,default:()=>!0},editMode:{type:Boolean,default:()=>!1},item:[Object,String,Array],tweikID:[String,Number],focusItem:String,itemID:String,releaseKey:Object,isUnmet:Boolean},data(){return{loading:!1,value:null,isItemBeingEdited:!1,computedKey:0,copying:!1,editEnd:!1}},watch:{releaseKey:{deep:!0,handler(){this.releaseKey&&this.releaseKey.tweikId===this.tweikI
1D&&(this.loading=!1,this.isItemBeingEdited=!1)}}},computed:{hydratedSelectedAnswers(){return this.item.selected_answers?this.item.answers.filter(e=>{if(this.item.selected_answers.includes(e.id))return e}):[]},addressDisplay(){return this.value?this.value.street_number+" "+this.value.route+", "+this.value.locality+", "+this.value.state_code+" "+this.value.postal_code+", "+this.value.country_code:"Not Provided"},highlighted(){return this.focusItem===this.makeID},makeID(){return this.tweikID+"_"+this.item.id}},methods:{valueChanged(e){this.$emit("valueChanged",e)},onCopy(){this.copying=!0,this.dialog("Url copied to clipboard"),setTimeout(()=>{this.copying=!1},200)},onError(){this.catchError("error copying value to clipboard"),console.error("error copying value to clipboard"),setTimeout(()=>{this.$store.dispatch("logout")},5e3)},emitFileDownload(e){this.$emit("download",e)},cancel(e){this.$emit("cancel",e),"address"===this.item.type&&(this.value=e.submitted_value),this.loading=!0},addFile(e){this.$emit("addFile",e)},delFile(e){this.$emit("delFile",e)},prettyDate(e){const t=new Date(e);return t.toLocaleDateString("en-US").toLocaleString().split(",")[0]},maskPhone(e){let t=e.match(/(\d{3})(\d{3})(\d{4})/);return t="+1 ("+t[1]+") "+t[2]+"-"+t[3],t},toggleItemEdit(){this.$emit("setActiveSection"),this.isItemBeingEdited=!this.isItemBeingEdited},saveItem(){ci.A.validateGroup("tweikGroup").isValid&&(this.loading=!0,this.$emit("saveChanges"))},toggleEditEnd(){this.editEnd=!this.editEnd},cancelEdit(){this.loading=!0,this.isItemBeingEdited=!1,this.toggleEditEnd(),this.$emit("cancel")},formatCurrency(e){return(0,ri.Cj)(e)},formatText(e,t){return(0,ri.zg)(e,t)}},created(){this.item.submitted_value&&(this.value=this.item.submitted_value)}};const mi=(0,je.A)(di,[["render",se],["__scopeId","data-v-50e23845"]]);var ui=mi,pi=i(29357),hi=class{constructor(e){(0,pi.A)(this,"tweikData",void 0),this.tweikData=e}getDep(e){for(const t of this.tweikData)for(const i of t.items)for(const t of i.items)if(e==t.question_id)return t}checkDeps(e){const t=this.getDep(e.deps);return this.depEval(e,t)}depEval(e,t){if(t.submitted_value||t.selected_answers.length>0)if("boolean"===t.type){const i=this.stringToBool(e.depValue),o="Yes"===this.mapAnswersText(t)[0];if(o===i)return!0}else{if("maturity"===t.type)return this.stringToBool(t.submitted_value[5])===this.stringToBool(e.depValue);if(Array.isArray(t.selected_answers)){const i=[];for(const e of this.mapAnswersText(t))i.push(e.toLowerCase());if(i.includes(e.depValue.toLowerCase()))return!0}else{if(("string"===t.type||"textarea"===t.type)&&t.selected_answers.includes(e.id))return!0;if("time frame"!==t.type)return!1;if(e.depValue===t.submitted_value.join(" "))return!0}}return!1}stringToBool(e){return"true"===`${e}`.toLowerCase()}mapAnswersText(e){return e.answers.filter(({id:t})=>t===e.selected_answers[0])?.map(({answer_text:e})=>e)}},gi={components:{tweikItem:ui,DxValidationSummary:g.US,DxValidationGroup:li.A,DxPopup:Nt.jF,preloader:Zt.A,CollapseTransition:le.ZQ},props:{isItemEditable:{type:Boolean,default:()=>!0},sectionIn:Object,tweikID:[String,Number],focusItem:String,sectionID:String,releaseKey:Object,status:Object,changeTracker:Number},data(){return{itemKey:0,editMode:!1,editEnd:!1,section:{label:"loading"},sectionBackup:JSON.parse(JSON.stringify(this.sectionIn)),loading:!0}},watch:{releaseKey:{deep:!0,handler(){this.releaseKey&&this.releaseKey.sectionId===this.section.id&&this.releaseKey.tweikId===this.tweikID&&this.init()}}},computed:{unmetRequirements(){return this.status?this.reqs2list():[]},highlighted(){return this.focusItem===this.makeID},makeID(){return this.tweikID+"_"+this.section.id},visibleItems(){this.changeTracker,this.releaseKey;const e=[];try{const t=new hi(this.$store.getters.tweikdata);if(!this.section.items)throw"Error: no items in section";for(const i of this.section.items)i.deps?t.checkDeps(i)&&e.push(i):e.push(i)}catch(t){console.error(t),this.catchError("Error loading items")}return e}},methods:{openEdit(){this.sectionBackup=JSON.parse(JSON.stringify(this.section)),this.editMode=!0},save(){ci.A.validateGroup("tweikGroup").isValid&&this.$emit("saveChanges",this.section)}
1,setActiveSection(){this.$emit("setActiveSection",this.section)},reqs2list(){const e=[];if(this.status.non_compliant_vendors)for(const t of this.status.non_compliant_vendors)e.push(...Object.keys(t.unmet_requirements));if(this.status.unmet_customers)for(const t of this.status.unmet_customers)e.push(...Object.keys(t.unmet_requirements));return this.status.unmet_continuous&&e.push(...Object.keys(this.status.unmet_continuous)),e},isUnmet(e){return!!this.unmetRequirements&&this.unmetRequirements.includes(e.id)},download(e){this.$emit("download",e)},cancelWarn(){this.editEnd=!0},cancel(){this.section=JSON.parse(JSON.stringify(this.sectionBackup)),this.editMode=!1,this.editEnd=!1,this.$emit("cancel",this.section)},addFile(e){this.$emit("addFile",e)},delFile(e){this.$emit("delFile",e)},update(){this.$emit("updateSection",this.section)},init(){this.loading=!0,this.editMode=!1;try{if(!this.sectionIn)throw"Error: section not provided";this.section=this.sectionIn}catch(e){console.error(e),this.catchError("Error loading section")}this.loading=!1}},created(){this.init()}};const vi=(0,je.A)(gi,[["render",x],["__scopeId","data-v-705ee96e"]]);var ki=vi,yi={components:{tweikEditSection:ki,DxScrollView:h.$,DxTreeView:g.mq},props:{isItemEditable:{type:Boolean,default:()=>!0},tweikData:Array,requirementData:Array,sectionIndex:Number,progressKey:Number,tweikID:[Number,String],releaseKey:Object,focusOverride:Object,treeviewItemKeys:{type:Array,default:()=>["id"]},treeviewSectionKeys:{type:Array,default:()=>["id"]},treeDelimiter:String,progressive:Boolean,status:Object,scroll:{type:Boolean,default:()=>!0}},data(){return{mounted:!1,scrollHeight:null,scrollInstance:null,focusItem:null,changeTracker:0,isBackToTopVisible:!1,isTreeViewShriked:!1,activeSection:null}},watch:{focusOverride:{deep:!0,handler(){this.selectItem(this.focusOverride)}}},computed:{computeHeight(){const e=500,t=300;let i=this.$store.getters?.windowHeight-e;return i<t&&(i=t),i}},methods:{updateSection(e){this.changeTracker++,this.$emit("updateData",e)},setActiveSection(e){this.activeSection&&this.activeSection?.id!==e?.id&&this.saveChanges(this.activeSection),this.activeSection=e},isHidden(e){if(e.deps)try{const t=new hi(this.$store.getters.tweikdata);return t.checkDeps(e)}catch(t){console.error(t),this.catchError("Error checking dependencies")}return!0},download(e){this.$emit("download",e)},makeTreeLabel(e,t){let i="";for(let o=0;o<t.length;o++)i+=e[t[o]]?e[t[o]]:"",t.length>1&&o!==t.length-1&&(i+=this.treeDelimiter?this.treeDelimiter:" - ");return i},treeDisplay(e){const t=!!e.items;let i=[];return i=t?this.treeviewSectionKeys:this.treeviewItemKeys,this.makeTreeLabel(e,i)},showCompleteTick(e){const t=!!e.items;if(t){const t=this.sectionProgress(e);return t.val===t.max}},cancel(e){this.$emit("cancel",e)},addFile(e){this.$emit("addFile",e)},delFile(e){this.$emit("delFile",e)},saveChanges(e){this.$emit("saveChanges",e)},dotColor(e){if(e.submitted)return{color:"#4abc96"};if(e.submitted_value){let t=0;for(const i of e.submitted_value)i.submitted&&t++;if(t===e.submitted_value.length)return{color:"#4abc96"};if(t>0&&t<e.submitted_value.length)return{color:"rgb(184, 238, 220)"}}},saveScroll(e){this.scrollInstance=e.component},getElemRootId(e){return e.parent?this.getElemRootId(e.parent):e.key},async setFocusItem(e){if(e.itemData?this.focusItem=this.tweikID+"_"+e.itemData.id:this.focusItem=this.tweikID+"_"+e.id,this.scroll)this.scrollInstance.scrollToElement(document.getElementById(this.focusItem));else{const e=document.getElementById(this.focusItem);e&&document.getElementById(this.focusItem).scrollIntoView({behavior:"smooth"})}},async selectItem(e){const t=e.node?this.getElemRootId(e.node):e.sectionId,i=this.requirementData.findIndex(e=>e.id===t);t&&await this.$emit("changeSection",i),await this.setFocusItem(e)},handleUrl(){this.$route.query.target&&this.$route.query.key&&this.$route.query.target==this.tweikID&&this.selectItem({id:this.$route.query.key}),this.$emit("loaded")},scrollToTweikTop(){document.getElementById("top-to-scroll").scrollIntoView({behavior:"smooth"})},onScrollTweik(e){const t=this.$refs?.tweikInnerDiv?.clientHeight;e.scrollOffset.top>t/4?this.isBackToTopVisible=!0:this.isBackToTopVisible=!1},evaluateProgress(e){if(e.submitted)return 1;if("multi file"===e.type||"file"===e.type){if(e.associated_urls&&e.associated_urls.length)return 1;if(e.associated_files&&e.associated_files.length)return 1}return 0},sectionProgress(e){let t=0,i=0;for(const o of e.items)if(o.items)for(const e of o.items)this.isHidden(e)&&(t++,i+=this.evaluateProgress(e));else this.isHidden(o)&&(t++,i+=this.evaluateProgress(o));return{max:t,val:i}},toggleTreeViewShrink(){this.isTreeViewShriked=!this.isTreeViewShriked}},mounted(){setTimeout(()=>{this.handleUrl()},500),this.mounted=!0},unmounted(){this.scrollInstance=null}};const fi=(0,je.A)(yi,[["render",p],["__scopeId","data-v-382339e6"]]);var bi=fi,Vi=i(38317),wi=class{constructor(e,t,i){(0,pi.A)(this,"data",void 0),(0,pi.A)(this,"simpleTypes",["string","textarea","number","currency","email","phone","percent","select","boolean","date"]),this.data=JSON.parse(JSON.stringify(e)),this.docs=JSON.parse(JSON.stringify(t)),this.targetType=i}makeSections(){const e=[];for(const t of this.data){const i=e.find(e=>e.id===t.section_id);i||e.push({id:t.section_id,label:t.section_label,items:[]}),e.find(e=>e.id===t.section_id).items.push(this.itemsIn(t))}for(const t of e)t.items=this.makeSubsections(t);return e}makeSubsections(e){const t=[];for(const i of e.items){let e=t.find(e=>e.id===i.subSectionId);e||t.push({id:i.subSectionId,parentId:i.sectionId,label:i.subSectionLabel,title:i.title,items:[]}),e=t.find(e=>e.id===i.subSectionId),e.items.push(i)}return t}makeTranslation(){return this.makeSections()}formatParams(e){const t=[];for(const i of e.items)t.push(this.itemsOut(i));return t}formatValuesIn(e,t){if(e){if("multi select"===t){const t=[];for(const i of e)t.push({id:i.answer_text,name:i.answer_text});return t}return e.map(({answer_text:e})=>e)}return null}formatSubmittedIn(e,t){if(e){if(this.simpleTypes.includes(t))return e[0];if(Array.isArray(e))return e}return null}formatSubmittedOut(e,t){return e?this.simpleTypes.includes(t)?[`${e}`]:e:null}itemsOut(e){const t={id:e.id,order_id:e.order_id,section_id:e.sectionId,section_label:e.sectionLabel,question_id:e.question_id,type:e.type,label:e.label,submitted:e.submitted,submitted_value:this.formatSubmittedOut(e.submitted_value,e.type),operation:e.operation,comments:e.comments,impact_rating:e.impact_rating,maturity_rating:e.maturity_rating,risk_impact_score:e.risk_impact_score,associated_urls:e.associated_urls,selected_answers:e.selected_answers};return t}itemsIn(e){const t={id:e.id,order_id:e.order_id,question_id:e.question_id,deps:e.depends_on,info:e.info,type:e.type,label:e.label,values:this.formatValuesIn(e.answers,e.type),depValue:e.depen
1ds_on_value,required:e.required,sectionId:e.section_id,sectionLabel:e.section_label,subSectionId:e.sub_section_id,subSectionLabel:e.sub_section_label,submitted_value:this.formatSubmittedIn(e.submitted_value,e.type),operation:e.operation,submitted:e.submitted,comments:e.comments,associated_urls:e.associated_urls,title:e.title,impact_rating:e.impact_rating,maturity_rating:e.maturity_rating,risk_impact_score:e.risk_impact_score,attach_files:e.attach_files,answers:e.answers,selected_answers:e.selected_answers},i=this.docs.filter(t=>t.assessment_data===e.id);return i&&(t["associated_files"]=i),"boolean"===e.type&&(t.submitted_value=this.parseBool(t.submitted_value)),t}parseBool(e){return!(!e||"true"!==e.toLowerCase())}};const Ni={class:"file-upload-progress"},Ei={key:0},xi={class:"d-block mr-3 py-1"},Ii=[".value"],Ci={key:1},_i={class:"error ml-2"};function Bi(e,t,i,a,n,s){return(0,o.openBlock)(),(0,o.createElementBlock)("div",Ni,[n.hide?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("div",Ei,[(0,o.createElementVNode)("label",xi,(0,o.toDisplayString)(s.fileName),1),t[0]||(t[0]=(0,o.createTextVNode)(" Â Â ",-1)),n.complete?((0,o.openBlock)(),(0,o.createElementBlock)("label",Ci," Finished")):((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:0},[(0,o.createElementVNode)("progress",{max:"100",".value":n.uploadPercentage},null,40,Ii),(0,o.createTextVNode)(" "+(0,o.toDisplayString)(n.uploadPercentage)+"% ",1)],64)),(0,o.createElementVNode)("label",_i,(0,o.toDisplayString)(n.error),1)]))])}var Di={props:{item:Object,inProccessSection:Object,file:null},data(){return{uploadPercentage:0,host:this.$store.getters.hostname,complete:!1,error:"",hide:!1}},computed:{fileName(){return this.file&&this.file.name?this.file.name:null}},methods:{init(){this.inProccessSection.id===this.item.subSectionId?(this.hide=!1,this.submitFile()):(this.hide=!0,this.$emit("complete",!1))},submitFile(){const e=new FormData;e.append("file",this.file),e.append("assessment_data",this.item.id),e.append("name",this.file.name),this.$store.getters.apiClient.post(`${this.host}/api/assessments/file/`,e,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(e){this.uploadPercentage=Math.round(e.loaded/e.total*100)}.bind(this)}).then(e=>{this.handleComplete(e.data)}).catch(e=>{this.$emit("fail"),console.error(e),this.catchError("Error uploading file"),this.error="Error uploading file"})},handleComplete(e){this.$emit("complete",e),this.complete=!0}},created(){this.init()}};const Si=(0,je.A)(Di,[["render",Bi]]);var Fi=Si;const Ti={id:"requirements-progress"},Ai={class:"row no-pad overall-progress"},qi={class:"col"},Ui=["onClick","id","name","aria-label"],Pi={class:"section-progress"},Oi={key:1,class:"section-nav-wrap row no-pad",style:{width:"100%"}},$i=["onClick","id","name","aria-label"],Ri={class:"section-progress"},Mi={class:"row no-pad question-progress"},Li={key:0,class:"col-12"},ji=["title","id","name","aria-label","onClick"],Ki={key:0,class:"fas fa-comment"};function Wi(e,t,i,a,n,s){const l=(0,o.resolveComponent)("green-gauge"),r=(0,o.resolveComponent)("dx-scroll-view");return(0,o.openBlock)(),(0,o.createElementBlock)("div",Ti,[(0,o.createElementVNode)("div",Ai,[t[0]||(t[0]=(0,o.createElementVNode)("label",{class:"col progress-col"}," Progress",-1)),(0,o.createElementVNode)("div",qi,[(0,o.createVNode)(l,{max:s.requirementsProgress.max,value:s.requirementsProgress.val},null,8,["max","value"])])]),s.scroll?((0,o.openBlock)(),(0,o.createBlock)(r,{key:0,height:"104px",direction:"horizontal",showScrollbar:"always",useNative:!0},{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",{class:"section-nav-wrap-scroll",style:(0,o.normalizeStyle)({width:s.navWidth})},[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(n.requirements,(e,t)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{onClick:e=>s.gotoSection(t),key:t,class:(0,o.normalizeClass)(["section-tab-scroll",[{"current-section":s.isCurrent(t)}]]),id:`section-${t}`,name:`section-${t}`,"aria-label":`section-${t}`,role:"button"},[(0,o.createElementVNode)("h2",null,(0,o.toDisplayString)(t+1)+". "+(0,o.toDisplayString)(e.label),1),(0,o.createElementVNode)("div",Pi,[((0,o.openBlock)(),(0,o.createBlock)(l,{key:n.guageKey+t,max:s.sectionProgress(e).max,value:s.sectionProgress(e).val},null,8,["max","value"]))])],10,Ui))),128))],4)],void 0,!0),_:1})):((0,o.openBlock)(),(0,o.createElementBlock)("div",Oi,[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(n.requirements,(e,t)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{onClick:e=>s.gotoSection(t),key:t,class:(0,o.normalizeClass)(["section-tab col",[{"current-section":s.isCurrent(t)}]]),id:`section-${t}`,name:`section-${t}`,"aria-label":`section-${t}`,role:"button"},[(0,o.createElementVNode)("h2",null,(0,o.toDisplayString)(t+1)+". "+(0,o.toDisplayString)(e.label),1),(0,o.createElementVNode)("div",Ri,[((0,o.openBlock)(),(0,o.createBlock)(l,{key:n.guageKey+t,max:s.sectionProgress(e).max,value:s.sectionProgress(e).val},null,8,["max","value"]))])],10,$i))),128))])),(0,o.createElementVNode)("div",Mi,[s.currentSection?((0,o.openBlock)(),(0,o.createElementBlock)("div",Li,[(0,o.createElementVNode)("label",null,(0,o.toDisplayString)(s.currentSection.label)+" question progress",1),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(s.visibleQuestions,(e,t)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{class:"prog-items",key:t},[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(e.items,(e,t)=>((0,o.openBlock)(),(0,o.createElementBlock)("a",{"data-toggle":"tooltip","data-
1placement":"top",title:e.id+": "+e.label,class:(0,o.normalizeClass)(["item",{answered:e.submitted,inactive:!s.isHidden(e)}]),key:t,id:`subsection-${t}`,name:`subsection-${t}`,"aria-label":`subsection-${t}`,role:"button",onClick:t=>s.setFocus(e)},[e.comments&&e.comments.length?((0,o.openBlock)(),(0,o.createElementBlock)("i",Ki)):(0,o.createCommentVNode)("",!0)],10,ji))),128))]))),128))])):(0,o.createCommentVNode)("",!0)])])}const Hi={class:"green-gauge row no-pad"},zi={class:"col number-col align-self-center"},Gi={class:"col align-self-center"};function Qi(e,t,i,a,n,s){const l=(0,o.resolveComponent)("DxRange"),r=(0,o.resolveComponent)("DxRangeContainer"),c=(0,o.resolveComponent)("DxLabel"),d=(0,o.resolveComponent)("DxScale"),m=(0,o.resolveComponent)("DxText"),u=(0,o.resolveComponent)("DxValueIndicator"),p=(0,o.resolveComponent)("DxLinearGauge");return(0,o.openBlock)(),(0,o.createElementBlock)("div",Hi,[(0,o.createElementVNode)("label",zi,"("+(0,o.toDisplayString)(i.value)+"/"+(0,o.toDisplayString)(i.max)+")â"+(0,o.toDisplayString)(Math.floor(i.value/i.max*100))+"%",1),(0,o.createElementVNode)("div",Gi,[(0,o.createVNode)(p,{animation:{enabled:!1},key:"assessment-progress",geometry:{orientation:"horizontal"},value:i.value,loadingIndicator:{show:!1},size:{height:12}},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(r,{backgroundColor:"#ff0000",width:{start:0,end:0},visible:!1},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(l,{"start-value":0,"end-value":i.max,color:"#c8c8c8"},null,8,["end-value"])],void 0,!0),_:1}),(0,o.createVNode)(d,{visible:!1,"start-value":0,"end-value":i.max,tick:{visible:!1}},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(c,{visible:!1})],void 0,!0),_:1},8,["end-value"]),(0,o.createVNode)(u,{color:"#4abc96",backgroundColor:"#ddd"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(m)],void 0,!0),_:1})],void 0,!0),_:1},8,["value"])])])}var Ji=i(79828),Yi={components:{DxLinearGauge:Ji.nO,DxScale:Ji.F4,DxLabel:Ji.jd,DxValueIndicator:Ji.vQ,DxText:Ji.wG,DxRangeContainer:Ji.T3,DxRange:Ji.Cf},props:{value:Number,max:Number}};const Zi=(0,je.A)(Yi,[["render",Qi],["__scopeId","data-v-594848f9"]]);var Xi=Zi,eo={components:{greenGauge:Xi,DxScrollView:h.$},props:{page:{type:Number,default:0},requirementsIn:[Array,Object]},data(){return{guageKey:0,requirements:null}},watch:{requirementsIn:{deep:!0,handler(){this.init()}}},computed:{scroll(){return this.requirements.length>12},navWidth(){let e=160*(this.requirements.length-1);return e+=240,`${e}px`},visibleQuestions(){return this.requirements[this.page].items},currentSection(){return this.requirements[this.page]?this.requirements[this.page]:null},requirementsProgress(){let e=0,t=0;for(const i of this.requirements){const o=this.sectionProgress(i);e+=o.val,t+=o.max}return e===t?this.$emit("complete",!0):this.$emit("complete",!1),{max:t,val:e}}},methods:{isHidden(e){if(e.deps)try{const t=new hi(this.$store.getters.tweikdata);return t.checkDeps(e)}catch(t){console.log(t),this.catchError("Error checking dependencies")}return!0},evaluateProgress(e){if(e.submitted)return 1;if("multi file"===e.type||"file"===e.type){if(e.associated_urls&&e.associated_urls.length)return 1;if(e.associated_files&&e.associated_files.length)return 1}return 0},sectionProgress(e){let t=0,i=0;for(const o of e.items)for(const e of o.items)this.isHidden(e)&&(t++,i+=this.evaluateProgress(e));return{max:t,val:i}},isCurrent(e){return this.page===e},gotoSection(e){this.$emit("changeSection",e),setTimeout(()=>{this.guageKey++},50)},setFocus(e){this.$emit("set-focus",e)},init(){this.requirements=this.requirementsIn}},mounted(){this.$emit("mounted")},created(){this.init()}};const to=(0,je.A)(eo,[["render",Wi],["__scopeId","data-v-3d4cc53a"]]);var io=to,oo={components:{tweik:bi,preloader:Zt.A,assesssmentsUploadProgress:Fi,DxPopup:Nt.jF,requirementsProgress:io,DxScrollView:h.$},props:{targetID:[String,Number],requirement:{type:Object,default:()=>null},targetType:{type:String,default:()=>"compliance_customer"}},watch:{requirement:{deep:!0,handler(){this.init()}}},data(){return{sectionIndex:0,requirementData:null,loading:!0,releaseKey:null,
1status:{},inProccessSection:null,focusOverride:null,translator:null,fileQue:[],docs:null,uploading:!1,count:0,progressKey:0,requirementsProgressMounted:!1}},computed:{computeHeight(){return this.$store.getters.windowWidth,this.$store.getters.windowHeight,this.$store.getters.windowWidth>1366?480:420},currentSection(){return this.requirementData[this.sectionIndex]||this.reset(),this.requirementData[this.sectionIndex].items},filteredFileQue(){return this.$store.getters.windowHeight,this.inProccessSection?this.fileQue.filter(e=>e.item.subSectionId===this.inProccessSection.id):[]}},methods:{rpMounted(){this.requirementsProgressMounted=!0},reset(){this.sectionIndex=0},changeSection(e){this.sectionIndex=e,this.progressKey++},completeHandler(e){e?(this.complete=!0,this.$emit("complete")):this.complete=!1},setFocusOverride(e){this.focusOverride=e},updateLocalData(e){const t=this.getIndex(this.requirementData,e.id);this.requirementData[t]=e,this.progressKey++},async sectionSubmitted(e){this.inProccessSection=e;const t=this.$store.getters.tweikdata,i=this.getObjectIndex(e.parentId,t),o=this.getObjectIndex(e.id,t[i].items),a=this.translator.formatParams(t[i].items[o]);try{await this.postAnswers(a),this.filteredFileQue.length?this.uploading=!0:(await this.refreshSection(e.parentId),this.updateSuccessful(e.id))}catch(n){console.error(n),this.catchError("Error saving section."),await this.refreshSection(e.parentId),this.release(e.id)}},async postAnswers(e){const t=await Vi.A.call({endpoint:"assessments_data",action:"put",ID:this.requirement.id,params:e}).then(e=>e.data).catch(e=>{throw e});return t},async refreshSection(e){try{const t=await this.getData(),i=await this.getDocs(),o=this.translate(t,i,this.targetType),a=o.find(t=>t.id===e),n=this.getIndex(this.requirementData,e);for(const e of a.items){const t=this.getIndex(this.requirementData[n].items,e.id);this.requirementData[n].items[t]=e}}catch(t){console.error(t),this.catchError("Error refreshing section.")}},updateSuccessful(e){this.release(e),this.$emit("update"),this.dialog("Section successfully saved."),this.progressKey++},release(e){this.releaseKey={tweikId:this.targetID,sectionId:e}},async cancel(e){this.inProccessSection=e;const t=this.getIndex(this.requirementData,e.id);this.requirementData[t]=e,this.fileQue=this.fileQue.filter(e=>e.item.sectionId!==this.inProccessSection.id),await this.refreshSection(this.inProccessSection.parentId),this.release(this.inProccessSection.id),this.progressKey++},async fileUploadsComplete(){this.count++,this.count===this.filteredFileQue.length&&(this.fileQue=this.fileQue.filter(e=>e.item.subSectionId!==this.inProccessSection.id),await this.refreshSection(this.inProccessSection.parentId),this.updateSuccessful(this.inProccessSection.id),this.uploading=!1,this.count=0)},downloadFile(e){this.loading=!0,Vi.A.downloadFrameworksFile(e.id).then(e=>{this.openFile(e),this.loading=!1}).catch(e=>{this.loading=!1,console.error(e),this.catchError("Error downloading file.")})},async deleteFile(e){e.isNew?this.fileQue=this.fileQue.filter(t=>t.file.id!==e.fileID):await Vi.A.deleteAssessmentsFile(e.fileID)},openFile(e){const t=e.headers["file-name"],i=window.navigator;if(i?.msSaveOrOpenBlob){const o=new Blob([e.data]);i.msSaveOrOpenBlob(o,t)}else{const i=window.URL.createObjectURL(new Blob([e.data])),o=document.createElement("a");o.href=i,o.setAttribute("download",t),document.body.appendChild(o),o.click()}},addToFileQue(e){this.fileQue.push(e)},getIndex(e,t){return this.findIndex(e,"id",t)},async init(){this.loading=!0;try{const e=await this.getData(),t=await this.getDocs();this.requirementData=this.translate(e,t,this.targetType),this.$store.dispatch("setTweikdata",this.requirementData)}catch(e){console.error(e),this.catchError("Error loading requirement data.")}await this.handleUrl(),this.loading=!1},async getData(){const e=await Vi.A.call({action:"get",endpoint:"assessments_data",ID:this.requirement.id}).then(e=>e.data).catch(e=>{throw console.error(e),"Error: Failed to get assessment data."});return e},async getDocs(){const e=await Vi.A.call({action:"get",endpoint:"assessment_files",ID:this.requirement.i
1d,limit:1e3}).then(e=>e.data).catch(e=>{throw console.error(e),"Error: Failed to get docs assessment files."});return e},translate(e,t,i){return this.translator=new wi(e,t,i),this.translator.makeTranslation()},handleUrl(){if(this.$route.query.target&&this.$route.query.key&&this.$route.query.target==this.targetID)for(const e in this.requirementData)for(const t of this.requirementData[e].items){const i=t.items.find(e=>e.id==this.$route.query.key);if(i)return void(this.sectionIndex=parseInt(e))}},removeQuery(){if(this.$route.query.target&&this.$route.query.key&&this.$route.query.assessment_id){const e=Object.assign({},this.$route.query);delete e.target,delete e.key,delete e.assessment_id,this.$router.push({path:"/requirements",query:e})}}},created(){this.init()}};const ao=(0,je.A)(oo,[["render",l],["__scopeId","data-v-0c332754"]]);var no=ao},94444:function(e,t,i){i.d(t,{A:function(){return c}});var o=i(96913);function a(e,t,i,a,n,s){return i.template?((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:1,onClick:t[1]||(t[1]=(...e)=>s.exportCSV&&s.exportCSV(...e)),id:"csv-export-button",name:"csv-export-button","aria-label":"csv export button",class:"blank-button"},[...t[3]||(t[3]=[(0,o.createElementVNode)("i",{class:"fas fa-file-export"},null,-1),(0,o.createTextVNode)(" Template ",-1)])])):((0,o.openBlock)(),(0,o.createElementBlock)("div",{key:0,onClick:t[0]||(t[0]=(...e)=>s.exportCSV&&s.exportCSV(...e)),id:"csv-export-button",name:"csv-export-button",class:"blank-button","aria-label":"csv export button"},[...t[2]||(t[2]=[(0,o.createElementVNode)("i",{class:"fas fa-file-export"},null,-1),(0,o.createTextVNode)(" Export CSV ",-1)])]))}i(74423),i(44114),i(18111),i(22489),i(7588),i(61701),i(13579),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(14603),i(47566),i(98721);var n=i(38317),s={props:{template:Boolean,id:Number,formatCallBack:Function,fileName:{type:String,default:()=>"CyRisk-file-export"}},data(){return{requirementData:null,fileNaming:null,templateRemovingHeaders:["order_id","section_id","sub_section_id","depends_on_value","required","submitted","attach_files","attached_files","title","assessment","operation","assignees","internal_reference"]}},methods:{async exportCSV(){this.requirementData=await this.getData();const e=this.makeCsvContent(),t="text/csv";this.template?this.fileNaming=`${this.fileName}_template.csv`:this.fileNaming=`${this.fileName}.csv`;const i=window.navigator;if(i?.msSaveOrOpenBlob){const o=new Blob([e],{type:t});i.msSaveOrOpenBlob(o,this.fileNaming)}else{window.URL=window.webkitURL||window.URL;const i=new Blob([e],{type:t}),o=window.URL.createObjectURL(i),a=document.createElement("a");a.href=o,a.setAttribute("download",this.fileNaming),document.body.appendChild(a),a.click()}},async getData(){let e=await n.A.call({action:"get",endpoint:"assessments_data",ID:this.id}).then(e=>e.data).catch(e=>{throw console.error(e),"Error: Failed to get assessment data."});const t=await n.A.call({action:"get",endpoint:"assessment_files",ID:this.id,limit:1e3}).then(e=>e.data).catch(e=>{throw console.log(e),"Error: Failed to get assessment files."});for(const i of e){const e=t.filter(e=>e.assessment_data===i.id);t&&(i["attached_files"]=e.map(e=>e.name))}return this.formatCallBack&&(e=this.formatCallBack(e)),e},makeCsvContent(){if(this.template)for(const i of this.templateRemovingHeaders)this.requirementData.forEach(e=>{delete e[i]});let e=[];const t=[];for(let i of this.requirementData)i=this.formatObject(i),Object.keys(i).some(e=>t.includes(e))||(e=this.mergeArrays(Object.keys(i),e)),t.push(Object.values(i));return t.unshift(e),t.map(e=>e.join(",")).join("\n")},formatObject(e){for(const t in e)Array.isArray(e[t])?e[t]=e[t].join(" | "):e[t]=`${e[t]}`,e[t]=this.replaceAll(e[t],",",";"),e[t]=this.replaceAll(e[t],'"','""'),e[t]=this.replaceAll(e[t],"#"," "),e[t]=e[t].replace(/(?:\r\n|\r|\n)/g,"");return e},replaceAll(e,t,i){return e.replace(new RegExp(t,"g"),i)},mergeArrays(...e){let t=[];return e.forEach(e=>{t=[...t,...e]}),[...new Set([...t])]}}},l=i(66262);const r=(0,l.A)(s,[["render",a],["__scopeId","data-v-415e2aae"]]);var c=r},66028:function(e,t,i){i.d(t,{A:function(){return u}});var o=i(96913);const a={class:"info"},n={key:0,class:"mr-2"};function s(e,t,i,s,l,r){const c=(0,o.resolveComponent)("dx-scroll-view"),d=(0,o.resolveComponent)("dx-popup");return(0,o.openBlock)(),(0,o.createElementBlock)("div",a,[(0,o.createElementVNode)("div",{onClick:t[0]||(t[0]=(...e)=>r.open&&r.open(...e)),id:"info-popup-open",name:"info-popup-open","aria-label":"open info popup",class:"button-wrapper"},[i.message?((0,o.openBlock)(),(0,o.createElementBlock)("span",n,(0,o.toDisplayString)(i.message),1)):(0,o.createCommentVNode)("",!0),t[2]||(t[2]=(0,o.createElementVNode)("svg",{class:"fas fa-question-circle"},null,-1))]),(0,o.createVNode)(d,{height:r.computeHeight,width:r.computeWidth,title:i.title,visible:l.popupOpen,"onUpdate:visible":t[1]||(t[1]=e=>l.popupOpen=e)},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(c,null,{default:(0,o.withCtx)(()=>[(0,o.renderSlot)(e.$slots,"default",{},void 0,!0)],void 0,!0),_:3})],void 0,!0),_:3},8,["height","width","title","visible"])])}var l=i(679),r=i(7628),c={components:{DxPopup:l.jF,DxScrollView:r.$},props:{title:{type:String,default:""},height:Number,width:Number,message:String},data(){return{popupOpen:!1}},computed:{computeHeight(){return this.height?this.gPopupHeight(this.height):null},computeWidth(){return this.width?this.gPopupWidth(this.width):null}},methods:{open(){this.popupOpen=this.toggle(this.popupOpen)}}},d=i(66262);const m=(0,d.A)(c,[["render",s],["__scopeId","data-v-1877ee54"]]);var u=m},44845:function(e,t,i){i.d(t,{A:function(){return I}});var o=i(96913);const a={key:0},n={key:1},s={class:"row no-pad"},l={class:"row no-pad"},r={class:"no-pad"},c={class:"file-input"},d={key:0,class:"error mt-1"},m={class:"row no-pad"};function u(e,t,i,u,p,h){const g=(0,o.resolveComponent)("preloader"),v=(0,o.resolveComponent)("csv-export-button"),k=(0,o.resolveComponent)("fade-transition"),y=(0,o.resolveComponent)("infos"),f=(0,o.resolveComponent)("dx-scroll-view"),b=(0,o.resolveComponent)("DxPopup");return(0,o.openBlock)(),(0,o.createElementBlock)("div",{onClick:t[4]||(t[4]=e=>p.popupVisible=!p.popupVisible),id:"csv-import-popup",name:"csv-import-popup","aria-label":"csv import popup",role:"button",class:"blank-button"},[t[13]||(t[13]=(0,o.createElementVNode)("i",{class:"fas fa-file-import"},null,-1)),t[14]||(t[14]=(0,o.createTextVNode)(" Import CSV ",-1)),p.popupVisible?((0,o.openBlock)(),(0,o.createBlock)(b,{key:0,visible:p.popupVisible,"onUpdate:visible":t[2]||(t[2]=e=>p.popupVisible=e),"drag-enabled":!1,hideOnOutsideClick:!0,"show-title":!0,height:e.gPopupHeight(270),width:e.gPopupWidth(610),title:"Import Requirements CSV"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(f,null,{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",null,[p.loading?((0,o.openBlock)(),(0,o.createElementBlock)("div",a,[(0,o.createVNode)(g,{size:.8,padding:1,message:"Importing..."})])):(0,o.createCommentVNode)("",!0),p.loading?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("div",n,[(0,o.createElementVNode)("div",s,[t[5]||(t[5]=(0,o.createElementVNode)("h2",{class:"titles"}," Download CSV template for this requirement. ",-1)),(0,o.createVNode)(k,null,{default:(0,o.withCtx)(()=>[i.selectedRequirement?((0,o.openBlock)(),(0,o.createBlock)(v,{key:0,fileName:i.selectedRequirement.assessment_name,id:i.selectedRequirement.i
1d,template:!0,class:"mr-2"},null,8,["fileName","id"])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1})]),(0,o.createElementVNode)("div",l,[t[7]||(t[7]=(0,o.createTextVNode)(" Instructions for filling your Requirements template: ",-1)),(0,o.createVNode)(y,{height:e.gPopupHeight(560),width:e.gPopupWidth(1e3),"drag-enabled":!1,hideOnOutsideClick:!0,title:"Requirements CSV Answers Help",class:"blue",message:""},{default:(0,o.withCtx)(()=>[...t[6]||(t[6]=[(0,o.createElementVNode)("div",{id:"help-popup"},[(0,o.createTextVNode)(" Downloading the template will include any responses you have already submitted. "),(0,o.createElementVNode)("hr"),(0,o.createElementVNode)("h2",{class:"py-2"},"General:"),(0,o.createElementVNode)("ul",null,[(0,o.createElementVNode)("li",null,[(0,o.createTextVNode)(' This questionnaire is grouped by section ("'),(0,o.createElementVNode)("span",{class:"bold"},"section_label"),(0,o.createTextVNode)('") and subsections ("'),(0,o.createElementVNode)("span",{class:"bold"},"sub_section_label"),(0,o.createTextVNode)('"). ')]),(0,o.createElementVNode)("li",null,[(0,o.createTextVNode)(' Every question has a corresponding unique ID "'),(0,o.createElementVNode)("span",{class:"bold"},"question_id"),(0,o.createTextVNode)('". ')]),(0,o.createElementVNode)("li",null,[(0,o.createTextVNode)(' You will find the full question under the "'),(0,o.createElementVNode)("span",{class:"bold"},"label"),(0,o.createTextVNode)('" header. Many questions have an "'),(0,o.createElementVNode)("span",{class:"bold"},"info"),(0,o.createTextVNode)('" header to expand on the respective question. ')]),(0,o.createElementVNode)("li",null,[(0,o.createTextVNode)(' You will fill the columns called "'),(0,o.createElementVNode)("span",{class:"bold"},"submitted_value"),(0,o.createTextVNode)('", "'),(0,o.createElementVNode)("span",{class:"bold"},"associated_urls"),(0,o.createTextVNode)('" and "'),(0,o.createElementVNode)("span",{class:"bold"},"comments"),(0,o.createTextVNode)('". ')])]),(0,o.createElementVNode)("hr"),(0,o.createElementVNode)("h2",{class:"py-2"},"Answers:"),(0,o.createElementVNode)("ul",null,[(0,o.createElementVNode)("li",null,[(0,o.createTextVNode)(' Each question will have a "'),(0,o.createElementVNode)("span",{class:"bold"},"type"),(0,o.createTextVNode)('" column to indicate if you can pick only one answer for it ('),(0,o.createElementVNode)("span",{class:"bold"},"select"),(0,o.createTextVNode)("), or if more than one ("),(0,o.createElementVNode)("span",{class:"bold"},"multi select"),(0,o.createTextVNode)("). ")]),(0,o.createElementVNode)("li",null,[(0,o.createTextVNode)(' The "'),(0,o.createElementVNode)("span",{class:"bold"},"values"),(0,o.createTextVNode)('" column will indicate the possible responses for the question. Each possible response will be separated by " '),(0,o.createElementVNode)("span",{class:"bold"},"|"),(0,o.createTextVNode)(' ". When selecting multiple answers for one question, your answers should be separated in the same way. Eg. '),(0,o.createElementVNode)("span",{class:"bold"},"Answer 1 | Answer 2")])]),(0,o.createElementVNode)("hr"),(0,o.createElementVNode)("h2",{class:"py-2"},"URL's & Comments:"),(0,o.createElementVNode)("ul",null,[(0,o.createElementVNode)("li",null,[(0,o.createTextVNode)(' Just as with multiple selection questions, you can add multiple URLs in the "'),(0,o.createElementVNode)("span",{class:"bold"},"associated_urls"),(0,o.createTextVNode)('" field. You would format this response as '),(0,o.createElementVNode)("span",{class:"bold"},"example.com/file1 | example.com/file2")]),(0,o.createElementVNode)("li",null,[(0,o.createTextVNode)(' Comments have limit of 4096 characters, and comments must not include the " '),(0,o.createElementVNode)("span",{class:"bold"},"|"),(0,o.createTextVNode)(' " separator. ')])])],-1)])],void 0,!0),_:1},8,["height","width"])]),t[11]||(t[11]=(0,o.createElementVNode)("hr",null,null,-1)),(0,o.createElementVNode)("div",r,[(0,o.createElementVNode)("div",c,[t[8]||(t[8]=(0,o.createElementVNode)("label",{class:"file-tag"},"Select Answers CSV: ",-1)),(0,o.createElementVNode)("input",{type:"file",class:"file",ref:"file",name:"csv-import-file",id:"csv-import-file","aria-label":"csv import file",onChange:t[0]||(t[0]=e=>h.selectFile())},null,544),p.error?((0,o.openBlock)(),(0,o.createElementBlock)("div",d,(0,o.toDisplayString)(p.error),1)):(0,o.createCommentVNode)("",!0)]),(0,o.createElementVNode)("div",m,[t[10]||(t[10]=(0,o.createElementVNode)("h2",{class:"titles"},"Import your answers.",-1)),(0,o.createElementVNode)("div",{id:"csv-import-button",name:"add-csv-import-button","aria-label":"csv import button",role:"button",class:"blank-button",onClick:t[1]||(t[1]=e=>h.importAndSend())},[...t[9]||(t[9]=[(0,o.createElementVNode)("i",{class:"fas fa-file-import"},null,-1),(0,o.createTextVNode)(" Answers ",-1)])])])])]))])],void 0,!0),_:1})],void 0,!0),_:1},8,["visible","height","width"])):(0,o.createCommentVNode)("",!0),(0,o.createVNode)(b,{visible:p.errorPopupOpen,"onUpdate:visible":t[3]||(t[3]=e=>p.errorPopupOpen=e),"drag-enabled":!1,hideOnOutsideClick:!0,"show-title":!0,height:e.gPopupHeight(600),width:e.gPopupWidth(500),title:"Alert"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(f,null,{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",null,[t[12]||(t[12]=(0,o.createElementVNode)("h1",{class:"mb-4"},[(0,o.createElementVNode)("span",{class:"error"},"File Error!"),(0,o.createTextVNode)(" The file you are trying to upload has the following errors: ")],-1)),(0,o.createElementVNode)("ul",null,[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(p.fileErrors,(e,t)=>((0,o.openBlock)(),(0,o.createElementBlock)("li",{class:"error mb-2",key:t},(0,o.toDisplayString)(e),1))),128))])])],void 0,!0),_:1})],void 0,!0),_:1},8,["visible","height","width"])])}i(74423),i(44114),i(18111),i(22489),i(7588),i(64979);var p=i(679),h=i(7628),g=i(78313),v=i(92259),k=i.n(v),y=i(66028),f=i(94444),b=i(38317),V=i(72279),w=JSON.parse('{"fs":["text/csv","text/plain","application/vnd.ms-excel","application/vnd.msexcel","application/excel","text/x-csv","application/csv","application/x-csv","text/comma-separated-names","text/x-comma-separated-names","text/tab-separated-names"],"C_":["id","order_id","assessment","section_id","section_label","sub_section_label","sub_section_id","question_id","depends_on","depends_on_value","info","type","values","label","required","submitted","submitted_value","comments","associated_urls","attach_files","title","operation","internal_reference","assignees","attached_files","impact_rating","maturity_rating","risk_impact_score"],"pI":["section_label","order_id","section_id","sub_section_label","sub_section_id","required","depends_on","info","type","label","attach_files","attached_files","title","assignees","operation"],"Di":["submitted","submitted_value","comments","associated_urls","assignees","internal_reference","impact_rating"]}'),N={props:{id:Number,selectedRequirement:Object},components:{preloader:V.A,DxPopup:p.jF,DxScrollView:h.$,FadeTransition:g.AV,infos:y.A,csvExportButton:f.A},data(){return{requirementData:null,popupVisible:!1,loading:!0,file:null,fileIsValid:!0,fileErrors:[],errorPopupOpen:!1,error:"",data:null,name:"",answers:null,baseData:null}},methods:{init(){this.file=null,this.fileIsValid=!0,this.error="",this.loading=!1},read(e){const t=new FileReader;return new Promise((i,o)=>{t.onerror=()=>{t.abort(),o(new DOMException("Problem parsing input file."))},t.onload=()=>{i(t.result)},t.readAsText(e)})},validateFile(e){return!!w.fs.includes(e.type)},fixKeys(e){return e.trim().replace(" ","_")},validateHeaders(e){for(const t of Object.keys(e[0])){const e=this.fixKeys(t);w.C_.includes(e)||this.fileErrors.push(`Invalid header in csv file! "${t}"`)}},idiotProofData(e){if(this.fileErrors=[],e.length)return this.validateHeaders(e),e;this.fileErrors.push("File is empty!")}
1,cleanAnswers(e){for(const t of w.pI)e.forEach(e=>{delete e[t]});return e},validateAnswers(e){return e.forEach(e=>{e.submitted_value&&"null"!==e.submitted_value&&""!==e.submitted_value?("null"!==e.values&&(e.values.includes(e.submitted_value)||"time frame"!==e.values||e.submitted_value.includes(e.values)||this.fileErrors.push(`Question with ID: "${e.question_id}" has an invalid answer. (Received: "${e.submitted_value}", options: "${e.values}").`)),e.submitted_value.includes(" | ")&&(e.submitted_value=e.submitted_value.split(" | ")),"object"!==typeof e.submitted_value&&(e.submitted_value=[e.submitted_value]),e["submitted"]=!0):delete e["submitted_value"],e.associated_urls&&"null"!==e.associated_urls&&""!==e.associated_urls?(e.associated_urls.includes(" | ")&&(e.associated_urls=e.associated_urls.split(" | ")),"object"!==typeof e.associated_urls&&(e.associated_urls=[e.associated_urls])):delete e["associated_urls"],e.comments&&"null"!==e.comments&&""!==e.comments||delete e["comments"],delete e["values"]}),e.filter(e=>e.submitted_value||e.associated_urls||e.comments)},async selectFile(){if(this.error="",this.file=this.$refs.file.files[0],this.fileIsValid=this.validateFile(this.file),this.fileIsValid)try{this.data=await this.read(this.file).catch(e=>{console.error(e),this.catchError("Error reading file.")});const e=await k()({trim:!0,flatKeys:!0}).fromString(this.data).then(e=>e);this.data=this.idiotProofData(e),this.data=this.cleanAnswers(this.data),this.data=this.validateAnswers(this.data),this.fileErrors.length&&(this.errorPopupOpen=!0,this.error="File errors detected")}catch(e){console.error(e),this.catchError("Error reading file."),this.file=null}else this.error="Invalid file type. Please select a valid .csv file."},async importAndSend(){this.file||(this.error="Please select a file."),this.loading=!0,this.baseData=await this.getBase(),this.baseData.forEach(e=>{this.data.forEach(t=>{if(e.id==t.id)for(const i of w.Di)t[i]&&(e[i]=t[i])})}),this.file&&this.fileIsValid&&await this.sendAnswers(this.baseData),this.loading=!1,this.popupVisible=!1,this.$emit("update")},async sendAnswers(e){const t=await b.A.call({endpoint:"assessments_data",action:"put",ID:this.id,params:e}).then(e=>e.data).catch(e=>{e.response.data.forEach((e,t)=>{let i=0;for(const[o,a]of Object.entries(e))i=t+2,this.fileErrors.push(`Row ${i}, "${a[0]}" for ${o}.`)}),this.errorPopupOpen=!0});return t},async getBase(){const e=await b.A.call({action:"get",endpoint:"assessments_data",ID:this.id}).then(e=>e.data).catch(e=>{throw console.error(e),"Error: Failed to get base assessment data."});return e}},created(){this.init()}},E=i(66262);const x=(0,E.A)(N,[["render",u],["__scopeId","data-v-5422b056"]]);var I=x},70188:function(e,t,i){i.d(t,{A:function(){return D}});var o=i(96913);const a={key:0},n={key:1},s={class:"row"},l={align:"center"},r={key:0,width:"inherit"},c={class:"col"},d={key:0},m={class:"col"},u={key:0},p={class:"col"},h={key:0},g={class:"col"},v={key:0};function k(e,t,i,k,y,f){const b=(0,o.resolveComponent)("preloader"),V=(0,o.resolveComponent)("csv-maturity-export-button"),w=(0,o.resolveComponent)("fade-transition"),N=(0,o.resolveComponent)("dx-scroll-view"),E=(0,o.resolveComponent)("DxPopup");return(0,o.openBlock)(),(0,o.createElementBlock)("div",{onClick:t[2]||(t[2]=(...e)=>f.popMaturity&&f.popMaturity(...e)),id:"maturity-score-button",name:"maturity-score-btn","aria-label":"maturity score button",role:"button",class:"blank-button"},[t[5]||(t[5]=(0,o.createElementVNode)("i",{class:"fas fa-chart-bar"},null,-1)),t[6]||(t[6]=(0,o.createTextVNode)(" Maturity Score ",-1)),y.popupVisible?((0,o.openBlock)(),(0,o.createBlock)(E,{key:0,visible:y.popupVisible,"onUpdate:visible":t[1]||(t[1]=e=>y.popupVisible=e),"drag-enabled":!1,hideOnOutsideClick:!0,"show-title":!0,height:e.gPopupHeight(),width:e.gPopupWidth(700),title:"Maturity Score"},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(N,null,{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",{onUpdated:t[0]||(t[0]=(...e)=>f.init&&f.init(...e))},[y.loading?((0,o.openBlock)(),(0,o.createElementBlock)("div",a,[(0,o.createVNode)(b,{size:.8,padding:1,message:"Importing..."})])):(0,o.createCommentVNode)("",!0),y.loading?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("div",n,[(0,o.createElementVNode)("div",s,[(0,o.createVNode)(w,null,{default:(0,o.withCtx)(()=>[y.maturityScore?((0,o.openBlock)(),(0,o.createBlock)(V,{key:0,fileName:y.maturityScore["asse
1ssment_name"],assessmentID:y.maturityScore["assessment_id"],class:"mr-2"},null,8,["fileName","assessmentID"])):(0,o.createCommentVNode)("",!0)],void 0,!0),_:1}),(0,o.createElementVNode)("h3",l,(0,o.toDisplayString)(y.maturityScore["assessment_name"]),1)]),t[4]||(t[4]=(0,o.createElementVNode)("hr",null,null,-1)),y.maturityScore?((0,o.openBlock)(),(0,o.createElementBlock)("div",r,[t[3]||(t[3]=(0,o.createElementVNode)("div",{class:"row header"},[(0,o.createElementVNode)("div",{class:"col"},[(0,o.createElementVNode)("h1",null,"Section")]),(0,o.createElementVNode)("div",{class:"col"},[(0,o.createElementVNode)("h1",null,"Subsection")]),(0,o.createElementVNode)("div",{class:"col"},[(0,o.createElementVNode)("h1",null,"Average Maturity Rating")]),(0,o.createElementVNode)("div",{class:"col"},[(0,o.createElementVNode)("h1",null,"Average Risk Score")])],-1)),((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(y.maturityScore["sections"],e=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{class:"row data",key:e.section_id},[(0,o.createElementVNode)("div",c,["N/A"!==e.maturity_rating?((0,o.openBlock)(),(0,o.createElementBlock)("h2",d,(0,o.toDisplayString)(e.section),1)):(0,o.createCommentVNode)("",!0)]),(0,o.createElementVNode)("div",m,["N/A"!==e.maturity_rating?((0,o.openBlock)(),(0,o.createElementBlock)("h2",u,(0,o.toDisplayString)(e.subsection),1)):(0,o.createCommentVNode)("",!0)]),(0,o.createElementVNode)("div",p,["N/A"!==e.maturity_rating?((0,o.openBlock)(),(0,o.createElementBlock)("h2",h,(0,o.toDisplayString)(e.maturity_rating),1)):(0,o.createCommentVNode)("",!0)]),(0,o.createElementVNode)("div",g,["N/A"!==e.maturity_rating?((0,o.openBlock)(),(0,o.createElementBlock)("h2",v,(0,o.toDisplayString)(e.risk_score),1)):(0,o.createCommentVNode)("",!0)])]))),128))])):(0,o.createCommentVNode)("",!0)]))],32)],void 0,!0),_:1})],void 0,!0),_:1},8,["visible","height","width"])):(0,o.createCommentVNode)("",!0)])}i(44114),i(18111),i(7588);var y=i(679),f=i(7628),b=i(78313),V=i(38317),w=i(72279);function N(e,t,i,a,n,s){return(0,o.openBlock)(),(0,o.createElementBlock)("div",{onClick:t[0]||(t[0]=(...e)=>s.exportCSV&&s.exportCSV(...e)),id:"csv-maturity-export-button",name:"csv-maturity-export","aria-label":"csv maturity export",role:"button",class:"blank-button"},[...t[1]||(t[1]=[(0,o.createElementVNode)("i",{class:"fas fa-file-export"},null,-1),(0,o.createTextVNode)(" Export CSV ",-1)])])}i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(14603),i(47566),i(98721);var E={props:{assessmentID:[Number,String],fileName:{type:String,default:()=>"CyRisk-file-export"}},data(){return{maturityScore:null,fileNaming:null,templateRemovingHeaders:["order_id","section_id","sub_section_id","depends_on_value","required","submitted","attach_files","attached_files","title","assessment","operation","assignees","internal_reference"]}},methods:{async exportCSV(){this.maturityScore=await this.getData();const e=this.maturityScore,t="text/csv";this.fileNaming=`${this.fileName}_maturity_score.csv`;const i=window.navigator;if(i?.msSaveOrOpenBlob){const o=new Blob([e],{type:t});i.msSaveOrOpenBlob(o,this.fileNaming)}else{window.URL=window.webkitURL||window.URL;const i=new Blob([e],{type:t}),o=window.URL.createObjectURL(i),a=document.createElement("a");a.href=o,a.setAttribute("download",this.fileNaming),document.body.appendChild(a),a.click()}},async getData(){return await V.A.call({action:"get",endpoint:"assessments_data_maturity_summary",ID:this.assessmentID,queries:[{name:"file",value:!0}]}).then(e=>e.data).catch(e=>{throw console.error(e),"Error: Failed to get maturity score data."})},formatObject(e){for(const t in e)Array.isArray(e[t])?e[t]=e[t].join(" | "):e[t]=`${e[t]}`,e[t]=this.replaceAll(e[t],",",";"),e[t]=this.replaceAll(e[t],'"','""'),e[t]=this.replaceAll(e[t],"#"," "),e[t]=e[t].replace(/(?:\r\n|\r|\n)/g,"");return e},replaceAll(e,t,i){return e.replace(new RegExp(t,"g"),i)},mergeArrays(...e){let t=[];return e.forEach(e=>{t=[...t,...e]}),[...new Set([...t])]}}},x=i(66262);const I=(0,x.A)(E,[["render",N],["__scopeId","data-v-65ff72be"]]);var C=I,_={props:{assessmentID:[Number,String],selectedRequirement:Object},components:{preloader:w.A,DxPopup:y.jF,DxScrollView:f.$,FadeTransition:b.AV,CsvMaturityExportButton:C},data(){return{maturityScore:{},popupVisible:!1,errorPopupOpen:!1,loading:!0,error:""}},methods:{popMaturity(){this.popupVisible?this.popupVisible=!1:(this.init(),this.popupVisible=!0)}
1,async init(){this.loading=!0,this.maturityScore=await V.A.call({action:"get",endpoint:"assessments_data_maturity_summary",ID:this.assessmentID}).then(e=>(this.loading=!1,this.flattenMaturityScore(e.data))).catch(e=>{console.error(e),this.catchError("Error fetching maturity score.")})},flattenMaturityScore(e){const t={};return t["assessment_id"]=e.assessment_id,t["assessment_name"]=e.assessment_name,t["sections"]=[],e["sections"].forEach(e=>{t["sections"].push({section:e.section_title,id:e.section_id,subsection:"",risk_score:this.parseScores(e.average_risk_score,2),maturity_rating:this.parseScores(e.average_maturity_rating,2)}),e.subsections.forEach(e=>{t["sections"].push({section:"",id:e.sub_section_id,subsection:e.sub_section_title,risk_score:this.parseScores(e.average_risk_score,2),maturity_rating:this.parseScores(e.average_maturity_rating,2)})})}),t}}};const B=(0,x.A)(_,[["render",k],["__scopeId","data-v-01c7762b"]]);var D=B}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.