PageSourceSearch

https://mastodon.macstories.net/packs/typed_functions-Whap35TF.js

js macstories.net collected 2026-09-24 08:38:45 UTC 13,415 bytes, 6 lines download raw bytes

1import{o as e,t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n}from"./react-C21x__mS.js";import{n as r,r as i}from"./redux-toolkit.modern-DNDb-du5.js";function a(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function o(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var s=e=>Array.isArray(e)?e:[e];function c(e){let t=Array.isArray(e[0])?e[0]:e;return o(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function l(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var u=class{constructor(e){this.value=e}deref(){return this.value}},d=typeof WeakRef>`u`?u:WeakRef,f=0,p=1;function m(){return{s:f,v:void 0,o:null,p:null}}function h(e){return e instanceof d?e.deref():e}function g(e,t={}){let n=m(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=m(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=m(),e.set(n,t)):t=r}}let s=t,c;if(t.s===p)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=h(i);e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new d(c):c}return s.s=p,s.v=c,c}return o.clearCache=()=>{n=m(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function _(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,o={},u=e.pop();typeof u==`object`&&(o=u,u=e.pop()),a(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let{memoize:d,memoizeOptions:f=[],argsMemoize:p=g,argsMemoizeOptions:m=[]}={...n,...o},h=s(f),_=s(m),v=c(e),y=d(function(){return t++,u.apply(null,arguments)},...h),b=p(function(){r++;let e=l(v,arguments);return i=y.apply(null,e),i},..._);return Object.assign(b,{resultFunc:u,memoizedResultFunc:y,dependencies:v,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:d,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var v=_(g),y=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),b=t(((e,t)=>{t.exports=y()})),x=e(n(),1),S=b(),C=Symbol.for(`react.transitional.element`),w=Symbol.for(`react.portal`),T=Symbol.for(`react.fragment`),E=Symbol.for(`react.strict_mode`),D=Symbol.for(`react.profiler`),O=Symbol.for(`react.consumer`),ee=Symbol.for(`react.context`),k=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),ne=Symbol.for(`react.suspense_list`),A=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),ie=k,ae=A;function oe(e){if(typeof e==`object`&&e){let{$$typeof:t}=e;switch(t){case C:switch(e=e.type,e){case T:case D:case E:case te:case ne:return e;default:switch(e&&=e.$$typeof,e){case ee:case k:case re:case A:return e;case O:return e;default:return t}}case w:return t}}}function se(e){return oe(e)===A}function ce(e,t,n,r,{areStatesEqual:i,areOwnPropsEqual:a,areStatePropsEqual:o}){let s=!1,c,l,u,d,f;function p(i,a){return c=i,l=a,u=e(c,l),d=t(r,l),f=n(u,d,l),s=!0,f}
vendor: 4,404 bytes, line 1
1function m(){return u=e(c,l),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function h(){return e.dependsOnOwnProps&&(u=e(c,l)),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function g(){let t=e(c,l),r=!o(t,u);return u=t,r&&(f=n(u,d,l)),f}function _(e,t){let n=!a(t,l),r=!i(e,c,t,l);return c=e,l=t,n&&r?m():n?h():r?g():f}return function(e,t){return s?_(e,t):p(e,t)}}function le(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...i}){return ce(t(e,i),n(e,i),r(e,i),e,i)}function ue(e,t){let n={};for(let r in e){let i=e[r];typeof i==`function`&&(n[r]=(...e)=>t(i(...e)))}return n}function j(e){return function(t){let n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function M(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function N(e,t){return function(t,{displayName:n}){let r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e,void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=M(e);let i=r(t,n);return typeof i==`function`&&(r.mapToProps=i,r.dependsOnOwnProps=M(i),i=r(t,n)),i},r}}function P(e,t){return(n,r)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function de(e){return e&&typeof e==`object`?j(t=>ue(e,t)):e?typeof e==`function`?N(e,`mapDispatchToProps`):P(e,`mapDispatchToProps`):j(e=>({dispatch:e}))}function fe(e){return e?typeof e==`function`?N(e,`mapStateToProps`):P(e,`mapStateToProps`):j(()=>({}))}function pe(e,t,n){return{...n,...e,...t}}function me(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let i=!1,a;return function(t,n,o){let s=e(t,n,o);return i?r(s,a)||(a=s):(i=!0,a=s),a}}}function he(e){return e?typeof e==`function`?me(e):P(e,`mergeProps`):()=>pe}function ge(e){e()}function _e(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ge(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var F={notify(){},get:()=>[]};function I(e,t){let n,r=F,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=_e())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=F)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var ve=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,ye=typeof navigator<`u`&&navigator.product===`ReactNative`,L=ve||ye?x.useLayoutEffect:x.useEffect;function R(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function z(e,t){if(R(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!R(e[n[r]],t[n[r]]))return!1;return!0}var be={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},xe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Se={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},B={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ce={[ie]:Se,[ae]:B};function V(e){return se(e)?B:Ce[e.$$typeof]||be}var we=Object.defineProperty,Te=Object.getOwnPropertyNames,H=Object.getOwnPropertySymbols,Ee=Object.getOwnPropertyDescriptor,De=Object.getPrototypeOf,U=Object.prototype;function W(e,t){if(typeof t!=`string`){if(U){let n=De(t);n&&n!==U&&W(e,n)}let n=Te(t);H&&(n=n.concat(H(t)));let r=V(e),i=V(t);for(let a=0;a<n.length;++a){let o=n[a];if(!xe[o]&&!(i&&i[o])&&!(r&&r[o])){let n=Ee(t,o);try{we(e,o,n)}catch{}}}}return e}var Oe=Symbol.for(`react-redux-context`),ke=typeof globalThis<`u`?globalThis:{};function Ae(){if(!x.createContext)return{};let e=ke[Oe]??=new Map,t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}
1var G=Ae(),je=[null,null];function Me(e,t,n){L(()=>e(...t),n)}function Ne(e,t,n,r,i,a){e.current=r,n.current=!1,i.current&&(i.current=null,a())}function Pe(e,t,n,r,i,a,o,s,c,l,u){if(!e)return()=>{};let d=!1,f=null,p=()=>{if(d||!s.current)return;let e=t.getState(),n,p;try{n=r(e,i.current)}catch(e){p=e,f=e}p||(f=null),n===a.current?o.current||l():(a.current=n,c.current=n,o.current=!0,u())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}function Fe(e,t){return e===t}function Ie(e,t,n,{pure:r,areStatesEqual:i=Fe,areOwnPropsEqual:a=z,areStatePropsEqual:o=z,areMergedPropsEqual:s=z,forwardRef:c=!1,context:l=G}={}){let u=l,d=fe(e),f=de(t),p=he(n),m=!!e;return e=>{let t=e.displayName||e.name||`Component`,n=`Connect(${t})`,r={shouldHandleStateChanges:m,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:d,initMapDispatchToProps:f,initMergeProps:p,areStatesEqual:i,areStatePropsEqual:o,areOwnPropsEqual:a,areMergedPropsEqual:s};function l(t){let[n,i,a]=x.useMemo(()=>{let{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),o=x.useMemo(()=>{let e=u;return n?.Consumer,e},[n,u]),s=x.useContext(o),c=!!t.store&&!!t.store.getState&&!!t.store.dispatch,l=!!s&&!!s.store,d=c?t.store:s.store,f=l?s.getServerState:d.getState,p=x.useMemo(()=>le(d.dispatch,r),[d]),[h,g]=x.useMemo(()=>{if(!m)return je;let e=I(d,c?void 0:s.subscription);return[e,e.notifyNestedSubs.bind(e)]},[d,c,s]),_=x.useMemo(()=>c?s:{...s,subscription:h},[c,s,h]),v=x.useRef(void 0),y=x.useRef(a),b=x.useRef(void 0),S=x.useRef(!1),C=x.useRef(!1),w=x.useRef(void 0);L(()=>(C.current=!0,()=>{C.current=!1}),[]);let T=x.useMemo(()=>()=>b.current&&a===y.current?b.current:p(d.getState(),a),[d,a]),E=x.useMemo(()=>e=>h?Pe(m,d,h,p,y,v,S,C,b,g,e):()=>{},[h]);Me(Ne,[y,v,S,a,b,g]);let D;try{D=x.useSyncExternalStore(E,T,f?()=>p(f(),a):T)}catch(e){throw w.current&&(e.message+=`
2The error may be correlated with this previous error:
3${w.current.stack}
4
5`),e}L(()=>{w.current=void 0,b.current=void 0,v.current=D});let O=x.useMemo(()=>x.createElement(e,{...D,ref:i}),[i,e,D]);return x.useMemo(()=>m?x.createElement(o.Provider,{value:_},O):O,[o,O,_])}let h=x.memo(l);if(h.WrappedComponent=e,h.displayName=l.displayName=n,c){let t=x.forwardRef(function(e,t){return x.createElement(h,{...e,reactReduxForwardedRef:t})});return t.displayName=n,t.WrappedComponent=e,W(t,e)}return W(h,e)}}var Le=Ie;function Re(e){let{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{let e=I(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),o=x.useMemo(()=>i.getState(),[i]);L(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||G;return x.createElement(s.Provider,{value:a},t)}var ze=Re;function K(e=G){return function(){return x.useContext(e)}}var q=K();function J(e=G){let t=e===G?q:K(e),n=()=>{let{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var Be=J();function Ve(e=G){let t=e===G?Be:J(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var Y=Ve(),He=(e,t)=>e===t;function Ue(e=G){let t=e===G?q:K(e),n=(e,n={})=>{let{equalityFn:r=He}=typeof n==`function`?{equalityFn:n}:n,{store:i,subscription:a,getServerState:o}=t();x.useRef(!0);let s=x.useCallback({[e.name](t){return e(t)}}[e.name],[e]),c=(0,S.useSyncExternalStoreWithSelector)(a.addNestedSub,i.getState,o||i.getState,s,r);return x.useDebugValue(c),c};return Object.assign(n,{withTypes:()=>n}),n}var X=Ue(),We=Y.withTypes(),Ge=X.withTypes(),Ke=i.withTypes(),Z=v.withTypes();function qe(e,t,n){let i=typeof e==`string`,a=i?e:void 0,o=i?t:e,s=i?n:t,c=null,l=e=>(t,n)=>{let r=o(e,{dispatch:t,getState:n},s);return c&&t(c(r,e)),r};return a?(c=r(a,(e,t)=>({payload:e,meta:{arg:t}})),Object.assign(l,c)):l}var Je=i.withTypes();function Q(e,t,n={}){return Je(e,async(e,{getState:r,dispatch:i,requestId:a,fulfillWithValue:o,rejectWithValue:s})=>{try{return o(await t(e,{dispatch:i,getState:r,requestId:a}),{useLoadingBar:n.useLoadingBar})}catch(e){return s({error:e},{useLoadingBar:n.useLoadingBar})}}
5,{getPendingMeta(){return n.useLoadingBar?{useLoadingBar:!0}:{}},condition:n.condition})}var $=Symbol(`discardLoadDataInPayload`);function Ye(e,t,n,r){let i,a;return typeof n==`function`?i=n:typeof n==`object`&&(a=n),r&&(a=r),Q(e,async(e,{getState:n,dispatch:r,requestId:a})=>{let o=await t(e,{dispatch:r,getState:n,requestId:a});if(!i)return o;let s=await i(o,{dispatch:r,getState:n,requestId:a,discardLoadData:$,actionArg:e});return s===void 0?o:s===$?void 0:s},{useLoadingBar:a?.useLoadingBar??!0,condition:a?.condition})}export{Ye as a,ze as c,Y as d,X as f,Q as i,Le as l,v as m,Z as n,We as o,b as p,qe as r,Ge as s,Ke as t,z as u};
6//# sourceMappingURL=typed_functions-Whap35TF.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.