PageSourceSearch

https://uprightplatform.com/assets/useFocusable-VeOdi_WJ.js

js uprightplatform.com collected 2026-10-06 03:03:49 UTC 14,053 bytes, 2 lines download raw bytes

1import{l as e,r as t}from"./jsx-runtime-CFVZ63Ta.js";import{n,o as r,s as i,t as a}from"./mergeProps-t69xKiD7.js";import{u as o}from"./utils-yHtgeFsE.js";var s=e=>e?.ownerDocument??document,c=e=>e&&`window`in e&&e.window===e?e:s(e).defaultView||window;function l(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function u(e){return l(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&`host`in e}var d=!1;function f(){return d}function ee(e,t){if(!f())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=n.tagName===`SLOT`&&n.assignedSlot?n.assignedSlot.parentNode:u(n)?n.host:n.parentNode}return!1}var p=(e=document)=>{if(!f())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function m(e){if(f()&&e.target instanceof Element&&e.target.shadowRoot){if(`composedPath`in e)return e.composedPath()[0]??null;if(`composedPath`in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function te(e){if(!e)return!1;let t=e.getRootNode(),n=c(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let r=t.activeElement;return r!=null&&e.contains(r)}function h(e){if(ne())e.focus({preventScroll:!0});else{let t=re(e);e.focus(),ie(t)}}var g=null;function ne(){if(g==null){g=!1;try{document.createElement(`div`).focus({get preventScroll(){return g=!0,!0}})}catch{}}return g}function re(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function ie(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function _(e){if(typeof window>`u`||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function v(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function y(e){let t=null;return()=>(t??=e(),t)}var b=y(function(){return v(/^Mac/i)}),ae=y(function(){return v(/^iPhone/i)}),x=y(function(){return v(/^iPad/i)||b()&&navigator.maxTouchPoints>1}),S=y(function(){return ae()||x()}),oe=y(function(){return b()||S()}),C=y(function(){return _(/AppleWebKit/i)&&!w()}),w=y(function(){return _(/Chrome/i)}),T=y(function(){return _(/Android/i)}),se=y(function(){return _(/Firefox/i)}),E=e(t(),1),D=(0,E.createContext)({isNative:!0,open:fe,useHref:e=>e});function ce(e){let{children:t,navigate:n,useHref:r}=e,i=(0,E.useMemo)(()=>({isNative:!1,open:(e,t,r,i)=>{de(e,e=>{ue(e,t)?n(r,i):O(e,t)})},useHref:r||(e=>e)}),[n,r]);return E.createElement(D.Provider,{value:i},t)}function le(){return(0,E.useContext)(D)}function ue(e,t){let n=e.getAttribute(`target`);return(!n||n===`_self`)&&e.origin===location.origin&&!e.hasAttribute(`download`)&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey}function O(e,t,n=!0){var r;let{metaKey:i,ctrlKey:a,altKey:o,shiftKey:s}=t;se()&&(r=window.event)!=null&&r.type?.startsWith(`key`)&&e.target===`_blank`&&(b()?i=!0:a=!0);let c=C()&&b()&&!x()?new KeyboardEvent(`keydown`,{keyIdentifier:`Enter`,metaKey:i,ctrlKey:a,altKey:o,shiftKey:s}):new MouseEvent(`click`,{metaKey:i,ctrlKey:a,altKey:o,shiftKey:s,detail:1,bubbles:!0,cancelable:!0});O.isOpening=n,h(e),e.dispatchEvent(c),O.isOpening=!1}O.isOpening=!1;function de(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute(`data-href`)){let n=document.createElement(`a`);n.href=e.getAttribute(`data-href`),e.hasAttribute(`data-target`)&&(n.target=e.getAttribute(`data-target`)),e.hasAttribute(`data-rel`)&&(n.rel=e.getAttribute(`data-rel`)),e.hasAttribute(`data-download`)&&(n.download=e.getAttribute(`data-download`)),e.hasAttribute(`data-ping`)&&(n.ping=e.getAttribute(`data-ping`)),e.hasAttribute(`data-referrer-policy`)&&(n.referrerPolicy=e.getAttribute(`data-referrer-policy`)),e.appendChild(n),t(n),e.removeChild(n)}}function fe(e,t){de(e,e=>O(e,t))}function pe(e){let t=le().useHref(e?.href??``);return{href:e?.href?t:void 0,target:e?.target,rel:e?.rel,download:e?.download,ping:e?.ping,referrerPolicy:e?.referrerPolicy}}function me(e,t,n,r){!t.isNative&&e.currentTarget instanceof HTMLAnchorElement&&e.currentTarget.href&&!e.isDefaultPrevented()&&ue(e.currentTarget,e)&&n&&(e.preventDefault(),t.open(e.currentTarget,e,n,r))}var k=new Map,A=new Set;function j(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=m(t);if(!e(t)||!r)return;let i=k.get(r);i||(i=new Set,k.set(r,i),r.addEventListener(`transitioncancel`,n,{once:!0})),i.add(t.propertyName)},n=t=>{let r=m(t);if(!e(t)||!r)return;let i=k.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),k.delete(r)),k.size===0)){for(let e of A)e();A.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,j):j());function he(){for(let[e]of k)`isConnected`in e&&!e.isConnected&&k.delete(e)}function M(e){requestAnimationFrame(()=>{he(),k.size===0?e():A.add(e)})}function N(e,t){i(()=>
vendor: 4,474 bytes, line 1
1{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function P(e){return e.pointerType===``&&e.isTrusted?!0:T()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function ge(e){return!T()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}var _e=typeof Element<`u`&&`checkVisibility`in Element.prototype;function ve(e){let t=c(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!==`none`&&r!==`hidden`&&r!==`collapse`;if(i){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r}=t(e);i=n!==`none`&&r!==`hidden`&&r!==`collapse`}return i}function ye(e,t){return!e.hasAttribute(`hidden`)&&!e.hasAttribute(`data-react-aria-prevent-focus`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function F(e,t){return _e?e.checkVisibility({visibilityProperty:!0})&&!e.closest(`[data-react-aria-prevent-focus]`):e.nodeName!==`#comment`&&ve(e)&&ye(e,t)&&(!e.parentElement||F(e.parentElement,e))}var I=[`input:not([disabled]):not([type=hidden])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`summary`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable^="false"])`,`permission`],be=I.join(`:not([hidden]),`)+`,[tabindex]:not([disabled]):not([hidden])`;I.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`);var xe=I.join(`:not([hidden]):not([tabindex="-1"]),`);function L(e){return e.matches(be)&&F(e)&&!R(e)}function Se(e){return e.matches(xe)&&F(e)&&!R(e)}function R(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function z(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Ce(e,t){Object.defineProperty(e,`target`,{value:t}),Object.defineProperty(e,`currentTarget`,{value:t})}function B(e){let t=(0,E.useRef)({isFocused:!1,observer:null});return i(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),(0,E.useCallback)(n=>{let r=m(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let n=r;n.addEventListener(`focusout`,r=>{if(t.current.isFocused=!1,n.disabled){let t=z(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){var e;(e=t.current.observer)==null||e.disconnect();let r=n===p()?null:p();n.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:r})),n.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:r}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:[`disabled`]})}},[e])}var V=!1;function we(e){for(;e&&!L(e);)e=e.parentElement;let t=c(e),n=t.document.activeElement;if(!n||n===e)return;V=!0;let r=!1,i=e=>{(m(e)===n||r)&&e.stopImmediatePropagation()},a=t=>{(m(t)===n||r)&&(t.stopImmediatePropagation(),!e&&!r&&(r=!0,h(n),l()))},o=t=>{(m(t)===e||r)&&t.stopImmediatePropagation()},s=t=>{(m(t)===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,h(n),l()))};t.addEventListener(`blur`,i,!0),t.addEventListener(`focusout`,a,!0),t.addEventListener(`focusin`,s,!0),t.addEventListener(`focus`,o,!0);let l=()=>{cancelAnimationFrame(u),t.removeEventListener(`blur`,i,!0),t.removeEventListener(`focusout`,a,!0),t.removeEventListener(`focusin`,s,!0),t.removeEventListener(`focus`,o,!0),V=!1,r=!1},u=requestAnimationFrame(l);return l}var H=null,U=`keyboard`,W=new Set,G=new Map,K=!1,q=!1,Te={Tab:!0,Escape:!0};function J(e,t){for(let n of W)n(e,t)}function Ee(e){return!(e.metaKey||!b()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function Y(e){K=!0,!O.isOpening&&Ee(e)&&(H=`keyboard`,U=`keyboard`,J(`keyboard`,e))}function X(e){H=`pointer`,U=`pointerType`in e?e.pointerType:`mouse`,(e.type===`mousedown`||e.type===`pointerdown`)&&(K=!0,J(`pointer`,e))}function De(e){!O.isOpening&&P(e)&&(K=!0,H=`virtual`,U=`virtual`)}function Oe(e){m(e)===window||m(e)===document||V||!e.isTrusted||(!K&&!q&&(H=`virtual`,U=`virtual`,J(`virtual`,e)),K=!1,q=!1)}function ke(){V||(K=!1,q=!0)}function Z(e){if(typeof window>`u`||typeof document>`u`||G.get(c(e)))return;
1let t=c(e),n=s(e),r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){K=!0,r.apply(this,arguments)},n.addEventListener(`keydown`,Y,!0),n.addEventListener(`keyup`,Y,!0),n.addEventListener(`click`,De,!0),t.addEventListener(`focus`,Oe,!0),t.addEventListener(`blur`,ke,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,X,!0),n.addEventListener(`pointermove`,X,!0),n.addEventListener(`pointerup`,X,!0)),t.addEventListener(`beforeunload`,()=>{Ae(e)},{once:!0}),G.set(t,{focus:r})}var Ae=(e,t)=>{let n=c(e),r=s(e);t&&r.removeEventListener(`DOMContentLoaded`,t),G.has(n)&&(n.HTMLElement.prototype.focus=G.get(n).focus,r.removeEventListener(`keydown`,Y,!0),r.removeEventListener(`keyup`,Y,!0),r.removeEventListener(`click`,De,!0),n.removeEventListener(`focus`,Oe,!0),n.removeEventListener(`blur`,ke,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,X,!0),r.removeEventListener(`pointermove`,X,!0),r.removeEventListener(`pointerup`,X,!0)),G.delete(n))};function je(e){let t=s(e),n;return t.readyState===`loading`?(n=()=>{Z(e)},t.addEventListener(`DOMContentLoaded`,n)):Z(e),()=>Ae(e,n)}typeof document<`u`&&je();function Me(){return H!==`pointer`}function Ne(){return H}function Pe(e){H=e,U=e===`pointer`?`mouse`:e,J(e,null)}function Fe(){return U}function Ie(){Z();let[e,t]=(0,E.useState)(H);return(0,E.useEffect)(()=>{let e=()=>{t(H)};return W.add(e),()=>{W.delete(e)}},[]),r()?null:e}var Le=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Re(e,t,n){let r=s(n?m(n):void 0),i=n?m(n):void 0,a=typeof window<`u`?c(i).HTMLInputElement:HTMLInputElement,o=typeof window<`u`?c(i).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<`u`?c(i).HTMLElement:HTMLElement,u=typeof window<`u`?c(i).KeyboardEvent:KeyboardEvent,d=p(r);return e=e||d instanceof a&&!Le.has(d.type)||d instanceof o||d instanceof l&&d.isContentEditable,!(e&&t===`keyboard`&&n instanceof u&&!Te[n.key])}function ze(e,t,n){Z(),(0,E.useEffect)(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{Re(!!n?.isTextInput,t,r)&&e(Me())};return W.add(t),()=>{W.delete(t)}},t)}function Be(e){if(!e.isConnected)return;let t=s(e);if(Ne()===`virtual`){let n=p(t);M(()=>{let r=p(t);(r===n||r===t.body)&&e.isConnected&&h(e)})}else h(e)}function Ve(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e,a=(0,E.useCallback)(e=>{if(m(e)===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),o=B(a),c=(0,E.useCallback)(e=>{let t=m(e),r=s(t),a=r?p(r):p();t===e.currentTarget&&t===a&&(n&&n(e),i&&i(!0),o(e))},[i,n,o]);return{focusProps:{onFocus:!t&&(n||i||r)?c:void 0,onBlur:!t&&(r||i)?a:void 0}}}function He(e){if(!e)return;let t=!0;return n=>{e({...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}}),t&&n.stopPropagation()}}function Ue(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:He(e.onKeyDown),onKeyUp:He(e.onKeyUp)}}}var Q=E.createContext(null);function We(e){let t=(0,E.useContext)(Q)||{};N(t,e);let{ref:n,...r}=t;return r}var Ge=E.forwardRef(function(e,t){let{children:n,...r}=e,i=o(t),a={...r,ref:i};return E.createElement(Q.Provider,{value:a},n)});function $(e,t){let{focusProps:n}=Ve(e),{keyboardProps:r}=Ue(e),i=a(n,r),o=We(t),s=e.isDisabled?{}:o,c=(0,E.useRef)(e.autoFocus);(0,E.useEffect)(()=>{c.current&&t.current&&Be(t.current),c.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:a({...i,tabIndex:l},s)}}var Ke=(0,E.forwardRef)(({children:e,...t},r)=>{r=o(r);let{focusableProps:i}=$(t,r),s=E.Children.only(e);(0,E.useEffect)(()=>{},[r,t.isDisabled]);let c=s.ref;return E.cloneElement(s,{...a(i,s.props),ref:n(c,r)})});export{C as A,f as B,M as C,O as D,pe as E,h as F,c as H,ee as I,te as L,T as M,oe as N,le as O,S as P,p as R,N as S,ce as T,s as V,we as _,Ue as a,ge as b,Ne as c,Ie as d,Me as f,Ce as g,B as h,Q as i,b as j,w as k,Pe as l,z as m,Ke as n,Ve as o,ze as p,$ as r,Be as s,Ge as t,Fe as u,L as v,me as w,P as x,Se as y,m as z};
2//# sourceMappingURL=useFocusable-VeOdi_WJ.js.map

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.