-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathchunk-HEKLLQKI.js
1 lines (1 loc) · 26.6 KB
/
chunk-HEKLLQKI.js
1
import{b as Fe,h as we,i as Me}from"./chunk-VXEXO2ZG.js";import{a as ye}from"./chunk-VUVIOKWJ.js";import{a as xe}from"./chunk-ERVUYXST.js";import{f as Re,h as Ve}from"./chunk-DNIAAPRH.js";import{Dc as q,Gb as Ce,Gc as Se,hc as ze,kc as ve,oa as ge,oc as _e,pc as be,wc as ke,xc as Oe}from"./chunk-U67ZLHSB.js";import{Aa as z,Ac as L,Ba as v,Bc as I,Cc as j,E as se,Gc as G,Hc as ie,Ib as O,Ic as ue,Jb as te,Jc as he,Ka as f,Kd as le,L as ce,Ob as E,P as de,Pb as C,Sc as fe,Wb as m,Xb as w,Yb as M,_b as pe,aa as $,bd as Q,dc as y,f as Z,ga as me,hd as U,ia as ee,ic as s,jc as l,kc as h,ld as b,na as Y,oc as x,rc as _,tb as a,tc as u,ub as T,uc as ne,vc as oe,wd as re,xa as F}from"./chunk-6WFMSBDD.js";import{a as H,b as B,c as K}from"./chunk-EQDQRRRY.js";var De=["*"],Ne=["slider"],Pe=["transform"];function Ie(t,r){}function je(t,r){if(t&1&&C(0,Ie,0,0,"ng-template",1),t&2){let e=u();m("ngTemplateOutlet",e.panelRenderHeader)}}function Ue(t,r){if(t&1){let e=x();s(0,"color-slider",8),_("nzOnChange",function(n){z(e);let i=u();return v(i.handleChange(n,"alpha"))})("nzOnChangeComplete",function(n){z(e);let i=u();return v(i.nzOnChangeComplete.emit(n))}),l()}if(t&2){let e=u();m("color",e.colorValue)("value",e.toRgbString)("gradientColors",e.gradientColors)("disabled",e.disabled)}}function Xe(t,r){}function $e(t,r){if(t&1&&C(0,Xe,0,0,"ng-template",1),t&2){let e=u();m("ngTemplateOutlet",e.panelRenderFooter)}}function Ye(t,r){t&1&&(s(0,"div",7)(1,"nz-input-group",11),h(2,"input",12),l()())}function Ge(t,r){if(t&1&&(s(0,"div",8)(1,"div",13),h(2,"nz-input-number",14),l(),s(3,"div",13),h(4,"nz-input-number",15),l(),s(5,"div",13),h(6,"nz-input-number",16),l()()),t&2){let e=u();a(2),m("nzMin",0)("nzMax",360)("nzStep",1)("nzPrecision",0),a(2),m("nzMin",0)("nzMax",100)("nzStep",1)("nzFormatter",e.formatterPercent)("nzParser",e.parserPercent),a(2),m("nzMin",0)("nzMax",100)("nzStep",1)("nzFormatter",e.formatterPercent)("nzParser",e.parserPercent)}}function Qe(t,r){t&1&&(s(0,"div",9)(1,"div",17),h(2,"nz-input-number",18),l(),s(3,"div",17),h(4,"nz-input-number",19),l(),s(5,"div",17),h(6,"nz-input-number",20),l()()),t&2&&(a(2),m("nzMin",0)("nzMax",255)("nzStep",1),a(2),m("nzMin",0)("nzMax",255)("nzStep",1),a(2),m("nzMin",0)("nzMax",255)("nzStep",1))}function qe(t,r){if(t&1&&(s(0,"div",10),h(1,"nz-input-number",21),l()),t&2){let e=u();a(),m("nzMin",0)("nzMax",100)("nzStep",1)("nzFormatter",e.formatterPercent)("nzParser",e.parserPercent)}}function We(t,r){if(t&1&&h(0,"nz-color-block",4),t&2){let e=u();m("nzColor",e.blockColor)("nzSize",e.nzSize)}}function Je(t,r){}function Ke(t,r){if(t&1&&C(0,Je,0,0,"ng-template",5),t&2){let e=u();m("ngTemplateOutlet",e.nzFlipFlop)}}function Ze(t,r){if(t&1&&(s(0,"div",6),ie(1),l()),t&2){let e=u();a(),he(" ",e.showText," ")}}function et(t,r){if(t&1){let e=x();s(0,"ng-antd-color-picker",7),_("nzOnChange",function(n){z(e);let i=u();return v(i.colorChange(n))}),l()}if(t&2){let e=u(),o=G(7),n=G(9);m("value",e.nzValue)("defaultValue",e.nzDefaultValue)("disabled",e.nzDisabled)("panelRenderHeader",o)("panelRenderFooter",n)("disabledAlpha",e.nzDisabledAlpha)}}function tt(t,r){if(t&1&&ie(0),t&2){let e=u(3);ue(e.nzTitle)}}function nt(t,r){if(t&1){let e=x();s(0,"div",12),_("click",function(){z(e);let n=u(3);return v(n.clearColorHandle())}),l()}}function ot(t,r){if(t&1&&(s(0,"div",8)(1,"div",9),C(2,tt,1,1,"ng-template",10),l(),C(3,nt,1,0,"div",11),l()),t&2){let e=u(2);a(2),m("nzStringTemplateOutlet",e.nzTitle),a(),y(e.nzAllowClear?3:-1)}}function it(t,r){if(t&1&&C(0,ot,4,2,"div",8),t&2){let e=u();y(e.nzTitle||e.nzAllowClear?0:-1)}}function rt(t,r){if(t&1){let e=x();s(0,"nz-color-format",13),_("formatChange",function(n){z(e);let i=u();return v(i.formatChange(n))})("nzOnFormatChange",function(n){z(e);let i=u();return v(i.nzOnFormatChange.emit(n))}),l()}if(t&2){let e=u();m("colorValue",e.blockColor)("clearColor",e.clearColor)("format",e.nzFormat)("nzDisabledAlpha",e.nzDisabledAlpha)}}var ae=t=>Math.round(Number(t||0)),lt=t=>{if(t&&typeof t=="object"&&"h"in t&&"b"in t){let r=t,{b:e}=r,o=K(r,["b"]);return B(H({},o),{v:e})}return typeof t=="string"&&/hsb/.test(t)?t.replace(/hsb/,"hsv"):t},W=class extends ge{constructor(r){super(lt(r))}toHsbString(){let r=this.toHsb(),e=ae(r.s*100),o=ae(r.b*100),n=ae(r.h),i=r.a,c=`hsb(${n}, ${e}%, ${o}%)`,p=`hsba(${n}, ${e}%, ${o}%, ${i.toFixed(i===0?0:2)})`;return i===1?c:p}toHsb(){let r=this.toHsv();typeof this.originalInput=="object"&&this.originalInput&&"h"in this.originalInput&&(r=this.originalInput);let n=r,{v:e}=n,o=K(n,["v"]);return B(H({},o),{b:r.v})}},d=t=>t instanceof W?t:new W(t),X=d("#1677ff");function Te(t,r,e,o,n){let{width:i,height:c}=r.getBoundingClientRect(),{width:p,height:R}=e.getBoundingClientRect(),S=p/2,g=R/2,k=(t.x+S)/i,D=1-(t.y+g)/c,V=o?.toHsb()||{a:0,h:0,s:0,b:0},N=k,P=(t.x+S)/i*360;if(n)switch(n){case"hue":return d(B(H({},V),{h:P<=0?0:P}));case"alpha":return d(B(H({},V),{a:N<=0?0:N}))}return d({h:V.h,s:k<=0?0:k,b:D>=1?1:D,a:V.a})}var J=(t,r,e,o)=>{let{width:n,height:i}=t.getBoundingClientRect(),{width:c,height:p}=r.getBoundingClientRect(),R=c/2,S=p/2,g=e?.toHsb()||{a:0,h:0,s:0,b:0};if(c===0&&p===0||c!==p)return null;if(o)switch(o){case"hue":return{x:g.h/360*n-R,y:-S/3};case"alpha":return{x:g.a*n-R,y:-S/3}}return{x:g.s*n-R,y:(1-g.b)*i-S}},Ee=(()=>{class t{color=X.toHsbString();nzOnClick=new f;static \u0275fac=function(o){return new(o||t)};static \u0275cmp=O({type:t,selectors:[["ng-antd-color-block"]],inputs:{color:"color"},outputs:{nzOnClick:"nzOnClick"},decls:2,vars:2,consts:[[1,"ant-color-picker-color-block",3,"click"],[1,"ant-color-picker-color-block-inner"]],template:function(o,n){o&1&&(s(0,"div",0),_("click",function(){return n.nzOnClick.emit(!0)}),h(1,"div",1),l()),o&2&&(a(),w("background-color",n.color))},encapsulation:2})}return t})(),Ae=(()=>{class t{color=null;size="default";static \u0275fac=function(o){return new(o||t)};static \u0275cmp=O({type:t,selectors:[["color-handler"]],inputs:{color:"color",size:"size"},decls:1,vars:4,consts:[[1,"ant-color-picker-handler"]],template:function(o,n){o&1&&h(0,"div",0),o&2&&(w("background-color",n.color),M("ant-color-picker-handler-sm",n.size==="small"))},encapsulation:2})}return t})(),He=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275cmp=O({type:t,selectors:[["color-palette"]],ngContentSelectors:De,decls:2,vars:0,consts:[[1,"ant-color-picker-palette"]],template:function(o,n){o&1&&(ne(),s(0,"div",0),oe(1),l())},encapsulation:2})}return t})();function at(t){let r="touches"in t?t.touches[0]:t,e=document.documentElement.scrollLeft||document.body.scrollLeft||window.pageXOffset,o=document.documentElement.scrollTop||document.body.scrollTop||window.pageYOffset;return{pageX:r.pageX-e,pageY:r.pageY-o}}var st=(()=>{class t{cdr;containerRef;transformRef;color=null;nzOnChange=new f;nzOnChangeComplete=new f;disabled=!1;offsetValue={x:0,y:0};dragRef=!1;document=Y(re);mouseMoveRef=()=>null;mouseUpRef=()=>null;toRgbString(){return this.color?.toRgbString()}toHsb(){return`hsl(${this.color?.toHsb().h},100%, 50%)`}constructor(e){this.cdr=e}ngOnInit(){this.document.removeEventListener("mousemove",this.mouseMoveRef),this.document.removeEventListener("mouseup",this.mouseUpRef),this.document.removeEventListener("touchmove",this.mouseMoveRef),this.document.removeEventListener("touchend",this.mouseUpRef),this.mouseMoveRef=()=>null,this.mouseUpRef=()=>null}ngOnChanges(e){let{color:o}=e;if(o&&!this.dragRef&&this.containerRef&&this.transformRef){let n=J(this.containerRef.nativeElement,this.transformRef.nativeElement,this.color);n&&(this.offsetValue=n,this.cdr.detectChanges())}}ngAfterViewInit(){if(!this.dragRef&&this.containerRef&&this.transformRef){let e=J(this.containerRef.nativeElement,this.transformRef.nativeElement,this.color);e&&(this.offsetValue=e,this.cdr.detectChanges())}}dragStartHandle(e){this.onDragStart(e)}updateOffset=(e,o="y")=>{let{pageX:n,pageY:i}=at(e),{x:c,y:p,width:R,height:S}=this.containerRef?.nativeElement?.getBoundingClientRect()||{x:0,y:0,width:0,height:0},{width:g,height:k}=this.transformRef?.nativeElement?.getBoundingClientRect()||{width:0,height:0},D=g/2,V=k/2,N=Math.max(0,Math.min(n-c,R))-D,P=Math.max(0,Math.min(i-p,S))-V,A={x:N,y:o==="x"?this.offsetValue.y:P};g===0&&k===0||g!==k||(this.offsetValue=A,this.nzOnChange.emit(Te(A,this.containerRef.nativeElement,this.transformRef.nativeElement,this.color)),this.cdr.detectChanges())};onDragMove=e=>{e.preventDefault(),this.updateOffset(e)};onDragStop=e=>{e.preventDefault(),this.dragRef=!1,this.document.removeEventListener("mousemove",this.onDragMove),this.document.removeEventListener("mouseup",this.mouseUpRef),this.document.removeEventListener("touchmove",this.mouseMoveRef),this.document.removeEventListener("touchend",this.mouseUpRef),this.mouseMoveRef=()=>null,this.mouseUpRef=()=>null,this.nzOnChangeComplete?.emit()};onDragStart=e=>{this.disabled||(this.updateOffset(e),this.dragRef=!0,this.document.addEventListener("mousemove",this.onDragMove),this.document.addEventListener("mouseup",this.onDragStop),this.document.addEventListener("touchmove",this.onDragMove),this.document.addEventListener("touchend",this.onDragStop),this.mouseMoveRef=this.onDragMove,this.mouseUpRef=this.onDragStop,this.cdr.markForCheck())};static \u0275fac=function(o){return new(o||t)(T(U))};static \u0275cmp=O({type:t,selectors:[["color-picker"]],viewQuery:function(o,n){if(o&1&&(L(Ne,5),L(Pe,5)),o&2){let i;I(i=j())&&(n.containerRef=i.first),I(i=j())&&(n.transformRef=i.first)}},inputs:{color:"color",disabled:[2,"disabled","disabled",b]},outputs:{nzOnChange:"nzOnChange",nzOnChangeComplete:"nzOnChangeComplete"},features:[E,F],decls:7,vars:7,consts:[["slider",""],["transform",""],[1,"ant-color-picker-select",3,"mousedown","touchstart"],[1,"ant-color-picker-transform"],[3,"color"],[1,"ant-color-picker-saturation"]],template:function(o,n){if(o&1){let i=x();s(0,"div",2,0),_("mousedown",function(p){return z(i),v(n.dragStartHandle(p))})("touchstart",function(p){return z(i),v(n.dragStartHandle(p))}),s(2,"color-palette")(3,"div",3,1),h(5,"color-handler",4),l(),h(6,"div",5),l()()}o&2&&(a(3),w("left",n.offsetValue.x+"px")("top",n.offsetValue.y+"px"),a(2),m("color",n.toRgbString()),a(),w("background-color",n.toHsb()))},dependencies:[Ae,He],encapsulation:2})}return t})(),ct=(()=>{class t{colors=[];direction="to right";type="hue";gradientColors="";ngOnInit(){this.useMemo()}ngOnChanges(e){let{colors:o,type:n}=e;(o||n)&&this.useMemo()}useMemo(){this.gradientColors=this.colors.map((e,o)=>{let n=d(e);return this.type==="alpha"&&o===this.colors.length-1&&n.setAlpha(1),n.toRgbString()}).join(",")}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=O({type:t,selectors:[["color-gradient"]],inputs:{colors:"colors",direction:"direction",type:"type"},features:[F],ngContentSelectors:De,decls:2,vars:2,consts:[[1,"ant-color-picker-gradient"]],template:function(o,n){o&1&&(ne(),s(0,"div",0),oe(1),l()),o&2&&w("background","linear-gradient("+n.direction+", "+n.gradientColors+")")},encapsulation:2})}return t})();function dt(t){let r="touches"in t?t.touches[0]:t,e=document.documentElement.scrollLeft||document.body.scrollLeft||window.pageXOffset,o=document.documentElement.scrollTop||document.body.scrollTop||window.pageYOffset;return{pageX:r.pageX-e,pageY:r.pageY-o}}var mt=(()=>{class t{cdr;containerRef;transformRef;gradientColors=[];direction="to right";type="hue";color=null;value=null;disabled=!1;nzOnChange=new f;nzOnChangeComplete=new f;offsetValue={x:0,y:0};dragRef=!1;mouseMoveRef=()=>null;mouseUpRef=()=>null;document=Y(re);constructor(e){this.cdr=e}ngOnInit(){this.document.removeEventListener("mousemove",this.mouseMoveRef),this.document.removeEventListener("mouseup",this.mouseUpRef),this.document.removeEventListener("touchmove",this.mouseMoveRef),this.document.removeEventListener("touchend",this.mouseUpRef),this.mouseMoveRef=()=>null,this.mouseUpRef=()=>null}ngOnChanges(e){let{color:o}=e;if(o&&!this.dragRef&&this.containerRef&&this.transformRef){let n=J(this.containerRef.nativeElement,this.transformRef.nativeElement,this.color,this.type);n&&(this.offsetValue=n,this.cdr.detectChanges())}}ngAfterViewInit(){if(!this.dragRef&&this.containerRef&&this.transformRef){let e=J(this.containerRef.nativeElement,this.transformRef.nativeElement,this.color,this.type);e&&(this.offsetValue=e,this.cdr.detectChanges())}}dragStartHandle(e){this.onDragStart(e)}updateOffset=(e,o="x")=>{let{pageX:n,pageY:i}=dt(e),{x:c,y:p,width:R,height:S}=this.containerRef?.nativeElement?.getBoundingClientRect()||{x:0,y:0,width:0,height:0},{width:g,height:k}=this.transformRef?.nativeElement?.getBoundingClientRect()||{width:0,height:0},D=g/2,V=k/2,N=Math.max(0,Math.min(n-c,R))-D,P=Math.max(0,Math.min(i-p,S))-V,A={x:N,y:o==="x"?this.offsetValue.y:P};g===0&&k===0||g!==k||(this.offsetValue=A,this.nzOnChange.emit(Te(A,this.containerRef.nativeElement,this.transformRef.nativeElement,this.color,this.type)),this.cdr.detectChanges())};onDragMove=e=>{e.preventDefault(),this.updateOffset(e)};onDragStop=e=>{e.preventDefault(),this.dragRef=!1,this.document.removeEventListener("mousemove",this.onDragMove),this.document.removeEventListener("mouseup",this.mouseUpRef),this.document.removeEventListener("touchmove",this.mouseMoveRef),this.document.removeEventListener("touchend",this.mouseUpRef),this.mouseMoveRef=()=>null,this.mouseUpRef=()=>null,this.nzOnChangeComplete?.emit(this.type)};onDragStart=e=>{this.disabled||(this.updateOffset(e),this.dragRef=!0,this.document.addEventListener("mousemove",this.onDragMove),this.document.addEventListener("mouseup",this.onDragStop),this.document.addEventListener("touchmove",this.onDragMove),this.document.addEventListener("touchend",this.onDragStop),this.mouseMoveRef=this.onDragMove,this.mouseUpRef=this.onDragStop,this.cdr.markForCheck())};static \u0275fac=function(o){return new(o||t)(T(U))};static \u0275cmp=O({type:t,selectors:[["color-slider"]],viewQuery:function(o,n){if(o&1&&(L(Ne,5),L(Pe,5)),o&2){let i;I(i=j())&&(n.containerRef=i.first),I(i=j())&&(n.transformRef=i.first)}},inputs:{gradientColors:"gradientColors",direction:"direction",type:"type",color:"color",value:"value",disabled:[2,"disabled","disabled",b]},outputs:{nzOnChange:"nzOnChange",nzOnChangeComplete:"nzOnChangeComplete"},features:[E,F],decls:7,vars:10,consts:[["slider",""],["transform",""],[1,"ant-color-picker-slider",3,"mousedown","touchstart"],[1,"ant-color-picker-transform"],["size","small",3,"color"],[3,"colors","direction","type"]],template:function(o,n){if(o&1){let i=x();s(0,"div",2,0),_("mousedown",function(p){return z(i),v(n.dragStartHandle(p))})("touchstart",function(p){return z(i),v(n.dragStartHandle(p))}),s(2,"color-palette")(3,"div",3,1),h(5,"color-handler",4),l(),h(6,"color-gradient",5),l()()}o&2&&(pe("ant-color-picker-slider-"+n.type),a(3),w("left",n.offsetValue.x+"px")("top",n.offsetValue.y+"px"),a(2),m("color",n.value),a(),m("colors",n.gradientColors)("direction",n.direction)("type",n.type))},dependencies:[He,ct,Ae],styles:["[_nghost-%COMP%]{display:block;width:100%}"]})}return t})(),pt=(()=>{class t{cdr;value;defaultValue;nzOnChange=new f;nzOnChangeComplete=new f;panelRenderHeader=null;panelRenderFooter=null;disabledAlpha=!1;disabled=!1;colorValue=null;alphaColor="";hueColor=["rgb(255, 0, 0) 0%","rgb(255, 255, 0) 17%","rgb(0, 255, 0) 33%","rgb(0, 255, 255) 50%","rgb(0, 0, 255) 67%","rgb(255, 0, 255) 83%","rgb(255, 0, 0) 100%"];gradientColors=["rgba(255, 0, 4, 0) 0%",this.alphaColor];toRgbString=this.colorValue?.toRgbString()||"";constructor(e){this.cdr=e}ngOnInit(){this.setColorValue(this.value)}ngOnChanges(e){let{value:o,defaultValue:n}=e;(o||n)&&this.setColorValue(this.value)}hasValue(e){return!!e}setColorValue(e){let o;this.hasValue(e)?o=e:this.hasValue(this.defaultValue)?o=this.defaultValue:o=X,this.colorValue=d(o),this.setAlphaColor(this.colorValue),this.toRgbString=this.colorValue?.toRgbString()||"",this.cdr.detectChanges()}setAlphaColor(e){let o=d(e.toRgbString());this.alphaColor=o.toRgbString(),this.gradientColors=["rgba(255, 0, 4, 0) 0%",this.alphaColor],this.cdr.markForCheck()}handleChange(e,o){this.setColorValue(e),this.nzOnChange.emit({color:e,type:o})}static \u0275fac=function(o){return new(o||t)(T(U))};static \u0275cmp=O({type:t,selectors:[["ng-antd-color-picker"]],inputs:{value:"value",defaultValue:"defaultValue",panelRenderHeader:"panelRenderHeader",panelRenderFooter:"panelRenderFooter",disabledAlpha:[2,"disabledAlpha","disabledAlpha",b],disabled:[2,"disabled","disabled",b]},outputs:{nzOnChange:"nzOnChange",nzOnChangeComplete:"nzOnChangeComplete"},features:[E,F],decls:9,vars:14,consts:[[1,"ant-color-picker-panel"],[3,"ngTemplateOutlet"],[3,"nzOnChange","nzOnChangeComplete","color","disabled"],[1,"ant-color-picker-slider-container"],[1,"ant-color-picker-slider-group"],[3,"nzOnChange","nzOnChangeComplete","color","value","gradientColors","disabled"],["type","alpha",3,"color","value","gradientColors","disabled"],[3,"color"],["type","alpha",3,"nzOnChange","nzOnChangeComplete","color","value","gradientColors","disabled"]],template:function(o,n){if(o&1&&(s(0,"div",0),C(1,je,1,1,null,1),s(2,"color-picker",2),_("nzOnChange",function(c){return n.handleChange(c)})("nzOnChangeComplete",function(c){return n.nzOnChangeComplete.emit(c)}),l(),s(3,"div",3)(4,"div",4)(5,"color-slider",5),_("nzOnChange",function(c){return n.handleChange(c,"hue")})("nzOnChangeComplete",function(c){return n.nzOnChangeComplete.emit(c)}),l(),C(6,Ue,1,4,"color-slider",6),l(),h(7,"ng-antd-color-block",7),l(),C(8,$e,1,1,null,1),l()),o&2){let i;M("ant-color-picker-panel-disabled",n.disabled),a(),y(n.panelRenderHeader?1:-1),a(),m("color",n.colorValue)("disabled",n.disabled),a(2),M("ant-color-picker-slider-group-disabled-alpha",n.disabledAlpha),a(),m("color",n.colorValue)("value","hsl("+(n.colorValue==null||(i=n.colorValue.toHsb())==null?null:i.h)+",100%, 50%)")("gradientColors",n.hueColor)("disabled",n.disabled),a(),y(n.disabledAlpha?-1:6),a(),m("color",n.toRgbString),a(),y(n.panelRenderFooter?8:-1)}},dependencies:[st,mt,Ee,le],encapsulation:2})}return t})(),Be=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=te({type:t});static \u0275inj=ee({})}return t})(),ut=(()=>{class t{nzColor=X.toHexString();nzSize="default";nzOnClick=new f;static \u0275fac=function(o){return new(o||t)};static \u0275cmp=O({type:t,selectors:[["nz-color-block"]],hostAttrs:[1,"ant-color-picker-inline"],hostVars:4,hostBindings:function(o,n){o&2&&M("ant-color-picker-inline-sm",n.nzSize==="small")("ant-color-picker-inline-lg",n.nzSize==="large")},inputs:{nzColor:"nzColor",nzSize:"nzSize"},outputs:{nzOnClick:"nzOnClick"},exportAs:["NzColorBlock"],decls:1,vars:1,consts:[[3,"nzOnClick","color"]],template:function(o,n){o&1&&(s(0,"ng-antd-color-block",0),_("nzOnClick",function(c){return n.nzOnClick.emit(c)}),l()),o&2&&m("color",n.nzColor)},dependencies:[Be,Ee],encapsulation:2,changeDetection:0})}return t})(),Le=(()=>{class t{formBuilder;format=null;colorValue="";clearColor=!1;nzDisabledAlpha=!1;formatChange=new f;nzOnFormatChange=new f;destroy$=new Z;validatorFn(){return e=>{let o=/^[0-9a-fA-F]{6}$/;if(e.value){if(!o.test(e.value))return{error:!0}}else return{error:!0};return null}}validateForm;formatterPercent=e=>`${e} %`;parserPercent=e=>+e.replace(" %","");constructor(e){this.formBuilder=e,this.validateForm=this.formBuilder.nonNullable.group({isFormat:this.formBuilder.control("hex"),hex:this.formBuilder.control("1677FF",this.validatorFn()),hsbH:215,hsbS:91,hsbB:100,rgbR:22,rgbG:119,rgbB:255,roundA:100})}ngOnInit(){this.validateForm.valueChanges.pipe(se(()=>this.validateForm.valid),ce(200),de((e,o)=>Object.keys(e).every(n=>e[n]===o[n])),$(this.destroy$)).subscribe(e=>{let o="";switch(e.isFormat){case"hsb":o=d({h:Number(e.hsbH),s:Number(e.hsbS)/100,b:Number(e.hsbB)/100,a:Number(e.roundA)/100}).toHsbString();break;case"rgb":o=d({r:Number(e.rgbR),g:Number(e.rgbG),b:Number(e.rgbB),a:Number(e.roundA)/100}).toRgbString();break;default:{let n=d(e.hex),i=d({r:n.r,g:n.g,b:n.b,a:Number(e.roundA)/100});o=i.getAlpha()<1?i.toHex8String():i.toHexString();break}}this.formatChange.emit({color:o,format:e.isFormat||this.format||"hex"})}),this.validateForm.get("isFormat")?.valueChanges.pipe($(this.destroy$)).subscribe(e=>{this.nzOnFormatChange.emit(e)})}ngOnChanges(e){let{colorValue:o,format:n,clearColor:i}=e;if(o){let c={hex:d(this.colorValue).toHex(),hsbH:Math.round(d(this.colorValue).toHsb().h),hsbS:Math.round(d(this.colorValue).toHsb().s*100),hsbB:Math.round(d(this.colorValue).toHsb().b*100),rgbR:Math.round(d(this.colorValue).r),rgbG:Math.round(d(this.colorValue).g),rgbB:Math.round(d(this.colorValue).b),roundA:Math.round(d(this.colorValue).roundA*100)};this.validateForm.patchValue(c)}n&&this.format&&this.validateForm.get("isFormat")?.patchValue(this.format),i&&this.clearColor&&this.validateForm.get("roundA")?.patchValue(0)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(o){return new(o||t)(T(q))};static \u0275cmp=O({type:t,selectors:[["nz-color-format"]],inputs:{format:"format",colorValue:"colorValue",clearColor:[2,"clearColor","clearColor",b],nzDisabledAlpha:[2,"nzDisabledAlpha","nzDisabledAlpha",b]},outputs:{formatChange:"formatChange",nzOnFormatChange:"nzOnFormatChange"},exportAs:["NzColorFormat"],features:[E,F],decls:11,vars:3,consts:[[1,"ant-color-picker-input-container",3,"formGroup"],[1,"ant-color-picker-format-select"],["formControlName","isFormat","nzBorderless","","nzSize","small"],["nzValue","hex","nzLabel","HEX"],["nzValue","hsb","nzLabel","HSB"],["nzValue","rgb","nzLabel","RGB"],[1,"ant-color-picker-input"],[1,"ant-color-picker-hex-input"],[1,"ant-color-picker-hsb-input"],[1,"ant-color-picker-rgb-input"],[1,"ant-color-picker-steppers","ant-color-picker-alpha-input"],["nzPrefix","#","nzSize","small"],["nz-input","","nzSize","small","formControlName","hex"],[1,"ant-color-picker-steppers","ant-color-picker-hsb-input"],["formControlName","hsbH","nzSize","small",3,"nzMin","nzMax","nzStep","nzPrecision"],["formControlName","hsbS","nzSize","small",3,"nzMin","nzMax","nzStep","nzFormatter","nzParser"],["formControlName","hsbB","nzSize","small",3,"nzMin","nzMax","nzStep","nzFormatter","nzParser"],[1,"ant-color-picker-steppers","ant-color-picker-rgb-input"],["formControlName","rgbR","nzSize","small",3,"nzMin","nzMax","nzStep"],["formControlName","rgbG","nzSize","small",3,"nzMin","nzMax","nzStep"],["formControlName","rgbB","nzSize","small",3,"nzMin","nzMax","nzStep"],["formControlName","roundA","nzSize","small",3,"nzMin","nzMax","nzStep","nzFormatter","nzParser"]],template:function(o,n){if(o&1&&(s(0,"div",0)(1,"div",1)(2,"nz-select",2),h(3,"nz-option",3)(4,"nz-option",4)(5,"nz-option",5),l()(),s(6,"div",6),C(7,Ye,3,0,"div",7)(8,Ge,7,14,"div",8)(9,Qe,7,9,"div",9),l(),C(10,qe,2,5,"div",10),l()),o&2){let i;m("formGroup",n.validateForm),a(7),y((i=n.validateForm.controls.isFormat.value)==="hex"?7:i==="hsb"?8:9),a(3),y(n.nzDisabledAlpha?-1:10)}},dependencies:[Se,ve,_e,be,ke,Oe,Me,Fe,we,Re,Ve,xe],encapsulation:2,changeDetection:0})}return t})(),ht=(()=>{class t{cdr;nzFormat=null;nzValue="";nzSize="default";nzDefaultValue="";nzTrigger="click";nzTitle="";nzFlipFlop=null;nzShowText=!1;nzOpen=!1;nzAllowClear=!1;nzDisabled=!1;nzDisabledAlpha=!1;nzOnChange=new f;nzOnFormatChange=new f;nzOnClear=new f;nzOnOpenChange=new f;formBuilder=Y(q);destroy$=new Z;isNzDisableFirstChange=!0;blockColor="";clearColor=!1;showText=X.toHexString();constructor(e){this.cdr=e}formControl=this.formBuilder.control("");onChange=()=>{};writeValue(e){this.nzValue=e,this.getBlockColor(),this.formControl.patchValue(e)}registerOnChange(e){this.onChange=e}registerOnTouched(){}setDisabledState(e){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||e,this.isNzDisableFirstChange=!1,this.cdr.markForCheck()}ngOnInit(){this.getBlockColor(),this.formControl.valueChanges.pipe($(this.destroy$)).subscribe(e=>{if(e){let o=e;this.nzFormat==="hex"?o=d(e).getAlpha()<1?d(e).toHex8String():d(e).toHexString():this.nzFormat==="hsb"?o=d(e).toHsbString():this.nzFormat==="rgb"&&(o=d(e).toRgbString()),this.showText=o,this.onChange(o),this.cdr.markForCheck()}})}ngOnChanges(e){let{nzValue:o,nzDefaultValue:n}=e;(o||n)&&this.getBlockColor()}clearColorHandle(){this.clearColor=!0,this.nzOnClear.emit(!0),this.cdr.markForCheck()}getBlockColor(){this.nzValue?this.blockColor=d(this.nzValue).toRgbString():this.nzDefaultValue?this.blockColor=d(this.nzDefaultValue).toRgbString():this.blockColor=X.toHexString()}colorChange(e){this.blockColor=e.color.getAlpha()<1?e.color.toHex8String():e.color.toHexString(),this.clearColor=!1,this.cdr.markForCheck()}formatChange(e){this.nzValue=e.color,this.clearColor=!1,this.getBlockColor(),this.nzOnChange.emit({color:d(e.color),format:e.format}),this.formControl.patchValue(e.color),this.cdr.markForCheck()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(o){return new(o||t)(T(U))};static \u0275cmp=O({type:t,selectors:[["nz-color-picker"]],hostAttrs:[1,"ant-color-picker-inline"],hostVars:2,hostBindings:function(o,n){o&2&&M("ant-color-picker-disabled",n.nzDisabled)},inputs:{nzFormat:"nzFormat",nzValue:"nzValue",nzSize:"nzSize",nzDefaultValue:"nzDefaultValue",nzTrigger:"nzTrigger",nzTitle:"nzTitle",nzFlipFlop:"nzFlipFlop",nzShowText:[2,"nzShowText","nzShowText",b],nzOpen:[2,"nzOpen","nzOpen",b],nzAllowClear:[2,"nzAllowClear","nzAllowClear",b],nzDisabled:[2,"nzDisabled","nzDisabled",b],nzDisabledAlpha:[2,"nzDisabledAlpha","nzDisabledAlpha",b]},outputs:{nzOnChange:"nzOnChange",nzOnFormatChange:"nzOnFormatChange",nzOnClear:"nzOnClear",nzOnOpenChange:"nzOnOpenChange"},exportAs:["NzColorPicker"],features:[fe([{provide:ze,useExisting:me(()=>t),multi:!0}]),E,F],decls:10,vars:11,consts:[["colorPicker",""],["nzPanelRenderHeader",""],["nzPanelRenderFooter",""],["nz-popover","",3,"nzPopoverVisibleChange","nzPopoverContent","nzPopoverTrigger","nzPopoverVisible"],[3,"nzColor","nzSize"],[3,"ngTemplateOutlet"],[1,"ant-color-picker-trigger-text"],[3,"nzOnChange","value","defaultValue","disabled","panelRenderHeader","panelRenderFooter","disabledAlpha"],[1,"ant-color-picker-title"],[1,"ant-color-picker-title-content"],[3,"nzStringTemplateOutlet"],[1,"ant-color-picker-clear"],[1,"ant-color-picker-clear",3,"click"],[3,"formatChange","nzOnFormatChange","colorValue","clearColor","format","nzDisabledAlpha"]],template:function(o,n){if(o&1){let i=x();s(0,"div",3),_("nzPopoverVisibleChange",function(p){return z(i),v(n.nzOnOpenChange.emit(p))}),C(1,We,1,2,"nz-color-block",4)(2,Ke,1,1,null,5)(3,Ze,2,1,"div",6),l(),C(4,et,1,6,"ng-template",null,0,Q)(6,it,1,1,"ng-template",null,1,Q)(8,rt,1,4,"ng-template",null,2,Q)}if(o&2){let i=G(5);M("ant-color-picker-trigger",!n.nzFlipFlop)("ant-color-picker-sm",n.nzSize==="small")("ant-color-picker-lg",n.nzSize==="large"),m("nzPopoverContent",i)("nzPopoverTrigger",n.nzDisabled?null:n.nzTrigger)("nzPopoverVisible",n.nzOpen),a(),y(n.nzFlipFlop?2:1),a(2),y(n.nzShowText&&n.showText&&!n.nzFlipFlop?3:-1)}},dependencies:[Be,pt,ye,ut,Le,le,Ce],encapsulation:2,changeDetection:0})}return t})(),Tt=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=te({type:t});static \u0275inj=ee({imports:[ht,Le]})}return t})();export{ut as a,ht as b,Tt as c};