@sprocketui-react/button 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{useHover as _,usePress as h,useFocusRing as j,useFocusable as V}from"@necto-react/hooks";import{HTMLElements as r}from"@necto/dom";import{mergeProps as C}from"@necto/mergers";import{filterDOMProps as G}from"@necto-react/helpers";import{ANCHOR_ELEMENT_PROPS as W,ALLOWED_EXTERNAL_PROPS as X}from"shared";var k=r.Button;function x(t,o){let{rel:d,href:u,target:i,autoFocus:p,focusDisabled:a,preventFocusOnPress:R,isDisabled:e=!1,type:l="button",as:c=k,elementType:n=c||k,onClick:m,onPress:B,onPressStart:P,onPressEnd:b,onPressUp:f,onPressChange:w}=t,y;n===r.Button?y={type:l,disabled:e}:y={role:"button",href:n===r.A&&!e?u:void 0,target:n===r.A?i:void 0,type:n===r.Input?l:void 0,disabled:n===r.Input?e:void 0,"aria-disabled":!e||n===r.Input?void 0:e,rel:n===r.A?d:void 0};let{hoverProps:H,isHovered:M}=_({...t,isDisabled:e}),{focusProps:S,isFocused:U,isFocusVisible:v}=j({autoFocus:p}),{focusableProps:T}=V(t,o),{pressProps:I,isPressed:N}=h({ref:o,isDisabled:e,preventFocusOnPress:R,onPressStart:P,onPressEnd:b,onPressChange:w,onPress:B,onPressUp:f,onClick:m});a&&(T.tabIndex=e?-1:T.tabIndex);let D=C(T,I,H,S,G(t,{allowLabelableProps:!0,allowedLabelableProps:new Set([]),allowedLinkProps:new Set(W),extraAllowedProps:new Set(X)}));return{isFocused:U,isPressed:N,isHovered:M,isDisabled:e,isFocusVisible:v,elementType:n,buttonProps:C(D,y)}}import{createContext as $}from"react";var s=$(null);import{useContext as q}from"react";function F(){return q(s)}import{kebabCase as O}from"@necto/strings";import{mergeProps as z}from"@necto/mergers";import{forwardRef as L,useMemo as J}from"react";import{buildInternalIdentifier as K}from"shared";import{Primitive as Q}from"@necto-react/components";import{useContextProps as Y,useRenderer as Z,useId as tt}from"@necto-react/hooks";import{jsxs as et}from"react/jsx-runtime";var g="Button";function A(t,o){[t,o]=Y({props:t,ref:o,context:s});let{buttonProps:d,isHovered:u,isPressed:i,isFocused:p,isDisabled:a,elementType:R,isFocusVisible:e}=x(t,o),l=tt({defaultId:d.id}),c=Z({...t,values:{isHovered:u,isPressed:i,isFocused:p,isFocusVisible:e,isDisabled:a},defaultClassName:K({component:g}),style:m=>({...t.style instanceof Function?t.style(m):t.style})}),n=J(()=>{let m={hover:u,focus:p,focusVisible:e,disabled:a,pressed:i},B={},P=[];for(let[b,f]of Object.entries(m))typeof f=="boolean"&&(B[`data-${O(b)}`]=f?String(!0):void 0,f&&P.push(O(b)));return{...B,"data-sprocket-state":P.join(" ")}},[u,p,e,a,i]);return et(Q,{ref:o,as:R,...c,...z(d,n),id:l,slot:t.slot||void 0,children:["''",c.children]})}var E=Object.assign(L((t,o)=>A(t,o)),{Root:L((t,o)=>A(t,o))});E.displayName=g;export{E as Button,s as ButtonContext,E as SprocketButton,s as SprocketButtonContext,x as useButton,F as useButtonContext,x as useSprocketButton,F as useSprocketButtonContext};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprocketui-react/button",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Sprocket's standalone React button component.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -15,24 +15,18 @@
15
15
  "engines": {
16
16
  "node": ">=10"
17
17
  },
18
- "scripts": {
19
- "build": "tsup",
20
- "test": "vitest",
21
- "dev": "tsup --watch"
22
- },
23
18
  "dependencies": {
24
- "@necto-react/components": "workspace:*",
25
- "@necto-react/helpers": "workspace:*",
26
- "@necto-react/hooks": "workspace:*",
27
- "@necto-react/types": "workspace:*",
28
- "@necto/constants": "workspace:*",
29
- "@necto/dom": "workspace:*",
30
- "@necto/mergers": "workspace:*",
31
- "@necto/strings": "^1.1.0",
19
+ "@necto-react/components": "^1.2.14",
20
+ "@necto-react/helpers": "^2.4.5",
21
+ "@necto-react/hooks": "^2.12.5",
22
+ "@necto-react/types": "^2.3.0",
23
+ "@necto/dom": "^1.4.5",
24
+ "@necto/mergers": "^1.4.0",
25
+ "@necto/strings": "^1.4.0",
32
26
  "@react-aria/focus": "^3.20.2",
33
- "@sprocketui-types/button": "workspace:*",
34
27
  "react-aria": "^3.39.0",
35
- "shared": "workspace:*"
28
+ "@sprocketui-types/button": "1.0.1",
29
+ "shared": "1.0.0"
36
30
  },
37
31
  "peerDependencies": {
38
32
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
@@ -48,5 +42,10 @@
48
42
  "react-dom": "^19.1.0",
49
43
  "tsup": "^8.4.0",
50
44
  "vitest": "^3.2.4"
45
+ },
46
+ "scripts": {
47
+ "build": "tsup",
48
+ "test": "vitest",
49
+ "dev": "tsup --watch"
51
50
  }
