PageSourceSearch

https://cncep-2025.vercel.app/build/assets/use-active-press-DKXRc03s.js

js cncep-2025.vercel.app collected 2026-10-03 05:17:40 UTC 9,393 bytes, 1 lines download raw bytes

1import{U as R,r as s}from"./app-DxXkf7gR.js";import{p as _,o as k,u as j}from"./open-closed-wQLrs8eh.js";const D=typeof document<"u"?R.useLayoutEffect:()=>{};function U(e){const n=s.useRef(null);return D(()=>{n.current=e},[e]),s.useCallback((...t)=>{const r=n.current;return r==null?void 0:r(...t)},[])}const m=e=>{var n;return(n=e==null?void 0:e.ownerDocument)!==null&&n!==void 0?n:document},b=e=>e&&"window"in e&&e.window===e?e:m(e).defaultView||window;function G(e){var n;return typeof window>"u"||window.navigator==null?!1:((n=window.navigator.userAgentData)===null||n===void 0?void 0:n.brands.some(t=>e.test(t.brand)))||e.test(window.navigator.userAgent)}function Y(e){var n;return typeof window<"u"&&window.navigator!=null?e.test(((n=window.navigator.userAgentData)===null||n===void 0?void 0:n.platform)||window.navigator.platform):!1}function W(e){let n=null;return()=>(n==null&&(n=e()),n)}const X=W(function(){return Y(/^Mac/i)}),z=W(function(){return G(/Android/i)});function N(e){return e.mozInputSource===0&&e.isTrusted?!0:z()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class q{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(n,t){this.nativeEvent=t,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.bubbles=t.bubbles,this.cancelable=t.cancelable,this.defaultPrevented=t.defaultPrevented,this.eventPhase=t.eventPhase,this.isTrusted=t.isTrusted,this.timeStamp=t.timeStamp,this.type=n}}function I(e){let n=s.useRef({isFocused:!1,observer:null});D(()=>{const r=n.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let t=U(r=>{e==null||e(r)});return s.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){n.current.isFocused=!0;let o=r.target,a=c=>{n.current.isFocused=!1,o.disabled&&t(new q("blur",c)),n.current.observer&&(n.current.observer.disconnect(),n.current.observer=null)};o.addEventListener("focusout",a,{once:!0}),n.current.observer=new MutationObserver(()=>{if(n.current.isFocused&&o.disabled){var c;(c=n.current.observer)===null||c===void 0||c.disconnect();let i=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:i})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:i}))}}),n.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[t])}function J(e){let{isDisabled:n,onFocus:t,onBlur:r,onFocusChange:o}=e;const a=s.useCallback(d=>{if(d.target===d.currentTarget)return r&&r(d),o&&o(!1),!0},[r,o]),c=I(a),i=s.useCallback(d=>{const l=m(d.target);d.target===d.currentTarget&&l.activeElement===d.target&&(t&&t(d),o&&o(!0),c(d))},[o,t,c]);return{focusProps:{onFocus:!n&&(t||o||r)?i:void 0,onBlur:!n&&(r||o)?a:void 0}}}let w=null,P=new Set,h=new Map,$=!1,H=!1;const Q={Tab:!0,Escape:!0};function C(e,n){for(let t of P)t(e,n)}function Z(e){return!(e.metaKey||!X()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function T(e){$=!0,Z(e)&&(w="keyboard",C("keyboard",e))}function f(e){w="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&($=!0,C("pointer",e))}function B(e){N(e)&&($=!0,w="virtual")}function A(e){e.target===window||e.target===document||(!$&&!H&&(w="virtual",C("virtual",e)),$=!1,H=!1)}function K(){$=!1,H=!0}function M(e){if(typeof window>"u"||h.get(b(e)))return;const n=b(e),t=m(e);let r=n.HTMLElement.prototype.focus;n.HTMLElement.prototype.focus=function(){$=!0,r.apply(this,arguments)},t.addEventListener("keydown",T,!0),t.addEventListener("keyup",T,!0),t.addEventListener("click",B,!0),n.addEventListener("focus",A,!0),n.addEventListener("blur",K,!1),typeof PointerEvent<"u"?(t.addEventListener("pointerdown",f,!0),t.addEventListener("pointermove",f,!0),t.addEventListener("pointerup",f,!0)):(t.addEventListener("mousedown",f,!0),t.addEventListener("mousemove",f,!0),t.addEventListener("mouseup",f,!0)),n.addEventListener("beforeunload",()=>{V(e)},{once:!0}),h.set(n,{focus:r})}const V=(e,n)=>{const t=b(e),r=m(e);n&&r.removeEventListener("DOMContentLoaded",n),h.has(t)&&(t.HTMLElement.prototype.focu
1s=h.get(t).focus,r.removeEventListener("keydown",T,!0),r.removeEventListener("keyup",T,!0),r.removeEventListener("click",B,!0),t.removeEventListener("focus",A,!0),t.removeEventListener("blur",K,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",f,!0),r.removeEventListener("pointermove",f,!0),r.removeEventListener("pointerup",f,!0)):(r.removeEventListener("mousedown",f,!0),r.removeEventListener("mousemove",f,!0),r.removeEventListener("mouseup",f,!0)),h.delete(t))};function ee(e){const n=m(e);let t;return n.readyState!=="loading"?M(e):(t=()=>{M(e)},n.addEventListener("DOMContentLoaded",t)),()=>V(e,t)}typeof document<"u"&&ee();function O(){return w!=="pointer"}const te=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ne(e,n,t){var r;const o=typeof window<"u"?b(t==null?void 0:t.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?b(t==null?void 0:t.target).HTMLTextAreaElement:HTMLTextAreaElement,c=typeof window<"u"?b(t==null?void 0:t.target).HTMLElement:HTMLElement,i=typeof window<"u"?b(t==null?void 0:t.target).KeyboardEvent:KeyboardEvent;return e=e||(t==null?void 0:t.target)instanceof o&&!te.has(t==null||(r=t.target)===null||r===void 0?void 0:r.type)||(t==null?void 0:t.target)instanceof a||(t==null?void 0:t.target)instanceof c&&(t==null?void 0:t.target.isContentEditable),!(e&&n==="keyboard"&&t instanceof i&&!Q[t.key])}function re(e,n,t){M(),s.useEffect(()=>{let r=(o,a)=>{ne(!!(t!=null&&t.isTextInput),o,a)&&e(O())};return P.add(r),()=>{P.delete(r)}},n)}function oe(e){let{isDisabled:n,onBlurWithin:t,onFocusWithin:r,onFocusWithinChange:o}=e,a=s.useRef({isFocusWithin:!1}),c=s.useCallback(l=>{a.current.isFocusWithin&&!l.currentTarget.contains(l.relatedTarget)&&(a.current.isFocusWithin=!1,t&&t(l),o&&o(!1))},[t,o,a]),i=I(c),d=s.useCallback(l=>{!a.current.isFocusWithin&&document.activeElement===l.target&&(r&&r(l),o&&o(!0),a.current.isFocusWithin=!0,i(l))},[r,o,i]);return n?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:c}}}let L=!1,F=0;function x(){L=!0,setTimeout(()=>{L=!1},50)}function S(e){e.pointerType==="touch"&&x()}function ie(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",S):document.addEventListener("touchend",x),F++,()=>{F--,!(F>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",S):document.removeEventListener("touchend",x))}}function de(e){let{onHoverStart:n,onHoverChange:t,onHoverEnd:r,isDisabled:o}=e,[a,c]=s.useState(!1),i=s.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;s.useEffect(ie,[]);let{hoverProps:d,triggerHoverEnd:l}=s.useMemo(()=>{let p=(u,g)=>{if(i.pointerType=g,o||g==="touch"||i.isHovered||!u.currentTarget.contains(u.target))return;i.isHovered=!0;let y=u.currentTarget;i.target=y,n&&n({type:"hoverstart",target:y,pointerType:g}),t&&t(!0),c(!0)},E=(u,g)=>{if(i.pointerType="",i.target=null,g==="touch"||!i.isHovered)return;i.isHovered=!1;let y=u.currentTarget;r&&r({type:"hoverend",target:y,pointerType:g}),t&&t(!1),c(!1)},v={};return typeof PointerEvent<"u"?(v.onPointerEnter=u=>{L&&u.pointerType==="mouse"||p(u,u.pointerType)},v.onPointerLeave=u=>{!o&&u.currentTarget.contains(u.target)&&E(u,u.pointerType)}):(v.onTouchStart=()=>{i.ignoreEmulatedMouseEvents=!0},v.onMouseEnter=u=>{!i.ignoreEmulatedMouseEvents&&!L&&p(u,"mouse"),i.ignoreEmulatedMouseEvents=!1},v.onMouseLeave=u=>{!o&&u.currentTarget.contains(u.target)&&E(u,"mouse")}),{hoverProps:v,triggerHoverEnd:E}},[n,t,r,o,i]);return s.useEffect(()=>{o&&l({currentTarget:i.target},i.pointerType)},[o]),{hoverProps:d,isHovered:a}}function le(e={}){let{autoFocus:n=!1,isTextInput:t,within:r}=e,o=s.useRef({isFocused:!1,isFocusVisible:n||O()}),[a,c]=s.useState(!1),[i,d]=s.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=s.useCallback(()=>d(o.current.isFocused&&o.current.isFocusVisible),[]),p=s.useCallback(u=>{o.current.isFocused=u,c(u),l()},[l]);re(u=>{o.current.isFocusVisible=u,l()},[],{isTextInput:t});let{focusProps:E}=J({isDisabled:r,onFocusChange:p}),{focusWithinProps:v}=oe({isDisabled:!r,onFocusWithinChange:p});return{isFocused:a,isFocusVisible:i,focusProps:r?v:E}}function ue(e){let n=e.width/2,t=e.height/2;return{top:e.clientY-t,right:e.clientX+n,bottom:e.clientY+t,left:e.clientX-n}}function ae(e,n){return!(!e||!n||e.right<n.left||e.left>n.right||e.bottom<n.top||e.top>n.bottom)}function fe({disabled:e=!1}={}){let n=s.useRef(null),[t,r]=s.useState(!1),o=_(),a=k(()=>{n.current=null,r(!1),o.dispose()}),c=k(i=>{if(o.dispose(),n.current===null){n.current=i.currentTarget,r(!0);{let d=j(i.currentTarget);o.addEventListener(d,"pointerup",a,!1),o.addEventListener(d,"pointermove",l=>
1{if(n.current){let p=ue(l);r(ae(p,n.current.getBoundingClientRect()))}},!1),o.addEventListener(d,"pointercancel",a,!1)}}});return{pressed:t,pressProps:e?{}:{onPointerDown:c,onPointerUp:a,onClick:a}}}export{le as $,de as a,fe as w};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.