(function(p,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("@vue-js-cron/core"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@vue-js-cron/core","vue"],y):(p=typeof globalThis<"u"?globalThis:p||self,y(p.CronAnt={},p.CronCore,p.Vue))})(this,function(p,y,o){"use strict";function u(e,t){ge(e)&&(e="100%");var r=ye(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function ge(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function ye(e){return typeof e=="string"&&e.indexOf("%")!==-1}function he(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function x(e){return e<=1?"".concat(Number(e)*100,"%"):e}function E(e){return e.length===1?"0"+e:String(e)}function ve(e,t,r){return{r:u(e,255)*255,g:u(t,255)*255,b:u(r,255)*255}}function F(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Ce(e,t,r){var n,a,i;if(e=u(e,360),t=u(t,100),r=u(r,100),t===0)a=r,i=r,n=r;else{var c=r<.5?r*(1+t):r+t-r*t,l=2*r-c;n=F(l,c,e+1/3),a=F(l,c,e),i=F(l,c,e-1/3)}return{r:n*255,g:a*255,b:i*255}}function we(e,t,r){e=u(e,255),t=u(t,255),r=u(r,255);var n=Math.max(e,t,r),a=Math.min(e,t,r),i=0,c=n,l=n-a,f=n===0?0:l/n;if(n===a)i=0;else{switch(n){case e:i=(t-r)/l+(t=60&&Math.round(e.h)<=240?n=r?Math.round(e.h)-T*t:Math.round(e.h)+T*t:n=r?Math.round(e.h)+T*t:Math.round(e.h)-T*t,n<0?n+=360:n>=360&&(n-=360),n}function X(e,t,r){if(e.h===0&&e.s===0)return e.s;var n;return r?n=e.s-G*t:t===Z?n=e.s+G:n=e.s+xe*t,n>1&&(n=1),r&&t===Y&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function K(e,t,r){var n;return r?n=e.v+Te*t:n=e.v-Pe*t,n>1&&(n=1),Number(n.toFixed(2))}function B(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[],n=O(e),a=Y;a>0;a-=1){var i=J(n),c=P(O({h:Q(i,a,!0),s:X(i,a,!0),v:K(i,a,!0)}));r.push(c)}r.push(P(n));for(var l=1;l<=Z;l+=1){var f=J(n),s=P(O({h:Q(f,l),s:X(f,l),v:K(f,l)}));r.push(s)}return t.theme==="dark"?je.map(function(v){var b=v.index,S=v.opacity,C=P(Ee(O(t.backgroundColor||"#141414"),O(r[b]),S*100));return C}):r}var N={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},M={},V={};Object.keys(N).forEach(function(e){M[e]=B(N[e]),M[e].primary=M[e][5],V[e]=B(N[e],{theme:"dark",backgroundColor:"#141414"}),V[e].primary=V[e][5]});var ee=[],A=[],Fe="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function $e(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}function Ie(e,t){if(t=t||{},e===void 0)throw new Error(Fe);var r=t.prepend===!0?"prepend":"append",n=t.container!==void 0?t.container:document.querySelector("head"),a=ee.indexOf(n);a===-1&&(a=ee.push(n)-1,A[a]={});var i;return A[a]!==void 0&&A[a][r]!==void 0?i=A[a][r]:(i=A[a][r]=$e(),r==="prepend"?n.insertBefore(i,n.childNodes[0]):n.appendChild(i)),e.charCodeAt(0)===65279&&(e=e.substr(1,e.length)),i.styleSheet?i.styleSheet.cssText+=e:i.textContent+=e,i}function re(e){for(var t=1;t * { line-height: 1; } .anticon svg { display: inline-block; } .anticon::before { display: none; } .anticon .anticon-icon { display: block; } .anticon[tabindex] { cursor: pointer; } .anticon-spin::before, .anticon-spin { display: inline-block; -webkit-animation: loadingCircle 1s infinite linear; animation: loadingCircle 1s infinite linear; } @-webkit-keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } `,oe=!1,De=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ve;o.nextTick(function(){oe||(typeof window<"u"&&window.document&&window.document.documentElement&&Ie(t,{prepend:!0}),oe=!0)})},Re=["icon","primaryColor","secondaryColor"];function Le(e,t){if(e==null)return{};var r=Ue(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ue(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i=0)&&(r[a]=e[a]);return r}function j(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function or(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i=0)&&(r[a]=e[a]);return r}le("#1890ff");var k=function(t,r){var n,a=fe({},t,r.attrs),i=a.class,c=a.icon,l=a.spin,f=a.rotate,s=a.tabindex,v=a.twoToneColor,b=a.onClick,S=ar(a,Xe),C=(n={anticon:!0},L(n,"anticon-".concat(c.name),!!c.name),L(n,i,i),n),z=l===""||l||c.name==="loading"?"anticon-spin":"",H=s;H===void 0&&b&&(H=-1,S.tabindex=H);var vr=f?{msTransform:"rotate(".concat(f,"deg)"),transform:"rotate(".concat(f,"deg)")}:void 0,Cr=ae(v),be=Ke(Cr,2),wr=be[0],kr=be[1];return o.createVNode("span",fe({role:"img","aria-label":c.name},S,{onClick:b,class:C}),[o.createVNode(R,{class:z,icon:c,primaryColor:wr,secondaryColor:kr,style:vr},null)])};k.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:String},k.displayName="AntdIcon",k.inheritAttrs=!1,k.getTwoToneColor=Qe,k.setTwoToneColor=le;const ir=k;var lr={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"};const cr=lr;function se(e){for(var t=1;t{}},dropdownProps:{type:Object,default:()=>{}},hideOnClick:{type:Boolean,default:!0}},emits:["update:model-value"],setup(e,t){const r=y.setupSelect(e,()=>e.modelValue,t),n=o.ref(!1),a=()=>{e.hideOnClick&&n.value&&(n.value=!1)},i=o.computed(()=>{const c=e.modelValue;return c?Array.isArray(c)?c:[c]:[]});return{...r,visible:n,updateVisibility:a,selectedKeys:i}}}),Sr="",de=(e,t)=>{const r=e.__vccOpts||e;for(const[n,a]of t)r[n]=a;return r},ur={class:"custom-select"};function pr(e,t,r,n,a,i){const c=o.resolveComponent("CloseCircleFilled"),l=o.resolveComponent("a-button"),f=o.resolveComponent("a-menu-item"),s=o.resolveComponent("a-menu"),v=o.resolveComponent("a-dropdown");return o.openBlock(),o.createElementBlock("span",ur,[o.createVNode(v,o.mergeProps({trigger:["click"],visible:e.visible,"onUpdate:visible":t[2]||(t[2]=b=>e.visible=b)},e.dropdownProps,{disabled:e.disabled}),{overlay:o.withCtx(()=>[o.createVNode(s,{multiple:"",selectedKeys:e.selectedKeys},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.itemRows,(b,S)=>(o.openBlock(),o.createElementBlock("div",{class:"vcron-a-row",type:"flex",key:S},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(b,(C,z)=>(o.openBlock(),o.createElementBlock("div",{class:"vcron-a-col",flex:1,key:z},[C?(o.openBlock(),o.createBlock(f,{key:C.value,onClick:()=>{e.select(C),e.updateVisibility()}},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(C.text),1)]),_:2},1032,["onClick"])):(o.openBlock(),o.createBlock(f,{key:1}))]))),128))]))),128))]),_:1},8,["selectedKeys"])]),default:o.withCtx(()=>[o.createVNode(l,o.normalizeProps(o.guardReactiveProps(e.buttonProps)),{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.selection??e.selectedStr),1),e.clearable&&!e.isEmpty?(o.openBlock(),o.createBlock(c,{key:0,onClick:[t[0]||(t[0]=b=>e.clear()),t[1]||(t[1]=o.withModifiers(()=>{},["stop"]))]})):o.createCommentVNode("",!0)]),_:1},16)]),_:1},16,["visible","disabled"])])}const mr=de(dr,[["render",pr],["__scopeId","data-v-22e30b1e"]]),ue=()=>({buttonProps:{type:Object,default(){return{}}},dropdownProps:{type:Object,default:()=>{}},...y.cronCoreProps()}),br=o.defineComponent({name:"CronAnt",components:{CustomSelect:mr},props:ue(),emits:["update:model-value","update:period","error"],setup(e,t){return y.setupCron(e,t)}}),Or="",gr={class:"vcron-a-spacer"},yr={class:"vcron-a-spacer"};function hr(e,t,r,n,a,i){const c=o.resolveComponent("custom-select");return o.openBlock(),o.createElementBlock("div",null,[o.createTextVNode(o.toDisplayString(e.period.prefix.value)+" ",1),o.createElementVNode("div",gr,[o.createVNode(c,{"model-value":e.period.selected.value.id,"item-value":"id",items:e.period.items,"onUpdate:modelValue":t[0]||(t[0]=l=>e.period.select(l)),disabled:e.disabled,"button-props":e.buttonProps},null,8,["model-value","items","disabled","button-props"])]),o.createTextVNode(" "+o.toDisplayString(e.period.suffix.value)+" ",1),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.selected,l=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:l.id},[o.createTextVNode(o.toDisplayString(l.prefix.value)+" ",1),o.createElementVNode("div",yr,[o.createVNode(c,{"model-value":l.selected.value,"onUpdate:modelValue":f=>l.select(f),items:l.items,cols:e.cols[l.id]||1,selection:l.text.value,multiple:"",clearable:"",disabled:e.disabled,"button-props":e.buttonProps,"dropdown-props":e.dropdownProps,hideOnClick:!1},null,8,["model-value","onUpdate:modelValue","items","cols","selection","disabled","button-props","dropdown-props"])]),o.createTextVNode(" "+o.toDisplayString(l.suffix.value),1)],64))),128))])}const pe=de(br,[["render",hr]]),me={install:e=>{e.component("CronAnt",pe)}};p.CronAnt=pe,p.CronAntPlugin=me,p.cronAntProps=ue,p.default=me,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); //# sourceMappingURL=ant.umd.cjs.map