PageSourceSearch

https://getdex.com/assets/useTransitionStatus-pooLrJFQ.js

js getdex.com collected 2026-10-01 10:38:12 UTC 3,470 bytes, 1 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`v5.20260930.1216-production.7e7ada9`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`c9c9976a-4317-40af-a99d-8165241ea3f7`,e._sentryDebugIdIdentifier=`sentry-dbid-c9c9976a-4317-40af-a99d-8165241ea3f7`)}catch{}})();import{a as e}from"./rolldown-runtime-B9z5rJDh.js";import{t}from"./react-DuuDrPmI.js";import{t as n}from"./react-dom-owto21z9.js";import{n as r,t as i}from"./useIsoLayoutEffect-BxtQW3kb.js";import{d as a}from"./useRenderElement-Cg6E-wWo.js";var o=e(n(),1),s=e(t(),1),c=[];function l(e){s.useEffect(e,c)}var u=null;globalThis.requestAnimationFrame;var d=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},f=class e{static create(){return new e}static request(e){return d.request(e)}static cancel(e){return d.cancel(e)}currentId=u;request(e){this.cancel(),this.currentId=d.request(()=>{this.currentId=u,e()})}cancel=()=>{this.currentId!==u&&(d.cancel(this.currentId),this.currentId=u)};disposeEffect=()=>this.cancel};function p(){let e=a(f.create).current;return l(e.disposeEffect),e}function m(e){return e==null?e:`current`in e?e.current:e}var h=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),g={[h.startingStyle]:``},_={[h.endingStyle]:``},v={transitionStatus(e){return e===`starting`?g:e===`ending`?_:null}};function y(e,t=!1,n=!0){let i=p();return r((r,a=null)=>{i.cancel();let s=m(e);if(s==null)return;let c=s,l=()=>{o.flushSync(r)};if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function u(){Promise.all(c.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||l()}).catch(()=>{if(n){a?.aborted||l();return}let e=c.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&u()})}if(t){let e=h.startingStyle;if(!c.hasAttribute(e)){i.request(u);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),u())});t.observe(c,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}i.request(u)})}function b(e){let{enabled:t=!0,open:n,ref:i,onComplete:a}=e,o=r(a),c=y(i,n,!1);s.useEffect(()=>{if(!t)return;let e=new AbortController;return c(o,e.signal),()=>{e.abort()}},[t,n,o,c])}function x(e,t=!1,n=!1){let[r,a]=s.useState(e&&t?`idle`:void 0),[o,c]=s.useState(e);return e&&!o&&(c(!0),a(`starting`)),!e&&o&&r!==`ending`&&!n&&a(`ending`),!e&&!o&&r===`ending`&&a(void 0),i(()=>{if(!e&&o&&r!==`ending`&&n){let e=f.request(()=>{a(`ending`)});return()=>{f.cancel(e)}}},[e,o,r,n]),i(()=>{if(!e||t)return;let n=f.request(()=>{a(void 0)});return()=>{f.cancel(n)}},[t,e]),i(()=>{if(!e||!t)return;e&&o&&r!==`idle`&&a(`starting`);let n=f.request(()=>{a(`idle`)});return()=>{f.cancel(n)}},[t,e,o,r]),{mounted:o,setMounted:c,transitionStatus:r}}export{v as a,p as c,h as i,l,b as n,m as o,y as r,f as s,x as t};

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.