/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import{g}from"./chunk.J2M2MXP2.js";var b=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,A=/a-z/i,h=10;function T(t){if(t=t.replace(/_|\s/g,""),b.test(t)){let f=new Date(t);if(A.test(t)||f.setMinutes(f.getMinutes()+f.getTimezoneOffset()),g(f))return f}let e=[];t.indexOf("/")!==-1?e=t.split("/"):t.indexOf("-")!==-1?e=t.split("-"):(t.length===6||t.length===8)&&!isNaN(+t)&&(e=[t.substring(0,2),t.substring(2,4),t.substring(4)]);let o=e.length===3,[n,s,r]=e;if(n==="0"&&(n="1"),s==="0"&&(s="1"),typeof r=="string"&&r.length===3&&(r=r.padStart(4,"0")),o){let f=n.length===1||n.length===2,l=s.length===1||s.length===2,c=r.length===2||r.length===4;if(!f||!l||!c)return null}else return null;if(r.length===2){let f=new Date().getFullYear()-(100-h),l=new Date().getFullYear()+h,c=String(f).slice(0,2),M=String(l).slice(0,2),D=+String(l).slice(2);r=+r<=D?`${M}${r}`:`${c}${r}`}let a=+n,i=+s,u=+r;a>12&&(a=12);let m=new Date(u,a,0).getDate();i>m&&(i=m);let d=new Date(u,a-1,i,0,0,0,0);return g(d)?d:null}function y(t){let e=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),n=String(t.getFullYear()).padStart(4,"0");return[e,o,n].join("/")}function C(t,e){return!t&&!e?!0:!t||!e||!g(t)||!g(e)?!1:t.setHours(0,0,0,0)===e.setHours(0,0,0,0)}function _(t,e){return new Date(e!=null?e:1970,t+1,0)}function L(t,e){return _(t,e).getDate()}function O(t,e){let o=document.createElement("div");o.innerHTML=t;for(let s=o.childNodes.length-1;s>=0;s--)o.childNodes[s].nodeName.toLowerCase()!=="svg"&&o.removeChild(o.childNodes[s]);let n=o.firstElementChild;return n&&n.nodeName.toLowerCase()==="svg"&&p(n)?(e&&n.setAttribute("viewBox",e),!n.hasAttribute("viewBox")&&e&&n.setAttribute("viewBox",e),n.removeAttribute("height"),n.removeAttribute("width"),n):null}function p(t){if(t.nodeType!==1)return!0;if(t.nodeName.toLowerCase()==="script")return!1;let e=Array.from(t.attributes);for(let n of e)if(typeof n.name=="string"&&n.name.toLowerCase().startsWith("on"))return!1;let o=Array.from(t.childNodes);for(let n of o)if(!p(n))return!1;return!0}var E=/^(0?[0-9]|1\d|2[0-3]):([0-5]\d)(:([0-5]\d))?$/,x=/^(0?[1-9]|1[0-2]):([0-5]\d)(:([0-5]\d))?\s*([AaPp][Mm])?$/,N=/^(\d?\d?):?(\d?\d?)(:?(\d?\d?))?\s*([AaPp][Mm]?)?$/,S=/[AaPp][Mm]?/;function $(t){let e=t.match(E)||[null,0,0,null,0],o=e[1],n=e[2],s=e[4];return{hours:o,minutes:n,seconds:s}}function I(t){let e=t.match(x)||[null,0,0,null,0,"AM"],o=e[1],n=e[2],s=e[4],r=e[5];return{hours:o,minutes:n,seconds:s,meridiem:r}}function G(t){return E.test(t)||x.test(t)}function F(t,e,o){if(t=t&&typeof t=="string"?t.replace(/_|\s/g,""):"",/^\s*$/.test(t)||/^:+$/.test(t))return"";let n=t.match(N);if(!n)return"";let s=n[1],r=n[2],a=n[4],i=n[5],u=t.match(S);u&&(i=u[0],t=t.replace(i,""),i.length===1&&(i+="m")),t.length===3&&!t.includes(":")&&(s=t[0],r=t.substring(1)),e?i="":S.test(i)?i=i.toUpperCase():/^[AaPp]/.test(i)?i.toLowerCase().startsWith("a")?i="AM":i.toLowerCase().startsWith("p")&&(i="PM"):i="";let m=+s||0,d=+r||0,f=!i||e?23:12;if(m>=f?s=String(f):m<0&&(s="00"),s=s.padStart(2,"0"),r!==void 0&&(d>59?r="59":d<0?r="00":r=r.padStart(2,"0")),a!==void 0){let c=+a||0;c>59?a="59":c<0?a="00":a=a.padStart(2,"0")}let l=s;return r!==void 0&&(l+=`:${r}`,a===void 0&&o&&(a="00")),a!==void 0&&(l+=`:${a}`),i&&(l+=` ${i}`),l}export{b as a,A as b,T as c,y as d,C as e,_ as f,L as g,O as h,p as i,E as j,x as k,N as l,S as m,$ as n,I as o,G as p,F as q};
//# sourceMappingURL=chunk.U6WGJELL.js.map
