bootstrap-vue-next
Version:
Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development
3 lines (2 loc) • 19.4 kB
JavaScript
;const e=require("./index-CbGpN2AJ.js"),t=require("vue");function n(t){const n={};for(const o in t)n[e.camelize(o)]=t[o];return n}const o=e.isClient?window:void 0,l=e.isClient?window.document:void 0;function r(e){var n;const o=t.toValue(e);return null!=(n=null==o?void 0:o.$el)?n:o}function a(...n){const l=[],a=()=>{l.forEach(e=>e()),l.length=0},u=t.computed(()=>{const o=e.toArray(t.toValue(n[0])).filter(e=>null!=e);return o.every(e=>"string"!=typeof e)?o:void 0}),s=e.watchImmediate(()=>{var l,a;return[null!=(a=null==(l=u.value)?void 0:l.map(e=>r(e)))?a:[o].filter(e=>null!=e),e.toArray(t.toValue(u.value?n[1]:n[0])),e.toArray(t.unref(u.value?n[2]:n[1])),t.toValue(u.value?n[3]:n[2])]},([t,n,o,r])=>{if(a(),!(null==t?void 0:t.length)||!(null==n?void 0:n.length)||!(null==o?void 0:o.length))return;const u=e.isObject(r)?{...r}:r;l.push(...t.flatMap(e=>n.flatMap(t=>o.map(n=>((e,t,n,o)=>(e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)))(e,t,n,u)))))},{flush:"post"});return e.tryOnScopeDispose(a),()=>{s(),a()}}let u=!1;function s(){const e=t.shallowRef(!1),n=t.getCurrentInstance();return n&&t.onMounted(()=>{e.value=!0},n),e}function i(e){const n=s();return t.computed(()=>(n.value,Boolean(e())))}function c(n,l,a={}){const{window:u=o,...s}=a;let c;const d=i(()=>u&&"MutationObserver"in u),f=()=>{c&&(c.disconnect(),c=void 0)},v=t.computed(()=>{const o=t.toValue(n),l=e.toArray(o).map(r).filter(e.notNullish);return new Set(l)}),p=t.watch(()=>v.value,e=>{f(),d.value&&e.size&&(c=new MutationObserver(l),e.forEach(e=>c.observe(e,s)))},{immediate:!0,flush:"post"}),m=()=>{p(),f()};return e.tryOnScopeDispose(m),{isSupported:d,stop:m,takeRecords:()=>null==c?void 0:c.takeRecords()}}const d=Symbol("vueuse-ssr-width");function f(){const n=t.hasInjectionContext()?e.injectLocal(d,null):null;return"number"==typeof n?n:void 0}function v(n,l={}){const{window:r=o,ssrWidth:u=f()}=l,s=i(()=>r&&"matchMedia"in r&&"function"==typeof r.matchMedia),c=t.shallowRef("number"==typeof u),d=t.shallowRef(),v=t.shallowRef(!1);return t.watchEffect(()=>{if(c.value){c.value=!s.value;const o=t.toValue(n).split(",");return void(v.value=o.some(t=>{const n=t.includes("not all"),o=t.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),l=t.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let r=Boolean(o||l);return o&&r&&(r=u>=e.pxValue(o[1])),l&&r&&(r=u<=e.pxValue(l[1])),n?!r:r}))}s.value&&(d.value=r.matchMedia(t.toValue(n)),v.value=d.value.matches)}),a(d,"change",e=>{v.value=e.matches},{passive:!0}),t.computed(()=>v.value)}const p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},m="__vueuse_ssr_handlers__",h=w();function w(){return m in p||(p[m]=p[m]||{}),p[m]}function g(e,t){return h[e]||t}function y(e){return v("(prefers-color-scheme: dark)",e)}const b={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},S="vueuse-storage";function x(n,l,r,u={}){var s;const{flush:i="pre",deep:c=!0,listenToStorageChanges:d=!0,writeDefaults:f=!0,mergeDefaults:v=!1,shallow:p,window:m=o,eventFilter:h,onError:w=e=>{console.error(e)},initOnMounted:y}=u,x=(p?t.shallowRef:t.ref)("function"==typeof l?l():l),E=t.computed(()=>t.toValue(n));if(!r)try{r=g("getDefaultStorage",()=>{var e;return null==(e=o)?void 0:e.localStorage})()}catch(N){w(N)}if(!r)return x;const O=t.toValue(l),V=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e?"object":Number.isNaN(e)?"any":"number"}(O),k=null!=(s=u.serializer)?s:b[V],{pause:A,resume:M}=e.watchPausable(x,()=>function(e){try{const t=r.getItem(E.value);if(null==e)T(t,null),r.removeItem(E.value);else{const n=k.write(e);t!==n&&(r.setItem(E.value,n),T(t,n))}}catch(N){w(N)}}(x.value),{flush:i,deep:c,eventFilter:h});t.watch(E,()=>C(),{flush:i});let D=!1;const R=e=>{y&&!D||C(e.detail)};function T(e,t){if(m){const n={key:E.value,oldValue:e,newValue:t,storageArea:r};m.dispatchEvent(r instanceof Storage?new StorageEvent("storage",n):new CustomEvent(S,{detail:n}))}}function C(e){if(!e||e.storageArea===r)if(e&&null==e.key)x.value=O;else if(!e||e.key===E.value){A();try{(null==e?void 0:e.newValue)!==k.write(x.value)&&(x.value=function(e){const t=e?e.newValue:r.getItem(E.value);if(null==t)return f&&null!=O&&r.setItem(E.value,k.write(O)),O;if(!e&&v){const e=k.read(t);return"function"==typeof v?v(e,O):"object"!==V||Array.isArray(e)?e:{...O,...e}}return"string"!=typeof t?t:k.read(t)}(e))}catch(N){w(N)}finally{e?t.nextTick(M):M()}}}return m&&d&&(r instanceof Storage?a(m,"storage",e=>{y&&!D||C(e)},{passive:!0}):a(m,S,R)),y?e.tryOnMounted(()=>{D=!0,C()}):C(),x}const E={multiple:!0,accept:"*",reset:!1,directory:!1};function O(e){return"undefined"!=typeof Window&&e instanceof Window?e.document.documentElement:"undefined"!=typeof Document&&e instanceof Document?e.documentElement:e}const V={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof MouseEvent?[e.movementX,e.movementY]:null};function k(e){const t=window.getComputedStyle(e);if("scroll"===t.overflowX||"scroll"===t.overflowY||"auto"===t.overflowX&&e.clientWidth<e.scrollWidth||"auto"===t.overflowY&&e.clientHeight<e.scrollHeight)return!0;{const t=e.parentNode;return!(!t||"BODY"===t.tagName)&&k(t)}}function A(e){const t=e||window.event;return!k(t.target)&&(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))}const M=new WeakMap;exports.breakpointsBootstrapV5={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},exports.createReusableTemplate=function(o={}){const{inheritAttrs:l=!0}=o,r=t.shallowRef(),a=t.defineComponent({setup:(e,{slots:t})=>()=>{r.value=t.default}}),u=t.defineComponent({inheritAttrs:l,props:o.props,setup:(e,{attrs:t,slots:a})=>()=>{var u;if(!r.value&&"production"!==process.env.NODE_ENV)throw new Error("[VueUse] Failed to find the definition of reusable template");const s=null==(u=r.value)?void 0:u.call(r,{...null==o.props?n(t):e,$slots:a});return l&&1===(null==s?void 0:s.length)?s[0]:s}});return e.makeDestructurable({define:a,reuse:u},[a,u])},exports.getSSRHandler=g,exports.onClickOutside=function(n,l,s={}){const{window:i=o,ignore:c=[],capture:d=!0,detectIframe:f=!1,controls:v=!1}=s;if(!i)return v?{stop:e.noop,cancel:e.noop,trigger:e.noop}:e.noop;if(e.isIOS&&!u){u=!0;const t={passive:!0};Array.from(i.document.body.children).forEach(n=>n.addEventListener("click",e.noop,t)),i.document.documentElement.addEventListener("click",e.noop,t)}let p=!0;const m=e=>t.toValue(c).some(t=>{if("string"==typeof t)return Array.from(i.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{const n=r(t);return n&&(e.target===n||e.composedPath().includes(n))}}),h=e=>{const o=r(n);null!=e.target&&(o instanceof Element||!function(e){const n=t.toValue(e);return n&&16===n.$.subTree.shapeFlag}(n)||!function(e,n){const o=t.toValue(e),l=o.$.subTree&&o.$.subTree.children;return!(null==l||!Array.isArray(l))&&l.some(e=>e.el===n.target||n.composedPath().includes(e.el))}(n,e))&&o&&o!==e.target&&!e.composedPath().includes(o)&&("detail"in e&&0===e.detail&&(p=!m(e)),p?l(e):p=!0)};let w=!1;const g=[a(i,"click",e=>{w||(w=!0,setTimeout(()=>{w=!1},0),h(e))},{passive:!0,capture:d}),a(i,"pointerdown",e=>{const t=r(n);p=!m(e)&&!(!t||e.composedPath().includes(t))},{passive:!0}),f&&a(i,"blur",e=>{setTimeout(()=>{var t;const o=r(n);"IFRAME"!==(null==(t=i.document.activeElement)?void 0:t.tagName)||(null==o?void 0:o.contains(i.document.activeElement))||l(e)},0)},{passive:!0})].filter(Boolean),y=()=>g.forEach(e=>e());return v?{stop:y,cancel:()=>{p=!1},trigger:e=>{p=!0,h(e),p=!1}}:y},exports.onKeyStroke=function(...e){let n,l,r={};3===e.length?(n=e[0],l=e[1],r=e[2]):2===e.length?"object"==typeof e[1]?(n=!0,l=e[0],r=e[1]):(n=e[0],l=e[1]):(n=!0,l=e[0]);const{target:u=o,eventName:s="keydown",passive:i=!1,dedupe:c=!1}=r,d="function"==typeof(f=n)?f:"string"==typeof f?e=>e.key===f:Array.isArray(f)?e=>f.includes(e.key):()=>!0;var f;return a(u,s,e=>{e.repeat&&t.toValue(c)||d(e)&&l(e)},i)},exports.unrefElement=r,exports.useBreakpoints=function(n,l={}){function r(o,l){let r=t.toValue(n[t.toValue(o)]);return null!=l&&(r=e.increaseWithUnit(r,l)),"number"==typeof r&&(r=`${r}px`),r}const{window:a=o,strategy:u="min-width",ssrWidth:s=f()}=l,i="number"==typeof s,c=i?t.shallowRef(!1):{value:!0};function d(t,n){return!c.value&&i?"min"===t?s>=e.pxValue(n):s<=e.pxValue(n):!!a&&a.matchMedia(`(${t}-width: ${n})`).matches}i&&e.tryOnMounted(()=>c.value=!!a);const p=e=>v(()=>`(min-width: ${r(e)})`,l),m=e=>v(()=>`(max-width: ${r(e)})`,l),h=Object.keys(n).reduce((e,t)=>(Object.defineProperty(e,t,{get:()=>"min-width"===u?p(t):m(t),enumerable:!0,configurable:!0}),e),{});function w(){const o=Object.keys(n).map(t=>[t,h[t],e.pxValue(r(t))]).sort((e,t)=>e[2]-t[2]);return t.computed(()=>o.filter(([,e])=>e.value).map(([e])=>e))}return Object.assign(h,{greaterOrEqual:p,smallerOrEqual:m,greater:e=>v(()=>`(min-width: ${r(e,.1)})`,l),smaller:e=>v(()=>`(max-width: ${r(e,-.1)})`,l),between:(e,t)=>v(()=>`(min-width: ${r(e)}) and (max-width: ${r(t,-.1)})`,l),isGreater:e=>d("min",r(e,.1)),isGreaterOrEqual:e=>d("min",r(e)),isSmaller:e=>d("max",r(e,-.1)),isSmallerOrEqual:e=>d("max",r(e)),isInBetween:(e,t)=>d("min",r(e))&&d("max",r(t,-.1)),current:w,active(){const e=w();return t.computed(()=>0===e.value.length?"":e.value.at("min-width"===u?-1:0))}})},exports.useColorMode=function(n={}){const{selector:l="html",attribute:a="class",initialValue:u="auto",window:s=o,storage:i,storageKey:c="vueuse-color-scheme",listenToStorageChanges:d=!0,storageRef:f,emitAuto:v,disableTransition:p=!0}=n,m={auto:"",light:"light",dark:"dark",...n.modes||{}},h=y({window:s}),w=t.computed(()=>h.value?"dark":"light"),b=f||(null==c?e.toRef(u):x(c,u,i,{window:s,listenToStorageChanges:d})),S=t.computed(()=>"auto"===b.value?w.value:b.value),E=g("updateHTMLAttrs",(e,t,n)=>{const o="string"==typeof e?null==s?void 0:s.document.querySelector(e):r(e);if(!o)return;const l=new Set,a=new Set;let u,i=null;if("class"===t){const e=n.split(/\s/g);Object.values(m).flatMap(e=>(e||"").split(/\s/g)).filter(Boolean).forEach(t=>{e.includes(t)?l.add(t):a.add(t)})}else i={key:t,value:n};if(0!==l.size||0!==a.size||null!==i){p&&(u=s.document.createElement("style"),u.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),s.document.head.appendChild(u));for(const e of l)o.classList.add(e);for(const e of a)o.classList.remove(e);i&&o.setAttribute(i.key,i.value),p&&(s.getComputedStyle(u).opacity,document.head.removeChild(u))}});function O(e){var t;E(l,a,null!=(t=m[e])?t:e)}function V(e){n.onChanged?n.onChanged(e,O):O(e)}t.watch(S,V,{flush:"post",immediate:!0}),e.tryOnMounted(()=>V(S.value));const k=t.computed({get:()=>v?b.value:S.value,set(e){b.value=e}});return Object.assign(k,{store:b,system:w,state:S})},exports.useDropZone=function(n,o={}){var l,r;const u=t.shallowRef(!1),s=t.shallowRef(null);let i=0,c=!0;if(e.isClient){const e="function"==typeof o?{onDrop:o}:o,d=null==(l=e.multiple)||l,f=null!=(r=e.preventDefaultForUnhandled)&&r,v=e=>{var t,n;const o=Array.from(null!=(n=null==(t=e.dataTransfer)?void 0:t.files)?n:[]);return 0===o.length?null:d?o:[o[0]]},p=n=>{const o=t.unref(e.dataTypes);return"function"==typeof o?o(n):!(null==o?void 0:o.length)||0!==n.length&&n.every(e=>o.some(t=>e.includes(t)))},m=e=>{const t=Array.from(null!=e?e:[]).map(e=>e.type),n=p(t),o=d||e.length<=1;return n&&o},h=()=>/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent)&&!("chrome"in window),w=(t,n)=>{var o,l,r,a,d,p;const w=null==(o=t.dataTransfer)?void 0:o.items;if(c=null!=(l=w&&m(w))&&l,f&&t.preventDefault(),!h()&&!c)return void(t.dataTransfer&&(t.dataTransfer.dropEffect="none"));t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy");const g=v(t);switch(n){case"enter":i+=1,u.value=!0,null==(r=e.onEnter)||r.call(e,null,t);break;case"over":null==(a=e.onOver)||a.call(e,null,t);break;case"leave":i-=1,0===i&&(u.value=!1),null==(d=e.onLeave)||d.call(e,null,t);break;case"drop":i=0,u.value=!1,c&&(s.value=g,null==(p=e.onDrop)||p.call(e,g,t))}};a(n,"dragenter",e=>w(e,"enter")),a(n,"dragover",e=>w(e,"over")),a(n,"dragleave",e=>w(e,"leave")),a(n,"drop",e=>w(e,"drop"))}return{files:s,isOverDropZone:u}},exports.useElementHover=function(n,l={}){const{delayEnter:u=0,delayLeave:s=0,triggerOnRemoval:i=!1,window:d=o}=l,f=t.shallowRef(!1);let v;const p=e=>{const t=e?u:s;v&&(clearTimeout(v),v=void 0),t?v=setTimeout(()=>f.value=e,t):f.value=e};return d?(a(n,"mouseenter",()=>p(!0),{passive:!0}),a(n,"mouseleave",()=>p(!1),{passive:!0}),i&&function(n,l,a={}){const{window:u=o,document:s=(null==u?void 0:u.document),flush:i="sync"}=a;if(!u||!s)return e.noop;let d;const f=e=>{null==d||d(),d=e},v=t.watchEffect(()=>{const e=r(n);if(e){const{stop:t}=c(s,t=>{t.map(e=>[...e.removedNodes]).flat().some(t=>t===e||t.contains(e))&&l(t)},{window:u,childList:!0,subtree:!0});f(t)}},{flush:i}),p=()=>{v(),f()};e.tryOnScopeDispose(p)}(t.computed(()=>r(n)),()=>p(!1)),f):f},exports.useEventListener=a,exports.useFileDialog=function(n={}){const{document:o=l}=n,a=t.ref(function(e){if(!e)return null;if(e instanceof FileList)return e;const t=new DataTransfer;for(const n of e)t.items.add(n);return t.files}(n.initialFiles)),{on:u,trigger:s}=e.createEventHook(),{on:i,trigger:c}=e.createEventHook(),d=t.computed(()=>{var e;const t=null!=(e=r(n.input))?e:o?o.createElement("input"):void 0;return t&&(t.type="file",t.onchange=e=>{const t=e.target;a.value=t.files,s(a.value)},t.oncancel=()=>{c()}),t}),f=()=>{a.value=null,d.value&&d.value.value&&(d.value.value="",s(null))},v=n=>{const o=d.value;o&&(o.multiple=t.toValue(n.multiple),o.accept=t.toValue(n.accept),o.webkitdirectory=t.toValue(n.directory),e.hasOwn(n,"capture")&&(o.capture=t.toValue(n.capture)))};return t.watchEffect(()=>{v(n)}),{files:t.readonly(a),open:e=>{const o=d.value;if(!o)return;const l={...E,...n,...e};v(l),t.toValue(l.reset)&&f(),o.click()},reset:f,onCancel:i,onChange:u}},exports.useFocus=function(e,n={}){const{initialValue:o=!1,focusVisible:l=!1,preventScroll:u=!1}=n,s=t.shallowRef(!1),i=t.computed(()=>r(e)),c={passive:!0};a(i,"focus",e=>{var t,n;l&&!(null==(n=(t=e.target).matches)?void 0:n.call(t,":focus-visible"))||(s.value=!0)},c),a(i,"blur",()=>s.value=!1,c);const d=t.computed({get:()=>s.value,set(e){var t,n;!e&&s.value?null==(t=i.value)||t.blur():e&&!s.value&&(null==(n=i.value)||n.focus({preventScroll:u}))}});return t.watch(i,()=>{d.value=o},{immediate:!0,flush:"post"}),{focused:d}},exports.useIntersectionObserver=function(n,l,a={}){const{root:u,rootMargin:s="0px",threshold:c=0,window:d=o,immediate:f=!0}=a,v=i(()=>d&&"IntersectionObserver"in d),p=t.computed(()=>{const o=t.toValue(n);return e.toArray(o).map(r).filter(e.notNullish)});let m=e.noop;const h=t.shallowRef(f),w=v.value?t.watch(()=>[p.value,r(u),h.value],([t,n])=>{if(m(),!h.value)return;if(!t.length)return;const o=new IntersectionObserver(l,{root:r(n),rootMargin:s,threshold:c});t.forEach(e=>e&&o.observe(e)),m=()=>{o.disconnect(),m=e.noop}},{immediate:f,flush:"post"}):e.noop,g=()=>{m(),w(),h.value=!1};return e.tryOnScopeDispose(g),{isSupported:v,isActive:h,pause(){m(),h.value=!1},resume(){h.value=!0},stop:g}},exports.useMouse=function(e={}){const{type:n="page",touch:l=!0,resetOnTouchEnds:r=!1,initialValue:u={x:0,y:0},window:s=o,target:i=s,scroll:c=!0,eventFilter:d}=e;let f=null,v=0,p=0;const m=t.shallowRef(u.x),h=t.shallowRef(u.y),w=t.shallowRef(null),g="function"==typeof n?n:V[n],y=e=>{const t=g(e);f=e,t&&([m.value,h.value]=t,w.value="mouse"),s&&(v=s.scrollX,p=s.scrollY)},b=e=>{if(e.touches.length>0){const t=g(e.touches[0]);t&&([m.value,h.value]=t,w.value="touch")}},S=()=>{if(!f||!s)return;const e=g(f);f instanceof MouseEvent&&e&&(m.value=e[0]+s.scrollX-v,h.value=e[1]+s.scrollY-p)},x=()=>{m.value=u.x,h.value=u.y},E=d?e=>d(()=>y(e),{}):e=>y(e),O=d?e=>d(()=>b(e),{}):e=>b(e),k=d?()=>d(()=>S(),{}):()=>S();if(i){const e={passive:!0};a(i,["mousemove","dragover"],E,e),l&&"movement"!==n&&(a(i,["touchstart","touchmove"],O,e),r&&a(i,"touchend",x,e)),c&&"page"===n&&a(s,"scroll",k,e)}return{x:m,y:h,sourceType:w}},exports.useMutationObserver=c,exports.useScrollLock=function(n,o=!1){const l=t.shallowRef(o);let r=null,u="";t.watch(e.toRef(n),e=>{const n=O(t.toValue(e));if(n){const e=n;if(M.get(e)||M.set(e,e.style.overflow),"hidden"!==e.style.overflow&&(u=e.style.overflow),"hidden"===e.style.overflow)return l.value=!0;if(l.value)return e.style.overflow="hidden"}},{immediate:!0});const s=()=>{const o=O(t.toValue(n));o&&l.value&&(e.isIOS&&(null==r||r()),o.style.overflow=u,M.delete(o),l.value=!1)};return e.tryOnScopeDispose(s),t.computed({get:()=>l.value,set(o){o?(()=>{const o=O(t.toValue(n));o&&!l.value&&(e.isIOS&&(r=a(o,"touchmove",e=>{A(e)},{passive:!1})),o.style.overflow="hidden",l.value=!0)})():s()}})},exports.useSwipe=function(e,n={}){const{threshold:o=50,onSwipe:l,onSwipeEnd:r,onSwipeStart:u,passive:s=!0}=n,i=t.reactive({x:0,y:0}),c=t.reactive({x:0,y:0}),d=t.computed(()=>i.x-c.x),f=t.computed(()=>i.y-c.y),{max:v,abs:p}=Math,m=t.computed(()=>v(p(d.value),p(f.value))>=o),h=t.shallowRef(!1),w=t.computed(()=>m.value?p(d.value)>p(f.value)?d.value>0?"left":"right":f.value>0?"up":"down":"none"),g=e=>[e.touches[0].clientX,e.touches[0].clientY],y=(e,t)=>{c.x=e,c.y=t},b={passive:s,capture:!s},S=[a(e,"touchstart",e=>{if(1!==e.touches.length)return;const[t,n]=g(e);((e,t)=>{i.x=e,i.y=t})(t,n),y(t,n),null==u||u(e)},b),a(e,"touchmove",e=>{if(1!==e.touches.length)return;const[t,n]=g(e);y(t,n),b.capture&&!b.passive&&Math.abs(d.value)>Math.abs(f.value)&&e.preventDefault(),!h.value&&m.value&&(h.value=!0),h.value&&(null==l||l(e))},b),a(e,["touchend","touchcancel"],e=>{h.value&&(null==r||r(e,w.value)),h.value=!1},b)];return{isSwiping:h,direction:w,coordsStart:i,coordsEnd:c,lengthX:d,lengthY:f,stop:()=>S.forEach(e=>e()),isPassiveEventSupported:!0}},exports.useTimestamp=function(n={}){const{controls:l=!1,offset:r=0,immediate:a=!0,interval:u="requestAnimationFrame",callback:s}=n,i=t.shallowRef(e.timestamp()+r),c=()=>i.value=e.timestamp()+r,d=s?()=>{c(),s(i.value)}:c,f="requestAnimationFrame"===u?function(n,l={}){const{immediate:r=!0,fpsLimit:a,window:u=o,once:s=!1}=l,i=t.shallowRef(!1),c=t.computed(()=>a?1e3/t.toValue(a):null);let d=0,f=null;function v(e){if(!i.value||!u)return;d||(d=e);const t=e-d;if(c.value&&t<c.value)f=u.requestAnimationFrame(v);else{if(d=e,n({delta:t,timestamp:e}),s)return i.value=!1,void(f=null);f=u.requestAnimationFrame(v)}}function p(){!i.value&&u&&(i.value=!0,d=0,f=u.requestAnimationFrame(v))}function m(){i.value=!1,null!=f&&u&&(u.cancelAnimationFrame(f),f=null)}return r&&p(),e.tryOnScopeDispose(m),{isActive:t.readonly(i),pause:m,resume:p}}(d,{immediate:a}):e.useIntervalFn(d,u,{immediate:a});return l?{timestamp:i,...f}:i};
//# sourceMappingURL=index-C8tYBJvG.js.map