import{a as O}from"./chunk-N6RJE5TE.js";import{d as l}from"./chunk-GPXQ2AOL.js";import{Ib as f,Jc as w,Kc as u,Le as y,ac as x,af as v,cc as _,dc as C,fc as g,gc as h,hc as p,ic as s,jc as c,kc as d,ob as m,sb as a,vc as o}from"./chunk-ISMRT7VU.js";function F(e,r){if(e&1&&(s(0,"div",0),d(1,"img",3),c()),e&2){let t=o().$implicit;a(),p("src","data:image/jpeg;base64,"+t.value,m)}}function P(e,r){if(e&1&&(s(0,"pre",1),w(1),c()),e&2){let t=o(),i=t.$implicit,n=t.$index,b=o();p("ngStyle",b.styleObj[n]),a(),u(i.value)}}function S(e,r){if(e&1&&(s(0,"div",2),d(1,"qrcode",4),c()),e&2){let t=o().$implicit;a(),p("qrdata",t.value)("cssClass","center")("elementType","svg")("width",175)}}function T(e,r){if(e&1&&x(0,F,2,1,"div",0)(1,P,2,2,"pre",1)(2,S,2,4,"div",2),e&2){let t,i=r.$implicit,n=o();_((t=i.type)===n.printFormat.image?0:t===n.printFormat.text?1:t===n.printFormat.qrCode?2:-1)}}var q=(()=>{class e{constructor(){this.printFormat={text:l.Text,image:l.Image,qrCode:l.QrCode},this.styleObj=[]}set data(t){t&&(this._data=t,this._processData())}get data(){return this._data}_processData(){this.styleObj=[],this.data&&this.data.forEach(t=>{this._getStyle(t.className||"")})}_getStyle(t){let i={"font-weight":"500","font-size":"12px","font-style":"","text-decoration":"","line-height":"14px"};t.indexOf("bold")>-1&&(i["font-weight"]="700",i["line-height"]="28px"),t.indexOf("doubleWidth")>-1&&(i["font-size"]="24px",i["line-height"]="28px"),t.indexOf("italic")>-1&&(i["font-style"]="italic"),t.indexOf("underline")>-1&&(i["text-decoration"]="underline"),this.styleObj.push(i)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=f({type:e,selectors:[["tis-print-view-content"]],inputs:{data:"data"},decls:2,vars:0,consts:[[1,"print-image-wrapper"],[2,"margin","0","white-space","pre-wrap","word-wrap","break-word",3,"ngStyle"],[2,"text-align","center"],["alt","logo",1,"print-image",3,"src"],[3,"qrdata","cssClass","elementType","width"]],template:function(i,n){i&1&&g(0,T,3,1,null,null,C),i&2&&h(n.data)},dependencies:[v,y,O],styles:[`[_nghost-%COMP%]{display:flex;flex-direction:column}.print-image-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;width:300px;overflow:hidden;align-self:center}.print-image[_ngcontent-%COMP%]{display:block;width:100%;max-width:100%;height:auto;object-fit:contain}
/*# sourceMappingURL=print-view-content.component-323EERSZ.css.map */`]})}}return e})();export{q as a};
//# sourceMappingURL=chunk-WM2SNXCB.js.map