52
- }
51
+ }
@@ -1 +0,0 @@
1
- "use strict";var O=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var Z=(t,e)=>{for(var r in e)O(t,r,{get:e[r],enumerable:!0})},tt=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Q(e))!Y.call(t,n)&&n!==r&&O(t,n,{get:()=>e[n],enumerable:!(i=K(e,n))||i.enumerable});return t};var et=t=>tt(O({},"__esModule",{value:!0}),t);var ot={};Z(ot,{Button:()=>C,ButtonContext:()=>p,SprocketButton:()=>C,SprocketButtonContext:()=>p,useButton:()=>B,useButtonContext:()=>w,useSprocketButton:()=>B,useSprocketButtonContext:()=>w});module.exports=et(ot);var a=require("@necto-react/hooks"),u=require("@necto/dom"),g=require("@necto/mergers"),S=require("@necto-react/helpers"),E=require("shared"),L=u.HTMLElements.Button;function B(t,e){let{rel:r,href:i,target:n,autoFocus:m,focusDisabled:d,preventFocusOnPress:k,isDisabled:o=!1,type:b=L,as:x=L,elementType:s=x||L,onClick:l,onPress:y,onPressStart:T,onPressEnd:R,onPressUp:c,onPressChange:j}=t,A;s===u.HTMLElements.Button?A={type:b,disabled:o}:A={role:"button",href:s===u.HTMLElements.A&&!o?i:void 0,target:s===u.HTMLElements.A?n:void 0,type:s===u.HTMLElements.Input?b:void 0,disabled:s===u.HTMLElements.Input?o:void 0,"aria-disabled":!o||s===u.HTMLElements.Input?void 0:o,rel:s===u.HTMLElements.A?r:void 0};let{hoverProps:V,isHovered:G}=(0,a.useHover)({...t,isDisabled:o}),{focusProps:W,isFocused:X,isFocusVisible:$}=(0,a.useFocusRing)({autoFocus:m}),{focusableProps:F}=(0,a.useFocusable)(t,e),{pressProps:q,isPressed:z}=(0,a.usePress)({ref:e,isDisabled:o,preventFocusOnPress:k,onPressStart:T,onPressEnd:R,onPressChange:j,onPress:y,onPressUp:c,onClick:l});d&&(F.tabIndex=o?-1:F.tabIndex);let J=(0,g.mergeProps)(F,q,V,W,(0,S.filterDOMProps)(t,{allowLabelableProps:!0,allowedLabelableProps:new Set([]),allowedLinkProps:new Set(E.ANCHOR_ELEMENT_PROPS),extraAllowedProps:new Set(E.ALLOWED_EXTERNAL_PROPS)}));return{isFocused:X,isPressed:z,isHovered:G,isDisabled:o,isFocusVisible:$,elementType:s,buttonProps:(0,g.mergeProps)(J,A)}}var M=require("react"),p=(0,M.createContext)(null);var U=require("react");function w(){return(0,U.useContext)(p)}var H=require("@necto/strings"),I=require("@necto/mergers"),P=require("react"),N=require("shared"),D=require("@necto-react/components");var f=require("@necto-react/hooks"),h=require("react/jsx-runtime"),_="Button";function v(t,e){[t,e]=(0,f.useContextProps)({props:t,ref:e,context:p});let{buttonProps:r,isHovered:i,isPressed:n,isFocused:m,isDisabled:d,elementType:k,isFocusVisible:o}=B(t,e),b=(0,f.useId)({defaultId:r.id}),x=(0,f.useRenderer)({...t,values:{isHovered:i,isPressed:n,isFocused:m,isFocusVisible:o,isDisabled:d},defaultClassName:(0,N.buildInternalIdentifier)({component:_}),style:l=>({...t.style instanceof Function?t.style(l):t.style})}),s=(0,P.useMemo)(()=>{let l={hover:i,focus:m,focusVisible:o,disabled:d,pressed:n},y={},T=[];for(let[R,c]of Object.entries(l))typeof c=="boolean"&&(y[`data-${(0,H.kebabCase)(R)}`]=c?"true":void 0,c&&T.push((0,H.kebabCase)(R)));return{...y,"data-sprocket-state":T.join(" ")}},[i,m,o,d,n]);return(0,h.jsx)(D.Primitive,{ref:e,as:k,...x,...(0,I.mergeProps)(r,s),id:b,slot:t.slot||void 0,children:x.children})}var C=Object.assign((0,P.forwardRef)((t,e)=>v(t,e)),{Root:(0,P.forwardRef)((t,e)=>v(t,e))});C.displayName=_;0&&(module.exports={Button,ButtonContext,SprocketButton,SprocketButtonContext,useButton,useButtonContext,useSprocketButton,useSprocketButtonContext});
@@ -1,18 +0,0 @@
1
- "use strict";(()=>{var qn=Object.create;var Jt=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var Xn=Object.getOwnPropertyNames;var Zn=Object.getPrototypeOf,Jn=Object.prototype.hasOwnProperty;var Re=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var eo=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of Xn(r))!Jn.call(e,u)&&u!==n&&Jt(e,u,{get:()=>r[u],enumerable:!(o=Qn(r,u))||o.enumerable});return e};var L=(e,r,n)=>(n=e!=null?qn(Zn(e)):{},eo(r||!e||!e.__esModule?Jt(n,"default",{value:e,enumerable:!0}):n,e));var fr=Re(_=>{"use strict";var Tt=Symbol.for("react.transitional.element"),to=Symbol.for("react.portal"),ro=Symbol.for("react.fragment"),no=Symbol.for("react.strict_mode"),oo=Symbol.for("react.profiler"),so=Symbol.for("react.consumer"),uo=Symbol.for("react.context"),ao=Symbol.for("react.forward_ref"),io=Symbol.for("react.suspense"),co=Symbol.for("react.memo"),sr=Symbol.for("react.lazy"),er=Symbol.iterator;function lo(e){return e===null||typeof e!="object"?null:(e=er&&e[er]||e["@@iterator"],typeof e=="function"?e:null)}var ur={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ar=Object.assign,ir={};function Le(e,r,n){this.props=e,this.context=r,this.refs=ir,this.updater=n||ur}Le.prototype.isReactComponent={};Le.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")};Le.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function cr(){}cr.prototype=Le.prototype;function ht(e,r,n){this.props=e,this.context=r,this.refs=ir,this.updater=n||ur}var bt=ht.prototype=new cr;bt.constructor=ht;ar(bt,Le.prototype);bt.isPureReactComponent=!0;var tr=Array.isArray,B={H:null,A:null,T:null,S:null,V:null},lr=Object.prototype.hasOwnProperty;function _t(e,r,n,o,u,i){return n=i.ref,{$$typeof:Tt,type:e,key:r,ref:n!==void 0?n:null,props:i}}function fo(e,r){return _t(e.type,r,void 0,void 0,void 0,e.props)}function Rt(e){return typeof e=="object"&&e!==null&&e.$$typeof===Tt}function po(e){var r={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return r[n]})}var rr=/\/+/g;function gt(e,r){return typeof e=="object"&&e!==null&&e.key!=null?po(""+e.key):r.toString(36)}function nr(){}function mo(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(nr,nr):(e.status="pending",e.then(function(r){e.status==="pending"&&(e.status="fulfilled",e.value=r)},function(r){e.status==="pending"&&(e.status="rejected",e.reason=r)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Pe(e,r,n,o,u){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var c=!1;if(e===null)c=!0;else switch(i){case"bigint":case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case Tt:case to:c=!0;break;case sr:return c=e._init,Pe(c(e._payload),r,n,o,u)}}if(c)return u=u(e),c=o===""?"."+gt(e,0):o,tr(u)?(n="",c!=null&&(n=c.replace(rr,"$&/")+"/"),Pe(u,r,n,"",function(E){return E})):u!=null&&(Rt(u)&&(u=fo(u,n+(u.key==null||e&&e.key===u.key?"":(""+u.key).replace(rr,"$&/")+"/")+c)),r.push(u)),1;c=0;var f=o===""?".":o+":";if(tr(e))for(var a=0;a<e.length;a++)o=e[a],i=f+gt(o,a),c+=Pe(o,r,n,i,u);else if(a=lo(e),typeof a=="function")for(e=a.call(e),a=0;!(o=e.next()).done;)o=o.value,i=f+gt(o,a++),c+=Pe(o,r,n,i,u);else if(i==="object"){if(typeof e.then=="function")return Pe(mo(e),r,n,o,u);throw r=String(e),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return c}function Qe(e,r,n){if(e==null)return e;var o=[],u=0;return Pe(e,o,"","",function(i){return r.call(n,i,u++)}),o}function Eo(e){if(e._status===-1){var r=e._result;r=r(),r.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=r)}if(e._status===1)return e._result.default;throw e._result}var or=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function vo(){}_.Children={map:Qe,forEach:function(e,r,n){Qe(e,function(){r.apply(this,arguments)},n)},count:function(e){var r=0;return Qe(e,function(){r++}),r},toArray:function(e){return Qe(e,function(r){return r})||[]},only:function(e){if(!Rt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};_.Component=Le;_.Fragment=ro;_.Profiler=oo;_.PureComponent=ht;_.StrictMode=no;_.Suspense=io;_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B;_.__COMPILER_RUNTIME={__proto__:null,c:function(e){return B.H.useMemoCache(e)}};_.cache=function(e){return function(){return e.apply(null,arguments)}};_.cloneElement=function(e,r,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=ar({},e.props),u=e.key,i=void 0;if(r!=null)for(c in r.ref!==void 0&&(i=void 0),r.key!==void 0&&(u=""+r.key),r)!lr.call(r,c)||c==="key"||c==="__self"||c==="__source"||c==="ref"&&r.ref===void 0||(o[c]=r[c]);var c=arguments.length-2;if(c===1)o.children=n;else if(1<c){for(var f=Array(c),a=0;a<c;a++)f[a]=arguments[a+2];o.children=f}return _t(e.type,u,void 0,void 0,i,o)};_.createContext=function(e){return e={$$typeof:uo,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:so,_context:e},e};_.createElement=function(e,r,n){var o,u={},i=null;if(r!=null)for(o in r.key!==void 0&&(i=""+r.key),r)lr.call(r,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(u[o]=r[o]);var c=arguments.length-2;if(c===1)u.children=n;else if(1<c){for(var f=Array(c),a=0;a<c;a++)f[a]=arguments[a+2];u.children=f}if(e&&e.defaultProps)for(o in c=e.defaultProps,c)u[o]===void 0&&(u[o]=c[o]);return _t(e,i,void 0,void 0,null,u)};_.createRef=function(){return{current:null}};_.forwardRef=function(e){return{$$typeof:ao,render:e}};_.isValidElement=Rt;_.lazy=function(e){return{$$typeof:sr,_payload:{_status:-1,_result:e},_init:Eo}};_.memo=function(e,r){return{$$typeof:co,type:e,compare:r===void 0?null:r}};_.startTransition=function(e){var r=B.T,n={};B.T=n;try{var o=e(),u=B.S;u!==null&&u(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(vo,or)}catch(i){or(i)}finally{B.T=r}};_.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()};_.use=function(e){return B.H.use(e)};_.useActionState=function(e,r,n){return B.H.useActionState(e,r,n)};_.useCallback=function(e,r){return B.H.useCallback(e,r)};_.useContext=function(e){return B.H.useContext(e)};_.useDebugValue=function(){};_.useDeferredValue=function(e,r){return B.H.useDeferredValue(e,r)};_.useEffect=function(e,r,n){var o=B.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return o.useEffect(e,r)};_.useId=function(){return B.H.useId()};_.useImperativeHandle=function(e,r,n){return B.H.useImperativeHandle(e,r,n)};_.useInsertionEffect=function(e,r){return B.H.useInsertionEffect(e,r)};_.useLayoutEffect=function(e,r){return B.H.useLayoutEffect(e,r)};_.useMemo=function(e,r){return B.H.useMemo(e,r)};_.useOptimistic=function(e,r){return B.H.useOptimistic(e,r)};_.useReducer=function(e,r,n){return B.H.useReducer(e,r,n)};_.useRef=function(e){return B.H.useRef(e)};_.useState=function(e){return B.H.useState(e)};_.useSyncExternalStore=function(e,r,n){return B.H.useSyncExternalStore(e,r,n)};_.useTransition=function(){return B.H.useTransition()};_.version="19.1.0"});var dr=Re((b,Xe)=>{"use strict";process.env.NODE_ENV!=="production"&&function(){function e(t,s){Object.defineProperty(o.prototype,t,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",s[0],s[1])}})}function r(t){return t===null||typeof t!="object"?null:(t=ae&&t[ae]||t["@@iterator"],typeof t=="function"?t:null)}function n(t,s){t=(t=t.constructor)&&(t.displayName||t.name)||"ReactClass";var d=t+"."+s;Se[d]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",s,t),Se[d]=!0)}function o(t,s,d){this.props=t,this.context=s,this.refs=vt,this.updater=d||$e}function u(){}function i(t,s,d){this.props=t,this.context=s,this.refs=vt,this.updater=d||$e}function c(t){return""+t}function f(t){try{c(t);var s=!1}catch{s=!0}if(s){s=console;var d=s.error,m=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return d.call(s,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",m),c(t)}}function a(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===$n?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ae:return"Fragment";case l:return"Profiler";case xe:return"StrictMode";case ee:return"Suspense";case q:return"SuspenseList";case F:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case De:return"Portal";case D:return(t.displayName||"Context")+".Provider";case h:return(t._context.displayName||"Context")+".Consumer";case H:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case _e:return s=t.displayName||null,s!==null?s:a(t.type)||"Memo";case de:s=t._payload,t=t._init;try{return a(t(s))}catch{}}return null}function E(t){if(t===Ae)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===de)return"<...>";try{var s=a(t);return s?"<"+s+">":"<...>"}catch{return"<...>"}}function S(){var t=C.A;return t===null?null:t.getOwner()}function y(){return Error("react-stack-top-frame")}function O(t){if(Ve.call(t,"key")){var s=Object.getOwnPropertyDescriptor(t,"key").get;if(s&&s.isReactWarning)return!1}return t.key!==void 0}function P(t,s){function d(){Gt||(Gt=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",s))}d.isReactWarning=!0,Object.defineProperty(t,"key",{get:d,configurable:!0})}function N(){var t=a(this.type);return Kt[t]||(Kt[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function T(t,s,d,m,g,A,R,k){return d=A.ref,t={$$typeof:oe,type:t,key:s,props:A,_owner:g},(d!==void 0?d:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:N}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:R}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:k}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function v(t,s){return s=T(t.type,s,void 0,void 0,t._owner,t.props,t._debugStack,t._debugTask),t._store&&(s._store.validated=t._store.validated),s}function j(t){return typeof t=="object"&&t!==null&&t.$$typeof===oe}function re(t){var s={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(d){return s[d]})}function ne(t,s){return typeof t=="object"&&t!==null&&t.key!=null?(f(t.key),re(""+t.key)):s.toString(36)}function ue(){}function ce(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(ue,ue):(t.status="pending",t.then(function(s){t.status==="pending"&&(t.status="fulfilled",t.value=s)},function(s){t.status==="pending"&&(t.status="rejected",t.reason=s)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Y(t,s,d,m,g){var A=typeof t;(A==="undefined"||A==="boolean")&&(t=null);var R=!1;if(t===null)R=!0;else switch(A){case"bigint":case"string":case"number":R=!0;break;case"object":switch(t.$$typeof){case oe:case De:R=!0;break;case de:return R=t._init,Y(R(t._payload),s,d,m,g)}}if(R){R=t,g=g(R);var k=m===""?"."+ne(R,0):m;return Yt(g)?(d="",k!=null&&(d=k.replace(qt,"$&/")+"/"),Y(g,s,d,"",function(pe){return pe})):g!=null&&(j(g)&&(g.key!=null&&(R&&R.key===g.key||f(g.key)),d=v(g,d+(g.key==null||R&&R.key===g.key?"":(""+g.key).replace(qt,"$&/")+"/")+k),m!==""&&R!=null&&j(R)&&R.key==null&&R._store&&!R._store.validated&&(d._store.validated=2),g=d),s.push(g)),1}if(R=0,k=m===""?".":m+":",Yt(t))for(var w=0;w<t.length;w++)m=t[w],A=k+ne(m,w),R+=Y(m,s,d,A,g);else if(w=r(t),typeof w=="function")for(w===t.entries&&(zt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),zt=!0),t=w.call(t),w=0;!(m=t.next()).done;)m=m.value,A=k+ne(m,w++),R+=Y(m,s,d,A,g);else if(A==="object"){if(typeof t.then=="function")return Y(ce(t),s,d,m,g);throw s=String(t),Error("Objects are not valid as a React child (found: "+(s==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":s)+"). If you meant to render a collection of children, use an array instead.")}return R}function K(t,s,d){if(t==null)return t;var m=[],g=0;return Y(t,m,"","",function(A){return s.call(d,A,g++)}),m}function Z(t){if(t._status===-1){var s=t._result;s=s(),s.then(function(d){(t._status===0||t._status===-1)&&(t._status=1,t._result=d)},function(d){(t._status===0||t._status===-1)&&(t._status=2,t._result=d)}),t._status===-1&&(t._status=0,t._result=s)}if(t._status===1)return s=t._result,s===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
2
-
3
- Your code should look like:
4
- const MyComponent = lazy(() => import('./MyComponent'))
5
-
6
- Did you accidentally put curly braces around the import?`,s),"default"in s||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
7
-
8
- Your code should look like:
9
- const MyComponent = lazy(() => import('./MyComponent'))`,s),s.default;throw t._result}function M(){var t=C.H;return t===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
10
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
11
- 2. You might be breaking the Rules of Hooks
12
- 3. You might have more than one copy of React in the same app
13
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t}function le(){}function z(t){if(Ke===null)try{var s=("require"+Math.random()).slice(0,7);Ke=(Xe&&Xe[s]).call(Xe,"timers").setImmediate}catch{Ke=function(m){Xt===!1&&(Xt=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var g=new MessageChannel;g.port1.onmessage=m,g.port2.postMessage(void 0)}}return Ke(t)}function J(t){return 1<t.length&&typeof AggregateError=="function"?new AggregateError(t):t[0]}function fe(t,s){s!==ze-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),ze=s}function p(t,s,d){var m=C.actQueue;if(m!==null)if(m.length!==0)try{U(m),z(function(){return p(t,s,d)});return}catch(g){C.thrownErrors.push(g)}else C.actQueue=null;0<C.thrownErrors.length?(m=J(C.thrownErrors),C.thrownErrors.length=0,d(m)):s(t)}function U(t){if(!yt){yt=!0;var s=0;try{for(;s<t.length;s++){var d=t[s];do{C.didUsePromise=!1;var m=d(!1);if(m!==null){if(C.didUsePromise){t[s]=d,t.splice(0,s);return}d=m}else break}while(!0)}t.length=0}catch(g){t.splice(0,s+1),C.thrownErrors.push(g)}finally{yt=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var oe=Symbol.for("react.transitional.element"),De=Symbol.for("react.portal"),Ae=Symbol.for("react.fragment"),xe=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler");Symbol.for("react.provider");var h=Symbol.for("react.consumer"),D=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),_e=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),ae=Symbol.iterator,Se={},$e={isMounted:function(){return!1},enqueueForceUpdate:function(t){n(t,"forceUpdate")},enqueueReplaceState:function(t){n(t,"replaceState")},enqueueSetState:function(t){n(t,"setState")}},Wt=Object.assign,vt={};Object.freeze(vt),o.prototype.isReactComponent={},o.prototype.setState=function(t,s){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,s,"setState")},o.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};var Q={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},Ge;for(Ge in Q)Q.hasOwnProperty(Ge)&&e(Ge,Q[Ge]);u.prototype=o.prototype,Q=i.prototype=new u,Q.constructor=i,Wt(Q,o.prototype),Q.isPureReactComponent=!0;var Yt=Array.isArray,$n=Symbol.for("react.client.reference"),C={H:null,A:null,T:null,S:null,V:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},Ve=Object.prototype.hasOwnProperty,$t=console.createTask?console.createTask:function(){return null};Q={"react-stack-bottom-frame":function(t){return t()}};var Gt,Vt,Kt={},Gn=Q["react-stack-bottom-frame"].bind(Q,y)(),Vn=$t(E(y)),zt=!1,qt=/\/+/g,Qt=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Xt=!1,Ke=null,ze=0,qe=!1,yt=!1,Zt=typeof queueMicrotask=="function"?function(t){queueMicrotask(function(){return queueMicrotask(t)})}:z;Q=Object.freeze({__proto__:null,c:function(t){return M().useMemoCache(t)}}),b.Children={map:K,forEach:function(t,s,d){K(t,function(){s.apply(this,arguments)},d)},count:function(t){var s=0;return K(t,function(){s++}),s},toArray:function(t){return K(t,function(s){return s})||[]},only:function(t){if(!j(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},b.Component=o,b.Fragment=Ae,b.Profiler=l,b.PureComponent=i,b.StrictMode=xe,b.Suspense=ee,b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,b.__COMPILER_RUNTIME=Q,b.act=function(t){var s=C.actQueue,d=ze;ze++;var m=C.actQueue=s!==null?s:[],g=!1;try{var A=t()}catch(w){C.thrownErrors.push(w)}if(0<C.thrownErrors.length)throw fe(s,d),t=J(C.thrownErrors),C.thrownErrors.length=0,t;if(A!==null&&typeof A=="object"&&typeof A.then=="function"){var R=A;return Zt(function(){g||qe||(qe=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(w,pe){g=!0,R.then(function(Oe){if(fe(s,d),d===0){try{U(m),z(function(){return p(Oe,w,pe)})}catch(zn){C.thrownErrors.push(zn)}if(0<C.thrownErrors.length){var Kn=J(C.thrownErrors);C.thrownErrors.length=0,pe(Kn)}}else w(Oe)},function(Oe){fe(s,d),0<C.thrownErrors.length&&(Oe=J(C.thrownErrors),C.thrownErrors.length=0),pe(Oe)})}}}var k=A;if(fe(s,d),d===0&&(U(m),m.length!==0&&Zt(function(){g||qe||(qe=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),C.actQueue=null),0<C.thrownErrors.length)throw t=J(C.thrownErrors),C.thrownErrors.length=0,t;return{then:function(w,pe){g=!0,d===0?(C.actQueue=m,z(function(){return p(k,w,pe)})):w(k)}}},b.cache=function(t){return function(){return t.apply(null,arguments)}},b.captureOwnerStack=function(){var t=C.getCurrentStack;return t===null?null:t()},b.cloneElement=function(t,s,d){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var m=Wt({},t.props),g=t.key,A=t._owner;if(s!=null){var R;e:{if(Ve.call(s,"ref")&&(R=Object.getOwnPropertyDescriptor(s,"ref").get)&&R.isReactWarning){R=!1;break e}R=s.ref!==void 0}R&&(A=S()),O(s)&&(f(s.key),g=""+s.key);for(k in s)!Ve.call(s,k)||k==="key"||k==="__self"||k==="__source"||k==="ref"&&s.ref===void 0||(m[k]=s[k])}var k=arguments.length-2;if(k===1)m.children=d;else if(1<k){R=Array(k);for(var w=0;w<k;w++)R[w]=arguments[w+2];m.children=R}for(m=T(t.type,g,void 0,void 0,A,m,t._debugStack,t._debugTask),g=2;g<arguments.length;g++)A=arguments[g],j(A)&&A._store&&(A._store.validated=1);return m},b.createContext=function(t){return t={$$typeof:D,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:h,_context:t},t._currentRenderer=null,t._currentRenderer2=null,t},b.createElement=function(t,s,d){for(var m=2;m<arguments.length;m++){var g=arguments[m];j(g)&&g._store&&(g._store.validated=1)}if(m={},g=null,s!=null)for(w in Vt||!("__self"in s)||"key"in s||(Vt=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),O(s)&&(f(s.key),g=""+s.key),s)Ve.call(s,w)&&w!=="key"&&w!=="__self"&&w!=="__source"&&(m[w]=s[w]);var A=arguments.length-2;if(A===1)m.children=d;else if(1<A){for(var R=Array(A),k=0;k<A;k++)R[k]=arguments[k+2];Object.freeze&&Object.freeze(R),m.children=R}if(t&&t.defaultProps)for(w in A=t.defaultProps,A)m[w]===void 0&&(m[w]=A[w]);g&&P(m,typeof t=="function"?t.displayName||t.name||"Unknown":t);var w=1e4>C.recentlyCreatedOwnerStacks++;return T(t,g,void 0,void 0,S(),m,w?Error("react-stack-top-frame"):Gn,w?$t(E(t)):Vn)},b.createRef=function(){var t={current:null};return Object.seal(t),t},b.forwardRef=function(t){t!=null&&t.$$typeof===_e?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof t!="function"?console.error("forwardRef requires a render function but was given %s.",t===null?"null":typeof t):t.length!==0&&t.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",t.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),t!=null&&t.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var s={$$typeof:H,render:t},d;return Object.defineProperty(s,"displayName",{enumerable:!1,configurable:!0,get:function(){return d},set:function(m){d=m,t.name||t.displayName||(Object.defineProperty(t,"name",{value:m}),t.displayName=m)}}),s},b.isValidElement=j,b.lazy=function(t){return{$$typeof:de,_payload:{_status:-1,_result:t},_init:Z}},b.memo=function(t,s){t==null&&console.error("memo: The first argument must be a component. Instead received: %s",t===null?"null":typeof t),s={$$typeof:_e,type:t,compare:s===void 0?null:s};var d;return Object.defineProperty(s,"displayName",{enumerable:!1,configurable:!0,get:function(){return d},set:function(m){d=m,t.name||t.displayName||(Object.defineProperty(t,"name",{value:m}),t.displayName=m)}}),s},b.startTransition=function(t){var s=C.T,d={};C.T=d,d._updatedFibers=new Set;try{var m=t(),g=C.S;g!==null&&g(d,m),typeof m=="object"&&m!==null&&typeof m.then=="function"&&m.then(le,Qt)}catch(A){Qt(A)}finally{s===null&&d._updatedFibers&&(t=d._updatedFibers.size,d._updatedFibers.clear(),10<t&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),C.T=s}},b.unstable_useCacheRefresh=function(){return M().useCacheRefresh()},b.use=function(t){return M().use(t)},b.useActionState=function(t,s,d){return M().useActionState(t,s,d)},b.useCallback=function(t,s){return M().useCallback(t,s)},b.useContext=function(t){var s=M();return t.$$typeof===h&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),s.useContext(t)},b.useDebugValue=function(t,s){return M().useDebugValue(t,s)},b.useDeferredValue=function(t,s){return M().useDeferredValue(t,s)},b.useEffect=function(t,s,d){t==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");var m=M();if(typeof d=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return m.useEffect(t,s)},b.useId=function(){return M().useId()},b.useImperativeHandle=function(t,s,d){return M().useImperativeHandle(t,s,d)},b.useInsertionEffect=function(t,s){return t==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useInsertionEffect(t,s)},b.useLayoutEffect=function(t,s){return t==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),M().useLayoutEffect(t,s)},b.useMemo=function(t,s){return M().useMemo(t,s)},b.useOptimistic=function(t,s){return M().useOptimistic(t,s)},b.useReducer=function(t,s,d){return M().useReducer(t,s,d)},b.useRef=function(t){return M().useRef(t)},b.useState=function(t){return M().useState(t)},b.useSyncExternalStore=function(t,s,d){return M().useSyncExternalStore(t,s,d)},b.useTransition=function(){return M().useTransition()},b.version="19.1.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()});var I=Re((Ls,wt)=>{"use strict";process.env.NODE_ENV==="production"?wt.exports=fr():wt.exports=dr()});var At=Re((ks,Er)=>{"use strict";var Ct=Object.defineProperty,yo=Object.getOwnPropertyDescriptor,go=Object.getOwnPropertyNames,To=Object.prototype.hasOwnProperty,ho=(e,r)=>{for(var n in r)Ct(e,n,{get:r[n],enumerable:!0})},bo=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of go(r))!To.call(e,u)&&u!==n&&Ct(e,u,{get:()=>r[u],enumerable:!(o=yo(r,u))||o.enumerable});return e},_o=e=>bo(Ct({},"__esModule",{value:!0}),e),pr={};ho(pr,{DisabledContext:()=>mr,DisabledProvider:()=>Co,FocusableContext:()=>So});Er.exports=_o(pr);var Ro=I(),mr=(0,Ro.createContext)(new Object),wo=I();function Co({value:e,children:r}){return(0,wo.createElement)(mr.Provider,{value:e||new Object},r)}var Ao=I(),So=(0,Ao.createContext)(null)});var xn=Re(pt=>{"use strict";var Cs=Symbol.for("react.transitional.element"),As=Symbol.for("react.fragment");function Dn(e,r,n){var o=null;if(n!==void 0&&(o=""+n),r.key!==void 0&&(o=""+r.key),"key"in r){n={};for(var u in r)u!=="key"&&(n[u]=r[u])}else n=r;return r=n.ref,{$$typeof:Cs,type:e,key:o,ref:r!==void 0?r:null,props:n}}pt.Fragment=As;pt.jsx=Dn;pt.jsxs=Dn});var Bn=Re(mt=>{"use strict";process.env.NODE_ENV!=="production"&&function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===le?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case T:return"Fragment";case j:return"Profiler";case v:return"StrictMode";case ce:return"Suspense";case Y:return"SuspenseList";case M:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case N:return"Portal";case ne:return(l.displayName||"Context")+".Provider";case re:return(l._context.displayName||"Context")+".Consumer";case ue:var h=l.render;return l=l.displayName,l||(l=h.displayName||h.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case K:return h=l.displayName||null,h!==null?h:e(l.type)||"Memo";case Z:h=l._payload,l=l._init;try{return e(l(h))}catch{}}return null}function r(l){return""+l}function n(l){try{r(l);var h=!1}catch{h=!0}if(h){h=console;var D=h.error,H=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return D.call(h,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),r(l)}}function o(l){if(l===T)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===Z)return"<...>";try{var h=e(l);return h?"<"+h+">":"<...>"}catch{return"<...>"}}function u(){var l=z.A;return l===null?null:l.getOwner()}function i(){return Error("react-stack-top-frame")}function c(l){if(J.call(l,"key")){var h=Object.getOwnPropertyDescriptor(l,"key").get;if(h&&h.isReactWarning)return!1}return l.key!==void 0}function f(l,h){function D(){U||(U=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",h))}D.isReactWarning=!0,Object.defineProperty(l,"key",{get:D,configurable:!0})}function a(){var l=e(this.type);return oe[l]||(oe[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function E(l,h,D,H,ee,q,_e,de){return D=q.ref,l={$$typeof:P,type:l,key:h,props:q,_owner:ee},(D!==void 0?D:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:a}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:_e}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:de}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function S(l,h,D,H,ee,q,_e,de){var F=h.children;if(F!==void 0)if(H)if(fe(F)){for(H=0;H<F.length;H++)y(F[H]);Object.freeze&&Object.freeze(F)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(F);if(J.call(h,"key")){F=e(l);var ae=Object.keys(h).filter(function($e){return $e!=="key"});H=0<ae.length?"{key: someKey, "+ae.join(": ..., ")+": ...}":"{key: someKey}",xe[F+H]||(ae=0<ae.length?"{"+ae.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
14
- let props = %s;
15
- <%s {...props} />
16
- React keys must be passed directly to JSX without using spread:
17
- let props = %s;
18
- <%s key={someKey} {...props} />`,H,F,ae,F),xe[F+H]=!0)}if(F=null,D!==void 0&&(n(D),F=""+D),c(h)&&(n(h.key),F=""+h.key),"key"in h){D={};for(var Se in h)Se!=="key"&&(D[Se]=h[Se])}else D=h;return F&&f(D,typeof l=="function"?l.displayName||l.name||"Unknown":l),E(l,F,q,ee,u(),D,_e,de)}function y(l){typeof l=="object"&&l!==null&&l.$$typeof===P&&l._store&&(l._store.validated=1)}var O=I(),P=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler");Symbol.for("react.provider");var re=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),le=Symbol.for("react.client.reference"),z=O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=Object.prototype.hasOwnProperty,fe=Array.isArray,p=console.createTask?console.createTask:function(){return null};O={"react-stack-bottom-frame":function(l){return l()}};var U,oe={},De=O["react-stack-bottom-frame"].bind(O,i)(),Ae=p(o(i)),xe={};mt.Fragment=T,mt.jsx=function(l,h,D,H,ee){var q=1e4>z.recentlyCreatedOwnerStacks++;return S(l,h,D,!1,H,ee,q?Error("react-stack-top-frame"):De,q?p(o(l)):Ae)},mt.jsxs=function(l,h,D,H,ee){var q=1e4>z.recentlyCreatedOwnerStacks++;return S(l,h,D,!0,H,ee,q?Error("react-stack-top-frame"):De,q?p(o(l)):Ae)}}()});var Et=Re((Mu,Ht)=>{"use strict";process.env.NODE_ENV==="production"?Ht.exports=xn():Ht.exports=Bn()});var it=L(I(),1);function se(...e){if(e.length===0)return{};if(e.length===1)return typeof e[0]=="object"&&e[0]!==null?e[0]:{};let r={},n={};for(let o of e)if(!(typeof o!="object"||o===null)){for(let u in o)if(Object.hasOwn(o,u)){if(u==="children")continue;let i=o[u];u.startsWith("on")&&typeof i=="function"?(n[u]??=[],n[u].push(i)):r[u]=i}}for(let o in n)Object.hasOwn(n,o)&&n[o].length>0&&(r[o]=(...u)=>{for(let i of n[o])i?.(...u)});for(let o=e.length-1;o>=0;o--){let u=e[o];if(typeof u=="object"&&u!==null&&"children"in u){r.children=u.children;break}}return r}var ls=L(I(),1),fs=L(At(),1),ds=L(I(),1),ct=L(I(),1),ut=L(I(),1);var Oo=Object.defineProperty,Ze=(e,r)=>{for(var n in r)Oo(e,n,{get:r[n],enumerable:!0})},Be={};Ze(Be,{HTML_TAGS:()=>yr,PRIMITIVE_TAGS:()=>vr,default:()=>Po});var vr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yr=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],Po={PRIMITIVE_TAGS:vr,HTML_TAGS:yr},Lo={};Ze(Lo,{NUMERIC_DIGITS:()=>gr,default:()=>Io});var gr=["1","2","3","4","5","6","7","8","9","0"],Io={NUMERIC_DIGITS:gr},ko={};Ze(ko,{AMPERSAND:()=>Or,ASTERISK:()=>Lr,BACKSLASH:()=>Fr,BOM:()=>Tr,CARRIAGE_RETURN:()=>_r,COLON:()=>Dr,COMMA:()=>kr,COMMERCIAL_AT:()=>Ur,DOT:()=>Mr,DOUBLE_QUOTE:()=>Cr,EXCLAMATION:()=>wr,GRAVE_ACCENT:()=>Yr,GREATER_THAN:()=>Br,LEFT_CURLY_BRACKET:()=>$r,LEFT_SQUARE_BRACKET:()=>Hr,LINE_FEED:()=>br,MINUS:()=>Nr,PERCENT:()=>Sr,PLUS:()=>Ir,QUESTION:()=>jr,RIGHT_CURLY_BRACKET:()=>Vr,RIGHT_SQUARE_BRACKET:()=>Wr,SHARP:()=>Ar,SINGLE_QUOTE:()=>Pr,SMALLER_THAN:()=>xr,SPACE:()=>Rr,TAB:()=>hr,VERTICAL_LINE:()=>Gr,default:()=>No});var Tr=65279,hr=9,br=10,_r=13,Rr=32,wr=33,Cr=34,Ar=35,Sr=37,Or=38,Pr=39,Lr=42,Ir=43,kr=44,Nr=45,Mr=46,Dr=58,xr=60,Br=62,jr=63,Ur=64,Hr=91,Fr=92,Wr=93,Yr=96,$r=123,Gr=124,Vr=125,No={BOM:Tr,TAB:hr,LINE_FEED:br,CARRIAGE_RETURN:_r,SPACE:Rr,EXCLAMATION:wr,DOUBLE_QUOTE:Cr,SHARP:Ar,PERCENT:Sr,AMPERSAND:Or,SINGLE_QUOTE:Pr,ASTERISK:Lr,PLUS:Ir,COMMA:kr,MINUS:Nr,DOT:Mr,COLON:Dr,SMALLER_THAN:xr,GREATER_THAN:Br,QUESTION:jr,COMMERCIAL_AT:Ur,LEFT_SQUARE_BRACKET:Hr,BACKSLASH:Fr,RIGHT_SQUARE_BRACKET:Wr,GRAVE_ACCENT:Yr,LEFT_CURLY_BRACKET:$r,VERTICAL_LINE:Gr,RIGHT_CURLY_BRACKET:Vr},Mo={};Ze(Mo,{CAPITALIZED:()=>Kr,LOWERCASE:()=>zr,VOWELS:()=>qr,default:()=>Do});var Kr=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],zr=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],qr=["A","E","I","O","U","a","e","i","o","u"],Do={CAPITALIZED:Kr,LOWERCASE:zr,VOWELS:qr};function xo(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):!1}var Bo=()=>xo(/^Mac/i);function Qr(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):!1}var jo=()=>Qr(/^iPhone/i),Uo=()=>Qr(/^iPad/i)||Bo()&&navigator.maxTouchPoints>1,St=()=>jo()||Uo();function Ho(e){return Fo(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}function Fo(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function et(e,r,n=!0){if(!e||!r)return!1;if(!n)return e.contains(r);let o=r;for(;o;){if(o===e)return!0;o=o instanceof Element&&o.tagName==="SLOT"&&o.assignedSlot?o.assignedSlot.parentNode:Ho(o)?o.host:o.parentNode}return!1}var Ee=(e=document,r=!0)=>{if(!r)return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&n.shadowRoot?.activeElement;)n=n.shadowRoot.activeElement;return n};function tt(e,r=!0){return r&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}var W=e=>e?.ownerDocument??document,ve=e=>e&&"window"in e&&e.window===e?e:W(e).defaultView||window,Je=null;function Wo(){if(Je==null){Je=!1;try{document.createElement("div").focus({get preventScroll(){return Je=!0,!0}})}catch{}}return Je}function Lt(e){if(Wo())e.focus({preventScroll:!0});else{let r=Yo(e);e.focus();for(let{element:n,scrollTop:o,scrollLeft:u}of r)n.scrollTop=o,n.scrollLeft=u}}function Yo(e){let r=e.parentNode,n=Array.from({length:0}),o=document.scrollingElement||document.documentElement;for(;r instanceof HTMLElement&&r!==o;)(r.offsetHeight<r.scrollHeight||r.offsetWidth<r.scrollWidth)&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),r=r.parentNode;return o instanceof HTMLElement&&n.push({element:o,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft}),n}var me=new Map,Ot=new Set;function $o(e){if(!("propertyName"in e)||!e.target)return;let r=me.get(e.target);r||(r=new Set,me.set(e.target,r),e.target.addEventListener("transitioncancel",It,{once:!0})),r.add(e.propertyName)}function It(e){if(!("propertyName"in e)||!e.target)return;let r=me.get(e.target);if(r&&(r.delete(e.propertyName),r.size===0&&(e.target.removeEventListener("transitioncancel",It),me.delete(e.target)),me.size===0)){for(let n of Ot)n();Ot.clear()}}if(typeof window<"u"&&typeof document<"u"){let e=()=>{let r=document.body;r&&(r.addEventListener("transitionrun",$o),r.addEventListener("transitionend",It))};document.readyState!=="loading"?e():document.addEventListener("DOMContentLoaded",e,{once:!0})}function kt(e){requestAnimationFrame(()=>{for(let[r]of me)"isConnected"in r&&!r.isConnected&&me.delete(r);me.size===0?e():Ot.add(e)})}var te=Be.HTML_TAGS.reduce((e,r)=>{var n;return e[n=r,n.charAt(0).toUpperCase()+n.slice(1)]=r,e},{}),Ie="default",Pt="",je=new WeakMap;function rt(e){if(St()){if(Ie==="default"){let r=W(e);r?.documentElement?.style.webkitUserSelect!==void 0&&(Pt=r.documentElement.style.webkitUserSelect,r.documentElement.style.webkitUserSelect="none",Ie="disabled")}}else if(e instanceof HTMLElement||e instanceof SVGElement){let r=e.style,n="userSelect"in r?"userSelect":"webkitUserSelect";je.has(e)||(je.set(e,r[n]??""),r[n]="none")}}function ye(e){if(St()){if(Ie!=="disabled")return;Ie="restoring",setTimeout(()=>{kt(()=>{if(Ie==="restoring"){let r=W(e);r?.documentElement?.style.webkitUserSelect==="none"&&(r.documentElement.style.webkitUserSelect=Pt||""),Pt="",Ie="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&je.has(e)){let r=je.get(e)??"",n=e.style,o="userSelect"in n?"userSelect":"webkitUserSelect";n[o]==="none"&&(n[o]=r),e.getAttribute("style")?.trim()===""&&e.removeAttribute("style"),je.delete(e)}}var ke=L(I(),1),dn=L(At(),1),he=L(I(),1),ms=L(I(),1);var us={},nt=Object.create(null),Ue=e=>globalThis.process?.env||us.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?nt:globalThis),ge=new Proxy(nt,{get(e,r){return Ue()[r]??nt[r]},has(e,r){let n=Ue();return r in n||r in nt},set(e,r,n){let o=Ue(!0);return o[r]=n,!0},deleteProperty(e,r){if(!r)return!1;let n=Ue(!0);return delete n[r],!0},ownKeys(){let e=Ue(!0);return Object.keys(e)}}),Zr=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",Go=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function Vo(){if(globalThis.process?.env)for(let e of Go){let r=e[1]||e[0];if(globalThis.process?.env[r])return{name:e[0].toLowerCase(),...e[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var Jr=Vo(),js=Jr.name;function we(e){return e?e!=="false":!1}var Nt=globalThis.process?.platform||"",en=we(ge.CI)||Jr.ci!==!1,tn=we(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);var Us=we(ge.DEBUG),Ce=Zr==="test"||we(ge.TEST),rn=Zr==="production";var Hs=we(ge.MINIMAL)||en||Ce||!tn,Ko=/^win/i.test(Nt),Fs=/^linux/i.test(Nt),nn=/^darwin/i.test(Nt),Ws=!we(ge.NO_COLOR)&&(we(ge.FORCE_COLOR)||(tn||Ko)&&ge.TERM!=="dumb"||en),zo=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null,Ys=Number(zo?.split(".")[0])||null,qo=globalThis.process||Object.create(null),Xr={versions:{}},$s=new Proxy(qo,{get(e,r){if(r==="env")return ge;if(r in e)return e[r];if(r in Xr)return Xr[r]}}),Qo=globalThis.process?.release?.name==="node",Xo=!!globalThis.Bun||!!globalThis.process?.versions?.bun,Zo=!!globalThis.Deno,Jo=!!globalThis.fastly,es=!!globalThis.Netlify,ts=!!globalThis.EdgeRuntime,rs=globalThis.navigator?.userAgent==="Cloudflare-Workers",ns=[[es,"netlify"],[ts,"edge-light"],[rs,"workerd"],[Jo,"fastly"],[Zo,"deno"],[Xo,"bun"],[Qo,"node"]];function os(){let e=ns.find(r=>r[0]);if(e)return{name:e[1]}}var ss=os(),Gs=ss?.name||"";var En=L(I(),1);var as=new Set(["id"]);function on(e,r){let{allowLabelableProps:n=!1,allowLinkProps:o=!1,extraAllowedProps:u,allowedLabelableProps:i=new Set,allowedLinkProps:c=new Set}=r,f={};for(let a in e)Object.hasOwn(e,a)&&(as.has(a)||n&&i.has(a)||o&&c.has(a)||u?.has(a)||new RegExp(/^(data-.*)$/).test(a))&&(f[a]=e[a]);return f}function Mt(e){if(!e)return;let r=!0;return n=>{let o={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){r&&rn?console.error("stopPropagation is now the default behavior for events in Necto. You can use continuePropagation() to revert this behavior."):r=!0},continuePropagation(){r=!1},isPropagationStopped(){return r}};e(o),r&&n.stopPropagation()}}function ot(e){let r=e;return Object.assign(r,{nativeEvent:e,isDefaultPrevented:()=>r.defaultPrevented,isPropagationStopped:()=>r.cancelBubble,persist:()=>{}}),r}var is=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),cs={Tab:!0,Escape:!0};function sn(e,r,n){if(!n||!("target"in n)||!n.target)return!1;let o=W(n.target),u=ve(n.target),i=typeof window<"u"?u.HTMLInputElement:HTMLInputElement,c=typeof window<"u"?u.HTMLTextAreaElement:HTMLTextAreaElement,f=typeof window<"u"?u.HTMLElement:HTMLElement,a=typeof window<"u"?u.KeyboardEvent:KeyboardEvent,E=o.activeElement;return e=e||E instanceof i&&!is.has(E.type)||E instanceof c||E instanceof f&&E.isContentEditable,!(e&&r==="keyboard"&&n instanceof a&&!cs[n.key])}var Fe=L(I(),1);var Te=L(I(),1);var V=L(I(),1);var X=L(I(),1);var lt=L(I(),1);var x=L(I(),1),Rn=L(I(),1),Cn=L(I(),1),An=L(I(),1);var Ne=L(I(),1),be=L(I(),1),On=L(I(),1);function ln({props:e,ref:r,context:n}){let o=_s({context:n,slot:e.slot})||{},{ref:u=null,...i}=o,c=(0,it.useRef)(null),f=(0,it.useCallback)(E=>{c.current=E,typeof r=="function"?r(E):r&&(r.current=E),typeof u=="function"?u(E):u&&typeof u=="object"&&(u.current=E)},[r,u]),a=se(i,e);return"style"in i&&i.style&&"style"in e&&e.style&&(typeof i.style=="function"||typeof e.style=="function"?a.style=E=>{let S=typeof i.style=="function"?i.style(E):i.style,y={...E.defaultStyle,...S},O=typeof e.style=="function"?e.style({...E,defaultStyle:y}):e.style;return{...y,...O}}:a.style={...i.style,...e.style}),[a,f]}function fn(e={}){let{isDisabled:r,onFocus:n,onBlur:o,onFocusChange:u}=e,i=(0,ut.useCallback)((E,S)=>{E?(n?.(S),u?.(!0)):(o?.(S),u?.(!1))},[n,o,u]),c=(0,ut.useCallback)(E=>{E.target===E.currentTarget&&i(!1,E)},[i]),f=Sn({onBlur:c}),a=(0,ut.useCallback)(E=>{let S=W(E.target),y=S?Ee(S):Ee();E.target===E.currentTarget&&y===tt(E.nativeEvent)&&(i(!0,E),f(E))},[i,f]);return{focusProps:{...r?{}:{onFocus:a,onBlur:c}}}}function pn(e,r){let{autoFocus:n,isDisabled:o,excludeFromTabOrder:u}=e,{focusProps:i}=fn(e),{keyboardProps:c}=bs(e),f=(0,ke.useContext)(dn.FocusableContext)||{},a=(0,ke.useRef)(n);Rs({context:f,ref:r});let{ref:E,...S}=f,y=W(r.current),O=Ee(y);(0,ke.useEffect)(()=>{if(a.current&&r.current)if(Es()==="virtual"){let N=O;kt(()=>{Ee(y)===N&&r.current?.isConnected&&Lt(r.current)})}else Lt(r.current);a.current=!1},[r]);let P=u?-1:0;return o&&(P=void 0),{focusableProps:se({...se(i??{},c),tabIndex:P},o?{}:S)}}var ps=null;function mn(e={}){let{within:r=!1,isTextInput:n=!1,autoFocus:o=!1}=e,u=(0,he.useRef)({isFocused:o,isFocusVisible:o||ps!=="pointer"}),[i,c]=(0,he.useState)(o),[f,a]=(0,he.useState)(()=>u.current.isFocused&&u.current.isFocusVisible),E=(0,he.useCallback)(()=>{a(u.current.isFocused&&u.current.isFocusVisible)},[]),S=(0,he.useCallback)(P=>{u.current.isFocused=P,c(P),E()},[E]);Ts({fn:P=>{u.current.isFocusVisible=P,E()},deps:[],opts:{isTextInput:n}});let{focusProps:y={}}=fn({isDisabled:r,onFocusChange:S})||{},{focusWithinProps:O={}}=hs({isDisabled:!r,onFocusWithinChange:S})||{};return{isFocused:i,isFocusVisible:f,focusProps:r?O:y}}var He=new Map,Dt=new Set,un=!1,xt=null,an=!1,G={get hasEventBeforeFocus(){return un},set hasEventBeforeFocus(e){un=e},get hasBlurredWindowRecently(){return an},set hasBlurredWindowRecently(e){an=e},get currentModality(){return xt},set currentModality(e){xt=e}};function Es(){return xt}function jt(e,r){Dt.forEach(n=>n(e,r))}function vs(e){return!(e.metaKey||nn&&e.altKey||e.ctrlKey||["Control","Shift","Meta"].includes(e.key))}function vn(e){vs(e)&&(G.hasEventBeforeFocus=!0,G.currentModality="keyboard",jt("keyboard",e))}function Bt(e){["mousedown","pointerdown"].includes(e.type)&&(G.hasEventBeforeFocus=!0,G.currentModality="pointer",jt("pointer",e))}function yn(e){[window,document].includes(e.target)||!e.isTrusted||!G.hasEventBeforeFocus&&!G.hasBlurredWindowRecently||(!G.hasEventBeforeFocus&&!G.hasBlurredWindowRecently&&(G.currentModality="virtual",jt("virtual",e)),G.hasEventBeforeFocus=!1,G.hasBlurredWindowRecently=!1)}function gn(){G.hasEventBeforeFocus=!1,G.hasBlurredWindowRecently=!0}function ys(e){let r=ve(e),n=W(e);if(typeof window>"u"||typeof document>"u"||He.has(r))return;let o=r.HTMLElement.prototype.focus;r.HTMLElement.prototype.focus=function(...u){G.hasEventBeforeFocus=!0,o.apply(this,u)},n.addEventListener("keydown",vn,!0),n.addEventListener("click",Bt,!0),r.addEventListener("focus",yn,!0),r.addEventListener("blur",gn,!1),typeof PointerEvent<"u"&&n.addEventListener("pointerdown",Bt,!0),He.set(r,{focus:o})}function gs(e){let r=ve(e),n=W(e);if(!He.has(r))return;let{focus:o}=He.get(r);r.HTMLElement.prototype.focus=o,n.removeEventListener("keydown",vn,!0),n.removeEventListener("click",Bt,!0),r.removeEventListener("focus",yn,!0),r.removeEventListener("blur",gn,!1),He.delete(r)}function Ts(e){let{fn:r,deps:n,opts:o}=e;typeof window>"u"||typeof document>"u"||(ys(),(0,En.useEffect)(()=>{let u=(i,c)=>{sn(!!o?.isTextInput,i,c)&&r(G.currentModality!=="pointer")};return Dt.add(u),()=>{Dt.delete(u),gs()}},n))}function hs(e){let{isDisabled:r,onFocusWithin:n,onBlurWithin:o,onFocusWithinChange:u}=e,i=(0,Fe.useRef)({isFocusWithin:!1}),{addGlobalListener:c,removeAllGlobalListeners:f}=Tn(),a=(0,Fe.useCallback)(y=>{y.currentTarget.contains(y.target)&&i.current.isFocusWithin&&!y.currentTarget.contains(y.relatedTarget)&&(i.current.isFocusWithin=!1,f(),o&&o(y),u&&u(!1))},[o,u,f]),E=Sn({onBlur:a}),S=(0,Fe.useCallback)(y=>{if(!y.currentTarget.contains(y.target))return;let O=W(y.target),P=Ee(O);if(!i.current.isFocusWithin&&P===tt(y.nativeEvent)){n&&n(y),u&&u(!0),i.current.isFocusWithin=!0,E(y);let N=y.currentTarget;c(O,"focus",T=>{if(i.current.isFocusWithin&&!et(N,T.target)&&O.defaultView&&typeof O.defaultView.FocusEvent=="function"){let v=new O.defaultView.FocusEvent("blur",{relatedTarget:T.target});Object.defineProperty(v,"target",{value:N}),Object.defineProperty(v,"currentTarget",{value:N});let j=ot(v);a(j)}},{capture:!0})}},[n,u,E,c,a]);return r?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:S,onBlur:a}}}function Tn(){let e=(0,Te.useRef)(new Map),r=(0,Te.useCallback)((u,i,c,f)=>{let a=typeof f=="object"&&f?.once?(...E)=>{e.current.delete(c),c(...E)}:c;e.current.set(c,{type:i,eventTarget:u,options:f}),u.addEventListener(i,a,f)},[]),n=(0,Te.useCallback)((u,i,c,f)=>{let a=e.current.get(c),E=a?.options?.once?a.fn:c;u.removeEventListener(i,E,f),e.current.delete(c)},[]),o=(0,Te.useCallback)(()=>{e.current.forEach((u,i)=>{u.eventTarget.removeEventListener(u.type,i,u.options)}),e.current.clear()},[]);return(0,Te.useEffect)(()=>()=>o(),[o]),{addGlobalListener:r,removeGlobalListener:n,removeAllGlobalListeners:o}}function hn(e={}){let{onHoverStart:r,onHoverChange:n,onHoverEnd:o,isDisabled:u}=e,[i,c]=(0,V.useState)(!1),f=(0,V.useRef)({hoverCount:0,ignoreEmulated:!1}),a=(0,V.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current,{addGlobalListener:E,removeAllGlobalListeners:S}=Tn(),y=(0,V.useCallback)(()=>{f.current.ignoreEmulated=!0,setTimeout(()=>{f.current.ignoreEmulated=!1},50)},[]);(0,V.useEffect)(()=>{let T=j=>{j.pointerType==="touch"&&y()};if(typeof document>"u")return;let v=f.current;return v.hoverCount++,typeof PointerEvent<"u"?document.addEventListener("pointerup",T):Ce&&document.addEventListener("touchend",y),()=>{v.hoverCount--,v.hoverCount===0&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",T):Ce&&document.removeEventListener("touchend",y))}},[y]);let O=(0,V.useCallback)((T,v)=>{u||v==="touch"||a.isHovered||!(T.currentTarget&&T.currentTarget.contains(T.target))||(a.isHovered=!0,a.pointerType=v,a.target=T.currentTarget,E(W(T.target instanceof Element?T.target:null),"pointerover",j=>{a.isHovered&&a.target&&!et(a.target,j.target)&&P(j,j.pointerType)},{capture:!0}),r?.({type:"hoverstart",target:T.currentTarget,pointerType:v}),n?.(!0),c(!0))},[u,r,n,E,a]),P=(0,V.useCallback)((T,v)=>{v==="touch"||!a.isHovered||!a.target||(a.isHovered=!1,a.pointerType="",a.target=null,S(),o?.({type:"hoverend",target:T.currentTarget,pointerType:v}),n?.(!1),c(!1))},[o,n,S,a.target,a]),N=(0,V.useMemo)(()=>{let T={};return typeof PointerEvent<"u"?(T.onPointerEnter=v=>{f.current.ignoreEmulated&&v.pointerType==="mouse"||O(v,v.pointerType)},T.onPointerLeave=v=>{!u&&v.currentTarget instanceof Element&&v.currentTarget.contains(v.target)&&P(v,v.pointerType)}):Ce&&(T.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},T.onMouseEnter=v=>{!a.ignoreEmulatedMouseEvents&&!f.current.ignoreEmulated&&O(v.nativeEvent,"mouse"),a.ignoreEmulatedMouseEvents=!1},T.onMouseLeave=v=>{!u&&v.currentTarget.contains(v.target)&&P(v.nativeEvent,"mouse")}),T},[u,O,P,a]);return(0,V.useEffect)(()=>{u&&a.isHovered&&P({currentTarget:a.target},a.pointerType)},[u,P,a.isHovered,a.pointerType,a.target]),{hoverProps:N,isHovered:i}}var cn={prefix:String(Math.round(Math.random()*1e10)),current:0},at=new Map,st=typeof FinalizationRegistry<"u"?new FinalizationRegistry(e=>{at.delete(e)}):null;function bn(e={}){let{prefix:r="necto",defaultId:n}=e,[o,u]=(0,X.useState)(()=>n),i=(0,X.useRef)(null),c=(0,X.useRef)({}),f=(()=>{if(n)return n;let a=typeof X.default.useId=="function"?(0,X.useId)():String(++cn.current);return`${Ce?r:`${r}${cn.prefix}`}-${a}`})();return(0,X.useEffect)(()=>{if(typeof window<"u"&&window.document?.createElement){let a=at.get(f)||[],E={current:i.current};a.some(S=>S===E)||at.set(f,[...a,E])}return st&&st.register(c.current,f),()=>{st&&st.unregister(c.current),at.delete(f)}},[f]),(0,X.useEffect)(()=>{let a=i.current;a&&(u(a),i.current=null)},[]),f}function bs(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:e.onKeyDown?Mt(r=>e.onKeyDown?.(r.nativeEvent)):void 0,onKeyUp:e.onKeyUp?Mt(r=>e.onKeyUp?.(r.nativeEvent)):void 0}}}function $(e,r,n){return{type:e,pointerType:r,target:n.currentTarget??n.target,shiftKey:n.shiftKey,ctrlKey:n.ctrlKey,metaKey:n.metaKey,altKey:n.altKey}}function _n(e={}){let{isDisabled:r,preventFocusOnPress:n,allowTextSelectionOnPress:o,ref:u,onPress:i,onPressStart:c,onPressEnd:f,onPressChange:a,onPressUp:E,onClick:S}=e,[y,O]=(0,x.useState)(!1),P=(0,x.useRef)(!1),N=(0,x.useRef)(null),T=(0,x.useRef)(!1),v=(0,x.useCallback)(p=>{y!==p&&(O(p),a?.(p))},[y,a]),j=(0,x.useCallback)(p=>{if(!T.current)return;let U=N.current&&N.current instanceof Node&&p.target instanceof Node&&N.current.contains(p.target);if(T.current=!1,v(!1),!o&&N.current instanceof HTMLElement&&ye(N.current),p.target){let oe={...$("pressend","mouse",p),target:p.target};f?.(oe),E?.(oe),U&&i?.(oe)}},[f,E,i,v,o]),re=(0,x.useCallback)(p=>{if(r||p.button!==0||P.current)return;n&&p.preventDefault(),o||rt(p.currentTarget),T.current=!0,N.current=p.currentTarget,v(!0);let U=$("pressstart","mouse",p);c?.(U),window.addEventListener("mouseup",j,{once:!0})},[r,n,o,c,v,j]),ne=(0,x.useCallback)(p=>{if(r||p.button!==0||!T.current)return;T.current=!1,v(!1),!o&&p.currentTarget instanceof HTMLElement&&ye(p.currentTarget);let U=$("pressend","mouse",p);f?.(U),E?.(U),p.currentTarget instanceof Node&&p.currentTarget.contains(p.target)&&i?.($("press","mouse",p))},[r,i,f,E,v,o]),ue=(0,x.useCallback)(p=>{y&&(v(!1),f?.($("pressend","mouse",p)),!o&&p.currentTarget instanceof HTMLElement&&ye(p.currentTarget))},[y,v,f,o]),ce=(0,x.useCallback)(p=>{T.current&&!y&&(v(!0),c?.($("pressstart","mouse",p)))},[y,c,v]),Y=(0,x.useCallback)(p=>{if(!T.current)return;T.current=!1,v(!1),!o&&N.current instanceof HTMLElement&&ye(N.current);let U={...$("pressend","touch",p),target:p.target};f?.(U),E?.(U)},[f,E,v,o]),K=(0,x.useCallback)(p=>{if(!T.current)return;T.current=!1,v(!1),!o&&N.current instanceof HTMLElement&&ye(N.current);let U={...$("pressend","touch",p),target:p.target};f?.(U)},[f,v,o]),Z=(0,x.useCallback)(p=>{r||(o||rt(p.currentTarget),P.current=!0,setTimeout(()=>{P.current=!1},100),T.current=!0,N.current=p.currentTarget,v(!0),c?.($("pressstart","touch",p)),window.addEventListener("touchend",Y,{once:!0}),window.addEventListener("touchcancel",K,{once:!0}))},[r,c,v,o,Y,K]),M=(0,x.useCallback)(p=>{if(r||!T.current)return;T.current=!1,v(!1),!o&&p.currentTarget instanceof HTMLElement&&ye(p.currentTarget);let U=$("pressend","touch",p);f?.(U),E?.(U),p.currentTarget instanceof Node&&p.currentTarget.contains(p.target)&&i?.($("press","touch",p))},[r,i,f,E,v,o]),le=(0,x.useCallback)(p=>{r||(p.key==="Enter"||p.key===" ")&&!y&&(p.key===" "&&p.preventDefault(),o||rt(),v(!0),T.current=!0,c?.($("pressstart","keyboard",p)))},[r,y,c,v,o]),z=(0,x.useCallback)(p=>{if(!r&&(p.key==="Enter"||p.key===" ")&&y){v(!1),T.current=!1,o||ye();let U=$("pressend","keyboard",p);f?.(U),E?.($("pressup","keyboard",p)),i?.($("press","keyboard",p))}},[r,y,i,f,E,v,o]),J=(0,x.useCallback)(p=>{if(r){p.preventDefault();return}P.current||S?.(p)},[r,S]);(0,x.useEffect)(()=>()=>{window.removeEventListener("mouseup",j),window.removeEventListener("touchend",Y),window.removeEventListener("touchcancel",K)},[j,Y,K]);let fe=(0,x.useMemo)(()=>({onMouseDown:re,onMouseUp:ne,onMouseLeave:ue,onMouseEnter:ce,onTouchStart:Z,onTouchEnd:M,onKeyDown:le,onKeyUp:z,onClick:J}),[re,ne,ue,ce,Z,M,le,z,J]);return(0,x.useEffect)(()=>{let p=u?.current;p&&p instanceof ve(p).Element&&ve(p).getComputedStyle(p).touchAction==="auto"&&(p.style.touchAction="pan-x pan-y pinch-zoom")},[u]),{pressProps:fe,isPressed:y}}function wn(e){let{className:r,style:n,children:o,defaultClassName:u="necto",defaultChildren:i,defaultStyle:c,values:f}=e;return(0,Rn.useMemo)(()=>{let a=typeof r=="function"?r({...f,defaultClassName:u}):`${u} ${r}`,E=typeof n=="function"?n({...f,defaultStyle:c||{}}):{...c,...n},S=typeof o=="function"?o({...f,defaultChildren:i}):o??i;return{className:a,style:E,children:S}},[r,n,o,u,i,c,f])}function _s(e){let{context:r,slot:n}=e,o=(0,Cn.useContext)(r);if(n===null)return null;if(o&&typeof o=="object"&&"slots"in o&&o.slots){let u=n||Symbol("default");if(!o.slots[u]){let i=new Intl.ListFormat().format(Object.keys(o.slots).map(f=>`"${f}"`)),c=n?`Invalid slot name: "${n}". This slot is not recognized. Please refer to the component's documentation for valid slot names.`:"A slot prop is required. You must provide a valid slot name to render content in this area.";throw new Error(`${c} Valid slot names are ${i}.`)}return o.slots[u]}return o}function Rs(e={}){let{ref:r,context:n}=e;(typeof document<"u"?An.useLayoutEffect:()=>{})(()=>{if(n&&n.ref&&r)return n.ref.current=r.current,()=>{n.ref&&(n.ref.current=null)}})}function Sn(e){let{onBlur:r}=e,n=(0,Ne.useRef)({isFocused:!1,observer:null});(0,Ne.useLayoutEffect)(()=>{let u=n.current;return()=>{u.observer&&(u.observer.disconnect(),u.observer=null)}},[]);let o=ws(u=>{r?.(u)});return(0,Ne.useCallback)(u=>{if(u.target instanceof HTMLButtonElement||u.target instanceof HTMLInputElement||u.target instanceof HTMLTextAreaElement||u.target instanceof HTMLSelectElement){n.current.isFocused=!0;let i=u.target,c=f=>{if(n.current.isFocused=!1,i.disabled){let a=ot(f);o(a)}n.current.observer&&(n.current.observer.disconnect(),n.current.observer=null)};i.addEventListener("focusout",c,{once:!0}),n.current.observer=new MutationObserver(()=>{if(n.current.isFocused&&i.disabled){n.current.observer?.disconnect();let f=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:f})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:f}))}}),n.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[o])}function ws(e){let r=(0,be.useRef)(e);return(typeof window<"u"?be.useLayoutEffect:be.useEffect)(()=>{r.current=e},[e]),(0,be.useCallback)((...n)=>r.current(...n),[])}function We(e,r=!1){let n=e.replace(/\p{Lu}/gu,o=>`-${o.toLowerCase()}`);return r?n:n.startsWith("-")?n.slice(1):n}We.reverse=e=>e.replace(/-\p{Ll}/gu,r=>r.slice(1).toUpperCase());var Pn=["rel","href","ping","target","download","hrefLang","referrerPolicy"],Ln=["id","form","name","value","formAction","formEncType","formMethod","formTarget","formNoValidate"];function In({prefix:e=":sprocket:=",component:r,variant:n,state:o,unique:u,obscure:i}){if(!r)throw new Error("Component context is required!");let c=[e+We(r,!1)];return n&&c.push(We(n,!1)),Array.isArray(o)&&o.length&&c.push(...o.map(f=>We(f,!1))),u&&c.push(Math.random().toString(36).slice(2,8)),i&&c.push(Math.random().toString(36).slice(2,16)),c.join("--")}var Ut=te.Button;function ft(e,r){let{rel:n,href:o,target:u,autoFocus:i,focusDisabled:c,preventFocusOnPress:f,isDisabled:a=!1,type:E=Ut,as:S=Ut,elementType:y=S||Ut,onClick:O,onPress:P,onPressStart:N,onPressEnd:T,onPressUp:v,onPressChange:j}=e,re;y===te.Button?re={type:E,disabled:a}:re={role:"button",href:y===te.A&&!a?o:void 0,target:y===te.A?u:void 0,type:y===te.Input?E:void 0,disabled:y===te.Input?a:void 0,"aria-disabled":!a||y===te.Input?void 0:a,rel:y===te.A?n:void 0};let{hoverProps:ne,isHovered:ue}=hn({...e,isDisabled:a}),{focusProps:ce,isFocused:Y,isFocusVisible:K}=mn({autoFocus:i}),{focusableProps:Z}=pn(e,r),{pressProps:M,isPressed:le}=_n({ref:r,isDisabled:a,preventFocusOnPress:f,onPressStart:N,onPressEnd:T,onPressChange:j,onPress:P,onPressUp:v,onClick:O});c&&(Z.tabIndex=a?-1:Z.tabIndex);let z=se(Z,M,ne,ce,on(e,{allowLabelableProps:!0,allowedLabelableProps:new Set([]),allowedLinkProps:new Set(Pn),extraAllowedProps:new Set(Ln)}));return{isFocused:Y,isPressed:le,isHovered:ue,isDisabled:a,isFocusVisible:K,elementType:y,buttonProps:se(z,re)}}var kn=L(I(),1),Me=(0,kn.createContext)(null);var Nn=L(I(),1);function Mn(){return(0,Nn.useContext)(Me)}function dt(e,r=!0){let n=e.replace(/\p{Lu}/gu,o=>`-${o.toLowerCase()}`);return r?n:n.startsWith("-")?n.slice(1):n}dt.reverse=e=>e.replace(/-\p{Ll}/gu,r=>r.slice(1).toUpperCase());var Ye=L(I(),1);var ie=L(I(),1),Un=L(Et(),1),Ss=te.Div,jn=({as:e,asChild:r,children:n,...o},u)=>{let i=e??Ss;if(r){let c=ie.Children.only(n);return(0,ie.isValidElement)(c)?(0,ie.cloneElement)(c,{...o,ref:c.ref??u}):null}return(0,Un.jsx)(i,{ref:u,...o,children:n})},Hn=Object.assign((0,ie.forwardRef)(jn),Be.HTML_TAGS.reduce((e,r)=>(e[r]=(0,ie.forwardRef)((n,o)=>jn({...n,as:r},o)),e),{}));var Yn=L(Et(),1),Wn="Button";function Fn(e,r){[e,r]=ln({props:e,ref:r,context:Me});let{buttonProps:n,isHovered:o,isPressed:u,isFocused:i,isDisabled:c,elementType:f,isFocusVisible:a}=ft(e,r),E=bn({defaultId:n.id}),S=wn({...e,values:{isHovered:o,isPressed:u,isFocused:i,isFocusVisible:a,isDisabled:c},defaultClassName:In({component:Wn}),style:O=>({...e.style instanceof Function?e.style(O):e.style})}),y=(0,Ye.useMemo)(()=>{let O={hover:o,focus:i,focusVisible:a,disabled:c,pressed:u},P={},N=[];for(let[T,v]of Object.entries(O))typeof v=="boolean"&&(P[`data-${dt(T)}`]=v?"true":void 0,v&&N.push(dt(T)));return{...P,"data-sprocket-state":N.join(" ")}},[o,i,a,c,u]);return(0,Yn.jsx)(Hn,{ref:r,as:f,...S,...se(n,y),id:E,slot:e.slot||void 0,children:S.children})}var Ft=Object.assign((0,Ye.forwardRef)((e,r)=>Fn(e,r)),{Root:(0,Ye.forwardRef)((e,r)=>Fn(e,r))});Ft.displayName=Wn;})();
package/dist/vue/index.js DELETED
@@ -1 +0,0 @@
1
- import{useHover as _,usePress as h,useFocusRing as j,useFocusable as V}from"@necto-react/hooks";import{HTMLElements as s}from"@necto/dom";import{mergeProps as k}from"@necto/mergers";import{filterDOMProps as G}from"@necto-react/helpers";import{ANCHOR_ELEMENT_PROPS as W,ALLOWED_EXTERNAL_PROPS as X}from"shared";var E=s.Button;function x(t,o){let{rel:d,href:u,target:i,autoFocus:a,focusDisabled:p,preventFocusOnPress:y,isDisabled:e=!1,type:l=E,as:c=E,elementType:n=c||E,onClick:f,onPress:B,onPressStart:P,onPressEnd:b,onPressUp:m,onPressChange:w}=t,T;n===s.Button?T={type:l,disabled:e}:T={role:"button",href:n===s.A&&!e?u:void 0,target:n===s.A?i:void 0,type:n===s.Input?l:void 0,disabled:n===s.Input?e:void 0,"aria-disabled":!e||n===s.Input?void 0:e,rel:n===s.A?d:void 0};let{hoverProps:H,isHovered:S}=_({...t,isDisabled:e}),{focusProps:M,isFocused:U,isFocusVisible:v}=j({autoFocus:a}),{focusableProps:R}=V(t,o),{pressProps:I,isPressed:N}=h({ref:o,isDisabled:e,preventFocusOnPress:y,onPressStart:P,onPressEnd:b,onPressChange:w,onPress:B,onPressUp:m,onClick:f});p&&(R.tabIndex=e?-1:R.tabIndex);let D=k(R,I,H,M,G(t,{allowLabelableProps:!0,allowedLabelableProps:new Set([]),allowedLinkProps:new Set(W),extraAllowedProps:new Set(X)}));return{isFocused:U,isPressed:N,isHovered:S,isDisabled:e,isFocusVisible:v,elementType:n,buttonProps:k(D,T)}}import{createContext as $}from"react";var r=$(null);import{useContext as q}from"react";function A(){return q(r)}import{kebabCase as F}from"@necto/strings";import{mergeProps as z}from"@necto/mergers";import{forwardRef as O,useMemo as J}from"react";import{buildInternalIdentifier as K}from"shared";import{Primitive as Q}from"@necto-react/components";import{useContextProps as Y,useRenderer as Z,useId as tt}from"@necto-react/hooks";import{jsx as et}from"react/jsx-runtime";var g="Button";function L(t,o){[t,o]=Y({props:t,ref:o,context:r});let{buttonProps:d,isHovered:u,isPressed:i,isFocused:a,isDisabled:p,elementType:y,isFocusVisible:e}=x(t,o),l=tt({defaultId:d.id}),c=Z({...t,values:{isHovered:u,isPressed:i,isFocused:a,isFocusVisible:e,isDisabled:p},defaultClassName:K({component:g}),style:f=>({...t.style instanceof Function?t.style(f):t.style})}),n=J(()=>{let f={hover:u,focus:a,focusVisible:e,disabled:p,pressed:i},B={},P=[];for(let[b,m]of Object.entries(f))typeof m=="boolean"&&(B[`data-${F(b)}`]=m?"true":void 0,m&&P.push(F(b)));return{...B,"data-sprocket-state":P.join(" ")}},[u,a,e,p,i]);return et(Q,{ref:o,as:y,...c,...z(d,n),id:l,slot:t.slot||void 0,children:c.children})}var C=Object.assign(O((t,o)=>L(t,o)),{Root:O((t,o)=>L(t,o))});C.displayName=g;export{C as Button,r as ButtonContext,C as SprocketButton,r as SprocketButtonContext,x as useButton,A as useButtonContext,x as useSprocketButton,A as useSprocketButtonContext};
File without changes
File without changes