@takumi-rs/helpers 0.16.0 → 0.17.0

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.d.ts CHANGED
@@ -538,6 +538,7 @@ export declare function gradient(from: ColorInput, to: ColorInput, angle?: numbe
538
538
  to: ColorInput;
539
539
  angle: number;
540
540
  };
541
+ export declare function rgba(r: number, g: number, b: number, a?: number): ColorInput;
541
542
  export declare function fromJsx(element: ReactNode): Promise<Node$1[]>;
542
543
 
543
544
  export {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var Qf=Object.create;var{getPrototypeOf:Yf,defineProperty:mx,getOwnPropertyNames:Jf}=Object;var Rf=Object.prototype.hasOwnProperty;var Mf=(f,w,$)=>{$=f!=null?Qf(Yf(f)):{};let A=w||!f||!f.__esModule?mx($,"default",{value:f,enumerable:!0}):$;for(let Z of Jf(f))if(!Rf.call(A,Z))mx(A,Z,{get:()=>f[Z],enumerable:!0});return A};var zf=(f,w)=>()=>(w||f((w={exports:{}}).exports,w),w.exports);var kx=zf((Wf,t)=>{(function(){function f(x,T){Object.defineProperty(A.prototype,x,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",T[0],T[1])}})}function w(x){if(x===null||typeof x!=="object")return null;return x=Yx&&x[Yx]||x["@@iterator"],typeof x==="function"?x:null}function $(x,T){x=(x=x.constructor)&&(x.displayName||x.name)||"ReactClass";var D=x+"."+T;Jx[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.",T,x),Jx[D]=!0)}function A(x,T,D){this.props=x,this.context=T,this.refs=xx,this.updater=D||Rx}function Z(){}function R(x,T,D){this.props=x,this.context=T,this.refs=xx,this.updater=D||Rx}function Y(x){return""+x}function W(x){try{Y(x);var T=!1}catch(X){T=!0}if(T){T=console;var D=T.error,G=typeof Symbol==="function"&&Symbol.toStringTag&&x[Symbol.toStringTag]||x.constructor.name||"Object";return D.call(T,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),Y(x)}}function O(x){if(x==null)return null;if(typeof x==="function")return x.$$typeof===Xf?null:x.displayName||x.name||null;if(typeof x==="string")return x;switch(x){case r:return"Fragment";case Hx:return"Profiler";case Zx:return"StrictMode";case Qx:return"Suspense";case Gf:return"SuspenseList";case Af:return"Activity"}if(typeof x==="object")switch(typeof x.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),x.$$typeof){case Xx:return"Portal";case Bx:return(x.displayName||"Context")+".Provider";case a:return(x._context.displayName||"Context")+".Consumer";case Ex:var T=x.render;return x=x.displayName,x||(x=T.displayName||T.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case e:return T=x.displayName||null,T!==null?T:O(x.type)||"Memo";case b:T=x._payload,x=x._init;try{return O(x(T))}catch(D){}}return null}function I(x){if(x===r)return"<>";if(typeof x==="object"&&x!==null&&x.$$typeof===b)return"<...>";try{var T=O(x);return T?"<"+T+">":"<...>"}catch(D){return"<...>"}}function q(){var x=E.A;return x===null?null:x.getOwner()}function N(){return Error("react-stack-top-frame")}function C(x){if(V.call(x,"key")){var T=Object.getOwnPropertyDescriptor(x,"key").get;if(T&&T.isReactWarning)return!1}return x.key!==void 0}function ex(x,T){function D(){Ox||(Ox=!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)",T))}D.isReactWarning=!0,Object.defineProperty(x,"key",{get:D,configurable:!0})}function xf(){var x=O(this.type);return jx[x]||(jx[x]=!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.")),x=this.props.ref,x!==void 0?x:null}function o(x,T,D,G,X,Q,H,J){return D=Q.ref,x={$$typeof:l,type:x,key:T,props:Q,_owner:X},(D!==void 0?D:null)!==null?Object.defineProperty(x,"ref",{enumerable:!1,get:xf}):Object.defineProperty(x,"ref",{enumerable:!1,value:null}),x._store={},Object.defineProperty(x._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(x,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(x,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.defineProperty(x,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(x.props),Object.freeze(x)),x}function ff(x,T){return T=o(x.type,T,void 0,void 0,x._owner,x.props,x._debugStack,x._debugTask),x._store&&(T._store.validated=x._store.validated),T}function m(x){return typeof x==="object"&&x!==null&&x.$$typeof===l}function Tf(x){var T={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(D){return T[D]})}function n(x,T){return typeof x==="object"&&x!==null&&x.key!=null?(W(x.key),Tf(""+x.key)):T.toString(36)}function Ax(){}function wf(x){switch(x.status){case"fulfilled":return x.value;case"rejected":throw x.reason;default:switch(typeof x.status==="string"?x.then(Ax,Ax):(x.status="pending",x.then(function(T){x.status==="pending"&&(x.status="fulfilled",x.value=T)},function(T){x.status==="pending"&&(x.status="rejected",x.reason=T)})),x.status){case"fulfilled":return x.value;case"rejected":throw x.reason}}throw x}function F(x,T,D,G,X){var Q=typeof x;if(Q==="undefined"||Q==="boolean")x=null;var H=!1;if(x===null)H=!0;else switch(Q){case"bigint":case"string":case"number":H=!0;break;case"object":switch(x.$$typeof){case l:case Xx:H=!0;break;case b:return H=x._init,F(H(x._payload),T,D,G,X)}}if(H){H=x,X=X(H);var J=G===""?"."+n(H,0):G;return zx(X)?(D="",J!=null&&(D=J.replace(qx,"$&/")+"/"),F(X,T,D,"",function(U){return U})):X!=null&&(m(X)&&(X.key!=null&&(H&&H.key===X.key||W(X.key)),D=ff(X,D+(X.key==null||H&&H.key===X.key?"":(""+X.key).replace(qx,"$&/")+"/")+J),G!==""&&H!=null&&m(H)&&H.key==null&&H._store&&!H._store.validated&&(D._store.validated=2),X=D),T.push(X)),1}if(H=0,J=G===""?".":G+":",zx(x))for(var B=0;B<x.length;B++)G=x[B],Q=J+n(G,B),H+=F(G,T,D,Q,X);else if(B=w(x),typeof B==="function")for(B===x.entries&&(Nx||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Nx=!0),x=B.call(x),B=0;!(G=x.next()).done;)G=G.value,Q=J+n(G,B++),H+=F(G,T,D,Q,X);else if(Q==="object"){if(typeof x.then==="function")return F(wf(x),T,D,G,X);throw T=String(x),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(x).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return H}function g(x,T,D){if(x==null)return x;var G=[],X=0;return F(x,G,"","",function(Q){return T.call(D,Q,X++)}),G}function $f(x){if(x._status===-1){var T=x._result;T=T(),T.then(function(D){if(x._status===0||x._status===-1)x._status=1,x._result=D},function(D){if(x._status===0||x._status===-1)x._status=2,x._result=D}),x._status===-1&&(x._status=0,x._result=T)}if(x._status===1)return T=x._result,T===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
1
+ var Jf=Object.create;var{getPrototypeOf:Rf,defineProperty:_x,getOwnPropertyNames:Mf}=Object;var zf=Object.prototype.hasOwnProperty;var Wf=(f,w,$)=>{$=f!=null?Jf(Rf(f)):{};let A=w||!f||!f.__esModule?_x($,"default",{value:f,enumerable:!0}):$;for(let Z of Mf(f))if(!zf.call(A,Z))_x(A,Z,{get:()=>f[Z],enumerable:!0});return A};var Of=(f,w)=>()=>(w||f((w={exports:{}}).exports,w),w.exports);var bx=Of((If,p)=>{(function(){function f(x,T){Object.defineProperty(A.prototype,x,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",T[0],T[1])}})}function w(x){if(x===null||typeof x!=="object")return null;return x=Jx&&x[Jx]||x["@@iterator"],typeof x==="function"?x:null}function $(x,T){x=(x=x.constructor)&&(x.displayName||x.name)||"ReactClass";var D=x+"."+T;Rx[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.",T,x),Rx[D]=!0)}function A(x,T,D){this.props=x,this.context=T,this.refs=fx,this.updater=D||Mx}function Z(){}function R(x,T,D){this.props=x,this.context=T,this.refs=fx,this.updater=D||Mx}function Y(x){return""+x}function O(x){try{Y(x);var T=!1}catch(X){T=!0}if(T){T=console;var D=T.error,G=typeof Symbol==="function"&&Symbol.toStringTag&&x[Symbol.toStringTag]||x.constructor.name||"Object";return D.call(T,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),Y(x)}}function I(x){if(x==null)return null;if(typeof x==="function")return x.$$typeof===Hf?null:x.displayName||x.name||null;if(typeof x==="string")return x;switch(x){case a:return"Fragment";case Bx:return"Profiler";case Hx:return"StrictMode";case Yx:return"Suspense";case Xf:return"SuspenseList";case Zf:return"Activity"}if(typeof x==="object")switch(typeof x.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),x.$$typeof){case Zx:return"Portal";case Ex:return(x.displayName||"Context")+".Provider";case e:return(x._context.displayName||"Context")+".Consumer";case Qx:var T=x.render;return x=x.displayName,x||(x=T.displayName||T.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case xx:return T=x.displayName||null,T!==null?T:I(x.type)||"Memo";case v:T=x._payload,x=x._init;try{return I(x(T))}catch(D){}}return null}function j(x){if(x===a)return"<>";if(typeof x==="object"&&x!==null&&x.$$typeof===v)return"<...>";try{var T=I(x);return T?"<"+T+">":"<...>"}catch(D){return"<...>"}}function U(){var x=E.A;return x===null?null:x.getOwner()}function q(){return Error("react-stack-top-frame")}function F(x){if(d.call(x,"key")){var T=Object.getOwnPropertyDescriptor(x,"key").get;if(T&&T.isReactWarning)return!1}return x.key!==void 0}function ff(x,T){function D(){Ix||(Ix=!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)",T))}D.isReactWarning=!0,Object.defineProperty(x,"key",{get:D,configurable:!0})}function Tf(){var x=I(this.type);return Nx[x]||(Nx[x]=!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.")),x=this.props.ref,x!==void 0?x:null}function n(x,T,D,G,X,Q,H,J){return D=Q.ref,x={$$typeof:r,type:x,key:T,props:Q,_owner:X},(D!==void 0?D:null)!==null?Object.defineProperty(x,"ref",{enumerable:!1,get:Tf}):Object.defineProperty(x,"ref",{enumerable:!1,value:null}),x._store={},Object.defineProperty(x._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(x,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(x,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.defineProperty(x,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(x.props),Object.freeze(x)),x}function wf(x,T){return T=n(x.type,T,void 0,void 0,x._owner,x.props,x._debugStack,x._debugTask),x._store&&(T._store.validated=x._store.validated),T}function _(x){return typeof x==="object"&&x!==null&&x.$$typeof===r}function $f(x){var T={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(D){return T[D]})}function u(x,T){return typeof x==="object"&&x!==null&&x.key!=null?(O(x.key),$f(""+x.key)):T.toString(36)}function Xx(){}function Df(x){switch(x.status){case"fulfilled":return x.value;case"rejected":throw x.reason;default:switch(typeof x.status==="string"?x.then(Xx,Xx):(x.status="pending",x.then(function(T){x.status==="pending"&&(x.status="fulfilled",x.value=T)},function(T){x.status==="pending"&&(x.status="rejected",x.reason=T)})),x.status){case"fulfilled":return x.value;case"rejected":throw x.reason}}throw x}function L(x,T,D,G,X){var Q=typeof x;if(Q==="undefined"||Q==="boolean")x=null;var H=!1;if(x===null)H=!0;else switch(Q){case"bigint":case"string":case"number":H=!0;break;case"object":switch(x.$$typeof){case r:case Zx:H=!0;break;case v:return H=x._init,L(H(x._payload),T,D,G,X)}}if(H){H=x,X=X(H);var J=G===""?"."+u(H,0):G;return Wx(X)?(D="",J!=null&&(D=J.replace(Ux,"$&/")+"/"),L(X,T,D,"",function(K){return K})):X!=null&&(_(X)&&(X.key!=null&&(H&&H.key===X.key||O(X.key)),D=wf(X,D+(X.key==null||H&&H.key===X.key?"":(""+X.key).replace(Ux,"$&/")+"/")+J),G!==""&&H!=null&&_(H)&&H.key==null&&H._store&&!H._store.validated&&(D._store.validated=2),X=D),T.push(X)),1}if(H=0,J=G===""?".":G+":",Wx(x))for(var B=0;B<x.length;B++)G=x[B],Q=J+u(G,B),H+=L(G,T,D,Q,X);else if(B=w(x),typeof B==="function")for(B===x.entries&&(qx||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),qx=!0),x=B.call(x),B=0;!(G=x.next()).done;)G=G.value,Q=J+u(G,B++),H+=L(G,T,D,Q,X);else if(Q==="object"){if(typeof x.then==="function")return L(Df(x),T,D,G,X);throw T=String(x),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(x).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return H}function y(x,T,D){if(x==null)return x;var G=[],X=0;return L(x,G,"","",function(Q){return T.call(D,Q,X++)}),G}function Gf(x){if(x._status===-1){var T=x._result;T=T(),T.then(function(D){if(x._status===0||x._status===-1)x._status=1,x._result=D},function(D){if(x._status===0||x._status===-1)x._status=2,x._result=D}),x._status===-1&&(x._status=0,x._result=T)}if(x._status===1)return T=x._result,T===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
2
2
 
3
3
  Your code should look like:
4
4
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -10,4 +10,4 @@ Your code should look like:
10
10
  1. You might have mismatching versions of React and the renderer (such as React DOM)
11
11
  2. You might be breaking the Rules of Hooks
12
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.`),x}function Df(){}function y(x){if(d===null)try{var T=("require"+Math.random()).slice(0,7);d=(t&&t[T]).call(t,"timers").setImmediate}catch(D){d=function(G){Kx===!1&&(Kx=!0,typeof MessageChannel==="undefined"&&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 X=new MessageChannel;X.port1.onmessage=G,X.port2.postMessage(void 0)}}return d(x)}function h(x){return 1<x.length&&typeof AggregateError==="function"?new AggregateError(x):x[0]}function k(x,T){T!==s-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. "),s=T}function u(x,T,D){var G=E.actQueue;if(G!==null)if(G.length!==0)try{c(G),y(function(){return u(x,T,D)});return}catch(X){E.thrownErrors.push(X)}else E.actQueue=null;0<E.thrownErrors.length?(G=h(E.thrownErrors),E.thrownErrors.length=0,D(G)):T(x)}function c(x){if(!fx){fx=!0;var T=0;try{for(;T<x.length;T++){var D=x[T];do{E.didUsePromise=!1;var G=D(!1);if(G!==null){if(E.didUsePromise){x[T]=D,x.splice(0,T);return}D=G}else break}while(1)}x.length=0}catch(X){x.splice(0,T+1),E.thrownErrors.push(X)}finally{fx=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var l=Symbol.for("react.transitional.element"),Xx=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),Zx=Symbol.for("react.strict_mode"),Hx=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),Bx=Symbol.for("react.context"),Ex=Symbol.for("react.forward_ref"),Qx=Symbol.for("react.suspense"),Gf=Symbol.for("react.suspense_list"),e=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),Af=Symbol.for("react.activity"),Yx=Symbol.iterator,Jx={},Rx={isMounted:function(){return!1},enqueueForceUpdate:function(x){$(x,"forceUpdate")},enqueueReplaceState:function(x){$(x,"replaceState")},enqueueSetState:function(x){$(x,"setState")}},Mx=Object.assign,xx={};Object.freeze(xx),A.prototype.isReactComponent={},A.prototype.setState=function(x,T){if(typeof x!=="object"&&typeof x!=="function"&&x!=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,x,T,"setState")},A.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};var j={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)."]},v;for(v in j)j.hasOwnProperty(v)&&f(v,j[v]);Z.prototype=A.prototype,j=R.prototype=new Z,j.constructor=R,Mx(j,A.prototype),j.isPureReactComponent=!0;var zx=Array.isArray,Xf=Symbol.for("react.client.reference"),E={H:null,A:null,T:null,S:null,V:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},V=Object.prototype.hasOwnProperty,Wx=console.createTask?console.createTask:function(){return null};j={react_stack_bottom_frame:function(x){return x()}};var Ox,Ix,jx={},Zf=j.react_stack_bottom_frame.bind(j,N)(),Hf=Wx(I(N)),Nx=!1,qx=/\/+/g,Ux=typeof reportError==="function"?reportError:function(x){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof x==="object"&&x!==null&&typeof x.message==="string"?String(x.message):String(x),error:x});if(!window.dispatchEvent(T))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",x);return}console.error(x)},Kx=!1,d=null,s=0,i=!1,fx=!1,Cx=typeof queueMicrotask==="function"?function(x){queueMicrotask(function(){return queueMicrotask(x)})}:y;j=Object.freeze({__proto__:null,c:function(x){return z().useMemoCache(x)}}),Wf.Children={map:g,forEach:function(x,T,D){g(x,function(){T.apply(this,arguments)},D)},count:function(x){var T=0;return g(x,function(){T++}),T},toArray:function(x){return g(x,function(T){return T})||[]},only:function(x){if(!m(x))throw Error("React.Children.only expected to receive a single React element child.");return x}},Wf.Component=A,Wf.Fragment=r,Wf.Profiler=Hx,Wf.PureComponent=R,Wf.StrictMode=Zx,Wf.Suspense=Qx,Wf.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,Wf.__COMPILER_RUNTIME=j,Wf.act=function(x){var T=E.actQueue,D=s;s++;var G=E.actQueue=T!==null?T:[],X=!1;try{var Q=x()}catch(B){E.thrownErrors.push(B)}if(0<E.thrownErrors.length)throw k(T,D),x=h(E.thrownErrors),E.thrownErrors.length=0,x;if(Q!==null&&typeof Q==="object"&&typeof Q.then==="function"){var H=Q;return Cx(function(){X||i||(i=!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(B,U){X=!0,H.then(function(_){if(k(T,D),D===0){try{c(G),y(function(){return u(_,B,U)})}catch(Ef){E.thrownErrors.push(Ef)}if(0<E.thrownErrors.length){var Bf=h(E.thrownErrors);E.thrownErrors.length=0,U(Bf)}}else B(_)},function(_){k(T,D),0<E.thrownErrors.length?(_=h(E.thrownErrors),E.thrownErrors.length=0,U(_)):U(_)})}}}var J=Q;if(k(T,D),D===0&&(c(G),G.length!==0&&Cx(function(){X||i||(i=!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(() => ...)"))}),E.actQueue=null),0<E.thrownErrors.length)throw x=h(E.thrownErrors),E.thrownErrors.length=0,x;return{then:function(B,U){X=!0,D===0?(E.actQueue=G,y(function(){return u(J,B,U)})):B(J)}}},Wf.cache=function(x){return function(){return x.apply(null,arguments)}},Wf.captureOwnerStack=function(){var x=E.getCurrentStack;return x===null?null:x()},Wf.cloneElement=function(x,T,D){if(x===null||x===void 0)throw Error("The argument must be a React element, but you passed "+x+".");var G=Mx({},x.props),X=x.key,Q=x._owner;if(T!=null){var H;x:{if(V.call(T,"ref")&&(H=Object.getOwnPropertyDescriptor(T,"ref").get)&&H.isReactWarning){H=!1;break x}H=T.ref!==void 0}H&&(Q=q()),C(T)&&(W(T.key),X=""+T.key);for(J in T)!V.call(T,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&T.ref===void 0||(G[J]=T[J])}var J=arguments.length-2;if(J===1)G.children=D;else if(1<J){H=Array(J);for(var B=0;B<J;B++)H[B]=arguments[B+2];G.children=H}G=o(x.type,X,void 0,void 0,Q,G,x._debugStack,x._debugTask);for(X=2;X<arguments.length;X++)Q=arguments[X],m(Q)&&Q._store&&(Q._store.validated=1);return G},Wf.createContext=function(x){return x={$$typeof:Bx,_currentValue:x,_currentValue2:x,_threadCount:0,Provider:null,Consumer:null},x.Provider=x,x.Consumer={$$typeof:a,_context:x},x._currentRenderer=null,x._currentRenderer2=null,x},Wf.createElement=function(x,T,D){for(var G=2;G<arguments.length;G++){var X=arguments[G];m(X)&&X._store&&(X._store.validated=1)}if(G={},X=null,T!=null)for(B in Ix||!("__self"in T)||"key"in T||(Ix=!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")),C(T)&&(W(T.key),X=""+T.key),T)V.call(T,B)&&B!=="key"&&B!=="__self"&&B!=="__source"&&(G[B]=T[B]);var Q=arguments.length-2;if(Q===1)G.children=D;else if(1<Q){for(var H=Array(Q),J=0;J<Q;J++)H[J]=arguments[J+2];Object.freeze&&Object.freeze(H),G.children=H}if(x&&x.defaultProps)for(B in Q=x.defaultProps,Q)G[B]===void 0&&(G[B]=Q[B]);X&&ex(G,typeof x==="function"?x.displayName||x.name||"Unknown":x);var B=1e4>E.recentlyCreatedOwnerStacks++;return o(x,X,void 0,void 0,q(),G,B?Error("react-stack-top-frame"):Zf,B?Wx(I(x)):Hf)},Wf.createRef=function(){var x={current:null};return Object.seal(x),x},Wf.forwardRef=function(x){x!=null&&x.$$typeof===e?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof x!=="function"?console.error("forwardRef requires a render function but was given %s.",x===null?"null":typeof x):x.length!==0&&x.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",x.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),x!=null&&x.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var T={$$typeof:Ex,render:x},D;return Object.defineProperty(T,"displayName",{enumerable:!1,configurable:!0,get:function(){return D},set:function(G){D=G,x.name||x.displayName||(Object.defineProperty(x,"name",{value:G}),x.displayName=G)}}),T},Wf.isValidElement=m,Wf.lazy=function(x){return{$$typeof:b,_payload:{_status:-1,_result:x},_init:$f}},Wf.memo=function(x,T){x==null&&console.error("memo: The first argument must be a component. Instead received: %s",x===null?"null":typeof x),T={$$typeof:e,type:x,compare:T===void 0?null:T};var D;return Object.defineProperty(T,"displayName",{enumerable:!1,configurable:!0,get:function(){return D},set:function(G){D=G,x.name||x.displayName||(Object.defineProperty(x,"name",{value:G}),x.displayName=G)}}),T},Wf.startTransition=function(x){var T=E.T,D={};E.T=D,D._updatedFibers=new Set;try{var G=x(),X=E.S;X!==null&&X(D,G),typeof G==="object"&&G!==null&&typeof G.then==="function"&&G.then(Df,Ux)}catch(Q){Ux(Q)}finally{T===null&&D._updatedFibers&&(x=D._updatedFibers.size,D._updatedFibers.clear(),10<x&&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.")),E.T=T}},Wf.unstable_useCacheRefresh=function(){return z().useCacheRefresh()},Wf.use=function(x){return z().use(x)},Wf.useActionState=function(x,T,D){return z().useActionState(x,T,D)},Wf.useCallback=function(x,T){return z().useCallback(x,T)},Wf.useContext=function(x){var T=z();return x.$$typeof===a&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),T.useContext(x)},Wf.useDebugValue=function(x,T){return z().useDebugValue(x,T)},Wf.useDeferredValue=function(x,T){return z().useDeferredValue(x,T)},Wf.useEffect=function(x,T,D){x==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");var G=z();if(typeof D==="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return G.useEffect(x,T)},Wf.useId=function(){return z().useId()},Wf.useImperativeHandle=function(x,T,D){return z().useImperativeHandle(x,T,D)},Wf.useInsertionEffect=function(x,T){return x==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),z().useInsertionEffect(x,T)},Wf.useLayoutEffect=function(x,T){return x==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),z().useLayoutEffect(x,T)},Wf.useMemo=function(x,T){return z().useMemo(x,T)},Wf.useOptimistic=function(x,T){return z().useOptimistic(x,T)},Wf.useReducer=function(x,T,D){return z().useReducer(x,T,D)},Wf.useRef=function(x){return z().useRef(x)},Wf.useState=function(x){return z().useState(x)},Wf.useSyncExternalStore=function(x,T,D){return z().useSyncExternalStore(x,T,D)},Wf.useTransition=function(){return z().useTransition()},Wf.version="19.1.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});function Fx(f){return{type:"container",...f}}function _x(f,w){return{...w,type:"text",text:f}}function Tx(f,w){return{...w,type:"image",src:f}}function uf(f){return f}function Lx(f){return{percentage:f}}function hx(f){return{vw:f}}function Px(f){return{vh:f}}function Sx(f){return{em:f}}function gx(f){return{rem:f}}function yx(f){return{fr:f}}function cf(f,w,$=0){return{from:f,to:w,angle:$}}var ax=Mf(kx(),1);import{renderToString as bf}from"react-dom/server";function bx(f){return f.replace(/[A-Z]/g,(w)=>`_${w.toLowerCase()}`)}var Of=["-moz-","-webkit-","-o-","-ms-"];function vx(f){if(typeof f!=="string")return f;if(If(f))return;if(f[0]==="-"){for(let w of Of)if(f.startsWith(w))return f.slice(w.length);throw new Error(`Unsupported prefix in value: ${f}`)}return f}function If(f){return f==="inherit"||f==="initial"||f==="revert"||f==="unset"}function jf(f){if(f.length===7)return Number.parseInt(f.slice(1),16);if(f.length===9){let w=Number.parseInt(f.slice(1),16);return[w>>24&255,w>>16&255,w>>8&255,(w&255)/255]}throw new Error(`Invalid hex color: ${f}`)}function Nf(f){let w=f.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(w){let[,$,A,Z]=w;return[Number($),Number(A),Number(Z)]}return null}function qf(f){let w=f.match(/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([0-9]*\.?[0-9]+)\s*\)$/);if(w){let[,$,A,Z,R]=w,Y=Number($),W=Number(A),O=Number(Z),I=Number(R);if(Y<0||Y>255||W<0||W>255||O<0||O>255)return null;if(I<0||I>1)return null;return[Y,W,O,I]}return null}function L(f){if(f.startsWith("#"))return jf(f);if(f.startsWith("rgb(")){let w=Nf(f);if(w!==null)return w}if(f.startsWith("rgba(")){let w=qf(f);if(w!==null)return w}throw new Error(`Invalid RGB color: ${f}`)}function M(f){if(typeof f==="number")return f;if(f==="auto"||f==="min-content"||f==="max-content")return f;let w=f.match(/^(-?[\d.]+)(.*)$/);if(!w)return 0;let[,$,A]=w;if(!$)return 0;let Z=Number.parseFloat($);switch(A){case"%":return Lx(Z);case"rem":return gx(Z);case"em":return Sx(Z);case"vh":return Px(Z);case"vw":return hx(Z);case"px":case"":return Z;default:return Z}}function K(f){if(typeof f==="number")return M(f);let $=f.trim().split(/\s+/).map(M);if($.length===1)return $[0];if($.length===2||$.length===4)return $;if($.length===3&&$[0]!==void 0&&$[1]!==void 0&&$[2]!==void 0)return[$[0],$[1],$[2],$[1]];throw new Error(`Invalid sides value: ${f}. Expected 1 to at most 4 values.`)}function Vx(f){if(typeof f==="number")return f;if(typeof f==="string"&&f.includes("/")){let[w,$]=f.split("/").map(Number.parseFloat);if(w===void 0||$===void 0)throw new Error(`Invalid aspect ratio: ${f}. Expected format 'width/height'.`);if($===0)throw new Error(`Invalid aspect ratio: ${f}. Denominator cannot be zero.`);return w/$}if(typeof f==="string")return Number.parseFloat(f);throw new Error(`Invalid aspect ratio: ${f}`)}function dx(f){switch(f){case"block":case"flex":case"grid":case"none":return f;default:return console.warn(`Invalid display value: ${f}, fallback to 'block'.`),"block"}}function sx(f){switch(f){case"relative":case"absolute":return f;case"static":return"relative";default:return console.warn(`Invalid position value: ${f}, fallback to 'relative'.`),"relative"}}function ix(f){let w=f.trim().split(/\s+/);if(w.length<2)throw new Error(`Invalid box-shadow: ${f}`);let $=!1,A="black",Z=0;if(w[0]==="inset")$=!0,Z=1;let R=/^(#|rgb|rgba|hsl|hsla|[a-zA-Z]+)/,Y=[];for(let N=Z;N<w.length;N++){let C=w[N]??"";if(N===w.length-1&&R.test(C))A=C;else Y.push(C)}if(Y.length<2||Y.length>4)throw new Error(`Invalid box-shadow format: ${f}`);let[W="0px",O="0px",I="0px",q="0px"]=Y;try{return{color:L(A),offset_x:M(W)??0,offset_y:M(O)??0,blur_radius:M(I)??0,spread_radius:M(q)??0,inset:$}}catch{throw new Error(`Invalid box-shadow color: ${A}`)}}function Uf(f){return f.trim().split(/\s+/).map(($)=>{if($.endsWith("fr")){let A=Number.parseFloat($.slice(0,-2));if(Number.isNaN(A))return{fr:0};return{fr:A}}return M($)??0})}function tx(f){switch(f){case"row":case"column":case"row dense":case"column dense":return f.replace(" ","-");default:return console.warn(`Invalid grid-auto-flow value: ${f}, fallback to 'row'.`),"row"}}function Kf(f){if(f.startsWith("span ")){let $=Number.parseInt(f.slice(5));if(Number.isNaN($))throw new Error(`Invalid span value: ${f}`);return{start:$,end:null}}if(f.includes("/")){let $=f.split("/");if($.length!==2)throw new Error(`Invalid grid line format: ${f}`);let[A="",Z=""]=$.map((W)=>W.trim()),R=A==="auto"?null:Number.parseInt(A)||A,Y=Z==="auto"?null:Number.parseInt(Z)||Z;return{start:R,end:Y}}if(f==="auto")return{start:null,end:null};let w=Number.parseInt(f);if(Number.isNaN(w))return{start:f,end:null};return{start:w,end:null}}function px(f){let w=f.match(/repeat\(([^,]+),\s*(.+)\)/);if(w){let $=Cf(w);if(!$)throw new Error(`Invalid repeat function: ${f}`);return $}return mf(f)}function Cf(f){let[,w,$]=f;if(!w||!$)return;let A;if(w==="auto-fill")A="auto-fill";else if(w==="auto-fit")A="auto-fit";else{let R=Number.parseInt(w);if(Number.isNaN(R))return;A=R}let Z=$.trim().split(/\s+/).map((R)=>{if(R.endsWith("fr")){let Y=Number.parseFloat(R.slice(0,-2));return Number.isNaN(Y)?0:{fr:Y}}return M(R)??0});return[{repeat:[A,Z]}]}function mf(f){return f.trim().split(/\s+/).map(($)=>{if($.endsWith("fr")){let A=Number.parseFloat($.slice(0,-2));return{single:Number.isNaN(A)?0:{fr:A}}}return{single:M($)??0}})}function ox(f){if(typeof f==="number")return Math.max(1,Math.min(1000,f));if(typeof f==="string")switch(f){case"normal":return 400;case"bold":return 700;case"lighter":return 300;case"bolder":return 600;default:{let w=Number.parseInt(f);if(!Number.isNaN(w))return Math.max(1,Math.min(1000,w))}}return console.warn(`Invalid font-weight value: ${f}, fallback to 400.`),400}function wx(f){if(typeof f==="string")return Uf(f);if(Array.isArray(f))return f;return typeof f==="number"?[f]:[yx(1)]}function $x(f){if(typeof f==="string")return Kf(f);if(typeof f==="number")return{start:f,end:null};return f}function nx(f){if(typeof f==="string")return px(f);if(Array.isArray(f))return f;return typeof f==="number"?[{single:f}]:[{single:0}]}function ux(f){if(typeof f==="string")return px(f);if(Array.isArray(f))return f;return typeof f==="number"?[{single:f}]:[{single:0}]}function cx(f){if(f==="none")return 0;return Number(f)}var P=Symbol("skip-parsing"),Ff={display:dx,position:sx,width:M,height:M,maxWidth:M,maxHeight:M,minWidth:M,minHeight:M,aspectRatio:Vx,padding:K,margin:K,flexDirection:P,flexWrap:P,justifyContent:(f)=>f,alignContent:(f)=>f,justifySelf:(f)=>f,alignItems:(f)=>f,alignSelf:(f)=>f,justifyItems:(f)=>f,flexBasis:M,gap:M,flexGrow:(f)=>Number(f),flexShrink:(f)=>Number(f),borderWidth:K,backgroundColor:L,boxShadow:ix,objectFit:P,gridAutoColumns:wx,gridAutoRows:wx,gridAutoFlow:tx,gridColumn:$x,gridRow:$x,gridTemplateColumns:nx,gridTemplateRows:ux,textOverflow:(f)=>f,borderColor:L,color:L,fontSize:M,fontFamily:P,lineHeight:M,fontWeight:ox,lineClamp:cx,borderRadius:(f)=>K(f),textAlign(f){if(f==="match-parent")return void console.warn("Unsupported value for text-align found:",f);return f},letterSpacing:M,inset:(f)=>K(f)},_f=new Set(["top","right","bottom","left","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft"]);function Lf(f,w,$){if(_f.has(w))return;let A=vx($);if(A===void 0||A===null)return;let Z=Ff[w];if(!Z){console.warn(`No parser found for CSS property: ${w}`);return}let R=bx(w);if(Z===P){f[R]=A;return}try{let Y=Z(A);if(Y!=null&&Y!==void 0)f[R]=Y}catch(Y){console.warn(`Failed to parse ${w}:`,Y)}}function hf(f){let w=K(f);if(typeof w==="number")return{top:w,right:w,bottom:w,left:w};if(Array.isArray(w)){if(w.length===2)return{top:w[0],right:w[1],bottom:w[0],left:w[1]};if(w.length===4)return{top:w[0],right:w[1],bottom:w[2],left:w[3]}}return{top:0,right:0,bottom:0,left:0}}function Pf(f,w,$,A,Z,R){let Y=f[$]!==void 0||f[A]!==void 0||f[Z]!==void 0||f[R]!==void 0;return f[w]!==void 0&&!Y}function Sf(f,w){let $=f[w];if($!==void 0&&typeof $!=="object")return hf($);return{top:0,right:0,bottom:0,left:0}}function p(f,w){let $=f[w];if($!==void 0&&typeof $!=="object")return M($);return 0}function Dx(f,w,$,A,Z,R){if(f[w]===void 0&&f[$]===void 0&&f[A]===void 0&&f[Z]===void 0&&f[R]===void 0)return;if(Pf(f,w,$,A,Z,R)){let N=f[w];if(N!==void 0)return K(N)}let Y=Sf(f,w),W=Y.top,O=Y.right,I=Y.bottom,q=Y.left;if(f[$]!==void 0)W=p(f,$);if(f[A]!==void 0)O=p(f,A);if(f[Z]!==void 0)I=p(f,Z);if(f[R]!==void 0)q=p(f,R);if(W===O&&O===I&&I===q)return W;return[W,O,I,q]}function gf(f){return Dx(f,"padding","paddingTop","paddingRight","paddingBottom","paddingLeft")}function yf(f){return Dx(f,"margin","marginTop","marginRight","marginBottom","marginLeft")}function kf(f){return Dx(f,"inset","top","right","bottom","left")}function Gx(f){if(!f)return;let w={};for(let[R,Y]of Object.entries(f))Lf(w,R,Y);let $=kf(f);if($!==void 0)w.inset=$;let A=gf(f);if(A!==void 0)w.padding=A;let Z=yf(f);if(Z!==void 0)w.margin=Z;return Object.keys(w).length>0?w:void 0}var vf=Symbol.for("react.transitional.element");function Vf(f){return typeof f==="object"&&f!==null&&"$$typeof"in f&&f.$$typeof===vf}async function S(f){if(f===void 0||f===null)return[];if(f instanceof Promise)return S(await f);if(typeof f==="object"&&Symbol.iterator in f)return of(f);if(Vf(f)){let w=await df(f);return Array.isArray(w)?w:w?[w]:[]}return[_x(String(f))]}async function df(f){if(typeof f.type==="function"){let A=f.type;return S(A(f.props))}if(typeof f.type==="symbol"&&f.type===Symbol.for("react.fragment"))return await rx(f)||[];if(lx(f,"img"))return sf(f);if(lx(f,"svg"))return[tf(f)];let w=await rx(f),$=pf(f.props);return[Fx({children:w,...Gx($)})]}function sf(f){if(!f.props.src)throw new Error("Image element must have a 'src' prop.");let w=f.props.style?.width??f.props.width,$=f.props.style?.height??f.props.height;return[Tx(f.props.src,{...Gx(f.props.style),width:w?M(w):void 0,height:$?M($):void 0})]}function tf(f){return Tx(bf(ax.cloneElement(f,{xmlns:"http://www.w3.org/2000/svg",...f.props},f.props.children)))}function pf(f){return typeof f==="object"&&f&&"style"in f?f.style:void 0}function lx(f,w){return f.type===w}async function rx(f){if(typeof f.props!=="object"||f.props===null||!("children"in f.props))return[];return await S(f.props.children)}async function of(f){return(await Promise.all(Array.from(f).map(S))).flat()}export{hx as vw,Px as vh,_x as text,uf as style,gx as rem,Lx as percentage,Tx as image,cf as gradient,S as fromJsx,yx as fr,Sx as em,Fx as container};
13
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),x}function Af(){}function k(x){if(s===null)try{var T=("require"+Math.random()).slice(0,7);s=(p&&p[T]).call(p,"timers").setImmediate}catch(D){s=function(G){Cx===!1&&(Cx=!0,typeof MessageChannel==="undefined"&&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 X=new MessageChannel;X.port1.onmessage=G,X.port2.postMessage(void 0)}}return s(x)}function P(x){return 1<x.length&&typeof AggregateError==="function"?new AggregateError(x):x[0]}function b(x,T){T!==i-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. "),i=T}function c(x,T,D){var G=E.actQueue;if(G!==null)if(G.length!==0)try{l(G),k(function(){return c(x,T,D)});return}catch(X){E.thrownErrors.push(X)}else E.actQueue=null;0<E.thrownErrors.length?(G=P(E.thrownErrors),E.thrownErrors.length=0,D(G)):T(x)}function l(x){if(!Tx){Tx=!0;var T=0;try{for(;T<x.length;T++){var D=x[T];do{E.didUsePromise=!1;var G=D(!1);if(G!==null){if(E.didUsePromise){x[T]=D,x.splice(0,T);return}D=G}else break}while(1)}x.length=0}catch(X){x.splice(0,T+1),E.thrownErrors.push(X)}finally{Tx=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=Symbol.for("react.transitional.element"),Zx=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),Hx=Symbol.for("react.strict_mode"),Bx=Symbol.for("react.profiler"),e=Symbol.for("react.consumer"),Ex=Symbol.for("react.context"),Qx=Symbol.for("react.forward_ref"),Yx=Symbol.for("react.suspense"),Xf=Symbol.for("react.suspense_list"),xx=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),Zf=Symbol.for("react.activity"),Jx=Symbol.iterator,Rx={},Mx={isMounted:function(){return!1},enqueueForceUpdate:function(x){$(x,"forceUpdate")},enqueueReplaceState:function(x){$(x,"replaceState")},enqueueSetState:function(x){$(x,"setState")}},zx=Object.assign,fx={};Object.freeze(fx),A.prototype.isReactComponent={},A.prototype.setState=function(x,T){if(typeof x!=="object"&&typeof x!=="function"&&x!=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,x,T,"setState")},A.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};var N={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)."]},V;for(V in N)N.hasOwnProperty(V)&&f(V,N[V]);Z.prototype=A.prototype,N=R.prototype=new Z,N.constructor=R,zx(N,A.prototype),N.isPureReactComponent=!0;var Wx=Array.isArray,Hf=Symbol.for("react.client.reference"),E={H:null,A:null,T:null,S:null,V:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},d=Object.prototype.hasOwnProperty,Ox=console.createTask?console.createTask:function(){return null};N={react_stack_bottom_frame:function(x){return x()}};var Ix,jx,Nx={},Bf=N.react_stack_bottom_frame.bind(N,q)(),Ef=Ox(j(q)),qx=!1,Ux=/\/+/g,Kx=typeof reportError==="function"?reportError:function(x){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof x==="object"&&x!==null&&typeof x.message==="string"?String(x.message):String(x),error:x});if(!window.dispatchEvent(T))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",x);return}console.error(x)},Cx=!1,s=null,i=0,t=!1,Tx=!1,Fx=typeof queueMicrotask==="function"?function(x){queueMicrotask(function(){return queueMicrotask(x)})}:k;N=Object.freeze({__proto__:null,c:function(x){return z().useMemoCache(x)}}),If.Children={map:y,forEach:function(x,T,D){y(x,function(){T.apply(this,arguments)},D)},count:function(x){var T=0;return y(x,function(){T++}),T},toArray:function(x){return y(x,function(T){return T})||[]},only:function(x){if(!_(x))throw Error("React.Children.only expected to receive a single React element child.");return x}},If.Component=A,If.Fragment=a,If.Profiler=Bx,If.PureComponent=R,If.StrictMode=Hx,If.Suspense=Yx,If.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,If.__COMPILER_RUNTIME=N,If.act=function(x){var T=E.actQueue,D=i;i++;var G=E.actQueue=T!==null?T:[],X=!1;try{var Q=x()}catch(B){E.thrownErrors.push(B)}if(0<E.thrownErrors.length)throw b(T,D),x=P(E.thrownErrors),E.thrownErrors.length=0,x;if(Q!==null&&typeof Q==="object"&&typeof Q.then==="function"){var H=Q;return Fx(function(){X||t||(t=!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(B,K){X=!0,H.then(function(m){if(b(T,D),D===0){try{l(G),k(function(){return c(m,B,K)})}catch(Yf){E.thrownErrors.push(Yf)}if(0<E.thrownErrors.length){var Qf=P(E.thrownErrors);E.thrownErrors.length=0,K(Qf)}}else B(m)},function(m){b(T,D),0<E.thrownErrors.length?(m=P(E.thrownErrors),E.thrownErrors.length=0,K(m)):K(m)})}}}var J=Q;if(b(T,D),D===0&&(l(G),G.length!==0&&Fx(function(){X||t||(t=!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(() => ...)"))}),E.actQueue=null),0<E.thrownErrors.length)throw x=P(E.thrownErrors),E.thrownErrors.length=0,x;return{then:function(B,K){X=!0,D===0?(E.actQueue=G,k(function(){return c(J,B,K)})):B(J)}}},If.cache=function(x){return function(){return x.apply(null,arguments)}},If.captureOwnerStack=function(){var x=E.getCurrentStack;return x===null?null:x()},If.cloneElement=function(x,T,D){if(x===null||x===void 0)throw Error("The argument must be a React element, but you passed "+x+".");var G=zx({},x.props),X=x.key,Q=x._owner;if(T!=null){var H;x:{if(d.call(T,"ref")&&(H=Object.getOwnPropertyDescriptor(T,"ref").get)&&H.isReactWarning){H=!1;break x}H=T.ref!==void 0}H&&(Q=U()),F(T)&&(O(T.key),X=""+T.key);for(J in T)!d.call(T,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&T.ref===void 0||(G[J]=T[J])}var J=arguments.length-2;if(J===1)G.children=D;else if(1<J){H=Array(J);for(var B=0;B<J;B++)H[B]=arguments[B+2];G.children=H}G=n(x.type,X,void 0,void 0,Q,G,x._debugStack,x._debugTask);for(X=2;X<arguments.length;X++)Q=arguments[X],_(Q)&&Q._store&&(Q._store.validated=1);return G},If.createContext=function(x){return x={$$typeof:Ex,_currentValue:x,_currentValue2:x,_threadCount:0,Provider:null,Consumer:null},x.Provider=x,x.Consumer={$$typeof:e,_context:x},x._currentRenderer=null,x._currentRenderer2=null,x},If.createElement=function(x,T,D){for(var G=2;G<arguments.length;G++){var X=arguments[G];_(X)&&X._store&&(X._store.validated=1)}if(G={},X=null,T!=null)for(B in jx||!("__self"in T)||"key"in T||(jx=!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")),F(T)&&(O(T.key),X=""+T.key),T)d.call(T,B)&&B!=="key"&&B!=="__self"&&B!=="__source"&&(G[B]=T[B]);var Q=arguments.length-2;if(Q===1)G.children=D;else if(1<Q){for(var H=Array(Q),J=0;J<Q;J++)H[J]=arguments[J+2];Object.freeze&&Object.freeze(H),G.children=H}if(x&&x.defaultProps)for(B in Q=x.defaultProps,Q)G[B]===void 0&&(G[B]=Q[B]);X&&ff(G,typeof x==="function"?x.displayName||x.name||"Unknown":x);var B=1e4>E.recentlyCreatedOwnerStacks++;return n(x,X,void 0,void 0,U(),G,B?Error("react-stack-top-frame"):Bf,B?Ox(j(x)):Ef)},If.createRef=function(){var x={current:null};return Object.seal(x),x},If.forwardRef=function(x){x!=null&&x.$$typeof===xx?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof x!=="function"?console.error("forwardRef requires a render function but was given %s.",x===null?"null":typeof x):x.length!==0&&x.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",x.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),x!=null&&x.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var T={$$typeof:Qx,render:x},D;return Object.defineProperty(T,"displayName",{enumerable:!1,configurable:!0,get:function(){return D},set:function(G){D=G,x.name||x.displayName||(Object.defineProperty(x,"name",{value:G}),x.displayName=G)}}),T},If.isValidElement=_,If.lazy=function(x){return{$$typeof:v,_payload:{_status:-1,_result:x},_init:Gf}},If.memo=function(x,T){x==null&&console.error("memo: The first argument must be a component. Instead received: %s",x===null?"null":typeof x),T={$$typeof:xx,type:x,compare:T===void 0?null:T};var D;return Object.defineProperty(T,"displayName",{enumerable:!1,configurable:!0,get:function(){return D},set:function(G){D=G,x.name||x.displayName||(Object.defineProperty(x,"name",{value:G}),x.displayName=G)}}),T},If.startTransition=function(x){var T=E.T,D={};E.T=D,D._updatedFibers=new Set;try{var G=x(),X=E.S;X!==null&&X(D,G),typeof G==="object"&&G!==null&&typeof G.then==="function"&&G.then(Af,Kx)}catch(Q){Kx(Q)}finally{T===null&&D._updatedFibers&&(x=D._updatedFibers.size,D._updatedFibers.clear(),10<x&&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.")),E.T=T}},If.unstable_useCacheRefresh=function(){return z().useCacheRefresh()},If.use=function(x){return z().use(x)},If.useActionState=function(x,T,D){return z().useActionState(x,T,D)},If.useCallback=function(x,T){return z().useCallback(x,T)},If.useContext=function(x){var T=z();return x.$$typeof===e&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),T.useContext(x)},If.useDebugValue=function(x,T){return z().useDebugValue(x,T)},If.useDeferredValue=function(x,T){return z().useDeferredValue(x,T)},If.useEffect=function(x,T,D){x==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");var G=z();if(typeof D==="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return G.useEffect(x,T)},If.useId=function(){return z().useId()},If.useImperativeHandle=function(x,T,D){return z().useImperativeHandle(x,T,D)},If.useInsertionEffect=function(x,T){return x==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),z().useInsertionEffect(x,T)},If.useLayoutEffect=function(x,T){return x==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),z().useLayoutEffect(x,T)},If.useMemo=function(x,T){return z().useMemo(x,T)},If.useOptimistic=function(x,T){return z().useOptimistic(x,T)},If.useReducer=function(x,T,D){return z().useReducer(x,T,D)},If.useRef=function(x){return z().useRef(x)},If.useState=function(x){return z().useState(x)},If.useSyncExternalStore=function(x,T,D){return z().useSyncExternalStore(x,T,D)},If.useTransition=function(){return z().useTransition()},If.version="19.1.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!=="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});function Lx(f){return{type:"container",...f}}function mx(f,w){return{...w,type:"text",text:f}}function wx(f,w){return{...w,type:"image",src:f}}function lf(f){return f}function hx(f){return{percentage:f}}function Px(f){return{vw:f}}function Sx(f){return{vh:f}}function W(f){return{em:f}}function gx(f){return{rem:f}}function yx(f){return{fr:f}}function rf(f,w,$=0){return{from:f,to:w,angle:$}}function kx(f,w,$,A=1){return[f,w,$,A]}var xf=Wf(bx(),1);import{renderToString as Vf}from"react-dom/server";function vx(f){return f.replace(/[A-Z]/g,(w)=>`_${w.toLowerCase()}`)}var jf=["-moz-","-webkit-","-o-","-ms-"];function Vx(f){if(typeof f!=="string")return f;if(Nf(f))return;if(f[0]==="-"){for(let w of jf)if(f.startsWith(w))return f.slice(w.length);throw new Error(`Unsupported prefix in value: ${f}`)}return f}function Nf(f){return f==="inherit"||f==="initial"||f==="revert"||f==="unset"}function qf(f){if(f.length===7)return Number.parseInt(f.slice(1),16);if(f.length===9){let w=Number.parseInt(f.slice(1),16);return[w>>24&255,w>>16&255,w>>8&255,(w&255)/255]}throw new Error(`Invalid hex color: ${f}`)}function Uf(f){let w=f.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(w){let[,$,A,Z]=w;return[Number($),Number(A),Number(Z)]}return null}function Kf(f){let w=f.match(/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([0-9]*\.?[0-9]+)\s*\)$/);if(w){let[,$,A,Z,R]=w,Y=Number($),O=Number(A),I=Number(Z),j=Number(R);if(Y<0||Y>255||O<0||O>255||I<0||I>255)return null;if(j<0||j>1)return null;return[Y,O,I,j]}return null}function h(f){if(f.startsWith("#"))return qf(f);if(f.startsWith("rgb(")){let w=Uf(f);if(w!==null)return w}if(f.startsWith("rgba(")){let w=Kf(f);if(w!==null)return w}throw new Error(`Invalid RGB color: ${f}`)}function M(f){if(typeof f==="number")return f;if(f==="auto"||f==="min-content"||f==="max-content")return f;let w=f.match(/^(-?[\d.]+)(.*)$/);if(!w)return 0;let[,$,A]=w;if(!$)return 0;let Z=Number.parseFloat($);switch(A){case"%":return hx(Z);case"rem":return gx(Z);case"em":return W(Z);case"vh":return Sx(Z);case"vw":return Px(Z);case"px":case"":return Z;default:return Z}}function C(f){if(typeof f==="number")return M(f);let $=f.trim().split(/\s+/).map(M);if($.length===1)return $[0];if($.length===2||$.length===4)return $;if($.length===3&&$[0]!==void 0&&$[1]!==void 0&&$[2]!==void 0)return[$[0],$[1],$[2],$[1]];throw new Error(`Invalid sides value: ${f}. Expected 1 to at most 4 values.`)}function dx(f){if(typeof f==="number")return f;if(typeof f==="string"&&f.includes("/")){let[w,$]=f.split("/").map(Number.parseFloat);if(w===void 0||$===void 0)throw new Error(`Invalid aspect ratio: ${f}. Expected format 'width/height'.`);if($===0)throw new Error(`Invalid aspect ratio: ${f}. Denominator cannot be zero.`);return w/$}if(typeof f==="string")return Number.parseFloat(f);throw new Error(`Invalid aspect ratio: ${f}`)}function sx(f){switch(f){case"block":case"flex":case"grid":case"none":return f;default:return console.warn(`Invalid display value: ${f}, fallback to 'block'.`),"block"}}function ix(f){switch(f){case"relative":case"absolute":return f;case"static":return"relative";default:return console.warn(`Invalid position value: ${f}, fallback to 'relative'.`),"relative"}}function tx(f){let w=f.trim().split(/\s+/);if(w.length<2)throw new Error(`Invalid box-shadow: ${f}`);let $=!1,A="black",Z=0;if(w[0]==="inset")$=!0,Z=1;let R=/^(#|rgb|rgba|hsl|hsla|[a-zA-Z]+)/,Y=[];for(let q=Z;q<w.length;q++){let F=w[q]??"";if(q===w.length-1&&R.test(F))A=F;else Y.push(F)}if(Y.length<2||Y.length>4)throw new Error(`Invalid box-shadow format: ${f}`);let[O="0px",I="0px",j="0px",U="0px"]=Y;try{return{color:h(A),offset_x:M(O)??0,offset_y:M(I)??0,blur_radius:M(j)??0,spread_radius:M(U)??0,inset:$}}catch{throw new Error(`Invalid box-shadow color: ${A}`)}}function Cf(f){return f.trim().split(/\s+/).map(($)=>{if($.endsWith("fr")){let A=Number.parseFloat($.slice(0,-2));if(Number.isNaN(A))return{fr:0};return{fr:A}}return M($)??0})}function px(f){switch(f){case"row":case"column":case"row dense":case"column dense":return f.replace(" ","-");default:return console.warn(`Invalid grid-auto-flow value: ${f}, fallback to 'row'.`),"row"}}function Ff(f){if(f.startsWith("span ")){let $=Number.parseInt(f.slice(5));if(Number.isNaN($))throw new Error(`Invalid span value: ${f}`);return{start:$,end:null}}if(f.includes("/")){let $=f.split("/");if($.length!==2)throw new Error(`Invalid grid line format: ${f}`);let[A="",Z=""]=$.map((O)=>O.trim()),R=A==="auto"?null:Number.parseInt(A)||A,Y=Z==="auto"?null:Number.parseInt(Z)||Z;return{start:R,end:Y}}if(f==="auto")return{start:null,end:null};let w=Number.parseInt(f);if(Number.isNaN(w))return{start:f,end:null};return{start:w,end:null}}function ox(f){let w=f.match(/repeat\(([^,]+),\s*(.+)\)/);if(w){let $=_f(w);if(!$)throw new Error(`Invalid repeat function: ${f}`);return $}return Lf(f)}function _f(f){let[,w,$]=f;if(!w||!$)return;let A;if(w==="auto-fill")A="auto-fill";else if(w==="auto-fit")A="auto-fit";else{let R=Number.parseInt(w);if(Number.isNaN(R))return;A=R}let Z=$.trim().split(/\s+/).map((R)=>{if(R.endsWith("fr")){let Y=Number.parseFloat(R.slice(0,-2));return Number.isNaN(Y)?0:{fr:Y}}return M(R)??0});return[{repeat:[A,Z]}]}function Lf(f){return f.trim().split(/\s+/).map(($)=>{if($.endsWith("fr")){let A=Number.parseFloat($.slice(0,-2));return{single:Number.isNaN(A)?0:{fr:A}}}return{single:M($)??0}})}function nx(f){if(typeof f==="number")return Math.max(1,Math.min(1000,f));if(typeof f==="string")switch(f){case"normal":return 400;case"bold":return 700;case"lighter":return 300;case"bolder":return 600;default:{let w=Number.parseInt(f);if(!Number.isNaN(w))return Math.max(1,Math.min(1000,w))}}return console.warn(`Invalid font-weight value: ${f}, fallback to 400.`),400}function $x(f){if(typeof f==="string")return Cf(f);if(Array.isArray(f))return f;return typeof f==="number"?[f]:[yx(1)]}function Dx(f){if(typeof f==="string")return Ff(f);if(typeof f==="number")return{start:f,end:null};return f}function ux(f){if(typeof f==="string")return ox(f);if(Array.isArray(f))return f;return typeof f==="number"?[{single:f}]:[{single:0}]}function cx(f){if(typeof f==="string")return ox(f);if(Array.isArray(f))return f;return typeof f==="number"?[{single:f}]:[{single:0}]}function lx(f){if(f==="none")return 0;return Number(f)}var S=Symbol("skip-parsing"),mf={display:sx,position:ix,width:M,height:M,maxWidth:M,maxHeight:M,minWidth:M,minHeight:M,aspectRatio:dx,padding:C,margin:C,flexDirection:S,flexWrap:S,justifyContent:(f)=>f,alignContent:(f)=>f,justifySelf:(f)=>f,alignItems:(f)=>f,alignSelf:(f)=>f,justifyItems:(f)=>f,flexBasis:M,gap:M,flexGrow:(f)=>Number(f),flexShrink:(f)=>Number(f),borderWidth:C,backgroundColor:h,boxShadow:tx,objectFit:S,gridAutoColumns:$x,gridAutoRows:$x,gridAutoFlow:px,gridColumn:Dx,gridRow:Dx,gridTemplateColumns:ux,gridTemplateRows:cx,textOverflow:(f)=>f,borderColor:h,color:h,fontSize:M,fontFamily:S,lineHeight:M,fontWeight:nx,lineClamp:lx,borderRadius:(f)=>C(f),textAlign(f){if(f==="match-parent")return void console.warn("Unsupported value for text-align found:",f);return f},letterSpacing:M,inset:(f)=>C(f)},hf=new Set(["top","right","bottom","left","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft"]);function Pf(f,w,$){if(hf.has(w))return;let A=Vx($);if(A===void 0||A===null)return;let Z=mf[w];if(!Z){console.warn(`No parser found for CSS property: ${w}`);return}let R=vx(w);if(Z===S){f[R]=A;return}try{let Y=Z(A);if(Y!=null&&Y!==void 0)f[R]=Y}catch(Y){console.warn(`Failed to parse ${w}:`,Y)}}function Sf(f){let w=C(f);if(typeof w==="number")return{top:w,right:w,bottom:w,left:w};if(Array.isArray(w)){if(w.length===2)return{top:w[0],right:w[1],bottom:w[0],left:w[1]};if(w.length===4)return{top:w[0],right:w[1],bottom:w[2],left:w[3]}}return{top:0,right:0,bottom:0,left:0}}function gf(f,w,$,A,Z,R){let Y=f[$]!==void 0||f[A]!==void 0||f[Z]!==void 0||f[R]!==void 0;return f[w]!==void 0&&!Y}function yf(f,w){let $=f[w];if($!==void 0&&typeof $!=="object")return Sf($);return{top:0,right:0,bottom:0,left:0}}function o(f,w){let $=f[w];if($!==void 0&&typeof $!=="object")return M($);return 0}function Gx(f,w,$,A,Z,R){if(f[w]===void 0&&f[$]===void 0&&f[A]===void 0&&f[Z]===void 0&&f[R]===void 0)return;if(gf(f,w,$,A,Z,R)){let q=f[w];if(q!==void 0)return C(q)}let Y=yf(f,w),O=Y.top,I=Y.right,j=Y.bottom,U=Y.left;if(f[$]!==void 0)O=o(f,$);if(f[A]!==void 0)I=o(f,A);if(f[Z]!==void 0)j=o(f,Z);if(f[R]!==void 0)U=o(f,R);if(O===I&&I===j&&j===U)return O;return[O,I,j,U]}function kf(f){return Gx(f,"padding","paddingTop","paddingRight","paddingBottom","paddingLeft")}function bf(f){return Gx(f,"margin","marginTop","marginRight","marginBottom","marginLeft")}function vf(f){return Gx(f,"inset","top","right","bottom","left")}function Ax(f){if(!f)return;let w={};for(let[R,Y]of Object.entries(f))Pf(w,R,Y);let $=vf(f);if($!==void 0)w.inset=$;let A=kf(f);if(A!==void 0)w.padding=A;let Z=bf(f);if(Z!==void 0)w.margin=Z;return Object.keys(w).length>0?w:void 0}var rx={p:{margin:[W(1),0]},blockquote:{margin:[W(1),40]},center:{text_align:"center"},hr:{margin:[W(0.5),"auto"],border_width:1},h1:{font_size:W(2),margin:[W(0.67),0],font_weight:700},h2:{font_size:W(1.5),margin:[W(0.83),0],font_weight:700},h3:{font_size:W(1.17),margin:[W(1),0],font_weight:700},h4:{margin:[W(1.33),0],font_weight:700},h5:{font_size:W(0.83),margin:[W(1.67),0],font_weight:700},h6:{font_size:W(0.67),margin:[W(2.33),0],font_weight:700},strong:{font_weight:700},b:{font_weight:700},code:{font_family:"monospace"},kbd:{font_family:"monospace"},pre:{font_family:"monospace",margin:[W(1),0]},mark:{background_color:kx(255,255,0),color:0},big:{font_size:19.2},small:{font_size:13.333333333333334}};var df=Symbol.for("react.transitional.element");function sf(f){return typeof f==="object"&&f!==null&&"$$typeof"in f&&f.$$typeof===df}async function g(f){if(f===void 0||f===null)return[];if(f instanceof Promise)return g(await f);if(typeof f==="object"&&Symbol.iterator in f)return uf(f);if(sf(f)){let w=await tf(f);return Array.isArray(w)?w:w?[w]:[]}return[mx(String(f))]}async function tf(f){if(typeof f.type==="function"){let A=f.type;return g(A(f.props))}if(typeof f.type==="symbol"&&f.type===Symbol.for("react.fragment"))return await ex(f)||[];if(ax(f,"img"))return pf(f);if(ax(f,"svg"))return[of(f)];let w=await ex(f),$=nf(f.props);return[Lx({children:w,...rx[f.type],...Ax($)})]}function pf(f){if(!f.props.src)throw new Error("Image element must have a 'src' prop.");let w=f.props.style?.width??f.props.width,$=f.props.style?.height??f.props.height;return[wx(f.props.src,{...Ax(f.props.style),width:w?M(w):void 0,height:$?M($):void 0})]}function of(f){return wx(Vf(xf.cloneElement(f,{xmlns:"http://www.w3.org/2000/svg",...f.props},f.props.children)))}function nf(f){return typeof f==="object"&&f&&"style"in f?f.style:void 0}function ax(f,w){return f.type===w}async function ex(f){if(typeof f.props!=="object"||f.props===null||!("children"in f.props))return[];return await g(f.props.children)}async function uf(f){return(await Promise.all(Array.from(f).map(g))).flat()}export{Px as vw,Sx as vh,mx as text,lf as style,kx as rgba,gx as rem,hx as percentage,wx as image,rf as gradient,g as fromJsx,yx as fr,W as em,Lx as container};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takumi-rs/helpers",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "author": {
5
5
  "email": "me@kane.tw",
6
6
  "name": "Kane Wang",