PageSourceSearch

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

js getdex.com collected 2026-09-24 09:06:03 UTC 3,424 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.20260924.1202-production.4880d64`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`4736f3bd-b09e-45f1-9e27-c5d883642734`,e._sentryDebugIdIdentifier=`sentry-dbid-4736f3bd-b09e-45f1-9e27-c5d883642734`)}catch{}})();import{a as e}from"./rolldown-runtime-kRBrHsR4.js";import{t}from"./react-Du8R2vNm.js";import{t as n}from"./react-dom-BycroCBV.js";import{d as r,f as i,p as a}from"./useRenderElement-B_YhN0o7.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 r=p();return i((i,a=null)=>{r.cancel();let s=m(e);if(s==null)return;let c=s,l=()=>{o.flushSync(i)};if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();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)){r.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}r.request(u)})}function b(e){let{enabled:t=!0,open:n,ref:r,onComplete:a}=e,o=i(a),c=y(r,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[i,a]=s.useState(e&&t?`idle`:void 0),[o,c]=s.useState(e);return e&&!o&&(c(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),r(()=>{if(!e&&o&&i!==`ending`&&n){let e=f.request(()=>{a(`ending`)});return()=>{f.cancel(e)}}},[e,o,i,n]),r(()=>{if(!e||t)return;let n=f.request(()=>{a(void 0)});return()=>{f.cancel(n)}},[t,e]),r(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=f.request(()=>{a(`idle`)});return()=>{f.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:c,transitionStatus:i}}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.