"use strict";const s=require("./focusWithoutScrolling-BlyUcXdY.cjs.js"),l=require("./platform-BDLy2vDY.cjs.js"),u=require("react"),v=u.createContext({isNative:!0,open:K,useHref:e=>e});function x(e){let{children:a,navigate:t,useHref:r}=e,d=u.useMemo(()=>({isNative:!1,open:(n,i,b,o)=>{y(n,f=>{h(f,i)?t(b,o):c(f,i)})},useHref:r||(n=>n)}),[t,r]);return u.createElement(v.Provider,{value:d},a)}function $(){return u.useContext(v)}function h(e,a){let t=e.getAttribute("target");return(!t||t==="_self")&&e.origin===location.origin&&!e.hasAttribute("download")&&!a.metaKey&&!a.ctrlKey&&!a.altKey&&!a.shiftKey}function c(e,a,t=!0){var r,d;let{metaKey:n,ctrlKey:i,altKey:b,shiftKey:o}=a;l.$c87311424ea30a05$export$b7d78993b74f766d()&&(!((d=window.event)===null||d===void 0||(r=d.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(l.$c87311424ea30a05$export$9ac100e40613ea10()?n=!0:i=!0);let f=l.$c87311424ea30a05$export$78551043582a6a98()&&l.$c87311424ea30a05$export$9ac100e40613ea10()&&!l.$c87311424ea30a05$export$7bef049ce92e4224()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:n,ctrlKey:i,altKey:b,shiftKey:o}):new MouseEvent("click",{metaKey:n,ctrlKey:i,altKey:b,shiftKey:o,bubbles:!0,cancelable:!0});c.isOpening=t,s.$7215afc6de606d6b$export$de79e2c695e052f3(e),e.dispatchEvent(f),c.isOpening=!1}c.isOpening=!1;function y(e,a){if(e instanceof HTMLAnchorElement)a(e);else if(e.hasAttribute("data-href")){let t=document.createElement("a");t.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(t.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(t.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(t.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(t.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(t.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(t),a(t),e.removeChild(t)}}function K(e,a){y(e,t=>c(t,a))}function g(e){let a=$();var t;const r=a.useHref((t=e.href)!==null&&t!==void 0?t:"");return{"data-href":e.href?r:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}function w(e){let a=$();var t;const r=a.useHref((t=e?.href)!==null&&t!==void 0?t:"");return{href:e?.href?r:void 0,target:e?.target,rel:e?.rel,download:e?.download,ping:e?.ping,referrerPolicy:e?.referrerPolicy}}function A(e,a,t,r){!a.isNative&&e.currentTarget instanceof HTMLAnchorElement&&e.currentTarget.href&&!e.isDefaultPrevented()&&h(e.currentTarget,e)&&t&&(e.preventDefault(),a.open(e.currentTarget,e,t,r))}exports.$ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f=A;exports.$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb=x;exports.$ea8dcbcb9ea1b556$export$7e924b3091a3bd18=w;exports.$ea8dcbcb9ea1b556$export$95185d699e05d4d7=c;exports.$ea8dcbcb9ea1b556$export$9a302a45f65d0572=$;exports.$ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6=g;
//# sourceMappingURL=openLink-DkCJYbzq.cjs.js.map
