/*! For license information please see 7340.e071c63d.js.LICENSE.txt */ "use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["7340"],{4675:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]])},60484:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},66298:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]])},17876:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},77600:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]])},84146:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]])},65207:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},77951:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("FileVolume",[["path",{d:"M11 11a5 5 0 0 1 0 6",key:"193qb2"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 6.765V4a2 2 0 0 1 2-2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-.93-.23",key:"ifyjnl"}],["path",{d:"M7 10.51a.5.5 0 0 0-.826-.38l-1.893 1.628A1 1 0 0 1 3.63 12H2.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h1.129a1 1 0 0 1 .652.242l1.893 1.63a.5.5 0 0 0 .826-.38z",key:"mk8rxu"}]])},26141:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("MessageCircleOff",[["path",{d:"M20.5 14.9A9 9 0 0 0 9.1 3.5",key:"1iebmn"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.6 5.6C3 8.3 2.2 12.5 4 16l-2 6 6-2c3.4 1.8 7.6 1.1 10.3-1.7",key:"1ov8ce"}]])},95951:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("Milestone",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M4 6a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h13a2 2 0 0 0 1.152-.365l3.424-2.317a1 1 0 0 0 0-1.635l-3.424-2.318A2 2 0 0 0 17 6z",key:"1btarq"}]])},59543:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]])},887:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},74655:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},10293:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]])},47976:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])},67791:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},27194:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},17048:function(e,t,r){r.d(t,{Z:()=>n});let n=(0,r(36150).Z)("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]])},62372:function(e,t,r){r.d(t,{Eh:()=>N,XI:()=>X,sJ:()=>A});var n,o,i=r(98661);function s(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e){var t=(0,i.useRef)(null);return function(r){r&&r!==t.current&&(t.current=r,e(r))}}var d="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function h(e){return parseFloat(e.replace("px",""))}function v(e,t,r){return er?r:e}function g(){for(var e=arguments.length,t=Array(e),r=0;r=0})}},{key:"negativeSides",get:function(){var e=this;return Object.fromEntries(E.filter(function(t){return e[t]<0}).map(function(t){return[t,e[t]]}))}}]),e}();function M(){for(var e=arguments.length,t=Array(e),r=0;rg?g-b:0;p[r.prop]=v(b+e+w,h,g),p[r.opposite.prop]=p[r.prop]+r.factor(i[l])}p.width=p.right-p.left,p.height=p.bottom-p.top;var C=L.create(p);return 0===e&&(this._cachedLayerBounds=C),C},t.getLayerCollisionBounds=function(){var e=this.offsets.container;return this.getLayerBounds().mapSides(function(t,r){return r-t.factor(e)}).merge(function(t){return{width:t.width+2*e,height:t.height+2*e}})},t.getContainerOffsets=function(e){if(this._cachedContainerOffsets&&!e)return this._cachedContainerOffsets;var t=this.subjectsBounds.merge({layer:e||this.getLayerCollisionBounds()}),r=P.mergeSmallestSides(t.layerOffsetsToScrollContainers);return e||(this._cachedContainerOffsets=r),r},a(e,[{key:"type",get:function(){return this.primary.prop+"-"+("center"===this.secondary.prop?"center":["bottom","right"].includes(this.secondary.prop)?"end":"start")}},{key:"triggerIsBigger",get:function(){var e=this.secondary.isHorizontal,t=this.subjectsBounds,r=t.triggerHasBiggerWidth,n=t.triggerHasBiggerHeight;return e&&r||!e&&n}},{key:"fitsContainer",get:function(){return this.getContainerOffsets().allSidesArePositive}},{key:"visibleSurface",get:function(){var e=this.getLayerBounds(),t=this.getContainerOffsets(e).negativeSides;for(var r in t)t[r]=-t[r];return e.substract(t).surface}},{key:"secondaryOffsetSide",get:function(){var e,t,r=this;return(null!=(e=null==(t=Object.entries(this.getContainerOffsets().negativeSides).map(function(e){var t=e[0],r=e[1];return[S[t],r]}).filter(function(e){var t=e[0];return r.primary.isOppositeDirection(t)}).sort(function(e,t){var r=e[1];return t[1]-r}))?void 0:t[0])?e:[])[0]||null}}]),e}(),H=function(e){function t(){return e.apply(this,arguments)||this}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,l(t,e),t.prototype.getLayerBounds=function(){var e=this.subjectsBounds,t=e.trigger,r=e.layer,n=L.empty();return n.top=t.top+t.height/2-r.height/2,n.bottom=n.top+r.height,n.left=t.left+t.width/2-r.width/2,n.right=n.left+r.width,n.width=n.right-n.left,n.height=n.bottom-n.top,n},t}(z),x={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null},R=function(){function e(e,t,r){this.placements=void 0,this.config=void 0,this.subjectsBounds=void 0,this.placements=e,this.config=t,this.subjectsBounds=r}e.getSidesFromPlacementType=function(e){var t,r=e.split("-"),n=r[0],o=r[1],i=S[n];return t="center"===o?O.center:i.isHorizontal?"start"===o?O.top:O.bottom:"start"===o?O.left:O.right,[i,t]},e.create=function(t,r){var n={arrow:r.arrowOffset,container:r.containerOffset,trigger:r.triggerOffset};function o(o){void 0===o&&(o=r.placement);var i=e.getSidesFromPlacementType(o),s=i[0],a=i[1],u=S[s.isHorizontal?r.preferY:r.preferX],l=!s.isHorizontal&&t.triggerHasBiggerWidth||s.isHorizontal&&t.triggerHasBiggerHeight;function c(e,o){return new z(e,o,t,r.layerDimensions,n)}var f=[];return f[0]=c(s,a),f[1]=c(s,a.isCenter?u:O.center),f[2]=c(s,O[(a.opposite.isCenter?u.opposite:a.opposite).prop]),f[3]=c(u,l?s:O[s.opposite.prop]),f[4]=c(u,O.center),f[5]=c(u,l?O[s.opposite.prop]:s),f[6]=c(S[u.opposite.prop],l?s:O[s.opposite.prop]),f[7]=c(S[u.opposite.prop],O.center),f[8]=c(S[u.opposite.prop],l?O[s.opposite.prop]:s),f[9]=c(S[s.opposite.prop],a),f[10]=c(S[s.opposite.prop],a.isCenter?u:O.center),f[11]=c(S[s.opposite.prop],O[(a.opposite.isCenter?u.opposite:a.opposite).prop]),f=f.filter(function(e){return e.type===r.placement||r.possiblePlacements.includes(e.type)})}return"center"===r.placement?new e([new H(O.center,O.center,t,r.layerDimensions,n)].concat(o(r.preferY+"-"+r.preferX)),r,t):new e(o(),r,t)};var t=e.prototype;return t.filterPlacementsBySide=function(e){return this.placements.filter(function(t){return t.primary===e})},t.findFirstPlacementThatFits=function(){return this.placements.find(function(e){return e.fitsContainer})},t.placementWithBiggestVisibleSurface=function(){return this.placements.map(function(e){return{placement:e,surface:e.visibleSurface}}).sort(function(e,t){return t.surface-e.surface})[0].placement},t.findSuitablePlacement=function(){return this.config.auto?this.findFirstPlacementThatFits()||this.placementWithBiggestVisibleSurface():this.placements[0]},t.getSecondaryOffset=function(e){var t,r=this.config,n=r.auto,o=r.snap;if(!n||o||e instanceof H)return 0;var i=this.filterPlacementsBySide(e.primary);if(0===i.indexOf(e)&&e.fitsContainer)return 0;var s=i.find(function(e){return!e.fitsContainer});if(!s)return 0;var a=s.secondaryOffsetSide;if(!a)return 0;var u=e.getContainerOffsets(),l=e.secondary;return t=e.triggerIsBigger||s===e?a.isPush?-1:1:l===O.left||[O.top,O.center].includes(l)&&a.isPush?-1:1,u[a.prop]*t},t.getStyles=function(e,t,r,n){var o={willChange:"top, left, width, height"};return{arrow:function(e,t,r){if(t.primary.isCenter)return x;var n,o,i,s,a,l,c,f,p,d,h=e.layer,g=e.trigger,y=e.arrow,m=t.primary.oppositeSizeProp,b=g[m]>h[m],w=r+y[m]/2,C=h[m]-y[m]/2-r,k=(n=e.layer,o=e.trigger,i=e.arrow,s=t.primary.oppositeSizeProp,l=(a=t.primary.isHorizontal?["top","bottom"]:["left","right"])[0],c=a[1],((f=n[l]+n[s]/2-o[l]-i[s]/2-r)<0?-f:0)+((p=n[c]-n[s]/2-o[c]+i[s]/2+r)>0?-p:0)),S=t.primary.prop,O=t.primary.oppositeCssProp,E=b?h[m]/2+k:g[O]+g[m]/2-h[O];return u({},x,((d={})[S]="100%",d[O]=v(E,w,C),d))}(this.subjectsBounds.merge({layer:e}),t,this.config.arrowOffset),layer:this.config.overflowContainer?u({},o,{position:"fixed",top:e.top,left:e.left}):u({},o,{position:"absolute",top:e.top-this.subjectsBounds.parent.top+r.top-n.top,left:e.left-this.subjectsBounds.parent.left+r.left-n.left})}},t.getHasDisappeared=function(e){var t=this.config.overflowContainer?this.subjectsBounds.trigger:e,r=P.mergeSmallestSides(this.subjectsBounds.offsetsToScrollContainers(t,!0));return Object.entries(r.negativeSides).some(function(e){var r=e[0];return e[1]<=-t[S[r].sizeProp]})?"full":r.allSidesArePositive?null:"partial"},t.result=function(e,t){var r=this.findSuitablePlacement(),n=this.getSecondaryOffset(r),o=r.getLayerBounds(n);return{styles:this.getStyles(o,r,e,t),layerSide:r.primary.prop,placement:r,layerBounds:o,hasDisappeared:this.getHasDisappeared(o)}},e}(),T=function(){function e(e,t){this.overflowContainer=void 0,this.trigger=void 0,this.layer=void 0,this.arrow=void 0,this.parent=void 0,this.window=void 0,this.scrollContainers=void 0,this.overflowContainer=t,Object.assign(this,e)}e.create=function(t,r,n,o,i,s,a,u){var l=L.fromWindow(t);return new e({layer:L.fromElement(r,{environment:t,withTransform:!1}),trigger:u?L.create(j(u())):L.fromElement(n),arrow:i?L.fromElement(i):L.empty(),parent:o?L.fromElement(o):l,window:l,scrollContainers:[l].concat(s.map(function(e){return L.fromElement(e,{withScrollbars:!1})}))},a)};var t=e.prototype;return t.merge=function(t){return new e(u({},this,t),this.overflowContainer)},t.offsetsToScrollContainers=function(e,t){return void 0===t&&(t=!1),(this.overflowContainer&&!t?[this.window]:this.scrollContainers).map(function(t){return t.offsetsTo(e)})},a(e,[{key:"layerOffsetsToScrollContainers",get:function(){return this.offsetsToScrollContainers(this.layer)}},{key:"triggerHasBiggerWidth",get:function(){return this.trigger.width>this.layer.width}},{key:"triggerHasBiggerHeight",get:function(){return this.trigger.height>this.layer.height}}]),e}(),Z={auto:!1,arrowOffset:0,containerOffset:10,triggerOffset:0,overflowContainer:!0,placement:"top-center",possiblePlacements:["bottom-start","bottom-end","bottom-center","top-start","top-center","top-end","left-end","left-center","left-start","right-end","right-center","right-start","center"],preferX:"right",preferY:"bottom",snap:!1,container:void 0};function A(e){var t,r,n,o,s,a,l,c,v,w,C,k,S,O,E,P,M,j,B,L,z,H,x,A,D,W,q,V,Y,N,X,_,F,G,U,J,$,K,Q=e.isOpen,ee=void 0!==Q&&Q,et=e.overflowContainer,er=void 0===et?Z.overflowContainer:et,en=e.environment,eo=void 0===en?"undefined"!=typeof window?window:void 0:en,ei=e.ResizeObserver,es=e.placement,ea=void 0===es?Z.placement:es,eu=e.possiblePlacements,el=void 0===eu?Z.possiblePlacements:eu,ec=e.preferX,ef=void 0===ec?Z.preferX:ec,ep=e.preferY,ed=void 0===ep?Z.preferY:ep,eh=e.auto,ev=void 0===eh?Z.auto:eh,eg=e.snap,ey=void 0===eg?Z.snap:eg,em=e.triggerOffset,eb=void 0===em?Z.triggerOffset:em,ew=e.containerOffset,eC=void 0===ew?Z.containerOffset:ew,ek=e.arrowOffset,eS=void 0===ek?Z.arrowOffset:ek,eO=e.container,eE=void 0===eO?Z.container:eO,eP=e.layerDimensions,eM=void 0===eP?null:eP,ej=e.onDisappear,eB=e.onOutsideClick,eL=e.onParentClose,ez=e.trigger,eH=(0,i.useState)(function(){return{layerSide:"center"===ea?"center":R.getSidesFromPlacementType(ea)[0].prop,styles:{layer:{position:er?"fixed":"absolute",top:0,left:0},arrow:{position:"absolute",top:0,left:0}}}}),ex=eH[0],eR=eH[1],eT=(0,i.useRef)(null),eZ=(t=(0,i.useRef)(ex),ee?t.current=ex:t.current=null,t),eA=(0,i.useRef)({cancelled:!1});(0,i.useEffect)(function(){return function(){eA.current.cancelled=!0}},[]);var eI=(0,i.useCallback)(function(e,t,r){var n=e.arrow,o=e.layer,i=e.scrollContainers,s=e.trigger,a=i[0],u=T.create(eo,o,s,a,n,i,er,null==ez?void 0:ez.getBounds),l=R.create(u,{placement:ea,possiblePlacements:el,auto:ev,layerDimensions:eM,arrowOffset:eS,containerOffset:eC,triggerOffset:eb,preferX:ef,preferY:ed,snap:ey,overflowContainer:er}).result(t,r),c=l.hasDisappeared,f={layerSide:l.layerSide,styles:l.styles};if(!eZ.current||function(e,t){if(e.layerSide!==t.layerSide)return!0;for(var r=0,n=["position","top","left","right","bottom"];r0},removeAllEventSubscriptions:function(){for(var e,t=f(M.current);!(e=t()).done;)(0,e.value)();M.current=[]},addEventSubscription:function(e){M.current.push(e)}}},[])).hasEventSubscriptions,L=j.addEventSubscription,z=j.removeAllEventSubscriptions,H=(0,i.useCallback)(function(){var e=E(),t=e.layer,r=e.trigger,n=e.scrollContainers,i=n[0];if(!t)throw Error(y("layer"));if(!r&&!C)throw Error(y("trigger"));var a={top:0,left:0};if(i){var u=i.scrollLeft;a={top:i.scrollTop,left:u}}else{var l=s.scrollX;a={top:s.scrollY,left:l}}var c={left:0,top:0};if(i){var f=s.getComputedStyle(i),p=f.borderLeftWidth,d=f.borderTopWidth;c={left:h(p)||0,top:h(d)||0}}o({layer:t,trigger:r,scrollContainers:n,arrow:w.current},a,c)},[E,o,s,w,C]),x=(0,i.useCallback)(function(){var e=E(),t=e.trigger,r=e.layer,n=e.scrollContainers;if(!r)throw Error(y("layer"));if(!t&&!C)throw Error(y("trigger"));if(v){for(var o=!1,i=new v(function(){if(!o){o=!0;return}H()}),a=0,u=[t,r,document.body];a=0||(o[r]=e[r]);return o}(e,D);if("center"===R)return null;var A=S[R],I=2*Y(P,O),N=Math.max(O,I);return(0,i.createElement)("svg",u({ref:t},Z,{style:u({},void 0===T?{}:T,{transform:"translate"+(A.isHorizontal?"Y":"X")+"(-50%)"}),width:N,height:N,preserveAspectRatio:A.isPush?"xMinYMin":"xMaxYMax",viewBox:((r={})[q]="0 "+-j+" "+I+" "+O,r.top="0 0 "+I+" "+(O+j),r[V]=-j+" 0 "+O+" "+I,r[W]="0 0 "+(O+j)+" "+I,r)[A.prop]}),(0,i.createElement)("path",{fill:H,strokeWidth:j,stroke:void 0===B?"black":B,d:(a=(void 0===L?0:L)/10*O*2,l=((n={})[q]=[0,O],n.top=[0,0],n[V]=[O,I],n[W]=[0,I],n)[A.prop].join(" "),c=A.isHorizontal?"V 0":"H "+I,f=I/2,p=I/2+Y(P,O/8),d=O/8,h=((o={})[q]=["C",p,d,f+a,0,f,0],o.top=["C",p,O-d,f+a,O,f,O],o[V]=["C",d,I-p,0,f-a,0,f],o[W]=["C",O-d,I-p,O,f-a,O,f],o)[A.prop].join(" "),v=I/2-Y(P,O/8),g=O/8,y=((s={})[q]=["C",f-a,0,v,g,l],s.top=["C",f-a,O,v,O-g,l],s[V]=["C",0,f+a,g,I-v,l],s[W]=["C",O,f+a,O-g,I-v,l],s)[A.prop].join(" "),["M",l,c,h,y].join(" "))}),(0,i.createElement)("path",{fill:H,d:(m=Y(P,j),w=(b=A.isPush?[0,j]:[O,O-j])[0],C=b[1],A.isHorizontal?["M",w,j,"V",I-j,"L",C,I-j-m,"V",m+j,"Z"].join(" "):["M",j,w,"H",I-j,"L",I-j-m,C,"H",m+j,"Z"].join(" "))}))});function X(e){var t=void 0===e?{}:e,r=t.delayEnter,n=void 0===r?0:r,s=t.delayLeave,a=void 0===s?0:s,u=t.hideOnScroll,l=void 0===u||u,c=(0,i.useState)(!1),f=c[0],p=c[1],d=(0,i.useRef)(null),h=(0,i.useRef)(o.IDLE),v=(0,i.useRef)(!1),g=(0,i.useCallback)(function(){clearTimeout(d.current),d.current=null,h.current=o.IDLE},[]);function y(e,t){if(h.current===o.ENTERING&&d.current&&g(),f){if(t){p(!1),d.current=null,h.current=o.IDLE;return}h.current=o.LEAVING,d.current=window.setTimeout(function(){p(!1),d.current=null,h.current=o.IDLE},a)}}return(0,i.useEffect)(function(){function e(){f&&l&&(g(),p(!1))}return window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0),d.current&&clearTimeout(d.current)}},[f,l,g]),[f,{onMouseEnter:function(){h.current===o.LEAVING&&d.current&&g(),!f&&(h.current=o.ENTERING,d.current=window.setTimeout(function(){p(!0),d.current=null,h.current=o.IDLE},n))},onMouseLeave:y,onTouchStart:function(){v.current=!1},onTouchMove:function(){v.current=!0},onTouchEnd:function(){v.current||f||p(!0),v.current=!1}},function(){return y(null,!0)}]}(n=o||(o={}))[n.ENTERING=0]="ENTERING",n[n.LEAVING=1]="LEAVING",n[n.IDLE=2]="IDLE"}}]);