able-baker/bundled/preact/compat.js

19 lines
9.9 KiB
JavaScript
Raw Normal View History

2024-05-14 17:17:10 -04:00
///<reference types="https://esm.sh/v128/preact@10.20.2/compat/src/index.d.ts"/>
/* esm.sh - esbuild bundle(preact@10.20.2/compat) es2022 production */
2024-05-14 20:34:18 -04:00
import{Component as f,createElement as c,options as i,toChildArray as _,Fragment as d,render as m,hydrate as W,createContext as $,createRef as H,cloneElement as z}
from"./preact.js";
export {createElement as jsx, createElement as jsxs} from "./preact.js";
import{Component as Ve,Fragment as We,createContext as $e,createElement as He,createRef as ze}
from"./preact.js";
import{useState as D,useId as B,useReducer as j,useEffect as I,useLayoutEffect as E,useRef as Y,useImperativeHandle as Z,useMemo as q,useCallback as G,useContext as J,useDebugValue as K}
from"./hooks.js";
export*from
"./hooks.js";
function L(e,t){for(var n in t)e[n]=t[n];return e}function b(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function C(e,t){this.props=e,this.context=t}function Q(e,t){function n(o){var a=this.props.ref,u=a==o.ref;return!u&&a&&(a.call?a(null):a.current=null),t?!t(this.props,o)||!u:b(this.props,o)}function r(o){return this.shouldComponentUpdate=n,c(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(C.prototype=new f).isPureReactComponent=!0,C.prototype.shouldComponentUpdate=function(e,t){return b(this.props,e)||b(this.state,t)};var N=i.__b;i.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),N&&N(e)};var X=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ee(e){function t(n){var r=L({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=X,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var R=function(e,t){return e==null?null:_(_(e).map(t))},te={map:R,forEach:R,count:function(e){return e?_(e).length:0},only:function(e){var t=_(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:_},ne=i.__e;i.__e=function(e,t,n,r){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}ne(e,t,n,r)};var x=i.unmount;function T(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=L({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return T(r,t,n)})),e}function M(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return M(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function h(){this.__u=0,this.t=null,this.__b=null}function A(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function re(e){var t,n,r;function o(a){if(t||(t=e()).then(function(u){n=u.default||u},function(u){r=u}),r)throw r;if(!n)throw t;return c(n,a)}return o.displayName="Lazy",o.__f=!0,o}function p(){this.u=null,this.o=null}i.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),x&&x(e)},(h.prototype=new f).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=A(r.__v),a=!1,u=function(){a||(a=!0,n.__R=null,o?o(l):l())};n.__R=u;var l=function(){if(!--r.__u){if(r.state.__a){var s=r.state.__a;r.__v.__k[0]=M(s,s.__c.__P,s.__c.__O)}var g;for(r.setState({__a:r.__b=null});g=r.t.pop();)g.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(u,u)},h.prototype.componentWillUnmount=function(){this.t=[]},h.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=T(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&c(d,null,e.fallback);return o&&(o.__u&=-33),[c(d,null,t.__a?null:e.children),o]};var k=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function oe(e){return this.getChildContext=function(){return e.context},e.children}function ae(e){var t=this,n=e.i;t.componentWillUnmount=function(){m(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(r){this.childNodes.push(r),t.i.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.i.removeChild(r)}}),m(c(oe,{context:t.context},e.__v),t.l)}function ue(e,t){var n=c(ae,{__v:e,i:t});return n.containerInfo=t,n}(p.prototype=new f).__a=function(e){var t=this,n=A(t.__v),r=t.o.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),k(t,e,r)):o()};n?n(a):a()}},p.prototype.render=function(e){this.u=null,this.o=new Map;var t=_(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&
export{te as Children,Ve as Component,We as Fragment,C as PureComponent,ke as StrictMode,h as Suspense,p as SuspenseList,ye as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Se as cloneElement,$e as createContext,He as createElement,be as createFactory,ue as createPortal,ze as createRef,Me as default,Ne as findDOMNode,xe as flushSync,ee as forwardRef,pe as hydrate,Ue as isElement,Ce as isFragment,Ee as isMemo,v as isValidElement,re as lazy,Q as memo,fe as render,V as startTransition,ge as unmountComponentAtNode,Re as unstable_batchedUpdates,Oe as useDeferredValue,we as useInsertionEffect,De as useSyncExternalStore,Pe as useTransition,Te as version};