1import{H as M,z as j}from"./chunk-DGAGBLQ5.js";import"./chunk-ZAI73KCM.js";import"./chunk-4LMFJ3RQ.js";import{d as l,e as p,o as d}from"./chunk-JBQ3SQYQ.js";import"./chunk-RXSTUEU6.js";import{f as R}from"./chunk-IELZJEER.js";import{Lc as u,Pb as N,Sb as m,f as x,ga as a,n as U}from"./chunk-G7JQUX5M.js";import{D as T,F as f,Fc as b,H as V,Kc as O,Mc as g,O as F,Pa as I,Qa as C,Rb as o,Xb as w,a as r,b as S,bc as _,ra as y,vc as k,wc as D,xc as A}from"./chunk-GRSQHQHU.js";V();function q(v,n){if(v&1){let e=b();D(0,"app-document-sign",1),O("signDocument",function(c){I(e);let i=g();return C(i.onSignDocument(c))}),A()}if(v&2){let e=g();k("title",e.documentName||(e.task.todo==null?null:e.task.todo.category.title))}}var s,E=(s=class{constructor(n,e,t,c,i,h){this.activatedRoute=n,this.translateService=e,this.documentApiService=t,this.redirectService=c,this.checkInFlowService=i,this.onFlyTasksFlowService=h,this.documentName=this.activatedRoute.snapshot.queryParams?.documentName,this.languageId$=this.translateService.getCurrentLanguageProperties().pipe(F(P=>P?.id),y(1)),this.isOnFlyTasksFlow=this.onFlyTasksFlowService.isOnFlyTasksFlow()}ngOnInit(){this.task=this.redirectService.getActiveTask(),typeof this.task.documentType!="string"&&this.documentApiService.getClinicDocumentTypes(this.task.clinicUuid,[N.SIGN_DOCUMENT]).subscribe(n=>{this.task.documentType=n.find(e=>e.id===Number(this.task.todo.actions[0].value[0]))?.name})}onSignDocument({signature:n,representative:e}){let t=r({signature:n,userId:this.task.todo.userId,clinicUuid:this.task.clinicUuid,documentType:this.task.documentType},e?{representative:e}:null);this.languageId$.subscribe(c=>{if(c&&(t.languageId=c),this.task.isDone)!this.isOnFlyTasksFlow&&this.task.source?.appointment?.id&&(t.appointmentId=this.task.source.appointment.id),this.documentApiService.signDocument(t).subscribe(()=>{this.checkInFlowService.isCheckInAppFlow()?this.checkInFlowService.moveForwardFromCompletedTask(this.task):this.redirectService.gotoSuccessPage()});else if(this.task.newTaskListFormat){let i=this.redirectService.getActiveTask();this.documentApiService.signDocumentAndCompleteSettingTask(r(S(r({clinicUuid:t.clinicUuid,languageId:t.languageId,documentType:t.documentType,sign:t.signature},this.isOnFlyTasksFlow?null:{appointmentId:i.source?.appointment.id}),{settingId:i.id}),e?{representative:e}:null),t.userId).subscribe(()=>{this.isOnFlyTasksFlow?(this.onFlyTasksFlowService.completeCurrentTask(),this.onFlyTasksFlowService.goToFirstIncompleteTask(t.clinicUuid,t.userId)):this.checkInFlowService.moveForwardFromCompletedTask(i)})}else this.documentApiService.signDocumentAndCompleteTask(t,this.task).subscribe(i=>{let h=this.redirectService.activateTaskAsCompleted(this.task,i);this.redirectService.redirectToTaskAction(h,!1)})})}},s.\u0275fac=function(e){return new(e||s)(o(a),o(m),o(u),o(l),o(p),o(d))},s.\u0275cmp=w({type:s,selectors:[["ng-component"]],decls:1,vars:1,consts:[[3,"title","signDocument",4,"ngIf"],[3,"signDocument","title"]],template:function(e,t){e&1&&_(0,q,1,1,"app-document-sign",0),e&2&&k("ngIf",t.task)},dependencies:[U,x,M,j],encapsulation:2}),s);E=T([R(),f("design:paramtypes",[a,m,u,l,p,d])],E);export{E as SignatureCreateComponent};
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.