UNPKG

@vue-js-cron/prime

Version:
10 lines (9 loc) 34.4 kB
(function(m,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("@vue-js-cron/core"),require("primevue/button"),require("primevue/config"),require("primevue/listbox"),require("@primevue/core/utils"),require("primevue/focustrap"),require("primevue/overlayeventbus"),require("primevue/portal"),require("@primevue/core/basedirective"),require("primevue/ripple/style"),require("@primevue/core/basecomponent"),require("primevue/popover/style"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@vue-js-cron/core","primevue/button","primevue/config","primevue/listbox","@primevue/core/utils","primevue/focustrap","primevue/overlayeventbus","primevue/portal","@primevue/core/basedirective","primevue/ripple/style","@primevue/core/basecomponent","primevue/popover/style","vue"],O):(m=typeof globalThis<"u"?globalThis:m||self,O(m.CronPrime={},m.CronCore,m.PButton,m.config,m.Listbox,m.utils,m.FocusTrap,m.OverlayEventBus,m.Portal,m.BaseDirective,m.RippleStyle,m.BaseComponent,m.PopoverStyle,m.Vue))})(this,function(m,O,je,Be,Ie,Ke,ze,B,He,Fe,We,Ze,Me,s){"use strict";function ne(e){return e==null||e===""||Array.isArray(e)&&e.length===0||!(e instanceof Date)&&typeof e=="object"&&Object.keys(e).length===0}function Ue(e){return!!(e&&e.constructor&&e.call&&e.apply)}function g(e){return!ne(e)}function R(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||Object.keys(e).length!==0)}function I(e,...t){return Ue(e)?e(...t):e}function x(e,t=!0){return typeof e=="string"&&(t||e!=="")}function ue(e,t=!0){return Array.isArray(e)&&(t||e.length!==0)}function qe(e){return g(e)&&!isNaN(e)}function L(e,t){if(t){const n=t.test(e);return t.lastIndex=0,n}return!1}function pe(e){return e&&e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":")}function fe(e){return x(e)?e.replace(/(_)/g,"-").replace(/[A-Z]/g,(t,n)=>n===0?t:"-"+t.toLowerCase()).toLowerCase():e}function he(e){return x(e)?e.replace(/[A-Z]/g,(t,n)=>n===0?t:"."+t.toLowerCase()).toLowerCase():e}function Xe(){const e=new Map;return{on(t,n){let r=e.get(t);return r?r.push(n):r=[n],e.set(t,r),this},off(t,n){let r=e.get(t);return r&&r.splice(r.indexOf(n)>>>0,1),this},emit(t,n){let r=e.get(t);r&&r.slice().map(i=>{i(n)})},clear(){e.clear()}}}var Ye=Object.defineProperty,Ge=Object.defineProperties,Je=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,ge=(e,t,n)=>t in e?Ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t)=>{for(var n in t||(t={}))me.call(t,n)&&ge(e,n,t[n]);if(K)for(var n of K(t))ye.call(t,n)&&ge(e,n,t[n]);return e},re=(e,t)=>Ge(e,Je(t)),E=(e,t)=>{var n={};for(var r in e)me.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&K)for(var r of K(e))t.indexOf(r)<0&&ye.call(e,r)&&(n[r]=e[r]);return n},Qe=Xe(),$=Qe;function ve(e,t){ue(e)?e.push(...t||[]):R(e)&&Object.assign(e,t)}function et(e){return R(e)&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")?e.value:e}function tt(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function ie(e="",t=""){return tt(`${x(e,!1)&&x(t,!1)?`${e}-`:e}${t}`)}function be(e="",t=""){return`--${ie(e,t)}`}function ke(e,t="",n="",r=[],i){if(x(e)){const o=/{([^}]*)}/g,l=e.trim();if(L(l,o)){const a=l.replaceAll(o,u=>{const p=u.replace(/{|}/g,"").split(".").filter(h=>!r.some(y=>L(h,y)));return`var(${be(n,fe(p.join("-")))}${g(i)?`, ${i}`:""})`}),c=/(\d+\s+[\+\-\*\/]\s+\d+)/g,d=/var\([^)]+\)/g;return L(a.replace(d,"0"),c)?`calc(${a})`:a}return l}else if(qe(e))return e}function nt(e,t,n){x(t,!1)&&e.push(`${t}:${n};`)}function T(e,t){return e?`${e}{${t}}`:""}var rt=e=>{var t;const n=N.getTheme(),r=se(n,e,void 0,"variable"),i=(t=r==null?void 0:r.match(/--[\w-]+/g))==null?void 0:t[0],o=se(n,e,void 0,"value");return{name:i,variable:r,value:o}},Se=(...e)=>se(N.getTheme(),...e),se=(e={},t,n,r)=>{if(t){const{variable:i,options:o}=N.defaults||{},{prefix:l,transform:a}=(e==null?void 0:e.options)||o||{},d=L(t,/{([^}]*)}/g)?t:`{${t}}`;return r==="value"||ne(r)&&a==="strict"?N.getTokenValue(t):ke(d,void 0,l,[i.excludedKeyRegex],n)}return""};function it(e,t={}){const n=N.defaults.variable,{prefix:r=n.prefix,selector:i=n.selector,excludedKeyRegex:o=n.excludedKeyRegex}=t,l=(d,u="")=>Object.entries(d).reduce((f,[p,h])=>{const y=L(p,o)?ie(u):ie(u,fe(p)),b=et(h);if(R(b)){const{variables:v,tokens:k}=l(b,y);ve(f.tokens,k),ve(f.variables,v)}else f.tokens.push((r?y.replace(`${r}-`,""):y).replaceAll("-",".")),nt(f.variables,be(y),ke(b,y,r,[o]));return f},{variables:[],tokens:[]}),{variables:a,tokens:c}=l(e,r);return{value:a,tokens:c,declarations:a.join(""),css:T(i,a.join(""))}}var C={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:`${e}{:root{[CSS]}}`,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(e.trim())}}},custom:{resolve(e){return{type:"custom",selector:e,matched:!0}}}},resolve(e){const t=Object.keys(this.rules).filter(n=>n!=="custom").map(n=>this.rules[n]);return[e].flat().map(n=>{var r;return(r=t.map(i=>i.resolve(n)).find(i=>i.matched))!=null?r:this.rules.custom.resolve(n)})}},_toVariables(e,t){return it(e,{prefix:t==null?void 0:t.prefix})},getCommon({name:e="",theme:t={},params:n,set:r,defaults:i}){var o,l,a,c,d,u,f;const{preset:p,options:h}=t;let y,b,v,k,S,P,w;if(g(p)&&h.transform!=="strict"){const{primitive:z,semantic:H,extend:F}=p,D=H||{},{colorScheme:W}=D,Z=E(D,["colorScheme"]),M=F||{},{colorScheme:U}=M,V=E(M,["colorScheme"]),j=W||{},{dark:q}=j,X=E(j,["dark"]),Y=U||{},{dark:G}=Y,J=E(Y,["dark"]),Q=g(z)?this._toVariables({primitive:z},h):{},ee=g(Z)?this._toVariables({semantic:Z},h):{},te=g(X)?this._toVariables({light:X},h):{},Ne=g(q)?this._toVariables({dark:q},h):{},Ae=g(V)?this._toVariables({semantic:V},h):{},De=g(J)?this._toVariables({light:J},h):{},Ve=g(G)?this._toVariables({dark:G},h):{},[Kt,zt]=[(o=Q.declarations)!=null?o:"",Q.tokens],[Ht,Ft]=[(l=ee.declarations)!=null?l:"",ee.tokens||[]],[Wt,Zt]=[(a=te.declarations)!=null?a:"",te.tokens||[]],[Mt,Ut]=[(c=Ne.declarations)!=null?c:"",Ne.tokens||[]],[qt,Xt]=[(d=Ae.declarations)!=null?d:"",Ae.tokens||[]],[Yt,Gt]=[(u=De.declarations)!=null?u:"",De.tokens||[]],[Jt,Qt]=[(f=Ve.declarations)!=null?f:"",Ve.tokens||[]];y=this.transformCSS(e,Kt,"light","variable",h,r,i),b=zt;const en=this.transformCSS(e,`${Ht}${Wt}`,"light","variable",h,r,i),tn=this.transformCSS(e,`${Mt}`,"dark","variable",h,r,i);v=`${en}${tn}`,k=[...new Set([...Ft,...Zt,...Ut])];const nn=this.transformCSS(e,`${qt}${Yt}color-scheme:light`,"light","variable",h,r,i),rn=this.transformCSS(e,`${Jt}color-scheme:dark`,"dark","variable",h,r,i);S=`${nn}${rn}`,P=[...new Set([...Xt,...Gt,...Qt])],w=I(p.css,{dt:Se})}return{primitive:{css:y,tokens:b},semantic:{css:v,tokens:k},global:{css:S,tokens:P},style:w}},getPreset({name:e="",preset:t={},options:n,params:r,set:i,defaults:o,selector:l}){var a,c,d;let u,f,p;if(g(t)&&n.transform!=="strict"){const h=e.replace("-directive",""),y=t,{colorScheme:b,extend:v,css:k}=y,S=E(y,["colorScheme","extend","css"]),P=v||{},{colorScheme:w}=P,z=E(P,["colorScheme"]),H=b||{},{dark:F}=H,D=E(H,["dark"]),W=w||{},{dark:Z}=W,M=E(W,["dark"]),U=g(S)?this._toVariables({[h]:_(_({},S),z)},n):{},V=g(D)?this._toVariables({[h]:_(_({},D),M)},n):{},j=g(F)?this._toVariables({[h]:_(_({},F),Z)},n):{},[q,X]=[(a=U.declarations)!=null?a:"",U.tokens||[]],[Y,G]=[(c=V.declarations)!=null?c:"",V.tokens||[]],[J,Q]=[(d=j.declarations)!=null?d:"",j.tokens||[]],ee=this.transformCSS(h,`${q}${Y}`,"light","variable",n,i,o,l),te=this.transformCSS(h,J,"dark","variable",n,i,o,l);u=`${ee}${te}`,f=[...new Set([...X,...G,...Q])],p=I(k,{dt:Se})}return{css:u,tokens:f,style:p}},getPresetC({name:e="",theme:t={},params:n,set:r,defaults:i}){var o;const{preset:l,options:a}=t,c=(o=l==null?void 0:l.components)==null?void 0:o[e];return this.getPreset({name:e,preset:c,options:a,params:n,set:r,defaults:i})},getPresetD({name:e="",theme:t={},params:n,set:r,defaults:i}){var o;const l=e.replace("-directive",""),{preset:a,options:c}=t,d=(o=a==null?void 0:a.directives)==null?void 0:o[l];return this.getPreset({name:l,preset:d,options:c,params:n,set:r,defaults:i})},applyDarkColorScheme(e){return!(e.darkModeSelector==="none"||e.darkModeSelector===!1)},getColorSchemeOption(e,t){var n;return this.applyDarkColorScheme(e)?this.regex.resolve(e.darkModeSelector===!0?t.options.darkModeSelector:(n=e.darkModeSelector)!=null?n:t.options.darkModeSelector):[]},getLayerOrder(e,t={},n,r){const{cssLayer:i}=t;return i?`@layer ${I(i.order||"primeui",n)}`:""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:r={},set:i,defaults:o}){const l=this.getCommon({name:e,theme:t,params:n,set:i,defaults:o}),a=Object.entries(r).reduce((c,[d,u])=>c.push(`${d}="${u}"`)&&c,[]).join(" ");return Object.entries(l||{}).reduce((c,[d,u])=>{if(u!=null&&u.css){const f=pe(u==null?void 0:u.css),p=`${d}-variables`;c.push(`<style type="text/css" data-primevue-style-id="${p}" ${a}>${f}</style>`)}return c},[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:r={},set:i,defaults:o}){var l;const a={name:e,theme:t,params:n,set:i,defaults:o},c=(l=e.includes("-directive")?this.getPresetD(a):this.getPresetC(a))==null?void 0:l.css,d=Object.entries(r).reduce((u,[f,p])=>u.push(`${f}="${p}"`)&&u,[]).join(" ");return c?`<style type="text/css" data-primevue-style-id="${e}-variables" ${d}>${pe(c)}</style>`:""},createTokens(e={},t,n="",r="",i={}){return Object.entries(e).forEach(([o,l])=>{const a=L(o,t.variable.excludedKeyRegex)?n:n?`${n}.${he(o)}`:he(o),c=r?`${r}.${o}`:o;R(l)?this.createTokens(l,t,a,c,i):(i[a]||(i[a]={paths:[],computed(d,u={}){var f,p;return this.paths.length===1?(f=this.paths[0])==null?void 0:f.computed(this.paths[0].scheme,u.binding):d&&d!=="none"?(p=this.paths.find(h=>h.scheme===d))==null?void 0:p.computed(d,u.binding):this.paths.map(h=>h.computed(h.scheme,u[h.scheme]))}}),i[a].paths.push({path:c,value:l,scheme:c.includes("colorScheme.light")?"light":c.includes("colorScheme.dark")?"dark":"none",computed(d,u={}){const f=/{([^}]*)}/g;let p=l;if(u.name=this.path,u.binding||(u.binding={}),L(l,f)){const y=l.trim().replaceAll(f,k=>{var S;const P=k.replace(/{|}/g,""),w=(S=i[P])==null?void 0:S.computed(d,u);return ue(w)&&w.length===2?`light-dark(${w[0].value},${w[1].value})`:w==null?void 0:w.value}),b=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,v=/var\([^)]+\)/g;p=L(y.replace(v,"0"),b)?`calc(${y})`:y}return ne(u.binding)&&delete u.binding,{colorScheme:d,path:this.path,paths:u,value:p.includes("undefined")?void 0:p}}}))}),i},getTokenValue(e,t,n){var r;const o=(c=>c.split(".").filter(u=>!L(u.toLowerCase(),n.variable.excludedKeyRegex)).join("."))(t),l=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,a=[(r=e[o])==null?void 0:r.computed(l)].flat().filter(c=>c);return a.length===1?a[0].value:a.reduce((c={},d)=>{const u=d,{colorScheme:f}=u,p=E(u,["colorScheme"]);return c[f]=p,c},void 0)},getSelectorRule(e,t,n,r){return n==="class"||n==="attr"?T(g(t)?`${e}${t},${e} ${t}`:e,r):T(e,g(t)?T(t,r):r)},transformCSS(e,t,n,r,i={},o,l,a){if(g(t)){const{cssLayer:c}=i;if(r!=="style"){const d=this.getColorSchemeOption(i,l);t=n==="dark"?d.reduce((u,{type:f,selector:p})=>(g(p)&&(u+=p.includes("[CSS]")?p.replace("[CSS]",t):this.getSelectorRule(p,a,f,t)),u),""):T(a??":root",t)}if(c){const d={name:"primeui",order:"primeui"};R(c)&&(d.name=I(c.name,{name:e,type:r})),g(d.name)&&(t=T(`@layer ${d.name}`,t),o==null||o.layerNames(d.name))}return t}return""}},N={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){const{theme:t}=e;t&&(this._theme=re(_({},t),{options:_(_({},this.defaults.options),t.options)}),this._tokens=C.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return((e=this.theme)==null?void 0:e.preset)||{}},get options(){var e;return((e=this.theme)==null?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),$.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=re(_({},this.theme),{preset:e}),this._tokens=C.createTokens(e,this.defaults),this.clearLoadedStyleNames(),$.emit("preset:change",e),$.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=re(_({},this.theme),{options:e}),this.clearLoadedStyleNames(),$.emit("options:change",e),$.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return C.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return C.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return C.getPresetC(n)},getDirective(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return C.getPresetD(n)},getCustomPreset(e="",t,n,r){const i={name:e,preset:t,options:this.options,selector:n,params:r,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return C.getPreset(i)},getLayerOrderCSS(e=""){return C.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",r){return C.transformCSS(e,t,r,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return C.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return C.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),$.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&$.emit("theme:load"))}};function st(e,t){return e?e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className):!1}function _e(e,t){if(e&&t){const n=r=>{st(e,r)||(e.classList?e.classList.add(r):e.className+=" "+r)};[t].flat().filter(Boolean).forEach(r=>r.split(" ").forEach(n))}}function Ce(e){for(const t of document==null?void 0:document.styleSheets)try{for(const n of t==null?void 0:t.cssRules)for(const r of n==null?void 0:n.style)if(e.test(r))return{name:r,value:n.style.getPropertyValue(r).trim()}}catch{}return null}function oe(e,t){if(e&&t){const n=r=>{e.classList?e.classList.remove(r):e.className=e.className.replace(new RegExp("(^|\\b)"+r.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach(r=>r.split(" ").forEach(n))}}function ot(e){let t={width:0,height:0};return e&&(e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible"),t}function lt(){let e=window,t=document,n=t.documentElement,r=t.getElementsByTagName("body")[0],i=e.innerWidth||n.clientWidth||r.clientWidth,o=e.innerHeight||n.clientHeight||r.clientHeight;return{width:i,height:o}}function at(){let e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}function ct(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}function dt(e,t,n=!0){var r,i,o,l;if(e){const a=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:ot(e),c=a.height,d=a.width,u=t.offsetHeight,f=t.offsetWidth,p=t.getBoundingClientRect(),h=ct(),y=at(),b=lt();let v,k,S="top";p.top+u+c>b.height?(v=p.top+h-c,S="bottom",v<0&&(v=h)):v=u+p.top+h,p.left+d>b.width?k=Math.max(0,p.left+y+f-d):k=p.left+y,e.style.top=v+"px",e.style.left=k+"px",e.style.transformOrigin=S,n&&(e.style.marginTop=S==="bottom"?`calc(${(i=(r=Ce(/-anchor-gutter$/))==null?void 0:r.value)!=null?i:"2px"} * -1)`:(l=(o=Ce(/-anchor-gutter$/))==null?void 0:o.value)!=null?l:"")}}function ut(e,t){e&&(typeof t=="string"?e.style.cssText=t:Object.entries(t||{}).forEach(([n,r])=>e.style[n]=r))}function pt(e,t){if(e instanceof HTMLElement){let n=e.offsetWidth;if(t){let r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}function le(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"}function we(e,t={}){if(le(e)){const n=(r,i)=>{var o,l;const a=(o=e==null?void 0:e.$attrs)!=null&&o[r]?[(l=e==null?void 0:e.$attrs)==null?void 0:l[r]]:[];return[i].flat().reduce((c,d)=>{if(d!=null){const u=typeof d;if(u==="string"||u==="number")c.push(d);else if(u==="object"){const f=Array.isArray(d)?n(r,d):Object.entries(d).map(([p,h])=>r==="style"&&(h||h===0)?`${p.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${h}`:h?p:void 0);c=f.length?c.concat(f.filter(p=>!!p)):c}}return c},a)};Object.entries(t).forEach(([r,i])=>{if(i!=null){const o=r.match(/^on(.+)/);o?e.addEventListener(o[1].toLowerCase(),i):r==="p-bind"?we(e,i):(i=r==="class"?[...new Set(n("class",i))].join(" ").trim():r==="style"?n("style",i).join(";").trim():i,(e.$attrs=e.$attrs||{})&&(e.$attrs[r]=i),e.setAttribute(r,i))}})}}function ft(e,t={},...n){if(e){const r=document.createElement(e);return we(r,t),r.append(...n),r}}function ht(e,t){e&&document.activeElement!==e&&e.focus(t)}function mt(e,t){if(le(e)){const n=e.getAttribute(t);return isNaN(n)?n==="true"||n==="false"?n==="true":n:+n}}function Le(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function ae(e){if(e){let t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}function yt(e,t){if(e){let n=e.offsetHeight;if(t){let r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}function Ee(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}function gt(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function vt(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function bt(e,t="",n){le(e)&&n!==null&&n!==void 0&&e.setAttribute(t,n)}function kt(){let e=[];const t=(l,a,c=999)=>{const d=i(l,a,c),u=d.value+(d.key===l?0:c)+1;return e.push({key:l,value:u}),u},n=l=>{e=e.filter(a=>a.value!==l)},r=(l,a)=>i(l,a).value,i=(l,a,c=0)=>[...e].reverse().find(d=>a?!0:d.key===l)||{key:l,value:c},o=l=>l&&parseInt(l.style.zIndex,10)||0;return{get:o,set:(l,a,c)=>{a&&(a.style.zIndex=String(t(l,!0,c)))},clear:l=>{l&&(n(o(l)),l.style.zIndex="")},getCurrent:l=>r(l,!0)}}var ce=kt(),St=Fe.extend({style:We});function A(e){"@babel/helpers - typeof";return A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(e)}function _t(e){return Et(e)||Lt(e)||wt(e)||Ct()}function Ct(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wt(e,t){if(e){if(typeof e=="string")return de(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?de(e,t):void 0}}function Lt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Et(e){if(Array.isArray(e))return de(e)}function de(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oe(e,t,n){return(t=Ot(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ot(e){var t=$t(e,"string");return A(t)=="symbol"?t:t+""}function $t(e,t){if(A(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(A(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pt=St.extend("ripple",{watch:{"config.ripple":function(t){t?(this.createRipple(this.$host),this.bindEvents(this.$host),this.$host.setAttribute("data-pd-ripple",!0),this.$host.style.overflow="hidden",this.$host.style.position="relative"):(this.remove(this.$host),this.$host.removeAttribute("data-pd-ripple"))}},unmounted:function(t){this.remove(t)},timeout:void 0,methods:{bindEvents:function(t){t.addEventListener("mousedown",this.onMouseDown.bind(this))},unbindEvents:function(t){t.removeEventListener("mousedown",this.onMouseDown.bind(this))},createRipple:function(t){var n=ft("span",Oe(Oe({role:"presentation","aria-hidden":!0,"data-p-ink":!0,"data-p-ink-active":!1,class:!this.isUnstyled()&&this.cx("root"),onAnimationEnd:this.onAnimationEnd.bind(this)},this.$attrSelector,""),"p-bind",this.ptm("root")));t.appendChild(n),this.$el=n},remove:function(t){var n=this.getInk(t);n&&(this.$host.style.overflow="",this.$host.style.position="",this.unbindEvents(t),n.removeEventListener("animationend",this.onAnimationEnd),n.remove())},onMouseDown:function(t){var n=this,r=t.currentTarget,i=this.getInk(r);if(!(!i||getComputedStyle(i,null).display==="none")){if(!this.isUnstyled()&&oe(i,"p-ink-active"),i.setAttribute("data-p-ink-active","false"),!Le(i)&&!Ee(i)){var o=Math.max(pt(r),yt(r));i.style.height=o+"px",i.style.width=o+"px"}var l=ae(r),a=t.pageX-l.left+document.body.scrollTop-Ee(i)/2,c=t.pageY-l.top+document.body.scrollLeft-Le(i)/2;i.style.top=c+"px",i.style.left=a+"px",!this.isUnstyled()&&_e(i,"p-ink-active"),i.setAttribute("data-p-ink-active","true"),this.timeout=setTimeout(function(){i&&(!n.isUnstyled()&&oe(i,"p-ink-active"),i.setAttribute("data-p-ink-active","false"))},401)}},onAnimationEnd:function(t){this.timeout&&clearTimeout(this.timeout),!this.isUnstyled()&&oe(t.currentTarget,"p-ink-active"),t.currentTarget.setAttribute("data-p-ink-active","false")},getInk:function(t){return t&&t.children?_t(t.children).find(function(n){return mt(n,"data-pc-name")==="ripple"}):void 0}}}),xt={name:"BasePopover",extends:Ze,props:{dismissable:{type:Boolean,default:!0},appendTo:{type:[String,Object],default:"body"},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},breakpoints:{type:Object,default:null},closeOnEscape:{type:Boolean,default:!0}},style:Me,provide:function(){return{$pcPopover:this,$parentInstance:this}}},$e={name:"Popover",extends:xt,inheritAttrs:!1,emits:["show","hide"],data:function(){return{visible:!1}},watch:{dismissable:{immediate:!0,handler:function(t){t?this.bindOutsideClickListener():this.unbindOutsideClickListener()}}},selfClick:!1,target:null,eventTarget:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,styleElement:null,overlayEventListener:null,documentKeydownListener:null,beforeUnmount:function(){this.dismissable&&this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.destroyStyle(),this.unbindResizeListener(),this.target=null,this.container&&this.autoZIndex&&ce.clear(this.container),this.overlayEventListener&&(B.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),this.container=null},mounted:function(){this.breakpoints&&this.createStyle()},methods:{toggle:function(t,n){this.visible?this.hide():this.show(t,n)},show:function(t,n){this.visible=!0,this.eventTarget=t.currentTarget,this.target=n||t.currentTarget},hide:function(){this.visible=!1},onContentClick:function(){this.selfClick=!0},onEnter:function(t){var n=this;ut(t,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.dismissable&&this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&ce.set("overlay",t,this.baseZIndex+this.$primevue.config.zIndex.overlay),this.overlayEventListener=function(r){n.container.contains(r.target)&&(n.selfClick=!0)},this.focus(),B.on("overlay-click",this.overlayEventListener),this.$emit("show"),this.closeOnEscape&&this.bindDocumentKeyDownListener()},onLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.unbindDocumentKeyDownListener(),B.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null,this.$emit("hide")},onAfterLeave:function(t){this.autoZIndex&&ce.clear(t)},alignOverlay:function(){dt(this.container,this.target,!1);var t=ae(this.container),n=ae(this.target),r=0;t.left<n.left&&(r=n.left-t.left),this.container.style.setProperty(rt("popover.arrow.left").name,"".concat(r,"px")),t.top<n.top&&(this.container.setAttribute("data-p-popover-flipped","true"),!this.isUnstyled&&_e(this.container,"p-popover-flipped"))},onContentKeydown:function(t){t.code==="Escape"&&this.closeOnEscape&&(this.hide(),ht(this.target))},onButtonKeydown:function(t){switch(t.code){case"ArrowDown":case"ArrowUp":case"ArrowLeft":case"ArrowRight":t.preventDefault()}},focus:function(){var t=this.container.querySelector("[autofocus]");t&&t.focus()},onKeyDown:function(t){t.code==="Escape"&&this.closeOnEscape&&(this.visible=!1)},bindDocumentKeyDownListener:function(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener:function(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},bindOutsideClickListener:function(){var t=this;!this.outsideClickListener&&gt()&&(this.outsideClickListener=function(n){t.visible&&!t.selfClick&&!t.isTargetClicked(n)&&(t.visible=!1),t.selfClick=!1},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null,this.selfClick=!1)},bindScrollListener:function(){var t=this;this.scrollHandler||(this.scrollHandler=new Ke.ConnectedOverlayScrollHandler(this.target,function(){t.visible&&(t.visible=!1)})),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var t=this;this.resizeListener||(this.resizeListener=function(){t.visible&&!vt()&&(t.visible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isTargetClicked:function(t){return this.eventTarget&&(this.eventTarget===t.target||this.eventTarget.contains(t.target))},containerRef:function(t){this.container=t},createStyle:function(){if(!this.styleElement&&!this.isUnstyled){var t;this.styleElement=document.createElement("style"),this.styleElement.type="text/css",bt(this.styleElement,"nonce",(t=this.$primevue)===null||t===void 0||(t=t.config)===null||t===void 0||(t=t.csp)===null||t===void 0?void 0:t.nonce),document.head.appendChild(this.styleElement);var n="";for(var r in this.breakpoints)n+=` @media screen and (max-width: `.concat(r,`) { .p-popover[`).concat(this.$attrSelector,`] { width: `).concat(this.breakpoints[r],` !important; } } `);this.styleElement.innerHTML=n}},destroyStyle:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},onOverlayClick:function(t){B.emit("overlay-click",{originalEvent:t,target:this.target})}},directives:{focustrap:ze,ripple:Pt},components:{Portal:He}},Tt=["aria-modal"];function Rt(e,t,n,r,i,o){var l=s.resolveComponent("Portal"),a=s.resolveDirective("focustrap");return s.openBlock(),s.createBlock(l,{appendTo:e.appendTo},{default:s.withCtx(function(){return[s.createVNode(s.Transition,s.mergeProps({name:"p-popover",onEnter:o.onEnter,onLeave:o.onLeave,onAfterLeave:o.onAfterLeave},e.ptm("transition")),{default:s.withCtx(function(){return[i.visible?s.withDirectives((s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,ref:o.containerRef,role:"dialog","aria-modal":i.visible,onClick:t[3]||(t[3]=function(){return o.onOverlayClick&&o.onOverlayClick.apply(o,arguments)}),class:e.cx("root")},e.ptmi("root")),[e.$slots.container?s.renderSlot(e.$slots,"container",{key:0,closeCallback:o.hide,keydownCallback:function(d){return o.onButtonKeydown(d)}}):(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:1,class:e.cx("content"),onClick:t[0]||(t[0]=function(){return o.onContentClick&&o.onContentClick.apply(o,arguments)}),onMousedown:t[1]||(t[1]=function(){return o.onContentClick&&o.onContentClick.apply(o,arguments)}),onKeydown:t[2]||(t[2]=function(){return o.onContentKeydown&&o.onContentKeydown.apply(o,arguments)})},e.ptm("content")),[s.renderSlot(e.$slots,"default")],16))],16,Tt)),[[a]]):s.createCommentVNode("",!0)]}),_:3},16,["onEnter","onLeave","onAfterLeave"])]}),_:3},8,["appendTo"])}$e.render=Rt;const Nt=s.defineComponent({inheritAttrs:!1,name:"CustomSelect",components:{PButton:je,PPopover:$e,Listbox:Ie},props:{...O.selectProps(),buttonProps:{type:Object,default:()=>{}},popoverProps:{type:Object,default:()=>{}},hideOnClick:{type:Boolean,default:!0}},emits:["update:model-value"],setup(e,t){var d,u;const n=O.setupSelect(e,()=>e.modelValue,t),r=s.ref(),o=((u=(d=Be.usePrimeVue().config.theme)==null?void 0:d.options)==null?void 0:u.prefix)+"-",l=f=>o+f,a=f=>{r.value.toggle(f)};return{...n,popover:r,toggle:a,cx:l,select:(f,p)=>{p&&(n.select(p),e.hideOnClick&&a(f))}}}}),sn="",Pe=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},At={class:"vcron-p-select"},Dt=["onClick"];function Vt(e,t,n,r,i,o){const l=s.resolveComponent("Listbox"),a=s.resolveComponent("p-button"),c=s.resolveComponent("p-popover");return s.openBlock(),s.createElementBlock("span",At,[s.withDirectives(s.createVNode(l,null,null,512),[[s.vShow,!1]]),s.createVNode(a,s.mergeProps({disabled:e.disabled},e.buttonProps,{onClick:e.toggle}),{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.selection??e.selectedStr),1),e.clearable&&!e.isEmpty?(s.openBlock(),s.createElementBlock("i",{key:0,class:"pi pi-times",onClick:[t[0]||(t[0]=d=>e.clear()),t[1]||(t[1]=s.withModifiers(()=>{},["stop"]))]})):s.createCommentVNode("",!0)]),_:1},16,["disabled","onClick"]),s.createVNode(c,s.mergeProps(e.popoverProps,{ref:"popover"}),{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.itemRows,(d,u)=>(s.openBlock(),s.createElementBlock("div",{class:"vcron-p-row",key:u},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(d,(f,p)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([[e.has(f)?"vcron-p-col-selected":""],"vcron-p-col"]),flex:1,key:p,onClick:h=>{f&&e.select(h,f)}},[f?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createTextVNode(s.toDisplayString(f.text),1)],64)):s.createCommentVNode("",!0)],10,Dt))),128))]))),128))]),_:1},16)])}const jt=Pe(Nt,[["render",Vt]]),xe=()=>({buttonProps:{type:Object,default(){return{}}},popoverProps:{type:Object,default:()=>{}},...O.cronCoreProps()}),Bt=s.defineComponent({name:"CronPrime",components:{CustomSelect:jt},props:xe(),emits:["update:model-value","update:period","error"],setup(e,t){return O.setupCron(e,t)}});function It(e,t,n,r,i,o){const l=s.resolveComponent("custom-select");return s.openBlock(),s.createElementBlock("div",null,[s.createTextVNode(s.toDisplayString(e.period.prefix.value)+" ",1),s.createVNode(l,{"model-value":e.period.selected.value.id,"item-value":"id",items:e.period.items,"onUpdate:modelValue":t[0]||(t[0]=a=>e.period.select(a)),disabled:e.disabled,"button-props":e.buttonProps,"popover-props":e.popoverProps},null,8,["model-value","items","disabled","button-props","popover-props"]),s.createTextVNode(" "+s.toDisplayString(e.period.suffix.value)+" ",1),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.selected,a=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:a.id},[s.createTextVNode(s.toDisplayString(a.prefix.value)+" ",1),s.createVNode(l,{"model-value":a.selected.value,"onUpdate:modelValue":c=>a.select(c),items:a.items,cols:e.cols[a.id]||1,selection:a.text.value,multiple:"",clearable:"",disabled:e.disabled,"button-props":e.buttonProps,"popover-props":e.popoverProps,hideOnClick:!1},null,8,["model-value","onUpdate:modelValue","items","cols","selection","disabled","button-props","popover-props"]),s.createTextVNode(" "+s.toDisplayString(a.suffix.value),1)],64))),128))])}const Te=Pe(Bt,[["render",It]]),Re={install:e=>{e.component("CronPrime",Te)}};m.CronPrime=Te,m.CronPrimePlugin=Re,m.cronPrimeProps=xe,m.default=Re,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); //# sourceMappingURL=prime.umd.cjs.map