import{b as I}from"./chunk-SPNVV2KO.js";import{z as V}from"./chunk-ZTKV4AIV.js";import{da as Q,ga as A}from"./chunk-JIDGXFMJ.js";import{j as q}from"./chunk-YJYOGSOO.js";import{Ab as u,Bc as N,Hb as v,Ic as m,Jc as d,Ob as f,Qb as D,Rb as k,Sb as r,Tb as l,Ua as y,Ub as E,Yb as M,hb as a,ib as T,ic as _,jc as s,na as S,qa as g,va as h,vc as p,wa as w,wc as x,xc as L}from"./chunk-FWZCAEAJ.js";var B=(e,i)=>i.value;function Y(e,i){if(e&1&&E(0,"div",6),e&2){let t=s(2);v("innerHTML",t.info,y)}}function F(e,i){if(e&1&&(r(0,"strong"),p(1),m(2,"tr"),l()),e&2){let t=s(2);a(),x(d(2,1,t.question))}}function U(e,i){if(e&1&&u(0,Y,1,1,"div",6)(1,F,3,3),e&2){let t=s();f(0,t.info?0:1)}}function $(e,i){if(e&1&&E(0,"bi",7),e&2){let t=s().$implicit;v("name",t.icon)}}function j(e,i){if(e&1){let t=M();r(0,"button",5),_("click",function(){let C=h(t).$implicit,O=s();return w(O.answerQuestion(C.value))}),u(1,$,1,1,"bi",7),p(2),m(3,"tr"),l()}if(e&2){let t=i.$implicit;a(),f(1,t.icon?1:-1),a(),L(" ",d(3,2,t.text)," ")}}var o=class o{constructor(i){this.activeModal=i,this.answers=o.YES_NO_ANSWERS,this.lumber=V("QuestionDialogComponent")}answerQuestion(i){this.lumber.info("answerQuestion","Question dialog result:",i),this.activeModal.close(i)}};o.YES_VALUE="yes",o.NO_VALUE="no",o.YES_NO_ANSWERS=[{icon:"check-circle-fill",text:"YES",value:o.YES_VALUE},{icon:"x-circle-fill",text:"NO",value:o.NO_VALUE}],o.\u0275fac=function(t){return new(t||o)(T(Q))},o.\u0275cmp=g({type:o,selectors:[["app-question-modal"]],inputs:{question:"question",info:"info",answers:"answers",title:"title"},standalone:!0,features:[N],decls:13,vars:7,consts:[[1,"modal-header","border-bottom-0"],[1,"modal-title","fs-5"],["type","button","aria-label","Close",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body","py-0"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[3,"innerHTML"],[3,"name"],["class","btn btn-outline-secondary","type","button"]],template:function(t,n){t&1&&(r(0,"div",0)(1,"h1",1),p(2),m(3,"tr"),l(),r(4,"button",2),_("click",function(){return n.activeModal.close()}),l()(),r(5,"div",3),u(6,U,2,1),l(),r(7,"div",4)(8,"button",5),_("click",function(){return n.activeModal.close()}),p(9),m(10,"tr"),l(),D(11,j,4,4,"button",8,B),l()),t&2&&(a(2),x(d(3,3,n.title?n.title:n.question)),a(4),f(6,n.question||n.info?6:-1),a(3),x(d(10,5,"CLOSE")),a(2),k(n.answers))},dependencies:[q,I],encapsulation:2,changeDetection:0});var b=o;function tt(){let e=S(A);return(i,t)=>{let n=e.open(b,{ariaLabelledBy:"modal-question-title",size:"md"});return n.componentInstance.title=i,t&&(n.componentInstance.info=t),new Promise(c=>{n.result.then(C=>{C?.toString().includes(b.YES_VALUE)&&c(!0),c(!1)}).catch(()=>c(!1))})}}export{tt as a};
