PageSourceSearch

https://www.mapka.ai/static/js/useFocusRing.CDbi6AXW.js

js mapka.ai collected 2026-10-05 14:53:24 UTC 9,826 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime.C0FnF6B9.js";import{r as t}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{A as n,D as r,F as i,G as a,H as o,O as s,Q as c,R as l,U as u,Z as d,ht as f,j as p,k as m,mt as ee,q as h,y as g}from"./Tooltip.J-aaVqsl.js";function _(e){return e.pointerType===``&&e.isTrusted?!0:n()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function v(e){return!n()&&e.width===0&&e.height===0||n()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}var y=e(t(),1),b=(0,y.createContext)({isNative:!0,open:ne,useHref:e=>e});function x(){return(0,y.useContext)(b)}function te(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 S(e,t,n=!0){let{metaKey:i,ctrlKey:a,altKey:c,shiftKey:l}=t;!r()&&p()&&window.event?.type?.startsWith(`key`)&&e.target===`_blank`&&(m()?i=!0:a=!0);let u=r()&&m()&&!s()?new KeyboardEvent(`keydown`,{keyIdentifier:`Enter`,metaKey:i,ctrlKey:a,altKey:c,shiftKey:l}):new MouseEvent(`click`,{metaKey:i,ctrlKey:a,altKey:c,shiftKey:l,detail:1,bubbles:!0,cancelable:!0});S.isOpening=n,o(e),e.dispatchEvent(u),S.isOpening=!1}S.isOpening=!1;function C(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 ne(e,t){C(e,e=>S(e,t))}function re(e){let t=x().useHref(e?.href??``),n={};if(e)for(let r of[`href`,`target`,`rel`,`download`,`ping`,`referrerPolicy`])r in e&&e[r]!==void 0&&(n[r]=r===`href`?t:e[r]);return n}function w(e,t,n,r){!t.isNative&&e.currentTarget instanceof HTMLAnchorElement&&e.currentTarget.href&&!e.isDefaultPrevented()&&te(e.currentTarget,e)&&n&&(e.preventDefault(),t.open(e.currentTarget,e,n,r))}var T=null,E=new Set,D=new Map,O=!1,k=!1,A={Tab:!0,Escape:!0};function j(e,t){for(let n of E)n(e,t)}function ie(e){return!(e.metaKey||!m()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function M(e){O=!0,!S.isOpening&&ie(e)&&(T=`keyboard`,j(`keyboard`,e))}function N(e){T=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(O=!0,j(`pointer`,e))}function P(e){!S.isOpening&&_(e)&&(O=!0,T=`virtual`)}function F(e){if(l)return;let t=h(e),n=c(t),r=d(t);if(t===n){k=!0;return}t===r||!e.isTrusted||(!O&&!k&&(T=`virtual`,j(`virtual`,e)),O=!1,k=!1)}function I(){l||(O=!1,k=!0)}function L(e){if(typeof window>`u`||typeof document>`u`)return;let t=c(e),n=d(e);if(D.get(t))return;let r=t.HTMLElement.prototype.focus;Reflect.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:function(){O=!0,r.apply(this,arguments)}}),n.addEventListener(`keydown`,M,!0),n.addEventListener(`keyup`,M,!0),n.addEventListener(`click`,P,!0),t.addEventListener(`focus`,F,!0),t.addEventListener(`blur`,I,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,N,!0),n.addEventListener(`pointermove`,N,!0),n.addEventListener(`pointerup`,N,!0)),t.addEventListener(`beforeunload`,()=>{R(e)},{once:!0}),D.set(t,{focus:r})}var R=(e,t)=>{let n=c(e),r=d(e);t&&r.removeEventListener(`DOMContentLoaded`,t),D.has(n)&&(Reflect.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:D.get(n).focus}),r.removeEventListener(`keydown`,M,!0),r.removeEventListener(`keyup`,M,!0),r.removeEventListener(`click`,P,!0),n.removeEventListener(`focus`,F,!0),n.removeEventListener(`blur`,I,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,N,!0),r.removeEventListener(`pointermove`,N,!0),r.removeEventListener(`pointerup`,N,!0)),D.delete(n))};function z(e){let t=d(e),n;return t.readyState===`loading`?(n=()=>{L(e)},t.addEventListener(`DOMContentLoaded`,n)):L(e),()=>R(e,n)}typeof document<`u`&&z();function B(){return T!==`pointer`}function V(){return T}function H(e){T=e,j(e,null)}var U=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function W(e,t,n){let r=n?h(n):void 0,i=d(r),o=c(r),s=o===void 0?HTMLInputElement:o.HTMLInputElement,l=o===void 0?HTMLTextAreaElement:o.HTMLTextAreaElement,u=o===void 0?HTMLElement:o.HTMLElement,f=o===void 0?KeyboardEvent:o.KeyboardEvent,p=a(i);return e=e||p instanceof s&&!U.has(p.type)||p instanceof l||p instanceof u&&p.isContentEditable,!(e&&t===`keyboard`&&n instanceof f&&!A[n.key])}function G(e,t,n){L(),(0,y.useEffect)(()=>
1{if(n?.enabled===!1)return;let t=(t,r)=>{W(!!n?.isTextInput,t,r)&&e(B())};return E.add(t),()=>{E.delete(t)}},t)}var K=new Map,q=new Set;function J(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=h(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=h(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 q)e();q.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,J):J());function ae(){for(let[e]of K)`isConnected`in e&&!e.isConnected&&K.delete(e)}function Y(e){requestAnimationFrame(()=>{ae(),K.size===0?e():q.add(e)})}function oe(e){if(!e.isConnected)return;let t=d(e);if(V()===`virtual`){let n=a(t);Y(()=>{let r=a(t);(r===n||r===t.body)&&e.isConnected&&o(e)})}else o(e)}function X(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e,s=(0,y.useCallback)(e=>{if(h(e)===e.currentTarget)return r&&r(e),o&&o(!1),!0},[r,o]),c=i(s),l=(0,y.useCallback)(e=>{let t=h(e),r=d(t),i=r?a(r):a();t===e.currentTarget&&t===i&&(n&&n(e),o&&o(!0),c(e))},[o,n,c]);return{focusProps:{onFocus:!t&&(n||o||r)?l:void 0,onBlur:!t&&(r||o)?s:void 0}}}function Z(e){if(e)return t=>{let n=!0;e({...t,preventDefault(){t.preventDefault()},isDefaultPrevented(){return t.isDefaultPrevented()},stopPropagation(){n=!0},continuePropagation(){n=!1,typeof t.continuePropagation==`function`&&t.continuePropagation()},isPropagationStopped(){return n}}),n&&!(typeof t.isPropagationStopped==`function`&&t.isPropagationStopped())&&t.stopPropagation()}}var se=new Set([`shift`,`alt`,`control`,`meta`,`mod`]),ce=[`Alt`,`Control`,`Meta`,`Shift`];function le(e){let t=new Set;return e.alt&&t.add(`Alt`),e.shift&&t.add(`Shift`),e.ctrl&&t.add(`Control`),e.meta&&t.add(`Meta`),e.mod&&t.add(m()?`Meta`:`Control`),t}function ue(e){let t=new Set;return e.altKey&&t.add(`Alt`),e.ctrlKey&&t.add(`Control`),e.metaKey&&t.add(`Meta`),e.shiftKey&&t.add(`Shift`),t}function Q(e){return ce.filter(t=>e.has(t))}function de(e){let t=e.split(`+`).reduce((e,t)=>{let n=t.toLowerCase();return se.has(n)?n===`shift`?e.shift=!0:n===`alt`?e.alt=!0:n===`control`?e.ctrl=!0:n===`meta`?e.meta=!0:n===`mod`&&(e.mod=!0):e.key=t,e},{shift:!1,alt:!1,ctrl:!1,meta:!1,mod:!1,key:``});if(t.key===``)throw Error(`Invalid keyboard shortcut: "${e}". Must include exactly one non-modifier key (e.g. "a", "Enter", "ArrowDown"). Combine any of Shift, Alt, Ctrl, Meta, and Mod.`);return t}function $(e){return e.toLowerCase()}var fe={space:` `,esc:`escape`,del:`delete`,ins:`insert`,left:`arrowleft`,right:`arrowright`,up:`arrowup`,down:`arrowdown`,pageup:`pageup`,pagedown:`pagedown`};function pe(e){let t=$(e);return fe[t]??t}function me(e){let t=Q(le(e)),n=pe(e.key);return t.length>0?`${t.join(`+`)}+${n}`:n}function he(e){let t=Q(ue(e)),n=$(e.key);return(t.length>0?`${t.join(`+`)}+`:``)+n}function ge(e){let t=new Map;for(let[n,r]of Object.entries(e)){let e=de(n);t.set(me(e),r)}return e=>{let n=he(e),r=t.get(n),i=r?.(e);i===void 0&&r!==void 0?i={shouldContinuePropagation:!1,shouldPreventDefault:!0}:typeof i==`boolean`&&(i={shouldContinuePropagation:!i,shouldPreventDefault:i}),i?.shouldPreventDefault&&e.preventDefault(),(!r||i?.shouldContinuePropagation)&&e.continuePropagation()}}function _e(e){let{shortcuts:t,allowRepeats:n=!1,allowComposing:r=!1}=e,i,a;if(t){let o=ge(t),s=Z(e=>{if(!u(e.currentTarget,h(e))){e.continuePropagation();return}if(e.nativeEvent?.repeat&&!n||e.nativeEvent?.isComposing&&!r){e.continuePropagation();return}o(e)}),c=Z(e=>{if(!u(e.currentTarget,h(e))){e.continuePropagation();return}if(e.nativeEvent?.repeat&&!n||e.nativeEvent?.isComposing&&!r){e.continuePropagation();return}e.continuePropagation()});i=e.onKeyDown?f(e.onKeyDown,s):s,a=e.onKeyUp?f(e.onKeyUp,c):c}else i=Z(e.onKeyDown),a=Z(e.onKeyUp);return{keyboardProps:e.isDisabled?{}:{onKeyDown:i,onKeyUp:a}}}function ve(e,t){ee(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function ye(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=(0,y.useRef)({isFocused:!1,isFocusVisible:t||B()}),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(()=>i.current.isFocused&&i.current.isFocusVisible),l=(0,y.useCallback)(()=>
1c(i.current.isFocused&&i.current.isFocusVisible),[]),u=(0,y.useCallback)(e=>{i.current.isFocused=e,i.current.isFocusVisible=B(),o(e),l()},[l]);G(e=>{i.current.isFocusVisible=e,l()},[n,a],{enabled:a,isTextInput:n});let{focusProps:d}=X({isDisabled:r,onFocusChange:u}),{focusWithinProps:f}=g({isDisabled:!r,onFocusWithinChange:u});return{isFocused:a,isFocusVisible:s,focusProps:r?f:d}}export{oe as a,H as c,re as d,S as f,_ as h,X as i,B as l,v as m,ve as n,Y as o,x as p,_e as r,V as s,ye as t,w as u};

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.