import{b as K}from"./chunk-SPNVV2KO.js";import{Ea as $,cb as H}from"./chunk-JIDGXFMJ.js";import{j}from"./chunk-YJYOGSOO.js";import{X as V}from"./chunk-KVTHJWZA.js";import{Ab as E,Bc as M,Fc as O,Hb as m,Ib as b,Ic as s,Jc as d,Nc as R,Pb as T,Qb as v,Rb as x,Sb as p,Tb as a,Ub as D,Xc as N,Yb as B,cb as y,hb as c,ic as u,jc as f,mc as I,ob as P,pa as g,qa as _,ta as h,tb as w,uc as A,va as F,vc as S,wa as k,xc as L}from"./chunk-FWZCAEAJ.js";var q=(()=>{let t=class t{transform(i){return i?G(i):!1}};t.\u0275fac=function(n){return new(n||t)},t.\u0275pipe=h({name:"isLightColor",type:t,pure:!0,standalone:!0});let e=t;return e})();function G(e){e=e.replace(/^#/,"");let t=parseInt(e.slice(0,2),16)/255,r=parseInt(e.slice(2,4),16)/255,i=parseInt(e.slice(4,6),16)/255;return .2126*C(t)+.7152*C(r)+.0722*C(i)>.5}function C(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function J(e,t){if(e&1){let r=B();p(0,"button",6),u("click",function(){let o=F(r).$implicit,l=f(2);return k(l.changeColor(o))}),a()}if(e&2){let r=t.$implicit;b("background-color",r)}}function Q(e,t){if(e&1&&(p(0,"div",5),v(1,J,1,2,"button",7,T),a()),e&2){let r=f();c(),x(r.colors)}}var U=(e,t,r)=>({"text-white":e,"text-dark":t,"text-body-emphasis":r}),ce=(()=>{let t=class t{constructor(){this.showColorPicker=y(!1),this.colors=["#EBEFFF","#1B2347","#C9D1FB","#6750A4","#D4DBFA","#607DFF","#F8FFA8","#EFFF32","#E0FFC0","#ACFF56","#FFDBF7","#FF60DC"],this.colorChange=new P}changeColor(i){this.color=i,this.colorChange.emit(this.color)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=_({type:t,selectors:[["app-color-picker"]],inputs:{color:"color",disabled:[g.HasDecoratorInputTransform,"disabled","disabled",N]},outputs:{colorChange:"colorChange"},standalone:!0,features:[w,M],decls:11,vars:23,consts:[[1,"btn-group"],["id","color-picker-button","type","button","placement","bottom","container","body","popoverClass","color-picker-class",1,"btn","btn-outline-info",3,"disabled","ngClass","autoClose","ngbPopover","click"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","ngbTooltip","click"],["name","x-circle-fill"],["popContent",""],[1,"d-flex","flex-row","flex-wrap",2,"width","200px"],["type","button",1,"color-btn",3,"click"],["class","color-btn","type","button",3,"background-color"]],template:function(n,o){if(n&1&&(p(0,"div",0)(1,"button",1),u("click",function(){return o.showColorPicker.set(!o.showColorPicker())}),s(2,"isLightColor"),s(3,"isLightColor"),S(4),s(5,"tr"),a(),p(6,"button",2),u("click",function(){return o.color=void 0,o.colorChange.emit(void 0)}),s(7,"tr"),D(8,"bi",3),a()(),E(9,Q,3,0,"ng-template",null,4,R)),n&2){let l=A(10);c(),b("background-color",o.color)("border-color",o.color),m("disabled",o.disabled)("ngClass",O(19,U,!d(2,11,o.color)&&o.color,d(3,13,o.color)&&o.color,!o.color))("autoClose","outside")("ngbPopover",l),c(3),L(" ",d(5,15,"COLOR_PICKER")," "),c(2),I("ngbTooltip",d(7,17,"RESET")),m("disabled",o.disabled)}},dependencies:[j,K,$,V,q,H],styles:[".color-btn[_ngcontent-%COMP%]{border:none;width:33px;height:33px}"],changeDetection:0});let e=t;return e})();export{ce as a};
