import{r as n,g as e,o as t,a as i,i as r,w as a,b as o,u as s,c as l,d as u,p as c,e as d,f as v,h as f,n as h,j as p}from"./@vue-15a5328c.js";var w="undefined"!=typeof window;function m(n){return w?requestAnimationFrame(n):-1}function g(n){m((()=>m(n)))}var y=(n,e)=>({top:0,left:0,right:n,bottom:e,width:n,height:e}),x=n=>{const e=s(n);if(e===window){const n=e.innerWidth,t=e.innerHeight;return y(n,t)}return(null==e?void 0:e.getBoundingClientRect)?e.getBoundingClientRect():y(0,0)};function b(n){const i=l(n,null);if(i){const n=e(),{link:r,unlink:a,internalChildren:o}=i;r(n),t((()=>a(n)));return{parent:i,index:u((()=>o.indexOf(n)))}}return{parent:null,index:o(-1)}}var k=(n,e)=>{const t=n.indexOf(e);return-1===t?n.findIndex((n=>void 0!==e.key&&null!==e.key&&n.type===e.type&&n.key===e.key)):t};function C(n,e,t){const i=function(n){const e=[],t=n=>{Array.isArray(n)&&n.forEach((n=>{var i;p(n)&&(e.push(n),(null==(i=n.component)?void 0:i.subTree)&&(e.push(n.component.subTree),t(n.component.subTree.children)),n.children&&t(n.children))}))};return t(n),e}(n.subTree.children);t.sort(((n,e)=>k(i,n.vnode)-k(i,e.vnode)));const r=t.map((n=>n.proxy));e.sort(((n,e)=>r.indexOf(n)-r.indexOf(e)))}function M(t){const i=n([]),r=n([]),a=e();return{children:i,linkChildren:n=>{c(t,Object.assign({link:n=>{n.proxy&&(r.push(n),i.push(n.proxy),C(a,i,r))},unlink:n=>{const e=r.indexOf(n);i.splice(e,1),r.splice(e,1)},children:i,internalChildren:r},n))}}}var O,T,E=1e3,L=60*E,j=60*L,A=24*j;function B(n){let e,t,r,a;const s=o(n.time),l=u((()=>{return{total:n=s.value,days:Math.floor(n/A),hours:Math.floor(n%A/j),minutes:Math.floor(n%j/L),seconds:Math.floor(n%L/E),milliseconds:Math.floor(n%E)};var n})),c=()=>{var n;r=!1,n=e,w&&cancelAnimationFrame(n)},f=()=>Math.max(t-Date.now(),0),h=e=>{var t,i;s.value=e,null==(t=n.onChange)||t.call(n,l.value),0===e&&(c(),null==(i=n.onFinish)||i.call(n))},p=()=>{e=m((()=>{r&&(h(f()),s.value>0&&p())}))},g=()=>{e=m((()=>{if(r){const t=f();n=t,e=s.value,(Math.floor(n/1e3)!==Math.floor(e/1e3)||0===t)&&h(t),s.value>0&&g()}var n,e}))},y=()=>{w&&(n.millisecond?p():g())};return d(c),v((()=>{a&&(r=!0,a=!1,y())})),i((()=>{r&&(c(),a=!0)})),{start:()=>{r||(t=Date.now()+s.value,r=!0,y())},pause:c,reset:(e=n.time)=>{c(),s.value=e},current:l}}function D(n){let e;f((()=>{n(),h((()=>{e=!0}))})),v((()=>{e&&n()}))}function F(n,e,o={}){if(!w)return;const{target:l=window,passive:u=!1,capture:c=!1}=o;let d,v=!1;const f=t=>{if(v)return;const i=s(t);i&&!d&&(i.addEventListener(n,e,{capture:c,passive:u}),d=!0)},h=t=>{if(v)return;const i=s(t);i&&d&&(i.removeEventListener(n,e,c),d=!1)};let p;return t((()=>h(l))),i((()=>h(l))),D((()=>f(l))),r(l)&&(p=a(l,((n,e)=>{h(e),f(n)}))),()=>{null==p||p(),h(l),v=!0}}function H(){if(!O&&(O=o(0),T=o(0),w)){const n=()=>{O.value=window.innerWidth,T.value=window.innerHeight};n(),window.addEventListener("resize",n,{passive:!0}),window.addEventListener("orientationchange",n,{passive:!0})}return{width:O,height:T}}var N,V=/scroll|auto|overlay/i,W=w?window:void 0;function R(n){return"HTML"!==n.tagName&&"BODY"!==n.tagName&&1===n.nodeType}function S(n,e=W){let t=n;for(;t&&t!==e&&R(t);){const{overflowY:n}=window.getComputedStyle(t);if(V.test(n))return t;t=t.parentNode}return e}function Y(n,e=W){const t=o();return f((()=>{n.value&&(t.value=S(n.value,e))})),t}function q(){if(!N&&(N=o("visible"),w)){const n=()=>{N.value=document.hidden?"hidden":"visible"};n(),window.addEventListener("visibilitychange",n)}return N}var z=Symbol("van-field");function I(n){const e=l(z,null);e&&!e.customValue.value&&(e.customValue.value=n,a(n,(()=>{e.resetValidation(),e.validateWithTrigger("onChange")})))}export{z as C,F as a,Y as b,x as c,M as d,q as e,g as f,S as g,b as h,I as i,B as j,D as o,H as u};