whose-turn 1.0.0-alpha.8 → 1.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +25 -13
- package/connectors/github.mjs +24 -0
- package/dist/assets/_plugin-vue_export-helper-BbgK5wvS.js +18 -0
- package/dist/assets/_plugin-vue_export-helper-BneMU3KP.css +1 -0
- package/dist/assets/bem-OtK9ToP0.js +1 -0
- package/dist/assets/index-B6grE8kv.css +1 -0
- package/dist/assets/index-C3jZLqLJ.js +15 -0
- package/dist/assets/report-DUlemvzD.js +1 -0
- package/dist/assets/scheme-DCqBrLhv.js +1 -0
- package/dist/assets/sheet-Ctd_6q4a.js +1 -0
- package/dist/index.html +6 -6
- package/dist/report.html +4 -4
- package/dist/sheet.html +4 -4
- package/lib/api.mjs +45 -4
- package/lib/backoff.mjs +13 -0
- package/lib/config.mjs +68 -14
- package/lib/default-table.mjs +1 -0
- package/lib/errors.mjs +1 -1
- package/lib/facts.mjs +1 -1
- package/lib/feedback.mjs +82 -21
- package/lib/notify.mjs +3 -8
- package/lib/registry.mjs +27 -5
- package/lib/rules.mjs +16 -9
- package/lib/table.mjs +1 -0
- package/lib/trace.mjs +6 -6
- package/lib/workspace.mjs +63 -15
- package/package.json +2 -1
- package/server.mjs +14 -7
- package/dist/assets/_plugin-vue_export-helper-DeQjDyQ9.js +0 -18
- package/dist/assets/_plugin-vue_export-helper-aQHODzfZ.css +0 -1
- package/dist/assets/bem-CST_YFrc.js +0 -1
- package/dist/assets/index-CEB3_bQv.css +0 -1
- package/dist/assets/index-DsQ_5Y-x.js +0 -7
- package/dist/assets/report-Bar3ULi6.js +0 -1
- package/dist/assets/scheme-BdlolNvz.js +0 -1
- package/dist/assets/sheet-q2RQEgOf.js +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{w as _t,t as xi,r as Si,s as Qc,c as I,i as tu,p as eu,d as rt,a as te,b as Q,u as su,g as nu,o as iu,e as ws,f as Pa,h as ou,j as ru,k as au,l as lu,m as Ea,C as cu,n as pt,q as uu,v as w,x as H,y as F,z as p,A as Ma,T as du,B as hu,D as ie,E as Mo,F as x,G as q,H as it,I as ft,J as Pt,K as y,L as P,M as O,_ as dt,N as ht,O as lt,P as Ge,Q as rs,R as Va,S as Yn,U as fu,V as as,W as ls,X as De,Y as pu,Z as Da,$ as mu}from"./_plugin-vue_export-helper-BbgK5wvS.js";import{s as gu,m as Ti,u as Ra,a as $a,r as Oa,p as yu,b as vu,i as Vo,l as La,c as wu,M as Nt,d as js,e as Ds,f as _u,g as _s,h as Ze,j as bu,k as dn,n as ku,o as xu,q as Ia,t as Su,v as Tu,w as Ai,x as Au,y as Ba,z as Cu,A as Pu,B as Eu,C as kn,D as Mu,E as Vu}from"./scheme-DCqBrLhv.js";import{g as bs,r as Du,e as Ru,w as Fa,p as qt,a as de,S as cs,T as qn,b as Ci,c as ce,h as $u,s as Pi,i as ja,m as ks,d as Ou,f as Na,j as hn,k as Lu,l as Ei,n as Iu,y as Bu,o as Ua,q as Fu,t as ju,v as Nu}from"./bem-OtK9ToP0.js";const ns=gu(Oa),Do=(t,e)=>{const s=Nt,n=new Float32Array(s*s);for(let r=0;r<n.length;r+=1)n[r]=t[r]===e?1e6:0;const i=(r,o,a)=>{n[o]+a<n[r]&&(n[r]=n[o]+a)};for(let r=0;r<s;r+=1)for(let o=0;o<s;o+=1){const a=r*s+o;o>0&&i(a,a-1,1),r>0&&i(a,a-s,1),o>0&&r>0&&i(a,a-s-1,Math.SQRT2),o<s-1&&r>0&&i(a,a-s+1,Math.SQRT2)}for(let r=s-1;r>=0;r-=1)for(let o=s-1;o>=0;o-=1){const a=r*s+o;o<s-1&&i(a,a+1,1),r<s-1&&i(a,a+s,1),o<s-1&&r<s-1&&i(a,a+s+1,Math.SQRT2),o>0&&r<s-1&&i(a,a+s-1,Math.SQRT2)}return n},xn=t=>{const e=String(t||"").trim(),s=/^#([0-9a-f]{6})$/i.exec(e);if(s)return[0,2,4].map(i=>parseInt(s[1].slice(i,i+2),16));const n=e.match(/[\d.]+/g);return n&&n.length>=3?n.slice(0,3).map(Number):null},Uu=t=>{const e=getComputedStyle(t),s=xn(e.getPropertyValue("--md-primary"))||[44,86,151],n=xn(e.getPropertyValue("--md-on-primary-container"))||s;return{core:Vo()?s:s.map((i,r)=>La(i,n[r],.35)),rim:xn(e.getPropertyValue("--blob-3"))||[23,223,220],strength:Vo()?.9:1}},Wu=(t,e,s)=>({size:t.range(.85,1.05)*Math.min(e,s),right:t.chance(.4),bottom:t.chance(.7),overflowX:t.range(-.02,.06),overflowY:t.range(-.02,.04)}),zu=t=>{const e={minX:Nt,maxX:0,minY:Nt,maxY:0};for(let n=0;n<t.length;n+=1)if(t[n]){const i=n%Nt,r=Math.floor(n/Nt);e.minX=Math.min(e.minX,i),e.maxX=Math.max(e.maxX,i),e.minY=Math.min(e.minY,r),e.maxY=Math.max(e.maxY,r)}const s=n=>(n-Nt/2)/js;return{minX:s(e.minX),maxX:s(e.maxX),minY:s(e.minY),maxY:s(e.maxY)}},Hu=(t,e,s,n)=>{const i=e.maxX-e.minX,r=e.maxY-e.minY,o=Math.min(t.size,2*s*.95/i,2*n*.98/r),a=o/2,l=-t.overflowX*o,u=-t.overflowY*o;return{size:o,centerX:t.right?s-l-e.maxX*a:l-e.minX*a,centerY:t.bottom?n-u-e.maxY*a:u-e.minY*a}},Ku=(t,e,s)=>"rgba("+t.core.map((i,r)=>Math.round(La(i,t.rim[r],e))).join(",")+","+s.toFixed(3)+")",Gu=(t,e,s)=>{const n=[],i=e.size/62,r=e.size/2/js,o=e.size*_u/4,a=i*.866;for(let l=0,u=e.centerY-o;u<e.centerY+o;l+=1,u+=a)for(let c=e.centerX-o+l%2*i/2;c<e.centerX+o;c+=i){const d=c+t.range(-.3,.3)*i,h=u+t.range(-.3,.3)*i,f=Math.floor((d-e.centerX)/r+Nt/2),m=Math.floor((h-e.centerY)/r+Nt/2);if(f<0||m<0||f>=Nt||m>=Nt)continue;const _=m*Nt+f,g=t.next(),k=t.range(.75,1.25),A=t.range(-.15,.15);if(s.inside[_]){const S=s.depth[_]/js,C=Ds(S/.035),W=Ds(S/.3);if(g>.5+.5*C)continue;n.push({x:d,y:h,radius:i*.5*(.45+.55*C)*(.95+.3*W)*k,alpha:.5+.25*C+.25*W,tint:Ds(.65-.65*W+A)})}else{const S=s.gap[_]/js;if(g>.14*Math.exp(-S/.05)+.004)continue;n.push({x:d,y:h,radius:i*t.range(.1,.24),alpha:.35,tint:Ds(.8+A)})}}return n},Yu=()=>document.getElementById("wt"),qu=()=>document.getElementById("backdrop"),Wa=()=>Math.floor(Math.random()*4294967296),Rs={},ct={workspace:"",seed:Wa(),species:"",wantedSpecies:"",wantedPose:"",built:null},Xu=(t,e)=>{const s=wu(ct.seed),n=ns[Math.floor(s.next()*ns.length)];ct.species=ns.includes(ct.wantedSpecies)?ct.wantedSpecies:n;const i=Wu(s,t,e),r={facing:i.right?-1:1,tilt:s.range(-.07,.07),stretchX:s.range(.92,1.08),stretchY:s.range(.92,1.08)};s.chance(.25)&&(r.facing=-r.facing);const o=yu(vu(Oa,ct.species,s,{pose:ct.wantedPose}).shapes,r),a={inside:o,depth:Do(o,1),gap:Do(o,0)},l=Hu(i,zu(o),t,e);return{key:ct.seed+":"+ct.species+":"+t+"x"+e,dots:Gu(s,l,a)}},Zs=()=>{const t=qu();if(!t)return;const e=t.clientWidth,s=t.clientHeight,n=window.devicePixelRatio||1,i=Math.round(e*n),r=Math.round(s*n);(t.width!==i||t.height!==r)&&(t.width=i,t.height=r);const o=t.getContext("2d");if(!o||(o.setTransform(n,0,0,n,0,0),o.clearRect(0,0,e,s),!e||!s))return;const a=ct.seed+":"+(ct.wantedSpecies||"?")+":"+e+"x"+s;(!ct.built||ct.built.key.split(":")[0]!==String(ct.seed)||!ct.built.key.endsWith(e+"x"+s)||ct.wantedSpecies&&ct.species!==ct.wantedSpecies)&&(ct.built=Xu(e,s));const l=Yu();if(!l)return a;const u=Uu(l);return ct.built.dots.forEach(c=>{o.fillStyle=Ku(u,c.tint,c.alpha*u.strength),o.beginPath(),o.arc(c.x,c.y,c.radius,0,Math.PI*2),o.fill()}),a};window.whoseTurnBackdrop={species:ns.slice(),seeded:Ti,get current(){return{workspace:ct.workspace,species:ct.species,seed:ct.seed}},show:t=>{const e=t||{},s=String(e.workspace||"");Rs[s]||(Rs[s]=Wa());const n=e.seed!==void 0?Number(e.seed)>>>0:Rs[s];Rs[s]=n;const i=e.species&&ns.includes(e.species)?e.species:"",r=String(e.pose||"");return s===ct.workspace&&n===ct.seed&&i===ct.wantedSpecies&&r===ct.wantedPose&&ct.built||(ct.workspace=s,ct.seed=n,ct.wantedSpecies=i,ct.wantedPose=r,ct.built=null,Zs()),window.whoseTurnBackdrop.current},repaint:Zs};_t(_s,Zs);Ra(window,"resize",$a(Zs,200));const{show:za,repaint:Ro,seeded:_1}=window.whoseTurnBackdrop,Zu="[data-tip-click]",$o=t=>t instanceof Element?t.closest(Zu):null,Ju=t=>t.isConnected&&t.getClientRects().length>0,Qu=()=>{if(!window.tippy)return()=>{};const t=new Set;let e=!1;const s=new Set,n=new MutationObserver(()=>d());let i=!1;const r=()=>{t.size&&!i?n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden"]}):!t.size&&i&&n.disconnect(),i=t.size>0},o=S=>{t.add(S),r()},a=S=>{t.delete(S),r()},l=S=>{s.delete(S),S.hide()},u=S=>t.forEach(C=>{C.reference!==S&&l(C)}),c=()=>u(null),d=()=>{t.forEach(S=>{S.reference.isConnected?Ju(S.reference)||l(S):(a(S),S.destroy())})},h=S=>document.activeElement===S&&!S.matches(":focus-visible")&&!S.matches(":hover"),f=S=>{const C=$o(S.target);e=!C,u(C)},m=S=>{const C=$o(S.target),W=C==null?void 0:C._tippy;W&&(s.has(W)?l(W):(s.add(W),W.show()))},_=S=>{S.key==="Escape"&&c()},g=()=>{e=!1};window.tippy.delegate(document.body,{target:"[data-tip]",content:S=>S.dataset.tip||"",trigger:"mouseenter focus",delay:[0,80],duration:[120,80],interactive:!0,hideOnClick:!1,maxWidth:440,placement:"top",theme:"wt",appendTo:()=>document.body,onShow:S=>{if(e||h(S.reference))return!1;o(S)},onHide:S=>s.has(S)?!1:void 0,onHidden:a,onDestroy:S=>{a(S),s.delete(S)}});const k=new ResizeObserver(c);k.observe(document.body);const A=[[document,"pointerdown",f,!0],[document,"pointerup",g,!0],[document,"click",m,!0],[document,"keydown",_,!0],[document,"pointercancel",g,!0],[document,"dragstart",c,!0],[document,"scroll",c,!0],[window,"resize",c,!1]];return A.forEach(([S,C,W,U])=>S.addEventListener(C,W,U)),()=>{n.disconnect(),k.disconnect(),A.forEach(([S,C,W,U])=>S.removeEventListener(C,W,U))}},td=()=>{let t=0;return{next:()=>++t,accepts:e=>e===t}},Oo=t=>{const e=structuredClone(xi(t)),s=e.connectors||{},n=e.rules||{};return n.statuses=n.statuses||{},{...e,connectors:Array.isArray(s)?s:Object.entries(s).map(([i,r])=>({type:i,...r})),rules:n,theme:e.theme||{}}},ed=t=>{const e=structuredClone(xi(t));return e.theme&&!Object.keys(e.theme).length&&delete e.theme,e.rules&&!Object.keys(e.rules.statuses||{}).length&&delete e.rules.statuses,e.rules&&!Object.keys(e.rules).length&&delete e.rules,e},Lo=new WeakMap;let sd=0;const Sn=t=>{const e=xi(t);let s=Lo.get(e);return s||(s=++sd,Lo.set(e,s)),s},Tn=t=>JSON.stringify(t),nd=(t,e)=>{const s=[];return t.forEach(n=>n.connectors.forEach(i=>{const r=e.get(i)||{};Object.keys(r).forEach(o=>{r[o]&&s.push({ws:n.id,connector:i.id||i.type,key:o,value:r[o]})})})),s},re=(t,e,s)=>{typeof s=="boolean"||s&&s.length?t[e]=s:delete t[e]},id=(t,e)=>{const s=n=>{const i=e.indexOf(n.id);return i<0?e.length:i};return[...t].sort((n,i)=>s(n)-s(i))},od=(t,e,s,n)=>{const i=t.filter(r=>r!==e);return i.splice(i.indexOf(s)+(n?0:1),0,e),i},rd={backlog:"in the backlog",passed:"passed",code_review:"in review",qa:"in testing",on_hold:"on hold",todo:"to do",in_progress:"in progress",done:"done"},Ha=t=>rd[t]||`in ${t.replace(/_/g," ")}`,ad={you:"your move",reviewer:"the reviewer's move",qa:"the tester's move",them:"waiting on others"},me=(t,e)=>{var s;return((s=t[e])==null?void 0:s.name)||e.replace(/[._]/g," ")},ld=(t,e,s)=>t?e:s,cd={approved:"the PR is approved",changes_requested:"changes are requested on the PR",none:"the PR has no review"},ud=(t,e,s)=>{switch(e){case"ticket.status":return`the ticket is ${Ha(String(s))}`;case"ticket.assignee":return s==="me"?"the ticket is on you":`the ticket is assigned to ${s}`;case"pr.checks":return s==="none"?"the PR has no checks":`the PR checks are ${s}`;case"pr.review":return cd[String(s)]||`the PR review is ${s}`;case"pr.base":return`the PR goes into ${s}`;default:return`${me(t,e)} is ${s}`}},dd=(t,e,s,n)=>{if(s==="present")return ld(n,`${me(t,e)} is given`,`${me(t,e)} is missing`);if(s==="prefix")return e==="pr.base"?`the PR goes into a branch starting with ${n}`:`${me(t,e)} starts with ${n}`;if(e==="unanswered_count"){const r=Number(n);return`${{gt:`more than ${r}`,gte:`at least ${r}`,lt:`fewer than ${r}`,lte:`at most ${r}`}[s]} mentions of you wait for an answer`}const i={gt:"more than",gte:"at least",lt:"less than",lte:"at most"};return`${me(t,e)} is ${i[s]} ${n}`},hd=(t,e,s)=>{var i;if(Array.isArray(s))return e==="ticket.status"?`the ticket is ${s.map(r=>Ha(String(r))).join(" or ")}`:`${me(t,e)} is ${s.join(" or ")}`;if(s&&typeof s=="object")return Object.entries(s).map(([r,o])=>dd(t,e,r,o)).join(" and ");const n=(i=t[e])==null?void 0:i.says;return typeof s=="boolean"&&n?n[s?0:1]:ud(t,e,s)},fd=(t,e)=>e.replace(/\{([\w.]+)\}/g,(s,n)=>`{${me(t,n)}}`),pd=(t,e={})=>{const s=Object.entries(t.when).map(([i,r])=>hd(e,i,r)),n=t.then.whose==="hidden"?"not shown":`${ad[t.then.whose]||t.then.whose}, "${fd(e,t.then.next||"")}"`;return{when:s.length?`When ${s.join(" and ")}:`:"In every other case:",then:n}},md=t=>t.modal?"modal":t.note?"note":t.settings?"settings":t.monitor?"monitor":t.feedback?"feedback":t.whatsNew?"whatsNew":null,gd=(t,e)=>{const s=new URLSearchParams(t).get("mode");return s==="app"||s==="tab"?s:e==="app"?"app":"tab"},yd=t=>"/?mode=tab"+(t?"&ws="+encodeURIComponent(t):""),vd=t=>({width:t.outerWidth,height:t.outerHeight}),Ka={writeDefaults:!1},Ga=Ze("wt-ws","",Ka),Ya=bu("wt-mode","",Ka),M=Qc({workspaces:[],workspace:{id:"",name:"",connectors:[],links:[],key_pattern:"",theme:null},turn:[],feed:[],marks:{seen:[],base:0,handled:{},info:{}},counts:{mine:0,others:0,failing:0,done:0},todos:[],errors:{},health:{ok:!0,stale:!1,fresh_at:"",failing:[],alerts:[]},problems:[],polled_at:"",update:{current:"",latest:"",available:!1,state:"idle"},notifications:{desktop:!0}}),D=Si({ws:new URLSearchParams(location.search).get("ws")||Ga.value,open:new Set,mode:gd(location.search,Ya.value),live:!1,reconnects:0,status:"Connecting…",modal:null,note:"",feedback:!1,reportNews:!1,whatsNew:!1,settings:!1,settingsNew:!1,monitor:!1,settingsDirty:!1,settingsAsk:!1,settingsAt:"",focusFeed:""});Ya.value=D.mode;const Js=dn("",6e3),ss=dn("",8e3),Yt=(t,e)=>{const s=de(t,e);return s&&(Js.value=s),!s};let An=!1;const Qs=async()=>{if(An)return;An=!0;const t=M.notifications;M.notifications={desktop:!t.desktop};const e=s=>{Yt(s,{refused:"The notification setting was not saved"})||(M.notifications=t)};await qt("/api/notifications",{desktop:M.notifications.desktop}).then(e,e),An=!1},wd=()=>{D.mode==="app"&&Ra(window,"resize",$a(()=>qt("/api/window",vd(window)).catch(Yt),600))},qa={resume:()=>{}},Se=xu({scheduler:t=>{const e=Ia(t,3e4,{immediate:!1});return qa.resume=e.resume,e}}),Cn=I(()=>{const t=M.workspace.theme;return t&&t.light&&t.dark?t[_s.value?"dark":"light"]:{}}),Ht=I(()=>M.counts),Io=I(()=>{const t=M.workspace.name,e=t?t+": ":"",s=Object.entries(M.errors||{}),n=M.health.failing||[],i=a=>n.find(({source:l})=>a===l||a.startsWith(l+".")),r=n.map(({source:a,polls:l})=>{const u=s.filter(([c])=>{var d;return((d=i(c))==null?void 0:d.source)===a}).map(([,c])=>c);return`Source ${a}: ${u.join(", ")||"failing"}, failed ${l} polls in a row`}),o=new Set(n.map(({source:a})=>"failing:"+a));return[...M.problems||[],...M.health.alerts.filter(a=>!o.has(a.id||"")).map(a=>a.text),...r,...s.filter(([a])=>!i(a)).map(([a,l])=>e+a+": "+l)]}),Mi=(t="")=>{D.settingsAt=t,D.settingsNew=!1,D.settings=!0},_d=()=>{D.settingsAt="",D.settingsNew=!0,D.settings=!0},Xa=I(()=>md(D)),bd=()=>{const t=Xa.value;if(t==="modal"&&(D.modal=null),t==="note"&&(D.note=""),t==="feedback"&&(D.feedback=!1),t==="whatsNew"&&(D.whatsNew=!1),!(t!=="settings"&&t!=="monitor")){if(D.settingsDirty){D.settingsAsk=!0;return}D.settings=!1,D.monitor=!1}},Xn=new Map,kd=(t,e)=>{e&&Xn.set(t,document.activeElement)},xd=(t,e)=>{if(e)return;const s=Xn.get(t);Xn.delete(t),s instanceof HTMLElement&&s.focus()},Sd={modal:()=>!!D.modal,note:()=>!!D.note,settings:()=>D.settings,monitor:()=>D.monitor,feedback:()=>D.feedback,whatsNew:()=>D.whatsNew};_t(()=>M.turn.some(t=>t.row_id===D.note),t=>{t||(D.note="")},{flush:"sync"});Object.entries(Sd).forEach(([t,e])=>{_t(e,s=>kd(t,s),{flush:"sync"}),_t(e,s=>xd(t,s),{flush:"post"})});let tn=-1,Zn=0;const Bo=td(),_e=(t=D.ws)=>{const e=Bo.next();return bs("/api/state"+(t?"?ws="+encodeURIComponent(t):"")).then(s=>Bo.accepts(e)?s.error?Du(s.error)!=="NO_SUCH_WORKSPACE"||!t?(D.status=Ru(s.error,"Could not load"),M):_e(""):t&&s.workspace.hidden&&s.workspaces.some(n=>!n.hidden)?_e(""):(Object.assign(M,s),D.ws=M.workspace.id,D.status="",za({workspace:M.workspace.id}),document.title="Whose Turn · "+M.workspace.name,M):M)},fn=()=>(tn=-1,_e()),us=ku("/api/stream",[],{immediate:!1,autoConnect:!1,autoReconnect:!0,serializer:{read:t=>JSON.parse(t||"null")}});_t(us.status,t=>{D.live=t==="OPEN",D.live&&(D.status="",D.reconnects++)},{flush:"sync"});_t(us.error,t=>{t&&(D.status="Disconnected from the local server, retrying…")},{flush:"sync"});_t(us.data,t=>{if(!t)return;if("update"in t){M.update=t.update;return}if("report_news"in t){D.reportNews=t.report_news&&!D.feedback;return}const e=M.workspaces.find(s=>s.id===t.ws);e&&((e.hidden||"")!==(t.hidden||"")||!!e.returned!=!!t.returned)&&_e(),typeof t.open_moves=="number"&&(M.workspaces=Fa(M.workspaces,t.ws,t.open_moves)),!(M.workspace.id&&t.ws!==M.workspace.id)&&(D.status="",t.version!==tn?(tn=t.version,Zn===0&&_e()):M.polled_at=t.polled_at)},{flush:"sync"});const Td=()=>{us.eventSource.value||us.open()},Ad=()=>(qa.resume(),_e().then(Td)),Za=t=>t===M.workspace.id?Promise.resolve():(tn=-1,Zn++,_e(t).then(()=>{D.ws===t&&(Ga.value=D.ws,D.open.clear())},()=>{Js.value=cs+"; staying on "+M.workspace.name+"."}).finally(()=>{Zn--})),Ja=(t,e)=>qt(t,{ws:M.workspace.id,...e}),Re=t=>Ja("/api/marks",t).then(e=>{const s=de(e);return s||(Object.assign(M,{marks:e.marks,turn:e.turn,counts:e.counts}),M.workspaces=Fa(M.workspaces,M.workspace.id,e.counts.mine)),s},e=>de(e)),Cd=t=>{D.focusFeed=t},Pd=t=>Ja("/api/todos",t).then(e=>{const s=de(e,{unreachable:qn});return!s&&Array.isArray(e)&&(M.todos=e),s},e=>de(e,{unreachable:qn})),Fo=t=>bs("/api/config").then(e=>qt("/api/config",{workspaces:id(e.workspaces,t),secrets:[]})).then(e=>{Yt(e,{refused:"The order was not saved"})&&fn()},e=>Yt(e,{refused:"The order was not saved"})),Ed=t=>qt("/api/workspaces/hidden",{id:t,hidden:null}).then(e=>{Yt(e,{refused:"The workspace was not restored"})&&fn()},e=>Yt(e,{refused:"The workspace was not restored"})),jo=()=>{D.status="Checking now…",qt("/api/refresh").catch(t=>{D.status="",Yt(t)}),za({workspace:M.workspace.id,seed:Math.floor(Math.random()*4294967296)})};function xs(t,e){const s=typeof t=="string"&&!e?`${t}Context`:e,n=Symbol(s);return[o=>{const a=tu(n,o);if(a===void 0)throw new Error(`Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`);return a},o=>(eu(n,o),o),n]}function Md(t,e){const{layoutGroup:s,presenceContext:n,config:i}=e,r=s.id&&t.layoutId?`${s.id}-${t.layoutId}`:t.layoutId||void 0;return{...t,layoutId:r,transition:t.transition??i.transition,layoutGroup:s,motionConfig:i,inViewOptions:t.inViewOptions??i.inViewOptions,presenceContext:n,initial:n.initial===!1?n.initial:t.initial===!0?void 0:t.initial}}function Vi(t,e){t.indexOf(e)===-1&&t.push(e)}function be(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const Xt=(t,e,s)=>s>e?e:s<t?t:s,Ut={},Di=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Ri=t=>typeof t=="object"&&t!==null,$i=t=>/^0[^.\s]+$/u.test(t);function Vd(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ot=t=>t,Ss=(...t)=>t.reduce((e,s)=>n=>s(e(n))),he=(t,e,s)=>{const n=e-t;return n?(s-t)/n:1};class en{constructor(){this.subscriptions=[]}add(e){return Vi(this.subscriptions,e),()=>this.remove(e)}remove(e){be(this.subscriptions,e)}notify(e,s,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,s,n);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,s,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Rt=t=>t*1e3,Dt=t=>t/1e3,Qa=(t,e)=>e?t*(1e3/e):0,Dd=(t,e,s)=>{const n=e-t;return((s-t)%n+n)%n+t},Pn=(t,e,s)=>t*(3*(1-t)*((1-t)*e+t*s)+t*t);function Ts(t,e,s,n){return t===e&&s===n?Ot:i=>{let r=0,o=1,a=i;for(let l=0;;l++){a>=r&&a<=o||(a=(r+o)/2);const u=Pn(a,t,s)-i;if(u*u<1e-28||l===40)break;u>0?o=a:r=a,a-=u*1e-7/(Pn(a+1e-7,t,s)-i-u)}return Pn(a,e,n)}}const tl=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Oi=t=>e=>1-t(1-e),el=Ts(.33,1.53,.69,.99),Li=Oi(el),sl=tl(Li),nl=t=>t>=1?1:(t*=2)<1?.5*Li(t):.5*(2-Math.pow(2,-10*(t-1))),Ii=t=>1-Math.sin(Math.acos(t)),il=Oi(Ii),ol=tl(Ii),Rd=Ts(.42,0,1,1),$d=Ts(0,0,.58,1),Bi=Ts(.42,0,.58,1),rl=t=>Array.isArray(t)&&typeof t[0]!="number";function al(t,e){return rl(t)?t[Dd(0,t.length,e)]:t}const Fi=t=>Array.isArray(t)&&typeof t[0]=="number",Od={linear:Ot,easeIn:Rd,easeInOut:Bi,easeOut:$d,circIn:Ii,circInOut:ol,circOut:il,backIn:Li,backInOut:sl,backOut:el,anticipate:nl},Ld=t=>typeof t=="string",No=t=>{if(Fi(t)){const[e,s,n,i]=t;return Ts(e,s,n,i)}else if(Ld(t))return Od[t];return t},xt={delta:0,timestamp:0,isProcessing:!1};let Ns;function Id(){Ns=void 0}const kt={now:()=>(Ns===void 0&&kt.set(xt.isProcessing||Ut.useManualTiming?xt.timestamp:performance.now()),Ns),set:t=>{Ns=t,queueMicrotask(Id)}},$e=t=>Math.round(t*1e5)/1e5,ll=t=>e=>typeof e=="string"&&e.startsWith(t),ji=ll("--"),Bd=ll("var(--"),pn=t=>Bd(t)?Fd.test(t.split("/*")[0].trim()):!1,Fd=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function En(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Je={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ds={...Je,transform:t=>Xt(0,1,t)},$s={...Je,default:1},Ni=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jd(t){return t==null}const Nd=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ui=(t,e)=>s=>!!(typeof s=="string"&&Nd.test(s)&&s.startsWith(t)||e&&!jd(s)&&Object.prototype.hasOwnProperty.call(s,e)),cl=(t,e,s)=>n=>{if(typeof n!="string")return n;const[i,r,o,a]=n.match(Ni);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ud=t=>Xt(0,255,t),Mn={...Je,transform:t=>Math.round(Ud(t))},ge={test:Ui("rgb","red"),parse:cl("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+Mn.transform(t)+", "+Mn.transform(e)+", "+Mn.transform(s)+", "+$e(ds.transform(n))+")"},Os=(t,e,s)=>{const n=t.substring(1+e*s,1+(e+1)*s);return s>1?n:n+n};function Wd(t){const e=t.length>5?2:1,s=Os(t,3,e);return{red:parseInt(Os(t,0,e),16),green:parseInt(Os(t,1,e),16),blue:parseInt(Os(t,2,e),16),alpha:s?parseInt(s,16)/255:1}}const Jn={test:Ui("#"),parse:Wd,transform:ge.transform},As=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Jt=As("deg"),Gt=As("%"),Y=As("px"),zd=As("vh"),Hd=As("vw"),Uo={...Gt,parse:t=>Gt.parse(t)/100,transform:t=>Gt.transform(t*100)},Ce={test:Ui("hsl","hue"),parse:cl("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+Gt.transform($e(e))+", "+Gt.transform($e(s))+", "+$e(ds.transform(n))+")"},At={test:t=>ge.test(t)||Jn.test(t)||Ce.test(t),parse:t=>ge.test(t)?ge.parse(t):Ce.test(t)?Ce.parse(t):Jn.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ge.transform(t):Ce.transform(t),getAnimatableNone:t=>{const e=At.parse(t);return e.alpha=0,At.transform(e)}},Kd=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ul=new RegExp(Ni.source),dl=new RegExp(Kd.source,"i");function Gd(t){return isNaN(t)&&typeof t=="string"&&(ul.test(t)||dl.test(t))}const hl="number",fl="color",Yd="var",qd="var(",Wo="${}",Xd=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function Zd(t){const e=t.toString();return ul.test(e)||dl.test(e)}function hs(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Xd,l=>(At.test(l)?(n.color.push(r),i.push(fl),s.push(At.parse(l))):l.startsWith(qd)?(n.var.push(r),i.push(Yd),s.push(l)):(n.number.push(r),i.push(hl),s.push(parseFloat(l))),++r,Wo)).split(Wo);return{values:s,split:a,indexes:n,types:i}}function Jd(t){return hs(t).values}function Wi({split:t,types:e}){const s=t.length;return n=>{let i="";for(let r=0;r<s;r++)if(i+=t[r],n[r]!==void 0){const o=e[r];o===hl?i+=$e(n[r]):o===fl?i+=At.transform(n[r]):i+=n[r]}return i}}function Qd(t){return Wi(hs(t))}const th=t=>typeof t=="number"?0:At.test(t)?At.getAnimatableNone(t):t,eh=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:th(t);function sh(t){const e=hs(t);return Wi(e)(e.values.map((n,i)=>eh(n,e.split[i])))}const Lt={test:Gd,parse:Jd,createTransformer:Qd,getAnimatableNone:sh};function Vn(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+(e-t)*6*s:s<1/2?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function nh({hue:t,saturation:e,lightness:s,alpha:n}){t/=360,e/=100,s/=100;let i=0,r=0,o=0;if(!e)i=r=o=s;else{const a=s<.5?s*(1+e):s+e-s*e,l=2*s-a;i=Vn(l,a,t+1/3),r=Vn(l,a,t),o=Vn(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:n}}function sn(t,e){return s=>s>0?e:t}const mt=(t,e,s)=>t+(e-t)*s,Dn=(t,e,s)=>{const n=t*t,i=s*(e*e-n)+n;return i<0?0:Math.sqrt(i)},ih=[Jn,ge,Ce],oh=t=>ih.find(e=>e.test(t));function zo(t){const e=oh(t);if(!e)return!1;let s=e.parse(t);return e===Ce&&(s=nh(s)),s}const Ho=(t,e)=>{const s=zo(t),n=zo(e);if(!s||!n)return sn(t,e);const i={...s};return r=>(i.red=Dn(s.red,n.red,r),i.green=Dn(s.green,n.green,r),i.blue=Dn(s.blue,n.blue,r),i.alpha=mt(s.alpha,n.alpha,r),ge.transform(i))},Qn=new Set(["none","hidden"]);function rh(t,e){return Qn.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}function ah(t,e){return s=>mt(t,e,s)}function zi(t){return typeof t=="number"?ah:typeof t=="string"?pn(t)?sn:At.test(t)?Ho:uh:Array.isArray(t)?pl:typeof t=="object"?At.test(t)?Ho:lh:sn}function pl(t,e){const s=[...t],n=s.length,i=t.map((r,o)=>zi(r)(r,e[o]));return r=>{for(let o=0;o<n;o++)s[o]=i[o](r);return s}}function lh(t,e){const s={...t,...e},n={};for(const i in s)t[i]!==void 0&&e[i]!==void 0&&(n[i]=zi(t[i])(t[i],e[i]));return i=>{for(const r in n)s[r]=n[r](i);return s}}function ch(t,e){const s=[],n={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][n[r]],a=t.values[o]??0;s[i]=a,n[r]++}return s}const uh=(t,e)=>{const s=hs(t),n=hs(e);return s.indexes.var.length===n.indexes.var.length&&s.indexes.color.length===n.indexes.color.length&&s.indexes.number.length>=n.indexes.number.length?Qn.has(t)&&!n.values.length||Qn.has(e)&&!s.values.length?rh(t,e):Ss(pl(ch(s,n),n.values),Wi(n)):sn(t,e)},Ko=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function dh(t,e){const s=Ko.exec(t);if(!s)return;const n=Ko.exec(e);if(!n||s[2]!==n[2])return;const i=s[2],r=parseFloat(s[1]),o=parseFloat(n[1]);return a=>$e(mt(r,o,a))+i}function Hi(t,e,s){if(typeof t=="number"&&typeof e=="number"&&typeof s=="number")return mt(t,e,s);if(typeof t=="string"&&typeof e=="string"){const i=dh(t,e);if(i)return i}return zi(t)(t,e)}const Ls=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hh(t){let e=new Set,s=new Set,n=!1,i=!1,r;const o=new Set;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(s.add(c),t()),(r=c)(a)}const u={schedule:(c,d=!1,h=!1)=>{const f=h&&n,m=f?e:s;return d&&o.add(c),f&&c!==r&&m.delete(c),m.add(c),c},cancel:c=>{s.delete(c),o.delete(c)},process:c=>{if(a=c,n){i=!0;return}n=!0;const d=e;e=s,s=d,e.forEach(l),e.clear(),r=void 0,n=!1,i&&(i=!1,u.process(c))}};return u}const fh=40;function ml(t,e,s={delta:0,timestamp:0,isProcessing:!1}){let n=!1,i=!0;const r=()=>n=!0,o=Ls.reduce((S,C)=>(S[C]=hh(r),S),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:h,render:f,postRender:m}=o,_=()=>{const S=Ut.useManualTiming,C=S?s.timestamp:performance.now();n=!1,S||(s.delta=i?1e3/60:Math.max(Math.min(C-s.timestamp,fh),1)),s.timestamp=C,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),d.process(s),h.process(s),f.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(_))},g=()=>{n=!0,i=!0,s.isProcessing||t(_)};return{schedule:Ls.reduce((S,C)=>{const W=o[C];return S[C]=(U,v=!1,b=!1)=>(n||g(),W.schedule(U,v,b)),S},{}),cancel:S=>{for(let C=0;C<Ls.length;C++)o[Ls[C]].cancel(S)},state:s,steps:o}}const{schedule:ot,cancel:fe,steps:Rn}=ml(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ot,!0,xt),gl=t=>{const e=({timestamp:s})=>t(s);return{start:(s=!0)=>ot.update(e,s),stop:()=>fe(e),now:()=>xt.isProcessing?xt.timestamp:kt.now()}},yl=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let r=0;r<i;r++)n+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Ki=2e4;function Gi(t,e=50,s=Ki,n){let i=0,r=t.next(i);for(;!r.done&&i<s;)i+=e,r=t.next(i);return i>=s?1/0:i}function vl(t,e=100,s){const{keyframes:n,velocity:i}=t,r=n&&n[n.length-1]-n[0],o=s({...t,velocity:i&&r?i*e/r:i,keyframes:[0,e]}),a=Math.min(Gi(o),Ki);return{type:"keyframes",ease:l=>o.next(a*l).value/e,duration:Dt(a)}}const Go=100,Yo=10,ph=1,mh=800,wl=.3,gh=.3,yh=.01,vh=2,wh=.005,_h=.5,bh=.01,kh=10,qo=.05,_l=t=>t<0?1/Math.max(1+t,qo):Math.max(1-t,qo);function bl(t,e){if(!(t>1))return 1;const s=Math.sqrt(t*t-1),n=t-s,i=t+s,r=2*s*Math.exp(-e)*(1+e);return kl(o=>i*Math.exp(-n*o)-n*Math.exp(-i*o)-r,o=>Math.exp(-i*o)-Math.exp(-n*o),e)/e}function ti(t,e){return t*Math.sqrt(1-e*e)}const xh=12;function kl(t,e,s){let n=s;for(let i=1;i<xh;i++)n=n-t(n)/e(n);return n}const $n=.001;function Sh({duration:t=mh,bounce:e=wl}){let s,n;const i=_l(e);t=Xt(bh,kh,Dt(t)),i<1?(s=u=>{const c=u*i,d=c*t,h=ti(u,i),f=Math.exp(-d);return $n-c/h*f},n=u=>{const d=u*i*t,h=i*i*u*u*t,f=Math.exp(-d),m=ti(u*u,i);return(-s(u)+$n>0?-1:1)*-h*f/m}):(s=u=>{const c=Math.exp(-u*t),d=u*t+1;return-$n+c*d},n=u=>{const c=Math.exp(-u*t),d=-u*(t*t);return c*d});const r=5/t,o=kl(s,n,r),a=o*bl(i,o*t),l=a*a;return{stiffness:l,damping:i*2*Math.sqrt(l),duration:Rt(t)}}const ei=(t,e)=>(e?t>=0:t>0)&&t<1/0;function On(t,e){if(ei(t,e))return t}function Th(t){const e=On(t.stiffness),s=On(t.damping,!0),n=On(t.mass),i={...t,stiffness:e??Go,damping:s??Yo,mass:n??ph,isResolvedFromDuration:!1,isTimeDefined:(e??s??n)===void 0&&(t.duration!==void 0||t.bounce!==void 0)};if(i.isTimeDefined){if(t.visualDuration){const r=_l(t.bounce||0),o=2*Math.PI/(t.visualDuration*1.2)*bl(r,2*Math.PI/1.2);i.stiffness=o*o,i.damping=2*r*Math.sqrt(i.stiffness)}else Object.assign(i,Sh(i)),i.isResolvedFromDuration=!0;(!ei(i.stiffness)||!ei(i.damping,!0))&&(i.stiffness=Go,i.damping=Yo)}return i}function Xo(t=gh,e=wl){const s=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t,n=s.keyframes[0],i=s.keyframes[s.keyframes.length-1],r={done:!1,value:n},{stiffness:o,damping:a,mass:l,duration:u,isResolvedFromDuration:c,isTimeDefined:d}=Th({...s}),h=v=>d?0:-Dt(v),f=a/(2*Math.sqrt(o*l)),m=Dt(Math.sqrt(o/l)),_=f*m,g={target:i,delta:i-n,velocity:h(s.velocity||0)||0,restSpeed:0,restDelta:0},k=()=>{const v=Math.abs(g.delta)<5;g.restSpeed=s.restSpeed||(v?yh:vh),g.restDelta=s.restDelta||(v?wh:_h)};k();let A,S,C;if(f<1){const v=ti(m,f),b={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};C=()=>{b.A=(g.velocity+_*g.delta)/v,b.sinC=_*b.A+g.delta*v,b.cosC=_*g.delta-b.A*v};const T=L=>{L!==b.t&&(b.t=L,b.env=Math.exp(-_*L),b.sin=Math.sin(v*L),b.cos=Math.cos(v*L))};A=L=>(T(L),g.target-b.env*(b.A*b.sin+g.delta*b.cos)),S=L=>(T(L),b.env*(b.sinC*b.sin+b.cosC*b.cos))}else if(f===1){A=b=>g.target-Math.exp(-m*b)*(g.delta+(g.velocity+m*g.delta)*b);const v={C:0};C=()=>{v.C=g.velocity+m*g.delta},S=b=>Math.exp(-m*b)*(m*v.C*b-g.velocity)}else{const v=m*Math.sqrt(f*f-1),b=_-v,T=_+v,L=v<1||d?1/0:300/v,X=(R,B)=>Math.exp(B>L?(_-R)*L-_*B:-R*B),V={S:0,F:0};C=()=>{const R=(g.velocity+_*g.delta)/v;V.S=(g.delta+R)/2,V.F=(g.delta-R)/2},A=R=>g.target-V.S*X(b,R)-V.F*X(T,R),S=R=>b*V.S*X(b,R)+T*V.F*X(T,R)}C();const W=c&&u||null,U={calculatedDuration:W,retarget:(v,b)=>{g.target=v[v.length-1],g.delta=g.target-v[0],g.velocity=h(b),s.restSpeed&&s.restDelta||k(),U.calculatedDuration=W,r.done=!1,C()},velocity:v=>Rt(S(v)),next:v=>{const b=A(v);if(c)r.done=v>=u;else{const T=Rt(S(v));r.done=Math.abs(T)<=g.restSpeed&&Math.abs(g.target-b)<=g.restDelta}return r.value=r.done?g.target:b,r},toString:()=>{const v=Math.min(Gi(U),Ki),b=yl(T=>U.next(v*T).value,v,30);return v+"ms "+b},toTransition:()=>{}};return U}const Yi=Object.assign(Xo,{applyToOptions:t=>{const e=vl(t,100,Xo);return t.ease=e.ease,t.duration=Rt(e.duration),t.type="keyframes",t}});function nn({keyframes:t,velocity:e=0,power:s=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],h={done:!1,value:d},f=v=>v<a||v>l,m=v=>a===void 0?l:l===void 0||Math.abs(a-v)<Math.abs(l-v)?a:l;let _=s*e;const g=d+_,k=o?o(g):g;k!==g&&(_=k-d);const A=v=>-_*Math.exp(-v/n),S=v=>{const b=A(v);h.done=Math.abs(b)<=u,h.value=h.done?k:v?k+b:d};let C,W;const U=v=>{f(h.value)&&(C=v,W=Yi({keyframes:[h.value,m(h.value)],velocity:-A(v)/n*1e3,damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return U(0),{calculatedDuration:null,next:v=>{let b=!1;return!W&&C===void 0&&(b=!0,S(v),U(v)),C!==void 0&&v>=C?W.next(v-C):(!b&&S(v),h)}}}function Ah(t,e,s){const n=[],i=s||Ut.mix||Hi,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||Ot:e;a=Ss(l,a)}n.push(a)}return n}function Ch(t,e,{clamp:s=!0,ease:n,mixer:i}={}){const r=t.length;if(r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Ah(e,n,i),l=a.length,u=c=>{if(o&&c<t[0])return e[0];let d=0;if(l>1)for(;d<t.length-2&&!(c<t[d+1]);d++);const h=he(t[d],t[d+1],c);return a[d](h)};return s?c=>u(Xt(t[0],t[r-1],c)):u}function xl(t,e){const s=t[t.length-1];for(let n=1;n<=e;n++){const i=he(0,e,n);t.push(mt(s,1,i))}}function qi(t){const e=[0];return xl(e,t.length-1),e}function Ph(t,e){return t.map(s=>s*e)}function Eh(t,e){return t.map(()=>e||Bi).splice(0,t.length-1)}function ue({duration:t=300,keyframes:e,times:s,ease:n="easeInOut"}){const i=rl(n)?n.map(No):No(n)||Bi,r={done:!1,value:e[0]};if(e.length===2&&!Array.isArray(i)&&(!s||s.length!==2||s[0]===0&&s[1]===1)){const[l,u]=e,c=l===u?void 0:(Ut.mix||Hi)(l,u);return{calculatedDuration:t,next:d=>(r.value=c?c(i(t>0?Xt(0,1,d/t):1)):u,r.done=d>=t,r)}}const o=Ph(s&&s.length===e.length?s:qi(e),t),a=Ch(o,e,{ease:Array.isArray(i)?i:Eh(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const Mh=5;function Vh(t,e,s){const n=Math.max(e-Mh,0);return Qa(s-t(n),e-n)}function Dh(t,e,s=0){return e<=0?s:t.velocity?t.velocity(e):Vh(n=>t.next(n).value,e,t.next(e).value)}const Rh=t=>t!==null;function fs(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(Rh),a=i<0||e&&s!=="loop"&&e%2===1?0:r.length-1;return!a||n===void 0?r[a]:n}const $h={decay:nn,inertia:nn,tween:ue,keyframes:ue,spring:Yi};function Sl(t){typeof t.type=="string"&&(t.type=$h[t.type])}const Oh=40,Tl=(t,e)=>e-t>Oh&&!Ut.useManualTiming?e:t;function Al(t,e){return{kind:t,animation:e,timestamp:kt.now(),frameTimestamp:xt.timestamp,frameIsProcessing:xt.isProcessing}}function Cl(t,e,s){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Al("animation-start",t),options:s?{...e,...s}:e})}catch{}}function Lh(t,e){const s=globalThis.__MOTION_INSPECT__;if(s)try{s({...Al("layout-animation-start",t),node:e})}catch{}}class Xi{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){var e;this.isResolved=!0,(e=this._resolve)==null||e.call(this)}then(e,s){return this.finished.then(e,s)}}const Ih=t=>t/100,si=t=>Math.round(t*1e4)/1e4;class ps extends Xi{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var n,i;const{motionValue:s}=this.options;s&&s.updatedAt!==kt.now()&&this.tick(kt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Cl(this,this.options)}initAnimation(){const{options:e}=this;Sl(e);const{type:s=ue,repeat:n=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=s||ue;l!==ue&&typeof a[0]!="number"&&(this.mixKeyframes=Ss(Ih,Hi(a[0],a[1])),a=[0,100]);const u=l(a===e.keyframes?e:{...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Gi(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,s=!1){const{generator:n,totalDuration:i,calculatedDuration:r}=this;if(this.startTime===null)return n.next(0);const{delay:o=0,keyframes:a,type:l,onUpdate:u,finalKeyframe:c}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=Tl(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),s?this.currentTime=e:this.updateTime(e);const d=this.currentTime-o*(this.playbackSpeed>=0?1:-1),h=this.playbackSpeed>=0?d<0:d>i;this.currentTime=Math.max(d,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);const f=this.generate(this.currentTime,h);let{done:m}=f;h||(m=this.playbackSpeed>=0?r<1/0?this.currentTime>=i:m:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&m);return _&&l!==nn&&(f.value=fs(a,this.options,c,this.speed)),u&&u(f.value),_&&this.finish(),f}at(e){return this.holdTime??si((e-this.startTime)*this.playbackSpeed)}sampleAt(e,s){const{options:n,totalDuration:i}=this,r=this.at(e)-(n.delay||0);return r>=i&&n.type!==nn?fs(n.keyframes,n,s?void 0:n.finalKeyframe):this.generate(Math.max(r,0),r<0).value}generate(e,s){const{generator:n,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a}=this,{keyframes:l,repeat:u,repeatType:c,repeatDelay:d}=this.options;let h=e,f=n;if(u){const _=Math.min(e,i)/a;let g=Math.floor(_),k=_%1;!k&&_>=1&&(k=1),k===1&&g--,g=Math.min(g,u+1),!!(g%2)&&(c==="reverse"?(k=1-k,d&&(k-=d/a)):c==="mirror"&&(f=o)),h=Xt(0,1,k)*a}let m;return s?(this.delayState.value=l[0],m=this.delayState):m=f.next(h),r&&!s&&(m.value=r(m.value)),m}get duration(){return Dt(this.calculatedDuration)}get iterationDuration(){return this.duration+Dt(this.options.delay??0)}get time(){return Dt(this.currentTime)}set time(e){e=Rt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Dh(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){const s=this.playbackSpeed!==e;s&&this.driver&&this.updateTime(kt.now()),this.playbackSpeed=e,s&&this.driver&&(this.time=Dt(this.currentTime))}play(){var i,r;if(this.isStopped)return;const{driver:e=gl,startTime:s}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(r=(i=this.options).onPlay)==null||r.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime/(this.playbackSpeed||1):this.startTime||(this.startTime=s??(this.pendingStartTime=n)),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(kt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,s;this.notifyFinished(),this.teardown(),this.state="finished",(s=(e=this.options).onComplete)==null||s.call(e)}cancel(){var e,s;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(s=(e=this.options).onCancel)==null||s.call(e)}teardown(){var e;this.state="idle",(e=this.driver)==null||e.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var s;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(s=this.driver)==null||s.stop(),e.observe(this)}}const Bh=new Set(["brightness","contrast","saturate","opacity"]);function Fh(t){const[e,s]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=s.match(Ni)||[];if(!n)return t;const i=s.replace(n,"");let r=Bh.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const jh=/\b([a-z-]*)\(.*?\)/gu,ni={...Lt,getAnimatableNone:t=>{const e=t.match(jh);return e?e.map(Fh).join(" "):t}},ii={...Lt,getAnimatableNone:t=>{const e=Lt.parse(t);return Lt.createTransformer(t)(e.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},Zo={...Je,transform:Math.round},Pl={rotate:Jt,pathRotation:Jt,rotateX:Jt,rotateY:Jt,rotateZ:Jt,scale:$s,scaleX:$s,scaleY:$s,scaleZ:$s,skew:Jt,skewX:Jt,skewY:Jt,distance:Y,translateX:Y,translateY:Y,translateZ:Y,x:Y,y:Y,z:Y,perspective:Y,transformPerspective:Y,opacity:ds,originX:Uo,originY:Uo,originZ:Y},ee={borderWidth:Y,borderTopWidth:Y,borderRightWidth:Y,borderBottomWidth:Y,borderLeftWidth:Y,borderRadius:Y,borderTopLeftRadius:Y,borderTopRightRadius:Y,borderBottomRightRadius:Y,borderBottomLeftRadius:Y,width:Y,maxWidth:Y,height:Y,maxHeight:Y,top:Y,right:Y,bottom:Y,left:Y,inset:Y,insetBlock:Y,insetBlockStart:Y,insetBlockEnd:Y,insetInline:Y,insetInlineStart:Y,insetInlineEnd:Y,padding:Y,paddingTop:Y,paddingRight:Y,paddingBottom:Y,paddingLeft:Y,paddingBlock:Y,paddingBlockStart:Y,paddingBlockEnd:Y,paddingInline:Y,paddingInlineStart:Y,paddingInlineEnd:Y,margin:Y,marginTop:Y,marginRight:Y,marginBottom:Y,marginLeft:Y,marginBlock:Y,marginBlockStart:Y,marginBlockEnd:Y,marginInline:Y,marginInlineStart:Y,marginInlineEnd:Y,fontSize:Y,backgroundPositionX:Y,backgroundPositionY:Y,...Pl,zIndex:Zo,fillOpacity:ds,strokeOpacity:ds,numOctaves:Zo},Nh={...ee,color:At,backgroundColor:At,outlineColor:At,fill:At,stroke:At,borderColor:At,borderTopColor:At,borderRightColor:At,borderBottomColor:At,borderLeftColor:At,filter:ni,WebkitFilter:ni,mask:ii,WebkitMask:ii},El=t=>Nh[t],Uh=new Set([ni,ii]);function Zi(t,e){let s=El(t);return Uh.has(s)||(s=Lt),s.getAnimatableNone?s.getAnimatableNone(e):void 0}function Wh(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ye=t=>t*180/Math.PI,oi=t=>{const e=ye(Math.atan2(t[1],t[0]));return ri(e)},zh={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:oi,rotateZ:oi,skewX:t=>ye(Math.atan(t[1])),skewY:t=>ye(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ri=t=>(t=t%360,t<0&&(t+=360),t),Jo=oi,Qo=t=>Math.hypot(t[0],t[1]),tr=t=>Math.hypot(t[4],t[5]),Hh={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Qo,scaleY:tr,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(Qo(t)+tr(t))/2,rotateX:t=>ri(ye(Math.atan2(t[6],t[5]))),rotateY:t=>ri(ye(Math.atan2(-t[2],t[0]))),rotateZ:Jo,rotate:Jo,skewX:t=>ye(Math.atan(t[4])),skewY:t=>ye(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ms(t){return t.includes("scale")?1:0}function Ji(t,e){if(!t||t==="none")return ms(e);const s=t.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!s)return ms(e);const n=(s[1]?Hh:zh)[e],i=s[2].split(",").map(r=>parseFloat(r));return typeof n=="function"?n(i):i[n]}const Ml=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return Ji(s,e)},Wt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$t=new Set([...Wt,"pathRotation"]),er=t=>t===Je||t===Y,Kh=new Set(["x","y","z"]),Gh=Wt.filter(t=>!Kh.has(t));function Yh(t){const e=[];return Gh.forEach(s=>{const n=t.getValue(s);if(n!==void 0){const i=n.get(),r=s.startsWith("scale")?1:0;if(i===r)return;e.push([s,i]),n.set(r)}}),e}const qh=new Set(["bottom","right"]);function sr(t,e,s,n,i,r){const o=parseFloat(t);if(!isNaN(o))return o;const{min:a,max:l}=e()[s],u=l-a;return r==="border-box"?u:u-parseFloat(n)-parseFloat(i)}const nr=({transform:t})=>Ji(t,"x"),ir=({transform:t})=>Ji(t,"y"),Ln={width:({width:t,paddingLeft:e="0",paddingRight:s="0",boxSizing:n},i)=>sr(t,i,"x",e,s,n),height:({height:t,paddingTop:e="0",paddingBottom:s="0",boxSizing:n},i)=>sr(t,i,"y",e,s,n),top:({top:t})=>parseFloat(t),left:({left:t})=>parseFloat(t),bottom:({top:t},e)=>{const{y:s}=e();return parseFloat(t)+(s.max-s.min)},right:({left:t},e)=>{const{x:s}=e();return parseFloat(t)+(s.max-s.min)},x:nr,y:ir,translateX:nr,translateY:ir},we=new Set;let ai=!1,li=!1,ci=!1;function Vl(){if(li){const t=[],e=new Set,s=new Set;we.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),qh.has(i.name)&&s.add(i.element))});const n=new Map;s.forEach(i=>{const r=Yh(i);r.length&&(n.set(i,r),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([o,a])=>{var l;(l=i.getValue(o))==null||l.set(a)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}li=!1,ai=!1,we.forEach(t=>t.complete(ci)),we.clear()}function Dl(){we.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(li=!0)})}function Xh(){ci=!0,Dl(),Vl(),ci=!1}function Zh(t,e,s){if(typeof t=="string"){if(Di(t)||$i(t))return parseFloat(t);if(!Lt.test(t)&&Lt.test(s))return Zi(e,s)}return t??void 0}class Qi{constructor(e,s,n,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=s,this.name=n,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(we.add(this),ai||(ai=!0,ot.read(Dl),ot.resolveKeyframes(Vl))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:s,element:n,motionValue:i}=this;if(e[0]===null){const r=i==null?void 0:i.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(n&&s){const a=Zh(n.readValue(s,o),s,o);a!==void 0&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Wh(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),we.delete(this)}cancel(){this.state==="scheduled"&&(we.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Cs=t=>t.startsWith("--");function Rl(t,e,s){Cs(e)?t.style.setProperty(e,s):t.style[e]=s}const Jh={};function $l(t,e){const s=Vd(t);return()=>Jh[e]??s()}const Qh=$l(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),to=$l(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pe=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,ui={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pe([0,.65,.55,1]),circOut:Pe([.55,0,1,.45]),backIn:Pe([.31,.01,.66,-.59]),backOut:Pe([.33,1.53,.69,.99])};function Ol(t,e){if(t)return typeof t=="function"?to()?yl(t,e):"ease-out":Fi(t)?Pe(t):Array.isArray(t)?t.map(s=>Ol(s,e)||ui.easeOut):ui[t]}function tf(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:s};l&&(c.offset=l);const d=Ol(a,i);Array.isArray(d)&&(c.easing=d);const h={delay:n,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(c,h)}function eo(t){return typeof t=="function"&&"applyToOptions"in t}function ef({type:t,...e}){return eo(t)&&to()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ll extends Xi{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:s,name:n,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e;const u=ef(e);this.animation=tf(s,n,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{var c;if(this.finishedTime=this.time,!r){const d=fs(i,this.options,a,this.speed);(c=this.updateMotionValue)==null||c.call(this,d),Rl(s,n,d),this.animation.cancel()}l==null||l(),this.notifyFinished()},Cl(this,e,u)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,s;(s=(e=this.animation).finish)==null||s.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,!(this.state==="idle"||this.finishedTime!==null)&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){var s,n,i;const e=(s=this.options)==null?void 0:s.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(n=this.animation).commitStyles)==null||i.call(n))}get duration(){var s,n;const e=((n=(s=this.animation.effect)==null?void 0:s.getComputedTiming)==null?void 0:n.call(s).duration)||0;return Dt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Dt(e)}get time(){return Dt(Number(this.animation.currentTime)||0)}set time(e){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Rt(e),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:s,observe:n}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Qh()?(this.animation.timeline=e,s==null||s(this.animation),Ot):n(this)}}const Il={anticipate:nl,backInOut:sl,circInOut:ol};function sf(t){return t in Il}function nf(t){typeof t.ease=="string"&&sf(t.ease)&&(t.ease=Il[t.ease])}const on=10;class of extends Ll{constructor(e){nf(e),Sl(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state==="running"?(kt.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){const{motionValue:s,onUpdate:n,onComplete:i,onPlay:r,onStop:o,element:a,...l}=this.options;this.sampler=new ps({...l,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){const{state:e}=this;if(e==="running"||e==="paused")return this.sample(this.elapsed())}updateMotionValue(e){const{motionValue:s,element:n,name:i}=this.options;if(!s)return;if(e!==void 0){s.set(e);return}const{speed:r}=this,o=this.elapsed(),a=this.state==="running"&&r?Xt(0,on,o):0,l=this.sample(o);n&&i&&Rl(n,i,l),s.setWithVelocity(this.sample(o-a*Math.sign(r)),l,a/Math.abs(r||1))}}const or=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Lt.test(t)||t==="0")&&!t.startsWith("url("));function rf(t){const e=t[0];if(t.length===1)return!0;for(let s=0;s<t.length;s++)if(t[s]!==e)return!0}function af(t,e,s,n){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=or(i,e),a=or(r,e);return!o||!a?!1:rf(t)||(s==="spring"||eo(s))&&n}function di(t){t.duration=0,t.type="keyframes"}const hi=new Set(["opacity","clipPath","filter","transform"]),lf=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function cf(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&lf.test(t[e]))return!0;return!1}const rr=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Bl=()=>!Ut.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,"animate");function uf(t){var d;const{motionValue:e,name:s,repeatDelay:n,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!s||!(hi.has(s)||rr.has(s)))return!1;const l=(d=e==null?void 0:e.owner)==null?void 0:d.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:c}=e.owner.getProps();return Bl()&&(hi.has(s)||rr.has(s)&&cf(a))&&(s!=="transform"||!c)&&!u&&!n&&i!=="mirror"&&r!==0&&o!=="inertia"}const ke=(t,e)=>e&&typeof t=="number"?e.transform(t):t,df={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hf=Wt.length,ar={},gs=(t,e,s=ke(e,Pl[t]))=>(ar[t]||(ar[t]=(df[t]||t)+"("))+s+")",so=(t,e)=>(typeof e=="number"?e:parseFloat(e))===(t.startsWith("scale")?1:0);function ff(t,e,s){let n="";for(let r=0;r<hf;r++){const o=Wt[r],a=t[o];if(a===void 0)continue;const l=s&&(e[o]=ke(a,ee[o]));so(o,a)||(n+=gs(o,a,l||void 0)+" ")}const i=t.pathRotation;return i&&(n+=gs("rotate",i)),n=n.trim(),s?s(e,n):n||"none"}const xe=new WeakMap,pf=200,Is=.001,mf=.1,gf=.001,yf=100,vf=t=>/^(linear|ease(In|Out|InOut))$/.test(t),In=(t,e)=>t-e,lr=(t,e,s)=>{const n=[];for(let i=0;i<=s;i++)n.push(mt(t,e,i/s));return n},Us=t=>t.motionValue.owner,Ws=t=>xe.get(t),Ee=(t,e)=>{var s;return t.latestValues?t.latestValues[e]:(s=t.getValue(e))==null?void 0:s.get()},wf=({name:t,motionValue:e})=>{var s;return t&&Wt.includes(t)&&((s=e==null?void 0:e.owner)==null?void 0:s.current)instanceof HTMLElement&&Bl()&&to()};function _f(t){var i;const e=Us(t),{onUpdate:s,transformTemplate:n}=e.getProps();return!t.isHandoff&&!s&&!t.hasOnUpdate&&!n&&t.type!=="inertia"&&(Ee(e,"transform")||"none")==="none"&&!Ee(e,"pathRotation")&&!((i=e.projection)!=null&&i.isProjecting())}class bf extends ps{constructor(e){const s=Us(e).current,{driver:n=gl}=e;let i;const r=_f(e);e.driver=a=>{const l=n(a);return{js:l,now:l.now,start:(u=!0)=>{const c=Ws(s);!c||c.isJS?l.start(u):c.schedule(!1,!u)},stop:()=>{l.stop();const u=Ws(s);u&&!u.isFinishing&&u.release(i)}}},super(e),i=this,this.canAccelerate=r;const{stop:o}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),o()}}get group(){return Ws(Us(this.options).current)}get js(){var e;return(e=this.driver)==null?void 0:e.js}get name(){return this.options.name}timing(){const{startTime:e,speed:s,totalDuration:n}=this,{delay:i=0,repeatType:r}=this.options;return this.holdTime!==null?[1/0,0]:n===1/0?[e+i/s,this.resolvedDuration*(r==="loop"?1:2)/s||1]:[e+(i+n)/s,0]}isAccelerated(){const{group:e,state:s}=this;return(e==null?void 0:e.tracks.has(this))&&!e.isJS&&this.canAccelerate&&(s==="running"||s==="paused")}liveValue(){return this.isAccelerated()?this.sampleAt(kt.now()):void 0}tween(){const{keyframes:e,type:s,ease:n,times:i,repeat:r,delay:o=0}=this.options,a=Fi(n)?Pe(n):vf(n)&&ui[n];if(a&&!r&&!i&&e.length===2&&s===ue&&this.holdTime===null){const l=this.startTime+o/this.speed;return[l,l+this.resolvedDuration/this.speed,a]}}boundaries(e,s){const{startTime:n,speed:i,resolvedDuration:r,options:o}=this,{delay:a=0,repeat:l=0,repeatDelay:u=0,repeatType:c,times:d,keyframes:h,type:f}=o,m=(f||ue)===ue?d||qi(h):[0,1],_=n+a/i,g=[];if(this.holdTime!==null||!(r>0))return g;for(let k=Math.max(0,Math.floor((e-_)*i/r));k<=l;k++){const A=_+k*r/i;if(A>s)break;for(const S of m){const C=A+(k%2&&c&&c!=="loop"?1-S:S)*(r-u)/i;C>e&&C<s&&g.push(C)}}return g}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){const e=kt.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-on,!0),this.sampleAt(e,!0),on)}play(){this.isStopped||((this.group||kf(Us(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();const{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(kt.now())}get time(){return this.isAccelerated()?Dt(Xt(0,this.totalDuration,this.at(kt.now())-(this.options.delay||0))):super.time}set time(e){super.time=e,this.isAccelerated()&&this.sync()}attachTimeline(e){var s;return this.canAccelerate=!1,(s=this.group)==null||s.demote(!0),super.attachTimeline(e)}}function kf(t){const e=t.current,s=new Set,n=new Map;let i={},r=[],o=new Map,a=[],l=!1,u=!1,c=!1,d=!1,h=-1/0;const f=E=>{for(const $ of s)if($.name===E)return!0},m=(E,$)=>{const N={};for(const j of E===void 0?Wt:r){const K=n.get(j),st=E===void 0?Ee(t,j):K?K.sampleAt($>E&&!K.timing()[1]?$:E):i[j];st!==void 0&&(N[j]=st)}return N},_=(E,$)=>{let N="";for(const j in E){const K=E[j];(!$||!so(j,K))&&(N+=gs(j,K)+" ")}return($?N.trim():N)||"none"},g=(E,$)=>_(m(E,$)),k=(E=m())=>{e.style.transform=_(E,!0)},A=(E=!0)=>{E&&k(),a.forEach(({animation:$})=>$.cancel()),a=[]},S=(E,$)=>new Animation(new KeyframeEffect(e,E,$)),C=(E,$,N=1/0)=>{const j={animation:E,offset:$,end:N};E.startTime=kt.now()+$,N<1/0&&(E.onfinish=()=>{j.isDone=!0,a.some(K=>K.end===1/0)&&(E.cancel(),a=a.filter(K=>K!==j)),B.schedule(!1)}),E.oncancel=()=>a.includes(j)&&B.demote(),a.push(j)},W=(E,$,N)=>{const j=(st,at)=>Math.abs(E(at)-E(st)),K=j($,N);for(;N-$>.01;){const st=($+N)/2;j($,st)>j(st,N)?N=st:$=st}return j($,N)>K/2?[$,N]:[]},U=(E,$,N,j)=>{const K=Math.min(pf,Math.max(2,Math.ceil((N-$)/on)));if(j.length*4>K)return;const st=lr($,N,K).concat(j).sort(In),at=et=>he($,N,et);let gt,Z;for(const et of E){const yt=st.map(bt=>et.numberAt(bt)),[Et]=yt,J=yt.map(bt=>bt-Et),tt=J[J.length-1],G=J.some(bt=>Math.abs(bt)*Is>Math.abs(tt))?0:tt,ut=J.map(bt=>G?bt/G:bt);if(G){if(!gt)gt=ut,Z=bt=>(et.numberAt(bt)-Et)/G;else if(ut.some((bt,zt)=>!(Math.abs(bt-gt[zt])<=Is)))return}else if(ut.some(bt=>!(Math.abs(bt)<=Is)))return}if(!gt||gt.every((et,yt)=>Math.abs(et-at(st[yt]))<=Is))return"linear";const z=[],nt=(et,yt=Z(et))=>z.push(si(yt)+" "+si(at(et)*100)+"%");return gt.forEach((et,yt)=>{yt&&Math.abs(et-gt[yt-1])>.2&&W(Z,st[yt-1],st[yt]).forEach(Et=>nt(Et)),nt(st[yt],et)}),"linear("+z+")"},v=(E,$,N,j)=>{const K=[$],st=(z,nt)=>E.every(et=>!(Math.abs(et.numberAt((z+nt)/2)-(et.numberAt(z)+et.numberAt(nt))/2)>(et.name.startsWith("scale")?gf:mf))),at=(z,nt,et)=>{if(nt-z<1||st(z,nt))K.push(nt);else if(et<4)at(z,(z+nt)/2,et+1),at((z+nt)/2,nt,et+1);else{for(const yt of E)K.push(...W(Et=>yt.numberAt(Et),z,nt));K.push(nt)}},gt=lr($,N,Math.ceil((N-$)/100));for(const z of j)gt.push(z,Math.min(z+.01,N));let Z=$;for(const z of gt.sort(In))z>Z&&at(Z,z,0),Z=z;return K.sort(In)},b=E=>{let $;for(const N of E){const j=N.tween();if(!j||$!=null&&$.some((K,st)=>st<2?Math.abs(j[st]-K)>1:j[st]!==K))return;$=j}return $},T=(E,$,N,j={fill:"both"},K,st)=>{const at=E.flatMap(et=>et.boundaries($,N)),gt=st||U(E,$,N,at),Z=gt?[$,N]:v(E,$,N,at),z=Z.map(et=>g(et,K));let nt={transform:z};return gt||(nt.offset=Z.map(et=>he($,N,et))),z.every(et=>et===z[0])&&(k(m($,K)),nt=null),S(nt,{...j,duration:N-$,easing:gt||"linear"})},L=E=>{let $=E,N=0,j=0;const K=[],st=[],at=new Set;n.clear(),o=new Map;for(const Z of s){n.set(Z.name,Z);const[z,nt]=Z.timing(),et=z===1/0;if(o.set(Z,[Z.at(E),Z.speed,et]),et){Z.sync();continue}if(Z.speed<0)return;if(nt){if(N){const yt=(z-j)/nt;if(Math.abs(nt-N)>1||Math.abs(yt-Math.round(yt))*N>1)return}else N=nt,j=z;st.push(Z)}else at.add(z);K.push(Z),$=Math.max($,z)}i={},r=Wt.filter(Z=>{if(n.has(Z))return!0;const z=i[Z]=Ee(t,Z);return z!==void 0&&parseFloat(z)!==(Z.startsWith("scale")?1:0)}),A(!1);const gt=!N&&b(K);try{if(gt&>[1]>E){const[Z,z,nt]=gt;C(T(K,Z,z,void 0,void 0,nt),Z-E,z-Z)}else $>E&&(C(T(K,E,$),0,$-E),at.forEach(Z=>Z<$-1&&C(S(null,{duration:Z-E}),0,Z-E)));if(N){const Z=j+Math.floor(($-j)/N)*N;C(T(st,Z,Z+N,{iterations:1/0,iterationStart:($-Z)/N,fill:"forwards"},$),$-E)}}catch{return}return a.length||A(),!0},X=E=>{let $,N=0;for(const j of s){const K=o.get(j);if(!K)return!1;const[st,at,gt]=K,Z=j.at(E),z=j.timing()[0]===1/0;if(gt){if(z&&Z===st)continue;return!1}const nt=(Z-st)/at,et=z?0:j.speed/at;if($===void 0)$=nt,N=et;else if(Math.abs(nt-$)>1||et!==N)return!1}if($===void 0)return!0;if(!a.length)return!1;for(const{offset:j,end:K,isDone:st}of a){const at=$-j;if(K<1/0&&(st?at<K-1:at<0||at>=K))return!1}for(const{animation:j,offset:K,isDone:st}of a){if(st)continue;const at=$-K;N&&j.updatePlaybackRate&&j.playState==="running"&&Math.abs(Number(j.currentTime)-at)<20?j.playbackRate!==N&&j.updatePlaybackRate(N):N?(j.playbackRate=N,j.startTime=E-at/N):(j.startTime=null,j.currentTime=at)}return!0},V=()=>s.size?!1:(c=!0,Ws(e)===B&&xe.delete(e),B.isJS||A(),!0),R=()=>{const E=kt.now();if(B.isJS||(B.isFinishing=!0,s.forEach(j=>{const[K,st]=j.timing();j.state==="running"&&j.speed>0&&!st&&K<=E+1&&(j.complete(),i[j.name]=Ee(t,j.name),o.has(j)||(l=!0))}),B.isFinishing=!1),u=!1,c||(s.forEach(({state:j},K)=>{(j==="idle"||j==="finished")&&s.delete(K)}),V()))return;for(const j of s)if(!j.canAccelerate)return B.demote(!0);B.isJS&&(B.isJS=!1,l=!0,s.forEach(j=>{var K;return(K=j.js)==null?void 0:K.stop()}));const $=l,N=d;if(l=d=!1,$||!X(E)){if(N){if(E-h<yf)return B.demote();h=E}if(!L(E))return B.demote()}},B={tracks:s,isJS:!1,isFinishing:!1,schedule(E,$){c||(l||(l=E),d||(d=!!$),u||(u=!0,xt.isProcessing?ot.render(R,!1,!0):queueMicrotask(R)))},release(E){const{state:$}=E;($==="idle"||$==="finished")&&s.delete(E),V()||B.schedule(!0)},check(){if(!B.isJS){for(const E in i)if(Ee(t,E)!==i[E]&&!f(E))return B.schedule(!0,!0)}},demote(E){if(!(B.isJS||c))return s.forEach($=>{$.isAccelerated()&&$.sync(),E||($.canAccelerate=!1)}),B.isJS=!0,o=new Map,A(),s.forEach($=>{var N;return $.state==="running"&&((N=$.js)==null?void 0:N.start())}),!0}};return xe.set(e,B),B}class xf extends Xi{constructor(e){var l;super(),this.stop=()=>{var u,c;this._animation&&(this._animation.stop(),(u=this.stopTimeline)==null||u.call(this)),(c=this.keyframeResolver)==null||c.cancel()},this.createdAt=kt.now();const{keyframes:s,name:n,motionValue:i,element:r}=e,o=e;o.autoplay??(o.autoplay=!0),o.delay??(o.delay=0),o.type??(o.type="keyframes"),o.repeat??(o.repeat=0),o.repeatDelay??(o.repeatDelay=0),o.repeatType??(o.repeatType="loop");const a=(r==null?void 0:r.KeyframeResolver)||Qi;this.keyframeResolver=new a(s,(u,c,d)=>this.onKeyframesResolved(u,c,o,!d),n,i,r),(l=this.keyframeResolver)==null||l.scheduleResolve()}onKeyframesResolved(e,s,n,i){var g,k;this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=n;this.resolvedAt=kt.now();const d=af(e,r,o,a);d||((Ut.instantAnimations||!l)&&(c==null||c(fs(e,n,s))),e[0]=e[e.length-1],di(n),n.repeat=0);const{onComplete:h}=n;n.finalKeyframe=s,n.keyframes=e,n.onComplete=()=>{h==null||h(),this.notifyFinished()};const f=d&&!u&&uf(n),m=!f&&wf(n);i&&(f||m||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=Tl(this.createdAt,this.resolvedAt)));let _;if(f){n.element=(k=(g=n.motionValue)==null?void 0:g.owner)==null?void 0:k.current;try{_=new of(n)}catch{_=new ps(n)}}else m?_=new bf(n):_=new ps(n);this.pendingTimeline&&(this.stopTimeline=_.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=_}get finished(){return this._animation?this._animation.finished:super.finished}then(e,s){return this.finished.finally(e).then(()=>{})}liveValue(){var e,s;return(s=(e=this._animation)==null?void 0:e.liveValue)==null?void 0:s.call(e)}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Xh()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e,s;(e=this._animation)==null||e.cancel(),(s=this.keyframeResolver)==null||s.cancel()}}class Sf{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,s){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=s}attachTimeline(e){const s=this.animations.map(n=>n.attachTimeline(e));return()=>{s.forEach((n,i)=>{n&&n(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return cr(this.animations,"duration")}get iterationDuration(){return cr(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(s=>s[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function cr(t,e){let s=0;for(let n=0;n<t.length;n++){const i=t[n][e];i!==null&&i>s&&(s=i)}return s}class ur extends Sf{then(e,s){return this.finished.finally(e).then(()=>{})}}function Fl(t,e,s,n=0,i=1){const r=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,a=(o-1)*n;return typeof s=="function"?s(r,o):i===1?r*n:a-r*n}const dr=30,Tf=t=>!isNaN(parseFloat(t));class is{constructor(e,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{const i=kt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.dirty(),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=s.owner}setCurrent(e){this.current=e,this.updatedAt=kt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Tf(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,s){var n;return e==="change"?this.onChangeSubscribe(s):((n=this.events)[e]||(n[e]=new en)).add(s)}onChangeSubscribe(e){const{events:s}=this;return!s.change&&!this.changeSubscriber?this.changeSubscriber=e:(s.change||(s.change=new en,s.change.add(this.changeSubscriber),this.changeSubscriber=void 0),s.change.add(e)),()=>{var n;this.changeSubscriber===e?this.changeSubscriber=void 0:(n=s.change)==null||n.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){ot.read(()=>{var e;!this.changeSubscriber&&!((e=this.events.change)!=null&&e.getSize())&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const e in this.events)this.events[e].clear()}attach(e,s){this.passiveEffect=e,this.stopPassiveEffect=s}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,s,n){this.set(s),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,s=!0){var n;this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),(n=this.stopPassiveEffect)==null||n.call(this)}dirty(){var n;const{current:e,changeSubscriber:s}=this;s?s(e):(n=this.events.change)==null||n.notify(e)}addDependent(e){(this.dependents||(this.dependents=new Set)).add(e)}removeDependent(e){var s;(s=this.dependents)==null||s.delete(e)}get(){var s,n;const e=(n=(s=this.animation)==null?void 0:s.liveValue)==null?void 0:n.call(s);return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=kt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>dr)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,dr);return Qa(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(e){return this.stop(),new Promise(s=>{var r;this.hasAnimated=!0;let n=!1,i;i=e(()=>{var o;n=!0,(o=this.events.animationComplete)==null||o.notify(),this.animation===i&&(this.animation=void 0),s()}),n||(this.animation=i),(r=this.events.animationStart)==null||r.notify()})}stop(){var e;this.animation&&(this.animation.stop(),(e=this.events.animationCancel)==null||e.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){var e,s,n;(e=this.dependents)==null||e.clear(),(s=this.events.destroy)==null||s.notify(),this.clearListeners(),this.stop(),(n=this.stopPassiveEffect)==null||n.call(this)}}function se(t,e){return new is(t,e)}function jl(t,e){if(t!=null&&t.inherit&&e){const{inherit:s,...n}=t;return{...e,...n}}return t}function no(t,e){const s=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return s!==t?jl(s,t):s}const Af={type:"spring",stiffness:500,damping:25,restSpeed:10},Cf=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Pf={type:"keyframes",duration:.8},Ef={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Mf=(t,{keyframes:e})=>e.length>2?Pf:$t.has(t)?t.startsWith("scale")?Cf(e[1]):Af:Ef,Vf=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","out"]);function Df(t){for(const e in t)if(!Vf.has(e))return!0;return!1}const mn=(t,e,s,n={},i,r)=>o=>{const a=no(n,t)||{},l=a.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Rt(l);const c={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i,hasOnUpdate:!!a.onUpdate};Df(a)||Object.assign(c,Mf(t,c)),c.duration&&(c.duration=Rt(c.duration)),c.repeatDelay&&(c.repeatDelay=Rt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(di(c),c.delay===0&&(d=!0)),(Ut.instantAnimations||Ut.skipAnimations||i!=null&&i.shouldSkipAnimations||a.skipAnimations)&&(d=!0,di(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,d&&!r&&e.get()!==void 0){const h=fs(c.keyframes,a);if(h!==void 0){ot.update(()=>{c.onUpdate(h),c.onComplete()});return}}return a.isSync?new ps(c):new xf(c)},Rf=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $f(t){const e=Rf.exec(t);if(!e)return[,];const[,s,n,i]=e;return[`--${s??n}`,i]}function io(t,e,s=1){const[n,i]=$f(t);if(!n)return;const r=window.getComputedStyle(e).getPropertyValue(n);if(r){const o=r.trim();return Di(o)?parseFloat(o):o}return pn(i)?io(i,e,s+1):i}function Of(t){const e=[{},{}];return t==null||t.values.forEach((s,n)=>{e[0][n]=s.get(),e[1][n]=s.getVelocity()}),e}function Lf(t,e,s,n){const i=r=>typeof r=="function"?r(s!==void 0?s:t.custom,...Of(n)):r;return e=i(e),typeof e=="string"&&(e=t.variants&&t.variants[e]),i(e)}function Oe(t,e,s){return Lf(t.getProps(),e,s,t)}const Nl=(t,e)=>{var s;return e==="exit"?(s=t.presenceContext)==null?void 0:s.custom:void 0},oo=new Set(["width","height","top","left","right","bottom",...Wt]),If=t=>Array.isArray(t);function Bf(t,e,s){t.hasValue(e)?t.getValue(e).set(s):t.addValue(e,se(s))}function Ff(t){return If(t)?t[t.length-1]||0:t}function jf(t,e){const s=Oe(t,e);let{transitionEnd:n={},transition:i={},...r}=s||{};r={...r,...n};for(const o in r){const a=Ff(r[o]);Bf(t,o,a)}}const Ct=t=>!!(t&&t.getVelocity);function Nf(t){return!!(Ct(t)&&t.add)}function fi(t,e){const s=t.getValue("willChange");if(Nf(s))return s.add(e);if(!s&&Ut.WillChange){const n=new Ut.WillChange("auto");t.addValue("willChange",n),n.add(e)}}const Uf="data-framer-appear-id";function Ul(t){return t.props[Uf]}const Wf=typeof window<"u";function zf({protectedKeys:t,needsAnimating:e},s){const n=s in t&&!e[s];return e[s]=!1,n}function Wl(t,e,{delay:s=0,transitionOverride:n,type:i}={}){var m,_;let{transition:r,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();r=r?jl(r,l):l;const u=r==null?void 0:r.reduceMotion,c=r==null?void 0:r.skipAnimations;n&&(r=n);const d=[],h=i&&((m=t.animationState)==null?void 0:m.getState()[i]),f=r==null?void 0:r.path;f&&(f.animateValues?f.animateValues(g=>t.getValue(g,t.latestValues[g]??0),a,r,s,d):(_=f.animateVisualElement)==null||_.call(f,t,a,r,s,d));for(const g in a){const k=t.getValue(g,t.latestValues[g]??null),A=a[g];if(A===void 0||h&&zf(h,g))continue;const S={delay:s,...no((h==null?void 0:h.out[g])||r||{},g)};c&&(S.skipAnimations=!0);const C=k.get();if(C!==void 0&&!k.isAnimating()&&!Array.isArray(A)&&A===C&&!S.velocity){ot.update(()=>k.set(A));continue}let W=!1;if(Wf&&window.MotionHandoffAnimation){const b=Ul(t);if(b){const T=window.MotionHandoffAnimation(b,g,ot);T!==null&&(S.startTime=T,W=!0)}}fi(t,g);const U=u??t.shouldReduceMotion;k.start(mn(g,k,A,U&&oo.has(g)?{type:!1}:S,t,W));const v=k.animation;v&&d.push(v)}if(o){const g=()=>ot.update(()=>{o&&jf(t,o)});d.length?Promise.all(d).then(g):g()}return d}function pi(t,e,s={}){const n=Oe(t,e,Nl(t,s.type)),i=s.transitionOverride||((n==null?void 0:n.transition)??(t.getDefaultTransition()||{})),r=()=>Promise.all(n?Wl(t,n,s):[]),o=(l=0)=>{const{variantChildren:u}=t,{delayChildren:c=0,staggerChildren:d,staggerDirection:h}=i,f=[];return u==null||u.forEach(m=>{m.notify("AnimationStart",e),f.push(pi(m,e,{...s,delay:l+(typeof c=="function"?0:c)+Fl(u,m,c,d,h)}).then(()=>m.notify("AnimationComplete",e)))}),Promise.all(f)},{when:a}=i;return a?a==="beforeChildren"?r().then(()=>o()):o().then(r):Promise.all([r(),o(s.delay)])}function Hf(t,e,s={}){return t.notify("AnimationStart",e),(Array.isArray(e)?Promise.all(e.map(i=>pi(t,i,s))):typeof e=="string"?pi(t,e,s):Promise.all(Wl(t,Oe(t,e,s.custom),s))).then(()=>{t.notify("AnimationComplete",e)})}const Kf={test:t=>t==="auto",parse:t=>t},Gf=t=>e=>e.test(t),Yf=[Je,Y,Gt,Jt,Hd,zd,Kf],hr=t=>Yf.find(Gf(t));function qf(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||$i(t):!0}const Xf=new Set(["auto","none","0"]);function Zf(t,e,s){let n=0,i;for(;n<t.length&&!i;){const r=t[n];typeof r=="string"&&!Xf.has(r)&&Zd(r)&&(i=t[n]),n++}if(i&&s)for(const r of e)t[r]!==i&&(t[r]=Zi(s,i))}class zl extends Qi{constructor(){super(...arguments),this.isAsync=!0}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:e,element:s,motionValue:n}=this,i=e[0]??(n==null?void 0:n.get());if(!(s!=null&&s.current)||i===void 0)return!1;for(let r=0;r<e.length;r++)if(En(r?e[r]:i))return!1;return!0}readKeyframes(){const{unresolvedKeyframes:e,element:s,name:n}=this;if(!(s!=null&&s.current))return;super.readKeyframes();for(let c=0;c<e.length;c++){let d=e[c];if(typeof d=="string"&&(d=d.trim(),pn(d))){const h=io(d,s.current);h!==void 0&&(e[c]=h),c===e.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!oo.has(n)||e.length!==2)return;const[i,r]=e;if(typeof i=="number"&&typeof r=="number")return;const o=hr(i),a=hr(r),l=En(i),u=En(r);if(l!==u&&Ln[n]){this.needsMeasurement=!0;return}if(o!==a)if(er(o)&&er(a))for(let c=0;c<e.length;c++){const d=e[c];typeof d=="string"&&(e[c]=parseFloat(d))}else Ln[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:s}=this,n=[];for(let i=0;i<e.length;i++)(e[i]===null||qf(e[i]))&&n.push(i);n.length&&Zf(e,n,s)}measure(){const{element:e,name:s}=this;return Ln[s](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){var r;const{element:e,unresolvedKeyframes:s,name:n}=this;if(!(e!=null&&e.current))return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),s[0]=this.measuredOrigin;const i=s[s.length-1];i!==void 0&&((r=this.motionValue)==null||r.jump(i,!1))}measureEndState(){var r;const{element:e,unresolvedKeyframes:s}=this;if(!(e!=null&&e.current))return;(r=this.motionValue)==null||r.jump(this.measuredOrigin,!1);const n=s.length-1,i=s[n];s[n]=this.measure(),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),this.resolveNoneKeyframes()}}const ro=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],ao=[];function Jf(t){Hl(t),ao.unshift(t)}function Hl(t){be(ao,t)}function Qf(t){return ao.find(e=>e.test(t))}function Kl(t,e,s={},n){const i=[],{velocity:r,path:o}=s,a=s.reduceMotion??(n==null?void 0:n.shouldReduceMotion);o!=null&&o.animateValues&&n&&(e={...e},o.animateValues(t,e,s,0,i));for(const u in e){if(u==="transition"||u==="transitionEnd")continue;const c=e[u];if(c===void 0)continue;const d=t(u),h=d.get();if(h!==void 0&&!d.isAnimating()&&!Array.isArray(c)&&c===h&&!r){ot.update(()=>d.set(c));continue}d.start(mn(u,d,c,a&&oo.has(u)?{type:!1}:s,n)),d.animation&&i.push(d.animation)}const{transitionEnd:l}=e;if(l){const u=()=>ot.update(()=>{for(const c in l)t(c).set(l[c])});i.length?Promise.all(i).then(u):u()}return i}function Gl(t,e,s,n,i){return Kl(r=>{let o=t.get(e,r);if(!o){let a;if(!i){const l=s[r];a=tp(l)??t.read(e,r,l)}o=se(a,{owner:i}),t(e,{[r]:o})}return o},s,n,i)}function tp(t){const e=Array.isArray(t)?t[0]:void 0;return e===null?void 0:e}function Qt(t){return Ri(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function Qe(t){return Ri(t)&&"ownerSVGElement"in t}const Ye={};function gn(t){var e;return(e=Ye.current)==null||e.add(t),t}const yn=t=>Ye.current?Ye.current.bind(t):t;function vn(t,e,s){var n;if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=e?e.current:((n=Ye.current)==null?void 0:n.root)||document,r=(s==null?void 0:s[t])??i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t).filter(i=>i!=null)}class ep{constructor(e=ot.render){this.step=e,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{const{pending:s,numPending:n}=this;this.numPending=0;for(let i=0;i<n;i++)s[i]()}}set(e,s,n,i){var l;if((l=this.values.get(e))==null||l.onRemove(),i)for(const u of this.values.values())u.value===i&&(n=u.render);const r=()=>n&&this.schedule(n);s.get()!==void 0&&r();const o=s.on("change",r),a=()=>{var u;o(),n&&!i&&this.cancel(n),((u=this.values.get(e))==null?void 0:u.onRemove)===a&&this.values.delete(e)};return this.values.set(e,{value:s,render:i?void 0:n,onRemove:a}),a}get(e){var s;return(s=this.values.get(e))==null?void 0:s.value}release(){const e=new Map;return this.values.forEach((s,n)=>{e.set(n,s.value),s.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){const{pending:s,numPending:n}=this;for(let i=0;i<n;i++)if(s[i]===e)return;n||this.step(this.flush),s[this.numPending++]=e}cancel(e){const{pending:s}=this;for(let n=0;n<this.numPending;n++)if(s[n]===e){s[n]=s[--this.numPending];return}}}function lo(t,{step:e,...s}={}){const n=new WeakMap;return Object.assign((r,o)=>{const a=n.get(r)??new ep(e);n.set(r,a);const l=[];for(const u in o){const c=o[u],d=t(r,a,u,c);l.push(d)}return()=>{for(const u of l)u()}},s,{get:(r,o)=>{var a;return(a=n.get(r))==null?void 0:a.get(o)},flush:r=>{var o;return(o=n.get(r))==null?void 0:o.flush()},state:r=>n.get(r)})}function sp(t){var r;let e="";const{transformKeys:s=[],transformValues:n={}}=t;for(let o=0;o<s.length;o++){const a=s[o],l=n[a].getCurrent();l!==void 0&&(so(a,l)||(e+=(e&&" ")+gs(a,l)))}const i=(r=t.get("pathRotation"))==null?void 0:r.get();return i&&(e+=(e&&" ")+gs("rotate",i)),e||"none"}const Yl=new Set(["originX","originY","originZ"]),Bn=(t,e)=>{var s;return ke((s=t.get(e))==null?void 0:s.get(),ee[e])},co=(t,e,s,n)=>{let i,r;if($t.has(s)){if(s!=="pathRotation"){const o=e.transformKeys??(e.transformKeys=[]);(e.transformValues??(e.transformValues={}))[s]=n,o.includes(s)||(o.push(s),o.sort((a,l)=>Wt.indexOf(a)-Wt.indexOf(l)))}e.get("transform")||(!Qt(t)&&!e.get("transformBox")&&co(t,e,"transformBox",new is("fill-box")),e.set("transform",new is("none"),()=>{var o;(o=xe.get(t))==null||o.check(),t.style.transform=sp(e)})),r=e.get("transform")}else Yl.has(s)?(e.get("transformOrigin")||e.set("transformOrigin",new is(""),()=>{const o=Bn(e,"originX")??"50%",a=Bn(e,"originY")??"50%",l=Bn(e,"originZ")??0;t.style.transformOrigin=`${o} ${a} ${l}`}),r=e.get("transformOrigin")):Cs(s)?i=()=>{t.style.setProperty(s,n.getCurrent())}:i=()=>{t.style[s]=ke(n.getCurrent(),ee[s])};return e.set(s,n,i,r)},np=t=>Qt(t)||Qe(t),ql=(t,e)=>{if($t.has(e))return Ml(t,e);const s=getComputedStyle(t),n=Cs(e)?s.getPropertyValue(e):s[e];return typeof n=="string"&&n.trim()||0},ip=lo(co,{test:np,read:ql});function ys(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function uo(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if($t.has(l)){o=!0;continue}else if(ji(l)){i[l]=u;continue}else{const c=ke(u,ee[l]);l.startsWith("origin")?(a=!0,r[l]=c):n[l]=c}}if(e.transform||(o||s?n.transform=ff(e,t.transform,s):n.transform&&(n.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;n.transformOrigin=`${l} ${u} ${c}`}}const op={offset:"stroke-dashoffset",array:"stroke-dasharray"},rp={offset:"strokeDashoffset",array:"strokeDasharray"};function ap(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?op:rp;t[r.offset]=`${-n}`,t[r.array]=`${e} ${s}`}const ho=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Xl(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(uo(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:h}=t;for(const f of ho)d[f]!==void 0&&(h[f]=d[f],delete d[f]);(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete d.transformBox),e!==void 0&&(d.x=e),s!==void 0&&(d.y=s),n!==void 0&&(d.scale=n),i!==void 0&&ap(d,i,r,o,!1)}function lp(t,e){if(!(e in t))return!1;const s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return s&&typeof s.set=="function"}const fr=(t,e,s,n,i=s)=>{const r=lp(t,i);!r&&(i.startsWith("data")||i.startsWith("aria"))&&(i=ys(i));const o=ee[s]||ee[i],a=r?()=>{t[i]=ke(n.get(),ee[s])}:()=>{const l=ke(n.get(),o);l==null?t.removeAttribute(i):t.setAttribute(i,String(l))};return e.set(s,n,a)};function cp(t,e,s,n){return ot.render(()=>t.setAttribute("pathLength","1")),s==="pathOffset"?e.set(s,n,()=>{const i=n.get();t.setAttribute("stroke-dashoffset",`${-i}`)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new is("1 1"),()=>{var o,a;const i=((o=e.get("pathLength"))==null?void 0:o.get())??1,r=(a=e.get("pathSpacing"))==null?void 0:a.get();t.setAttribute("stroke-dasharray",`${i} ${r??1-Number(i)}`)}),e.set(s,n,void 0,e.get("stroke-dasharray")))}const up=(t,e,s,n)=>s.startsWith("path")&&!$t.has(s)?cp(t,e,s,n):s.startsWith("attr")?fr(t,e,s,n,Zl(s)):($t.has(s)||Yl.has(s)||Cs(s)||s in t.style?co:fr)(t,e,s,n),dp=(t,e)=>{var s;return $t.has(e)?((s=ee[e])==null?void 0:s.default)||0:Cs(e)||ho.includes(e)?ql(t,e)||t.getAttribute(ys(e))||0:(e=Zl(e),t.getAttribute(ys(e))??t.getAttribute(e)??void 0)},hp=lo(up,{test:Qe,read:dp});function Zl(t){return t.replace(/^attr([A-Z])/,(e,s)=>s.toLowerCase())}function Jl({top:t,left:e,right:s,bottom:n}){return{x:{min:e,max:s},y:{min:t,max:n}}}function fp({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function pp(t,e){if(!e)return t;const s=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:s.y,left:s.x,bottom:n.y,right:n.x}}function Fn(t){return t===void 0||t===1}function mi({scale:t,scaleX:e,scaleY:s}){return!Fn(t)||!Fn(e)||!Fn(s)}const qe=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"];function pe(t){return mi(t)||tc(t)||Ql(t)}function Ql(t){return t.z||t.rotate||t.rotateX||t.rotateY||t.rotateZ||t.skewX||t.skewY}function tc(t){return pr(t.x)||pr(t.y)}function pr(t){return t&&t!=="0%"}function rn(t,e,s){const n=t-s,i=e*n;return s+i}function mr(t,e,s,n,i){return i!==void 0&&(t=rn(t,i,n)),rn(t,s,n)+e}function gi(t,e=0,s=1,n,i){t.min=mr(t.min,e,s,n,i),t.max=mr(t.max,e,s,n,i)}function ec(t,{x:e,y:s}){gi(t.x,e.translate,e.scale,e.originPoint),gi(t.y,s.translate,s.scale,s.originPoint)}const gr=.999999999999,yr=1.0000000000001;function mp(t,e,s,n=!1){var a,l,u,c;const i=s.length;if(!i)return;e.x=e.y=1;let r,o;for(let d=0;d<i;d++)r=s[d],o=r.projectionDelta,((l=(a=r.options.visualElement)==null?void 0:a.props.style)==null?void 0:l.display)!=="contents"&&(n===!0&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(jt(t.x,-r.scroll.offset.x),jt(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,ec(t,o)),n&&(((u=n.path)==null?void 0:u[d])||n)!==r&&pe(r.latestValues)&&zs(t,r.latestValues,(c=r.layout)==null?void 0:c.layoutBox));e.x<yr&&e.x>gr&&(e.x=1),e.y<yr&&e.y>gr&&(e.y=1)}function jt(t,e){t.min+=e,t.max+=e}function vr(t,e,s,n,i=.5){const r=mt(t.min,t.max,i);gi(t,e,s,r,n)}function wr(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function zs(t,e,s){const n=s??t;vr(t.x,wr(e.x,n.x),e.scaleX,e.scale,e.originX),vr(t.y,wr(e.y,n.y),e.scaleY,e.scale,e.originY)}function fo(t,e){return Jl(pp(t.getBoundingClientRect(),e))}function gp(t,e,s){const n=fo(t,s),{scroll:i}=e;return i&&(jt(n.x,i.offset.x),jt(n.y,i.offset.y)),n}const yp={},vp=t=>Qe(t)?hp:ip;class wp{constructor(e,s){this.effect=e,this.current=s,this.KeyframeResolver=zl}getValue(e){return this.effect.get(this.current,e)}readValue(e,s){return this.effect.read(this.current,e,s)}render(){this.effect.flush(this.current)}measureViewportBox(){return fo(this.current)}getProps(){return yp}}function _p(t,e,s,n){var r;if((r=Ye.current)==null||r.track(t),n)return Kl(o=>n.getValue(o,null),e,s,n);const i=vp(t);return Gl(i,t,e,s,new wp(i,t))}const bp=lo((t,e,s,n)=>e.set(s,n,()=>{t[s]=n.get()}),{test:t=>Ri(t),read:(t,e)=>{const s=t[e];return typeof s=="string"||typeof s=="number"?s:void 0}}),{schedule:sc}=ml(queueMicrotask,!1);function po(t,e,s){const n=Ct(t)?t:se(t);return n.start(mn("",n,e,s)),n.animation}const ve={};function nc(t){for(const e in t)ve[e]=t[e],ji(e)&&(ve[e].isCSSVariable=!0)}function kp(t,e){const s=kt.now();t=yn(t);const n=({timestamp:i})=>{const r=i-s;r>=e&&(fe(n),t(r-e))};return ot.setup(n,!0),gn(()=>fe(n))}function xp(t){return Qe(t)&&t.tagName==="svg"}function jn(t){return Ct(t)?t.get():t}const _r=t=>typeof t=="number"?t:parseFloat(t),Sp=ro.length,br=t=>typeof t=="number"||Y.test(t);function Tp(t,e,s,n,i,r){i?(t.opacity=mt(0,s.opacity??1,Ap(n)),t.opacityExit=mt(e.opacity??1,0,Cp(n))):r&&(t.opacity=mt(e.opacity??1,s.opacity??1,n));for(let o=0;o<Sp;o++){const a=ro[o];let l=kr(e,a),u=kr(s,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||br(l)===br(u)?(t[a]=Math.max(mt(_r(l),_r(u),n),0),(Gt.test(u)||Gt.test(l))&&(t[a]+="%")):t[a]=u}for(let o=0;o<qe.length;o++){const a=qe[o];(e[a]||s[a])&&(t[a]=mt(e[a]||0,s[a]||0,n))}}function kr(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Ap=ic(0,.5,il),Cp=ic(.5,.95,Ot);function ic(t,e,s){return n=>n<t?0:n>e?1:s(he(t,e,n))}function yi(t,e){t.min=e.min,t.max=e.max}function It(t,e){yi(t.x,e.x),yi(t.y,e.y)}function xr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const oc=1e-4,Pp=1-oc,Ep=1+oc,rc=.01,Mp=0-rc,Vp=0+rc;function Mt(t){return t.max-t.min}function Dp(t,e,s){return Math.abs(t-e)<=s}function Sr(t,e,s,n=.5){t.origin=n,t.originPoint=mt(e.min,e.max,t.origin),t.scale=Mt(s)/Mt(e),t.translate=mt(s.min,s.max,t.origin)-t.originPoint,(t.scale>=Pp&&t.scale<=Ep||isNaN(t.scale))&&(t.scale=1),(t.translate>=Mp&&t.translate<=Vp||isNaN(t.translate))&&(t.translate=0)}function an(t,e,s,n){Sr(t.x,e.x,s.x,n==null?void 0:n.originX),Sr(t.y,e.y,s.y,n==null?void 0:n.originY)}function Tr(t,e,s,n=0){const i=n?mt(s.min,s.max,n):s.min;t.min=i+e.min,t.max=t.min+Mt(e)}function Rp(t,e,s,n){Tr(t.x,e.x,s.x,n==null?void 0:n.x),Tr(t.y,e.y,s.y,n==null?void 0:n.y)}function Ar(t,e,s,n=0){const i=n?mt(s.min,s.max,n):s.min;t.min=e.min-i,t.max=t.min+Mt(e)}function ln(t,e,s,n){Ar(t.x,e.x,s.x,n==null?void 0:n.x),Ar(t.y,e.y,s.y,n==null?void 0:n.y)}function Cr(t,e,s,n,i){return t-=e,t=rn(t,1/s,n),i!==void 0&&(t=rn(t,1/i,n)),t}function $p(t,e=0,s=1,n=.5,i,r=t,o=t){if(Gt.test(e)&&(e=parseFloat(e),e=mt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=mt(r.min,r.max,n);t===r&&(a-=e),t.min=Cr(t.min,e,s,a,i),t.max=Cr(t.max,e,s,a,i)}function Pr(t,e,[s,n,i],r,o){$p(t,e[s],e[n],e[i],e.scale,r,o)}const Op=["x","scaleX","originX"],Lp=["y","scaleY","originY"];function Er(t,e,s,n){Pr(t.x,e,Op,s==null?void 0:s.x,n==null?void 0:n.x),Pr(t.y,e,Lp,s==null?void 0:s.y,n==null?void 0:n.y)}const Mr=()=>({translate:0,scale:1,origin:0,originPoint:0}),Me=()=>({x:Mr(),y:Mr()}),Vr=()=>({min:0,max:0}),Tt=()=>({x:Vr(),y:Vr()});function Dr(t){return t.translate===0&&t.scale===1}function ac(t){return Dr(t.x)&&Dr(t.y)}function Rr(t,e){return t.min===e.min&&t.max===e.max}function Ip(t,e){return Rr(t.x,e.x)&&Rr(t.y,e.y)}function $r(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function lc(t,e){return $r(t.x,e.x)&&$r(t.y,e.y)}function Or(t){return Mt(t.x)/Mt(t.y)}function Lr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Bp{constructor(){this.members=[]}add(e){Vi(this.members,e);for(let s=this.members.length-1;s>=0;s--){const n=this.members[s];if(n===e||n===this.lead||n===this.prevLead)continue;const i=n.instance;(!i||i.isConnected===!1)&&!n.snapshot&&(be(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(be(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(e){var s;for(let n=this.members.indexOf(e)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&((s=i.instance)==null?void 0:s.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,s){var i;const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=n.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=n,s&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var s,n,i,r,o;(n=(s=e.options).onExitComplete)==null||n.call(s),(o=(i=e.resumingFrom)==null?void 0:(r=i.options).onExitComplete)==null||o.call(r)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}function Ir(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Kt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Y.test(t))t=parseFloat(t);else return t;const s=Ir(t,e.target.x),n=Ir(t,e.target.y);return`${s}% ${n}%`}},cc={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=Lt.parse(t);if(i.length>5)return n;const r=Lt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=s.x.scale*e.x,l=s.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=mt(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},Fp={borderRadius:Object.assign({},Kt,{applyTo:ro.slice()}),borderTopLeftRadius:Kt,borderTopRightRadius:Kt,borderBottomLeftRadius:Kt,borderBottomRightRadius:Kt,boxShadow:cc};function jp(t,e,s){let n="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(s==null?void 0:s.z)||0;if((i||r||o)&&(n=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),s){const{transformPerspective:u}=s;u&&(n=`perspective(${u}px) ${n}`);for(let c=0;c<qe.length;c++){const d=qe[c],h=s[d];h&&(n+=`${d}(${h}deg) `),!c&&s.pathRotation&&(n+=`rotate(${s.pathRotation}deg) `)}}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(n+=`scale(${a}, ${l})`),n||"none"}function Ft(t){return[t("x"),t("y")]}const Np=(t,e)=>t.depth-e.depth;class Up{constructor(){this.children=[],this.isDirty=!1}add(e){Vi(this.children,e),this.isDirty=!0}remove(e){be(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Np),this.isDirty=!1,this.children.forEach(e)}}const Hs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Br=["z","skew","skewZ"],Wp=1e3;let zp=0;function Fr(t,e,s,n){const{latestValues:i}=e;i[t]&&(s[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}const Nn=t=>{var e;return t.instance&&((e=xe.get(t.instance))==null?void 0:e.demote())&&t.resetSkewAndRotation()};function uc(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const s=Ul(e);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(s,"transform",ot,!(i||r))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&uc(n)}function dc({attachResizeListener:t,defaultParent:e,measureScroll:s,checkIsScrollRoot:n,resetTransform:i}){return Object.assign(ve,{...Fp,...ve}),class{constructor(o={},a=e==null?void 0:e()){this.id=zp++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Gp),this.nodes.forEach(em),this.nodes.forEach(sm),this.nodes.forEach(Yp)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Up)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new en),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){var l;(l=this.eventHandlers.get(o))==null||l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){var c;if(this.instance)return;this.isSVG=Qe(o)&&!xp(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),(c=this.parent)==null||c.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let d,h=0;const f=()=>this.root.updateBlockedByResize=!1;ot.read(()=>{h=window.innerWidth}),t(o,()=>{const m=window.innerWidth;m!==h&&(h=m,this.root.updateBlockedByResize=!0,d==null||d(),d=kp(f,250),Hs.hasAnimatedSinceResize&&(Hs.hasAnimatedSinceResize=!1,this.nodes.forEach(Ur)))})}a&&this.root.registerSharedNode(a,this),this.addLayoutListener()}addLayoutListener(){const{layoutId:o,layout:a,visualElement:l,animate:u}=this.options;!this.instance||this.hasLayoutListener||u===!1||!l||!(o||a)||(this.hasLayoutListener=!0,this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:f})=>{var S,C;if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||rm,{onLayoutAnimationStart:_,onLayoutAnimationComplete:g}=l.getProps(),k=!this.targetLayout||!lc(this.targetLayout,f),A=!d&&h;if(this.options.layoutRoot||this.resumeFrom||A||d&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const W={...no(m,"layout"),onPlay:_,onComplete:g};(l.shouldReduceMotion||this.options.layoutRoot)&&(W.delay=0,W.type=!1),this.startAnimation(W),this.setAnimationOrigin(c,A,W.path)}else d||Ur(this),this.isLead()&&((C=(S=this.options).onExitComplete)==null||C.call(S));this.targetLayout=f}))}unmount(){var o,a;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(o=this.getStack())==null||o.remove(this),(a=this.parent)==null||a.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,fe(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){var o;this.isUpdateBlocked()||(this.isUpdating=!0,(o=this.nodes)==null||o.forEach(nm),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){var c,d;if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){(d=(c=this.options).onExitComplete)==null||d.call(c);return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&uc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Nn(this),this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const f=this.path[h];f.shouldResetTransform=!0,Nn(f),(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1),f.isAnimationBlocked&&(f.dragSnapshot||(f.dragSnapshot=f.measure()),this.dragAncestor=f)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(Xp),this.nodes.forEach(jr);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Nr);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Jp),this.nodes.forEach(Qp),this.nodes.forEach(tm),this.nodes.forEach(Hp),this.nodes.forEach(Kp)):this.nodes.forEach(Nr),this.clearAllSnapshots();const a=kt.now();xt.delta=Xt(0,1e3/60,a-xt.timestamp),xt.timestamp=a,xt.isProcessing=!0,Rn.update.process(xt),Rn.preRender.process(xt),Rn.render.process(xt),xt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,sc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qp),this.sharedNodes.forEach((o,a)=>o.members.length?o.removeLeadSnapshot():this.sharedNodes.delete(a))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ot.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ot.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Mt(this.snapshot.measuredBox.x)&&!Mt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected=Tt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a==null||a.notify("LayoutMeasure",this.layout.layoutBox,o==null?void 0:o.layoutBox)}updateScroll(o="measure"){const{scroll:a,instance:l}=this,{animationId:u}=this.root;if(this.options.layoutScroll&&l&&!(a&&a.animationId===u&&a.phase===o)){const c=n(l);this.scroll={animationId:u,phase:o,isRoot:c,offset:s(l),wasRoot:a?a.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;o&&Nn(this);const a=this.projectionDelta&&!ac(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||pe(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),am(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return Tt();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(lm))){const{scroll:c}=this.root;c&&(jt(a.x,c.offset.x),jt(a.y,c.offset.y))}return a}removeElementScroll(o){var l;const a=Tt();if(It(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:d,options:h}=c;c!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&It(a,o),jt(a.x,d.offset.x),jt(a.y,d.offset.y))}return a}applyTransform(o,a=!1,l,u,c=0){var h,f;const d=l||Tt();It(d,o);for(let m=c;m<this.path.length;m++){const _=this.path[m];!a&&_.options.layoutScroll&&_.scroll&&_!==_.root&&(jt(d.x,-_.scroll.offset.x),jt(d.y,-_.scroll.offset.y)),pe(_.latestValues)&&zs(d,_.latestValues,(h=_.layout)==null?void 0:h.layoutBox)}return!u&&pe(this.latestValues)&&zs(d,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),d}removeTransform(o){var l;const a=Tt();It(a,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!pe(c.latestValues))continue;let d;c.instance&&(mi(c.latestValues)&&c.updateSnapshot(),d=Tt(),It(d,c.measurePageBox())),Er(a,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,d)}return pe(this.latestValues)&&Er(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:d}=this.options;if(!this.layout||!(c||d))return;this.resolvedRelativeTargetAt=xt.timestamp;const h=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Tt(),this.targetWithTransforms=Tt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Rp(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):It(this.target,this.layout.layoutBox),ec(this.target,this.targetDelta)):It(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&(!h.resumingFrom==!this.resumingFrom||h.options.layoutRoot&&!h.resumingFrom)&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||mi(this.parent.latestValues)||tc(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tt(),this.relativeTargetOrigin=Tt(),ln(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),It(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m,_;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===xt.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!((_=this.parent)!=null&&_.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;It(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;mp(this.layoutCorrected,this.treeScale,this.path,a&&(o.relativeTarget&&!o.relativeParent.resumingFrom?o.relativeParent:!0)),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Tt());const{target:f}=o;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xr(this.prevProjectionDelta.x,this.projectionDelta.x),xr(this.prevProjectionDelta.y,this.projectionDelta.y)),an(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!Lr(this.projectionDelta.x,this.prevProjectionDelta.x)||!Lr(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a,l;(a=this.options.visualElement)==null||a.scheduleRender(),o&&((l=this.getStack())==null||l.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Me(),this.projectionDelta=Me(),this.projectionDeltaWithTransform=Me()}setAnimationOrigin(o,a=!1,l){var C;const u=this.snapshot,c=u?u.latestValues:{},d={...this.latestValues},h=Me();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Tt(),m=(u==null?void 0:u.source)!==((C=this.layout)==null?void 0:C.source),_=this.getStack(),g=!_||_.members.length<=1,k=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(om));this.animationProgress=0;let A;const S=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=W=>{const U=W/1e3,v=S==null?void 0:S(U);Wr(h.x,o.x,U),Wr(h.y,o.y,U),v&&(h.x.translate=v.x,h.y.translate=v.y),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ln(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),im(this.relativeTarget,this.relativeTargetOrigin,f,U),A&&Ip(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=Tt()),It(A,this.relativeTarget)),m&&(this.animationValues=d,Tp(d,c,this.latestValues,U,k,g)),(v==null?void 0:v.rotate)!==void 0&&(this.animationValues||(this.animationValues=d),this.animationValues.pathRotation=v.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=U},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(fe(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ot.update(()=>{Hs.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=se(0)),this.motionValue.jump(0,!1),this.currentAnimation=po(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),Lh(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var o;this.currentAnimation&&((o=this.mixTargetDelta)==null||o.call(this,Wp),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead(),{targetWithTransforms:a,layout:l,latestValues:u}=o;let{target:c}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&hc(this.options.animationType,this.layout.layoutBox,l.layoutBox)){const{layoutBox:d}=this.layout,h=c;c=this.target||Tt(),Yr(c.x,h.x,d.x),Yr(c.y,h.y,d.y)}It(a,c),zs(a,u),an(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Bp),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u==null?void 0:u.transition,preserveFollowOpacity:u!=null&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){var u;(u=this.getStack())==null||u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){var o;return((o=this.getStack())==null?void 0:o.relegate(this))||!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;const{latestValues:a}=o;if(!Ql(a))return;const l={};for(let u=0;u<Br.length;u++)Fr(Br[u],o,l,this.animationValues);for(let u=0;u<qe.length;u++)Fr(qe[u],o,l,this.animationValues);o.render();for(const u in l)o.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;const l=this.getLead();if(!this.isVisible&&l!==this){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=jn(a==null?void 0:a.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}if(!this.projectionDelta||!this.layout||!l.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,o.visibility="",o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=jn(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!pe(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=l.animationValues||l.latestValues;this.applyTransformsToTarget();let d=jp(this.projectionDeltaWithTransform,this.treeScale,c);u&&(d=u(c,d)),o.transform=d;const{x:h,y:f}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${f.origin*100}% 0`,l.animationValues?o.opacity=l===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=l===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in ve){if(c[m]===void 0)continue;const{correct:_,applyTo:g,isCSSVariable:k}=ve[m],A=d==="none"?c[m]:_(c[m],l);if(g){const S=g.length;for(let C=0;C<S;C++)o[g[C]]=A}else k?this.options.visualElement.renderState.vars[m]=A:o[m]=A}this.options.layoutId&&(o.pointerEvents=l===this?jn(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(jr),this.root.sharedNodes.clear()}}}function Hp(t){t.updateLayout(),Zp(t)}function Kp(t){var s,n,i;const e=((s=t.resumeFrom)==null?void 0:s.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=t.layout,{animationType:a}=t.options,l=e.source!==t.layout.source,u=(g,k)=>{if(a==="size")Ft(A=>{const S=Mt(g[A]);g[A].min=k[A].min,g[A].max=g[A].min+S});else if(a==="x"||a==="y"){const A=a==="x"?"y":"x";yi(g[A],k[A])}else hc(a,e.layoutBox,r)&&Ft(A=>{const S=Mt(k[A]);g[A].max=g[A].min+S,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[A].max=t.relativeTarget[A].min+S)})},c=l?e.measuredBox:e.layoutBox;u(c,r);const d=Me();an(d,r,e.layoutBox);const h=Me();an(h,l?t.applyTransform(o,!0):r,c);const f=!ac(d);let m=!1;const _=t.getClosestProjectingParent();if((!t.resumeFrom||_!=null&&_.options.layoutRoot&&t.resumeFrom.path.includes(_))&&_&&!_.resumeFrom){const{snapshot:g,layout:k}=_;if(g&&k){const A=t.options.layoutAnchor||void 0,S=Tt();ln(S,l?t.resumeFrom.applyTransform(e.layoutBox,!0,void 0,!0,_.depth+1):e.layoutBox,g.layoutBox,A);const C=Tt();ln(C,r,k.layoutBox,A),l&&u(S,C),lc(S,C)||(m=!0),_.options.layoutRoot&&(t.relativeTarget=C,t.relativeTargetOrigin=S,t.relativeParent=_)}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:h,layoutDelta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:m})}else t.isLead()&&((i=(n=t.options).onExitComplete)==null||i.call(n));t.options.transition=void 0}function Gp(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Yp(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function qp(t){t.clearSnapshot()}function jr(t){t.clearMeasurements()}function Xp(t){t.isLayoutDirty=!0,t.updateLayout()}function Nr(t){t.isLayoutDirty=!1}function Zp(t){const{snapshot:e,dragAncestor:s}=t,n=(s==null?void 0:s.isAnimationBlocked)&&s.layout;if(!e||!n||t.resumeFrom||t.isAnimationBlocked)return;const i=s.dragSnapshot;Ft(r=>jt(e.layoutBox[r],n.layoutBox[r].min-i.layoutBox[r].min))}function Jp(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function Qp(t){var e;t.relativeTarget&&((e=t.relativeParent)!=null&&e.isLayoutDirty)&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function tm(t){const{visualElement:e}=t.options;e!=null&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ur(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function em(t){t.resolveTargetDelta()}function sm(t){t.calcProjection()}function nm(t){t.resetSkewAndRotation()}function Wr(t,e,s){t.translate=mt(e.translate,0,s),t.scale=mt(e.scale,1,s),t.origin=e.origin,t.originPoint=e.originPoint}function zr(t,e,s,n){t.min=mt(e.min,s.min,n),t.max=mt(e.max,s.max,n)}function im(t,e,s,n){zr(t.x,e.x,s.x,n),zr(t.y,e.y,s.y,n)}function om(t){var e;return((e=t.animationValues)==null?void 0:e.opacityExit)!==void 0}const rm={duration:.45,ease:[.4,0,.1,1]},Hr=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Kr=Hr("applewebkit/")&&!Hr("chrome/")?Math.round:Ot;function Gr(t){t.min=Kr(t.min),t.max=Kr(t.max)}function am(t){Gr(t.x),Gr(t.y)}function Yr(t,e,s){t.max=Mt(s)+(t.min=e.min)}function hc(t,e,s){return t==="position"||t==="preserve-aspect"&&!Dp(Or(e),Or(s),.2)}function lm(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}function vs(t,e,s,n={passive:!0}){return t.addEventListener(e,s,n),()=>t.removeEventListener(e,s,n)}const cm=dc({attachResizeListener:(t,e)=>vs(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Ks={current:void 0},um=dc({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ks.current){const t=new cm({});t.mount(window),t.setOptions({layoutScroll:!0}),Ks.current=t}return Ks.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),fc=new WeakMap;function mo(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function cn(t){return typeof t=="string"||Array.isArray(t)}const go=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qr=["initial"].concat(go);function pc(t){if(mo(t.animate))return!0;for(let e=0;e<qr.length;e++)if(cn(t[qr[e]]))return!0;return!1}function dm(t){return!!(pc(t)||t.variants)}function hm(t,e,s){for(const n in e){const i=e[n],r=s[n];if(Ct(i))t.addValue(n,i);else if(Ct(r))t.addValue(n,se(i,{owner:t}));else if(r!==i)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(n);t.addValue(n,se(o!==void 0?o:i,{owner:t}))}}for(const n in s)e[n]===void 0&&t.removeValue(n);return e}const vi={current:null},mc={current:!1},fm=typeof window<"u";function pm(){if(mc.current=!0,!!fm)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vi.current=t.matches;t.addEventListener("change",e),e()}else vi.current=!1}const Xr=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zr={};class mm{scrapeMotionValuesFromProps(e,s,n){return{}}constructor({parent:e,props:s,presenceContext:n,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Qi,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=kt.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,ot.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=s.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=s,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=pc(s),this.isVariantNode=dm(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(s,{},this);for(const f in h){const m=h[f];u[f]!==void 0&&Ct(m)&&m.set(u[f])}}mount(e){var s,n,i,r;if(this.hasBeenMounted)for(const o in this.initialValues)(s=this.values.get(o))==null||s.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];if(this.current=e,fc.set(e,this),(n=this.projection)!=null&&n.instance||((i=this.projection)==null||i.mount(e)),this.isVariantNode&&!this.isControllingVariants){let o=this;do o=o.props.inherit!==!1&&o.parent;while(o&&!o.isVariantNode);if(o){const{variantChildren:a}=o;a.add(this),this.removeFromVariantTree=()=>a.delete(this)}}this.values.forEach((o,a)=>this.bindToMotionValue(a,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(mc.current||pm(),this.shouldReduceMotion=vi.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e,s,n;(e=this.projection)==null||e.unmount(),fe(this.notifyUpdate),fe(this.render),this.valueSubscriptions.forEach(i=>i()),this.valueSubscriptions.clear(),(s=this.removeFromVariantTree)==null||s.call(this),(n=this.parent)==null||n.removeChild(this);for(const i in this.events)this.events[i].clear();for(const i in this.features){const r=this.features[i];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||(this.enteringChildren=new Set)).add(e)}removeChild(e){var s;this.children.delete(e),(s=this.enteringChildren)==null||s.delete(e)}bindToMotionValue(e,s){var o;if((o=this.valueSubscriptions.get(e))==null||o(),s.accelerate&&hi.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:l,times:u,ease:c,duration:d}=s.accelerate,h=new Ll({element:this.current,name:e,keyframes:l,times:u,ease:c,duration:Rt(d)}),f=a(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const n=$t.has(e);n&&this.onBindTransform&&this.onBindTransform();const i=s.on("change",a=>{var l;this.latestValues[e]=a,this.props.onUpdate&&ot.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),(l=xe.get(this.current))==null||l.check()),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,s)),this.valueSubscriptions.set(e,()=>{i(),r==null||r()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Zr){const s=Zr[e];if(!s)continue;const{isEnabled:n,Feature:i}=s;if(!this.features[e]&&i&&n(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Tt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,s){this.latestValues[e]=s}update(e,s){var r,o,a,l;const{transformTemplate:n,onUpdate:i}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!i)&&((r=xe.get(this.current))==null||r.demote()),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let u=0;u<Xr.length;u++){const c=Xr[u];(a=(o=this.propEventSubscriptions)[c])==null||a.call(o),delete this.propEventSubscriptions[c];const d="on"+c,h=e[d];h&&(this.propEventSubscriptions[c]=this.on(c,h))}this.prevMotionValues=hm(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),(l=this.handleChildMotionValue)==null||l.call(this)}getProps(){return this.props}getVariant(e){var s;return(s=this.props.variants)==null?void 0:s[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,s){const n=this.values.get(e);if(s!==n){n&&this.removeValue(e),this.bindToMotionValue(e,s),this.values.set(e,s);const i=s.get();i!==void 0&&(this.latestValues[e]=i)}}removeValue(e){var s;this.values.delete(e),(s=this.valueSubscriptions.get(e))==null||s(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,s){var i,r;let n=(i=this.props.values)==null?void 0:i[e];return n||(n=this.values.get(e),n===void 0&&s!==void 0&&(n=se(s??((r=this.getDefaultValue)==null?void 0:r.call(this,e)),{owner:this}),this.addValue(e,n)),n)}readValue(e,s){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n=="string"&&(Di(n)||$i(n))?n=parseFloat(n):typeof n!="number"&&!Lt.test(n)&&Lt.test(s)&&(n=Zi(e,s)),this.setBaseTarget(e,Ct(n)?n.get():n)),Ct(n)?n.get():n}setBaseTarget(e,s){this.baseTarget[e]=s}on(e,s){return(this.events[e]||(this.events[e]=new en)).add(s)}notify(e,...s){var n;(n=this.events[e])==null||n.notify(...s)}scheduleRenderMicrotask(){sc.render(this.render)}}class gc extends mm{constructor(){super(...arguments),this.KeyframeResolver=zl}sortInstanceNodePosition(e,s){return e.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(e,s){const n=e.style;return n?n[s]:void 0}removeValueFromRenderState(e,{vars:s,style:n}){delete s[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ct(e)&&(this.childSubscription=e.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function yc(t,{style:e,vars:s},n,i){const r=t.style;let o;for(o in e)r[o]=e[o];i==null||i.applyProjectionStyles(r,n);for(o in s)r.setProperty(o,s[o])}function gm(t,{layout:e,layoutId:s}){return $t.has(t)||t.startsWith("origin")||(e||s!==void 0)&&(!!ve[t]||t==="opacity")}function vc(t,e,s){var o;const n=t.style,i=e==null?void 0:e.style,r={};if(!n)return r;for(const a in n)(Ct(n[a])||i&&Ct(i[a])||gm(a,t)||((o=s==null?void 0:s.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(r[a]=n[a]);return r}function ym(t){return window.getComputedStyle(t)}class vm extends gc{constructor(){super(...arguments),this.type="html",this.renderInstance=yc}mount(e){super.mount(e)}readValueFromInstance(e,s){var n;if($t.has(s))return(n=this.projection)!=null&&n.isProjecting?ms(s):Ml(e,s);{const i=ym(e),r=(ji(s)?i.getPropertyValue(s):i[s])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:s}){return fo(e,s)}build(e,s,n){uo(e,s,n.transformTemplate)}scrapeMotionValuesFromProps(e,s,n){return vc(e,s,n)}}const yo=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Gs=new WeakMap;let ae;const wc=(t,e,s)=>(n,i)=>i&&i[0]?i[0][t+"Size"]:Qe(n)&&"getBBox"in n?n.getBBox()[e]:n[s],wm=wc("inline","width","offsetWidth"),_m=wc("block","height","offsetHeight");function bm({target:t,borderBoxSize:e}){var s;(s=Gs.get(t))==null||s.forEach(n=>{n(t,{get width(){return wm(t,e)},get height(){return _m(t,e)}})})}function km(t){t.forEach(bm)}function xm(){typeof ResizeObserver>"u"||(ae=new ResizeObserver(km))}function Sm(t,e){ae||xm();const s=vn(t);return s.forEach(n=>{let i=Gs.get(n);i||(i=new Set,Gs.set(n,i)),i.add(e),ae==null||ae.observe(n)}),()=>{s.forEach(n=>{const i=Gs.get(n);i==null||i.delete(e),i!=null&&i.size||ae==null||ae.unobserve(n)})}}const Ys=new Set;let Ve;function Tm(){Ve=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ys.forEach(e=>e(t))},window.addEventListener("resize",Ve)}function Am(t){return Ys.add(t),Ve||Tm(),()=>{Ys.delete(t),!Ys.size&&typeof Ve=="function"&&(window.removeEventListener("resize",Ve),Ve=void 0)}}function Jr(t,e){return gn(typeof t=="function"?Am(t):Sm(t,e))}const Qr=(t,e)=>Math.abs(t-e);function Cm(t,e){const s=Qr(t.x,e.x),n=Qr(t.y,e.y);return Math.sqrt(s**2+n**2)}const Pm=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Em(t){return Pm.has(t.tagName)||t.isContentEditable===!0}const Mm=new Set(["INPUT","SELECT","TEXTAREA"]);function Vm(t){return Mm.has(t.tagName)||t.isContentEditable===!0}const Bt={x:!1,y:!1};function _c(){return Bt.x||Bt.y}function Dm(t){return t==="x"||t==="y"?Bt[t]?null:(Bt[t]=!0,()=>{Bt[t]=!1}):Bt.x||Bt.y?null:(Bt.x=Bt.y=!0,()=>{Bt.x=Bt.y=!1})}function bc(t,e){const s=vn(t),n=new AbortController,i={passive:!0,...e,signal:n.signal},r=gn(()=>n.abort());return[s,i,r]}function Rm(t){return!(t.pointerType==="touch"||_c())}function $m(t,e,s={}){e=yn(e);const[n,i,r]=bc(t,s);return n.forEach(o=>{let a=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",m)},d=g=>{u&&(u(g),u=void 0),c()},h=g=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,d(g))},f=()=>{a=!0,window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",h,i)},m=g=>{if(g.pointerType!=="touch"){if(a){l=!0;return}d(g)}},_=g=>{if(!Rm(g))return;l=!1;const k=e(o,g);typeof k=="function"&&(u=k,o.addEventListener("pointerleave",m,i))};o.addEventListener("pointerenter",_,i),o.addEventListener("pointerdown",f,i)}),r}const kc=(t,e)=>e?t===e?!0:kc(t,e.parentElement):!1,qs=new WeakSet;function ta(t){return e=>{e.key==="Enter"&&t(e)}}function Un(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Om=(t,e)=>{let s=!1;const n=ta(()=>{qs.has(t)||(s=!0,Un(t,"down"))}),i=ta(()=>{s&&(s=!1,Un(t,"up"))});t.addEventListener("keydown",n,e),t.addEventListener("keyup",i,e),t.addEventListener("blur",()=>{t.removeEventListener("keydown",n),t.removeEventListener("keyup",i),s&&Un(t,"cancel")},{...e,once:!0})};function ea(t){return yo(t)&&!_c()}const sa=new WeakSet;function Lm(t,e,s={}){e=yn(e);const[n,i,r]=bc(t,s),o=a=>{const l=a.currentTarget;if(!ea(a)||sa.has(a))return;qs.add(l),s.stopPropagation&&sa.add(a);const u=e(l,a),c={...i,capture:!0},d=(m,_)=>{window.removeEventListener("pointerup",h,c),window.removeEventListener("pointercancel",f,c),qs.has(l)&&qs.delete(l),ea(m)&&typeof u=="function"&&u(m,{success:_})},h=m=>{d(m,l===window||l===document||s.useGlobalTarget||kc(l,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",h,c),window.addEventListener("pointercancel",f,c)};return n.forEach(a=>{(s.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Qt(a)&&(a.addEventListener("focus",()=>Om(a,i),i),!Em(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}const vo=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),xc=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Im(t,e,s,n){yc(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(vo.has(i)?i:ys(i),e.attrs[i])}function Bm(t,e,s){const n=vc(t,e,s);for(const i in t)if(i!=="children"&&(Ct(t[i])||Ct(e[i]))){const r=Wt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[r]=t[i]}return n}class Fm extends gc{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Tt}getBaseTargetFromProps(e,s){return $t.has(s)?super.getBaseTargetFromProps(e,s)??ms(s):e[s]}getDefaultValue(e){return $t.has(e)?this.latestValues[e]??ms(e):void 0}readValueFromInstance(e,s){if($t.has(s)){const n=El(s);return n&&n.default||0}if(ho.includes(s)){const i=getComputedStyle(e)[s];if(typeof i=="string"&&i)return i.trim()}return s=vo.has(s)?s:ys(s),e.getAttribute(s)}scrapeMotionValuesFromProps(e,s,n){return Bm(e,s,n)}build(e,s,n){Xl(e,s,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,s,n,i){Im(e,s,n,i)}mount(e){this.isSVGTag=xc(e.tagName),super.mount(e)}}function Sc(t,e){if(!Array.isArray(e))return!1;const s=e.length;if(s!==t.length)return!1;for(let n=0;n<s;n++)if(e[n]!==t[n])return!1;return!0}const jm=[...go].reverse(),na=t=>(t==null?void 0:t.out)===!0?t:t==null?void 0:t.out;function Nm(t){let e=a=>Promise.all(a.map(({animation:l,options:u})=>Hf(t,l,u))),s=ia(),n=!0,i=!1;function r(a){var W;const{props:l,parent:u,manuallyAnimateOnMount:c}=t,{initial:d}=l,h=n||i,f=[],m=(U=d)=>{var v;return typeof U!="boolean"&&Oe(t,Array.isArray(U)?U[0]:U,(v=t.presenceContext)==null?void 0:v.custom)||void 0},_=new Map;let g={},k=1/0,A=t;do A=A.props.inherit!==!1&&A.parent;while(A&&!A.isControllingVariants);const S=h&&na((W=m(d??(A&&A.props.initial)))==null?void 0:W.transition);if(jm.forEach((U,v)=>{var gt,Z;const b=s[U],T=l[U],L=A&&A.props[U],X=T!==void 0?T:cn(L)||L===!1?L:void 0,V=cn(X),R=U===a?b.isActive:null,B=V&&T===void 0&&!(h&&c);if(b.protectedKeys={...g},!b.isActive&&R===null||!X&&!b.prevProp||mo(X)||typeof X=="boolean")return;if(R===!1&&(k=v),U==="exit"&&b.isActive&&R!==!0){g={...g,...b.prevResolvedValues};return}const E=Um(b.prevProp,X);let $=E||V&&(R&&!B||v>k),N=!1;const j=Array.isArray(X)?X:[X];let K={},st;if(R!==!1)for(const z of j){const{transition:nt,transitionEnd:et,...yt}=Oe(t,z,Nl(t,U))||{};K={...K,...yt,...et},st=na(nt)||st}const{prevResolvedValues:at}=b;for(const z in{...at,...K}){if(z in g)continue;const nt=K[z],et=at[z],yt=Array.isArray(nt)&&Array.isArray(et)?!Sc(nt,et)||E:nt!==et;let Et;if(yt&&nt==null)_.has(z)||_.set(z,b.prevOut);else if(yt||nt!==void 0&&_.has(z)){$=!0,Et=_.get(z)||S,_.delete(z)&&(N=!0),b.needsAnimating[z]=!0;const J=t.getValue(z);J&&(J.liveStyle=!1)}else b.protectedKeys[z]=!0;b.out[z]=Et}if(b.prevProp=X,b.prevResolvedValues=K,b.prevOut=st,b.isActive&&(g={...g,...K}),$&&(!(B&&E)||N))for(const z of j){const nt={type:U};if(typeof z=="string"&&h&&c&&(u!=null&&u.enteringChildren)){const et=(Z=(gt=Oe(u,z))==null?void 0:gt.transition)==null?void 0:Z.delayChildren;nt.delay=Fl(u.enteringChildren,t,et)}f.push({animation:z,options:nt})}}),_.size){const U={},v=m();let b=v==null?void 0:v.transition;_.forEach((T,L)=>{T&&(b={...b||t.getDefaultTransition(),[L]:T});const X=t.getValue(L);X&&(X.liveStyle=!0);const V=v&&!Array.isArray(d)?v[L]:void 0,R=t.getBaseTargetFromProps(l,L);U[L]=(V!==void 0?V:R!==void 0&&!Ct(R)?R:t.initialValues[L]===void 0?t.baseTarget[L]:void 0)??null}),b&&(U.transition=b),f.push({animation:U})}const C=h&&t.blockInitialAnimation||n&&!c&&(l.initial===!1||l.initial===l.animate);return n=i=!1,!C&&f.length?e(f):Promise.resolve()}function o(a,l){var c;if(s[a].isActive===l)return Promise.resolve();(c=t.variantChildren)==null||c.forEach(d=>{var h;return(h=d.animationState)==null?void 0:h.setActive(a,l)}),s[a].isActive=l;const u=r(a);for(const d in s)s[d].protectedKeys={};return u}return{animateChanges:r,setActive:o,setAnimateFunction:a=>{e=a(t)},getState:()=>s,reset:()=>{s=ia(),i=!0}}}function Um(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Sc(e,t):!1}function ia(){const t={};for(const e of go)t[e]={isActive:e==="animate",protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return t}function wo(t){return typeof t=="object"&&!Array.isArray(t)}function Tc(t,e,s,n){return t==null?[]:typeof t=="string"&&wo(e)?vn(t,s,n):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(i=>i!=null):[t]}function Wm(t,e,s){return t*(e+1)+s*e}function Ac(t,e){if(e.has(t))return e.get(t);const[,s,n]=t.match(/^(.+?)([+-][\d.]+)$/)||[];return e.has(s)?Math.max(0,e.get(s)+parseFloat(n)):void 0}function zm(t,e,s,n){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?s:e.startsWith("<")?Math.max(0,s+parseFloat(e.slice(1))):Ac(e,n)??t}function Hm(t,e,s){for(let n=0;n<t.length;n++){const i=t[n];i.at>e&&i.at<s&&(be(t,i),n--)}}function Km(t,e,s,n,i,r){Hm(t,i,r);for(let o=0;o<e.length;o++)t.push({value:e[o],at:mt(i,r,n[o]),easing:al(s,o)})}function Gm(t,e,s=0){const n=e+1+e*s;for(let i=0;i<t.length;i++)t[i]=t[i]/n}function Ym(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const qm="easeInOut",Xm=20;function Zm(t,{defaultTransition:e={},...s}={},n,i,r){const o=e.duration||.3,a=new Map,l=new Map,u={},c=new Map;let d=0,h=0,f=0;const m=(_,g)=>{let k=g;const A=S=>typeof S=="number"?g+S:zm(h,S,d,c);for(let S=0;S<_.length;S++){const C=_[S];if(typeof C=="string"){c.set(C,h);continue}else if(!Array.isArray(C)){const L=C.at===void 0?h:A(C.at);"sequence"in C?(d=h=L,h=m(C.sequence,L),d=L,k=Math.max(k,h)):c.set(C.name,L);continue}let[W,U,v={}]=C;v.at!==void 0&&(h=A(v.at));let b=0;const T=(L,X,V,R=0,B=0)=>{const E=Jm(L),{delay:$=0,times:N=qi(E),type:j=e.type||"keyframes",repeat:K,repeatType:st,repeatDelay:at=0,...gt}=X;let{ease:Z=e.ease||"easeOut",duration:z}=X;const nt=typeof $=="function"?$(R,B):$,et=E.length,yt=eo(j)?j:i==null?void 0:i[j||"keyframes"];if(et<=2&&yt){let G=100;if(et===2&&eg(E)){const zt=E[1]-E[0];G=Math.abs(zt)}const ut={...e,...gt};z!==void 0&&(ut.duration=Rt(z));const bt=vl(ut,G,yt);Z=bt.ease,z=bt.duration}z??(z=o);const Et=h+nt;N.length===1&&N[0]===0&&(N[1]=1);const J=N.length-E.length;if(J>0&&xl(N,J),E.length===1&&E.unshift(null),K&&K<Xm){const G=z>0?at/z:0;z=Wm(z,K,at);const ut=[...E],bt=[...N];Z=Array.isArray(Z)?[...Z]:[Z];const zt=[...Z],Vt=st==="reverse"||st==="mirror";let Ae=ut,Vs=zt;Vt&&(Ae=[...ut].reverse(),st==="reverse"&&(Vs=[...zt].reverse().map(oe=>typeof oe=="function"?Oi(oe):oe)));for(let oe=0;oe<K;oe++){const Co=Vt&&oe%2===0,Po=Co?Ae:ut,Jc=Co?Vs:zt,Eo=(oe+1)*(1+G);G>0&&(E.push(E[E.length-1]),N.push(Eo),Z.push("linear")),E.push(...Po);for(let ts=0;ts<Po.length;ts++)N.push(bt[ts]+Eo),Z.push(ts===0?"linear":al(Jc,ts-1))}Gm(N,K,G)}const tt=Et+z;Km(V,E,Z,N,Et,tt),b=Math.max(nt+z,b),f=Math.max(tt,f)};if(Ct(W)){const L=oa(W,l);T(U,v,ra("default",L))}else{const L=Tc(W,U,n,u),X=L.length;for(let V=0;V<X;V++){U=U,v=v;const R=L[V],B=oa(R,l);for(const E in U)T(U[E],Qm(v,E),ra(E,B),V,X)}}d=h,h+=b,k=Math.max(k,h)}return k};return m(t,0),r&&(r.duration=f,r.labels=c),l.forEach((_,g)=>{for(const k in _){const A=_[k];A.sort(Ym);const S=[],C=[],W=[];for(let T=0;T<A.length;T++){const{at:L,value:X,easing:V}=A[T];S.push(X),C.push(he(0,f,L)),W.push(V||"easeOut")}C[0]!==0&&(C.unshift(0),S.unshift(S[0]),W.unshift(qm)),C[C.length-1]!==1&&(C.push(1),S.push(null)),a.has(g)||a.set(g,{keyframes:{},transition:{}});const U=a.get(g);U.keyframes[k]=S;const{type:v,...b}=e;U.transition[k]={...b,duration:f,ease:W,times:C,...s}}}),a}function oa(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ra(t,e){return e[t]||(e[t]=[]),e[t]}function Jm(t){return Array.isArray(t)?t:[t]}function Qm(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const tg=t=>typeof t=="number",eg=t=>t.every(tg);function sg(t,e){return Ct(t)||typeof t=="number"||typeof t=="string"&&!wo(e)}function Cc(t,e,s,n){const i=[];if(sg(t,e))i.push(po(t,wo(e)&&e.default||e,s&&(s.default||s)));else{if(t==null)return i;const r=Tc(t,e,n),o=r.length;for(let a=0;a<o;a++){const l=r[a],u={...s};"delay"in u&&typeof u.delay=="function"&&(u.delay=u.delay(a,o)),l instanceof Element?i.push(..._p(l,e,u,fc.get(l))):i.push(...Gl(Qf(l)??bp,l,e,u))}}return i}function ng(t,e,s,n){const i=[],r=t.map(a=>{if(Array.isArray(a)&&typeof a[0]=="function"){const l=a[0],u=se(0);return u.on("change",l),a.length===1?[u,[0,1]]:a.length===2?[u,[0,1],a[1]]:[u,a[1],a[2]]}return a});return Zm(r,e,s,{spring:Yi},n).forEach(({keyframes:a,transition:l},u)=>{i.push(...Cc(u,a,l))}),i}let aa=0;function ig(t,e){const s=[...t],n=typeof s[0]=="function"?Math.max(1,s.length-1):2;return s[n]={...s[n],at:e},s}const la=(t,e)=>e===void 0?t:{name:t,at:e};function ca(t){t.pause(),t.time=0,t.stop()}class Le{constructor(e=[],s={},n){this.options=s,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.isWrapped=!1,this.stop=()=>{var r;this.flush(),(r=this.group)==null||r.stop()},this.isPaused=s.autoplay===!1,this.newFinished(),e.forEach(r=>this.add(r)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new ur(n),this.watch()):(this.invalidate(),this.flush());const{scope:i}=s;i&&(i.animations.push(this),this.finished.then(()=>be(i.animations,this)))}add(e,s){return e instanceof Le&&e.adopt(this),this.push({item:e,at:s})}call(e,s){return this.push({item:e,at:s,marker:{name:"_m"+aa++,time:0,callback:e}})}addPause(e,s){return this.push({item:s||{},at:e,marker:{name:"_m"+aa++,time:0,callback:s,pause:!0}})}move(e,s){return this.entries.forEach(n=>{n.item===e&&(n.at=s)}),this.invalidate()}remove(e){return e instanceof Le&&(e.parent=void 0),this.entries=this.entries.filter(s=>s.item!==e),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){const s=this.resolve(e),n=Math.abs(this.speed);return this.speed=s<this.time?-n:n,this.stopAt=s,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){var e;return((e=this.active())==null?void 0:e.time)??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){var e;return((e=this.active())==null?void 0:e.state)??"idle"}get startTime(){var e;return((e=this.active())==null?void 0:e.startTime)??null}play(){var e;this.flush(),this.isPaused=!1,(e=this.group)==null||e.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){var e;this.flush(),this.isPaused=!0,(e=this.group)==null||e.pause()}cancel(){var e;this.flush(),(e=this.group)==null||e.cancel()}complete(){var e;this.flush(),(e=this.group)==null||e.complete()}attachTimeline(e){var s;return this.flush(),this.scrollTimeline=e,this.detachScroll=(s=this.group)==null?void 0:s.attachTimeline(e),()=>{var n;this.scrollTimeline=void 0,(n=this.detachScroll)==null||n.call(this)}}then(e,s){return this.finished.then(e,s)}active(){var e;return this.flush(),(e=this.group)!=null&&e.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&this.build()}adopt(e){this.group&&(ca(this.group),this.group=void 0),this.isDirty=!1,this.parent=e}build(){var S;this.isDirty=!1,this.isWrapped=!1;const e=this.group;let s=0;e&&(this.isRebuilding=!0,this.scrollTimeline?((S=this.detachScroll)==null||S.call(this),e.cancel()):(s=e.animations.length?e.time:0,ca(e)),this.isRebuilding=!1);const{defaultTransition:n,onComplete:i,onUpdate:r,onRepeat:o,onReverseComplete:a,autoplay:l,scope:u,...c}=this.options,d={};(u==null?void 0:u.reduceMotion)!==void 0&&(d.reduceMotion=u.reduceMotion),(u==null?void 0:u.skipAnimations)!==void 0&&(d.skipAnimations=u.skipAnimations),Object.assign(d,c);const h=new Map,f={},m=ng(this.toSequence(h),{defaultTransition:n,...d},u,f),_=f.labels;let g=d.duration??f.duration;const k=f.duration?g/f.duration:1;if(_.forEach((C,W)=>_.set(W,C*k)),this.markers=[],h.forEach((C,W)=>{C.time=_.get(W),_.delete(W),g=Math.max(g,C.time),this.markers.push(C)}),this.markers.sort((C,W)=>C.time-W.time),this.labels=_,this.totalDuration=g,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||r||o){const C=this.clock=se(0);C.on("change",W=>C===this.clock&&this.onClock(W)),m.unshift(this.clockAnimation=po(C,[0,g],{...d,duration:g,ease:"linear"}))}const A=this.group=new ur(m);s=Math.min(s,g),this.isDone&&s<g&&this.newFinished(),this.scrollTimeline?this.detachScroll=A.attachTimeline(this.scrollTimeline):(A.speed=this.playbackSpeed,this.isPaused&&A.pause(),s&&(A.time=s)),this.repeatIndex=this.currentRepeat(),this.prevTime=s||-1,this.watch()}toSequence(e){return this.entries.map(({item:s,at:n,marker:i})=>i?(e.set(i.name,i),la(i.name,n)):s instanceof Le?{sequence:s.toSequence(e),at:n}:typeof s=="string"?la(s,n):n===void 0?s:Array.isArray(s)?ig(s,n):{...s,at:n})}resolve(e){return this.flush(),typeof e=="number"?e:Ac(e,this.labels)??this.time}currentRepeat(){var o;const{repeat:e=0,repeatDelay:s=0,delay:n=0}=this.options,i=this.totalDuration+s,r=(((o=this.clockAnimation)==null?void 0:o.time)??0)-n;return i&&r>0?Math.min(e,Math.floor(r/i)):0}onClock(e){let s=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;const{onUpdate:n,onRepeat:i,repeatType:r="loop"}=this.options;n==null||n(e);const o=this.currentRepeat();if(o!==this.repeatIndex&&(this.repeatIndex=o,i==null||i(),r==="loop")){const a=this.speed>0;if(this.cross(s,a?this.totalDuration:0))return;s=a?-1:1/0}this.cross(s,e)}cross(e,s){var o;if(e===s)return;const n=s>e,i=a=>n?a>e&&a<=s:a<e&&a>=s,r=n?this.markers:[...this.markers].reverse();for(const a of r)if(i(a.time)&&((o=a.callback)==null||o.call(a,n?1:-1),a.pause))return this.pauseAt(a.time);if(this.stopAt!==void 0&&i(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=e,!0}watch(){const e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;const{onComplete:s,onReverseComplete:n}=this.options,i=this.speed<0&&n||s;i==null||i(),this.resolveFinished()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e})}}function og(t){return Array.isArray(t)&&t.some(Array.isArray)}function rg(t={}){const{scope:e,reduceMotion:s,skipAnimations:n}=t;function i(r,o,a){const l=Ye.current,u=l==null?void 0:l.transition,c={};s!==void 0&&(c.reduceMotion=s),n!==void 0&&(c.skipAnimations=n);let d;if(og(r)){const h={...c,...o,scope:e};u&&(h.defaultTransition={...u,...h.defaultTransition}),d=new Le(r,h)}else{const{onComplete:h,...f}=a||{},m={...c,...u,...f},{onUpdate:_}=f,g=typeof r=="number"||typeof r=="string"&&(typeof o=="string"||Array.isArray(o))?[_||(()=>{}),Array.isArray(o)?o:[r,o],{...m,onUpdate:void 0}]:[r,o,m];d=new Le([g],{...c,onComplete:h,scope:e},Cc(r,o,m,e))}return l&&d.finished.then(l.add(()=>d.stop())),d}return i}const ag=Object.assign(rg(),{addEffect:Jf,removeEffect:Hl}),lg={some:0,all:1};function cg(t,e,{root:s,margin:n,amount:i="some"}={}){const r=vn(t);e=yn(e);const o=new WeakMap,a=u=>{u.forEach(c=>{const d=o.get(c.target);if(c.isIntersecting!==!!d)if(c.isIntersecting){const h=e(c.target,c);typeof h=="function"?o.set(c.target,h):l.unobserve(c.target)}else typeof d=="function"&&(d(c),o.delete(c.target))})},l=new IntersectionObserver(a,{root:s,rootMargin:n,threshold:typeof i=="number"?i:lg[i]});return r.forEach(u=>l.observe(u)),gn(()=>l.disconnect())}function Pc({current:t}){return t?t.ownerDocument.defaultView:null}function wi(t){if(t)return t.nodeType===3||t.nodeType===8?wi(t.nextSibling):t}var[ug,dg]=xs("Motion"),[hg]=xs("LayoutGroup"),Ec={reducedMotion:"never",transition:void 0,nonce:void 0},[fg,pg]=xs("MotionConfig");function _o(){return fg(I(()=>Ec))}var mg=rt({name:"MotionConfig",inheritAttrs:!1,__name:"MotionConfig",props:{transition:{},reduceMotion:{},reducedMotion:{default:({reduceMotion:t})=>Su(t)?t:Ec.reducedMotion},skipAnimations:{type:Boolean},nonce:{},inViewOptions:{}},setup(t){const e=t,s=_o(),n=I(()=>({transition:e.transition??s.value.transition,reducedMotion:e.reducedMotion??s.value.reducedMotion,skipAnimations:e.skipAnimations??s.value.skipAnimations,nonce:e.nonce??s.value.nonce,inViewOptions:e.inViewOptions??s.value.inViewOptions}));return pg(n),(i,r)=>te(i.$slots,"default")}}),gg=mg;function Mc(t,e,s){if(Array.isArray(t))return t.reduce((n,i)=>{const r=Mc(i,e,s);return r?{...n,...r}:n},{});if(typeof t=="object")return t;if(t&&e){const n=e[t];return typeof n=="function"?n(s):n}}function yg(t,e,s){const n=Mc(t,e,s);if(!n)return;const{transition:i,transitionEnd:r,...o}=n;return{...o,...r}}function vg(t,e){var i;const s=(t.initial===void 0&&t.variants?e==null?void 0:e.initial:t.initial)===!1?["initial","animate"]:["initial"],n=t.custom??((i=t.presenceContext)==null?void 0:i.custom);return s.reduce((r,o)=>({...r,...yg(t[o]||(e==null?void 0:e[o]),t.variants,n)}),{})}var wg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],_g=new Set(wg);function Vc(t){return _g.has(t)}var ua=new WeakMap,bg=class{constructor(t,e,s={}){var n;this.element=null,this.isExiting=!1,this.children=new Set,this.features=new Map,this.featureCtors=[],this._context=null,this.options=t,this.parent=e,(n=e==null?void 0:e.children)==null||n.add(this),this.latestValues=vg(t,this.context),this.type=Vc(this.options.as)?"svg":"html",this.setBundle(s)}get context(){if(!this._context){const t={get:(e,s)=>{var i;const n=this.options[s];return cn(n)||s==="initial"&&n===!1?n:(i=this.parent)==null?void 0:i.context[s]}};this._context=new Proxy({},t)}return this._context}setBundle(t){var e;t.renderer&&this.initVisualElement(t.renderer),(e=t.features)!=null&&e.length&&(this.featureCtors=t.features),this.updateFeatures()}updateFeatures(){if(this.visualElement)for(const t of this.featureCtors){let e=this.features.get(t.key);e||(e=new t(this),this.features.set(t.key,e)),this.isMounted()&&(e.isMount?e.update():(e.mount(),e.isMount=!0))}}updateOptions(t){var e;this.options=t,(e=this.visualElement)==null||e.update({...this.options,whileTap:this.options.whilePress},this.options.presenceContext??null)}mount(t){var e,s;ua.set(t,this),this.element=t,(e=this.features.get("layout"))==null||e.refreshRootScroll(),(s=this.visualElement)==null||s.mount(t),this.updateFeatures()}beforeUnmount(){this.getSnapshot(!1)}unmount(){var t,e,s;(e=(t=this.parent)==null?void 0:t.children)==null||e.delete(this),this.element&&ua.delete(this.element),this.features.forEach(n=>{n.unmount(),n.isMount=!1}),(s=this.visualElement)==null||s.unmount(),this.element=null}beforeUpdate(){this.getSnapshot(!this.isExiting)}update(){this.updateFeatures(),this.didUpdate()}getFeature(t){return this.features.get(t)}setActive(t,e){var n,i;t==="exit"&&e&&(this.isExiting=!0);const s=t==="whilePress"?"whileTap":t;(i=(n=this.visualElement)==null?void 0:n.animationState)==null||i.setActive(s,e).then(()=>{t==="exit"&&e&&(this.isExiting=!1)})}isMounted(){return!!this.element}initVisualElement(t){var e,s;this.visualElement||(this.visualElement=t(this.options.as,{presenceContext:this.options.presenceContext??null,parent:(e=this.parent)==null?void 0:e.visualElement,props:{...this.options,whileTap:this.options.whilePress},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{...this.latestValues}},reducedMotionConfig:(s=this.options.motionConfig)==null?void 0:s.reducedMotion}),this.isMounted()&&this.visualElement.mount(this.element))}getSnapshot(t){var e;(e=this.features.get("layout"))==null||e.getSnapshot(t)}didUpdate(){}},Zt=class{constructor(t){this.isMount=!1,this.state=t}mount(){}beforeUnmount(){}unmount(){}update(){}getSnapshot(t){}};function Dc(t){return t.style.display==="none"||t.offsetParent===null&&window.getComputedStyle(t).position!=="fixed"}var Ie,kg=(Ie=class extends Zt{constructor(e){super(e);const s=e.visualElement;s.animationState||(s.animationState=Nm(s))}updateAnimationControlsSubscription(){const{animate:e}=this.state.options;mo(e)&&(this.unmountControls=e.subscribe(this.state.visualElement))}mount(){var e;Dc(this.state.element)?this.state.setActive("exit",!0):(e=this.state.visualElement.animationState)==null||e.animateChanges(),this.updateAnimationControlsSubscription()}update(){var n;(n=this.state.visualElement.animationState)==null||n.animateChanges();const{animate:e}=this.state.visualElement.getProps(),{animate:s}=this.state.visualElement.prevProps||{};e!==s&&this.updateAnimationControlsSubscription()}unmount(){var e;this.state.visualElement.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}},Ie.key="animation",Ie),Be,xg=(Be=class extends Zt{constructor(...e){super(...e),this.exitGeneration=0}exit(){var r,o;const e=++this.exitGeneration,s=this.state;s.isExiting=!0;const n=new Promise(a=>{this.pendingExit={resolve:a}}),i=(o=(r=s.visualElement)==null?void 0:r.animationState)==null?void 0:o.setActive("exit",!0);return i?i.then(()=>{var a;e===this.exitGeneration&&(s.isExiting=!1,(a=s.options)!=null&&a.layoutId?ot.postRender(()=>this.tryCompleteExit(e)):this.tryCompleteExit(e))}):(s.isExiting=!1,this.tryCompleteExit(e)),s.getSnapshot(!1),n}reenter(){this.exitGeneration++,this.settleExit(),this.state.isExiting=!1,this.state.setActive("exit",!1),this.state.getSnapshot(!0)}completeExitFromProjection(){this.tryCompleteExit(this.exitGeneration)}tryCompleteExit(e){var s,n,i;e!==this.exitGeneration||this.state.isExiting||(s=this.state.options)!=null&&s.layoutId&&((i=(n=this.state.visualElement.projection)==null?void 0:n.currentAnimation)==null?void 0:i.state)==="running"||this.settleExit()}settleExit(){var e;(e=this.pendingExit)==null||e.resolve(),this.pendingExit=void 0}mount(){var e,s;(s=(e=this.state.options.presenceContext)==null?void 0:e.register)==null||s.call(e,this.state)}unmount(){var e,s;(s=(e=this.state.options.presenceContext)==null?void 0:e.unregister)==null||s.call(e,this.state),this.settleExit()}},Be.key="exit",Be);function Sg(t,e){return Vc(t)?new Fm(e):new vm(e)}function Xe(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}function Tg(t){return e=>yo(e)&&t(e,Xe(e))}var Fe,Ag=(Fe=class extends Zt{constructor(e){super(e)}isActive(){const{whilePress:e,onPress:s,onPressCancel:n,onPressStart:i}=this.state.options;return!!(e||s||n||i)}register(){var s;const e=this.state.element;!e||!this.isActive()||((s=this.removePress)==null||s.call(this),this.removePress=Lm(e,(n,i)=>{const r=this.state.options;return this.state.setActive("whilePress",!0),r.onPressStart&&ot.postRender(()=>r.onPressStart(i,Xe(i))),(o,{success:a})=>{this.state.setActive("whilePress",!1);const l=a?"onPress":"onPressCancel",u=this.state.options[l];u&&ot.postRender(()=>u(o,Xe(o)))}},{useGlobalTarget:this.state.options.globalPressTarget}))}mount(){this.register()}update(){const e=this.state.visualElement.prevProps;!(e!=null&&e.whilePress||e!=null&&e.whileTap||e!=null&&e.onPress||e!=null&&e.onPressCancel||e!=null&&e.onPressStart)&&this.isActive()&&this.register()}unmount(){var e;(e=this.removePress)==null||e.call(this),this.removePress=void 0}},Fe.key="press",Fe),je,Cg=(je=class extends Zt{constructor(e){super(e)}isActive(){const{whileHover:e,onHoverStart:s,onHoverEnd:n}=this.state.options;return!!(e||s||n)}register(){var s;const e=this.state.element;!e||!this.isActive()||((s=this.removeHover)==null||s.call(this),this.removeHover=$m(e,(n,i)=>{const r=this.state.options;return this.state.setActive("whileHover",!0),r.onHoverStart&&ot.postRender(()=>r.onHoverStart(i,Xe(i))),o=>{this.state.setActive("whileHover",!1);const a=this.state.options.onHoverEnd;a&&ot.postRender(()=>a(o,Xe(o)))}}))}mount(){this.register()}update(){const e=this.state.visualElement.prevProps;!(e!=null&&e.whileHover||e!=null&&e.onHoverStart||e!=null&&e.onHoverEnd)&&this.isActive()&&this.register()}unmount(){var e;(e=this.removeHover)==null||e.call(this),this.removeHover=void 0}},je.key="hover",je),Ne,Pg=(Ne=class extends Zt{constructor(e){super(e)}isActive(){const{whileInView:e,onViewportEnter:s,onViewportLeave:n}=this.state.options;return!!(e||s||n)}startObserver(){var i;const e=this.state.element;if(!e||!this.isActive())return;(i=this.removeObserver)==null||i.call(this);const{once:s,...n}=this.state.options.inViewOptions||{};this.removeObserver=cg(e,(r,o)=>{const a=this.state.options;if(this.state.setActive("whileInView",!0),a.onViewportEnter&&ot.postRender(()=>a.onViewportEnter(o)),!s)return()=>{this.state.setActive("whileInView",!1);const l=this.state.options.onViewportLeave;l&&ot.postRender(()=>l(o))}},n)}mount(){this.startObserver()}update(){const{props:e,prevProps:s}=this.state.visualElement;["amount","margin","root"].some(n=>{var i,r;return((i=e.inViewOptions)==null?void 0:i[n])!==((r=s==null?void 0:s.inViewOptions)==null?void 0:r[n])})&&this.startObserver()}unmount(){var e;(e=this.removeObserver)==null||e.call(this),this.removeObserver=void 0}},Ne.key="inView",Ne),Ue,Eg=(Ue=class extends Zt{constructor(e){super(e),this.isFocused=!1}onFocus(){let e=!1;try{e=this.state.element.matches(":focus-visible")}catch{e=!0}e&&(this.state.setActive("whileFocus",!0),this.isFocused=!0)}onBlur(){this.isFocused&&(this.state.setActive("whileFocus",!1),this.isFocused=!1)}mount(){const e=this.state.element;this.removeFocus=Ss(vs(e,"focus",()=>this.onFocus()),vs(e,"blur",()=>this.onBlur()))}unmount(){var e;(e=this.removeFocus)==null||e.call(this),this.removeFocus=void 0}},Ue.key="focus",Ue);function Rc(t){if(t)return t.options.allowProjection!==!1?t.projection:Rc(t.parent)}var $c={borderRadius:{...Kt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Kt,borderTopRightRadius:Kt,borderBottomLeftRadius:Kt,borderBottomRightRadius:Kt,boxShadow:cc},Mg=typeof window>"u",We,Vg=(We=class extends Zt{constructor(e){super(e),nc($c),Mg||this.initProjection()}initProjection(){var n;const e=this.state.options;this.state.visualElement.projection=new um(this.state.visualElement.latestValues,e["data-framer-portal-id"]?void 0:Rc(this.state.visualElement.parent)),this.projection=this.state.visualElement.projection,this.projection.isPresent=!0,this.setOptions();const s=(n=this.projection.getStack())==null?void 0:n.lead;s&&!this.projection.root.isUpdateBlocked()&&(s.willUpdate(),s.scheduleCheckAfterUnmount())}setOptions(){var o;const e=this.state.options,{layoutId:s,layout:n,drag:i=!1,dragConstraints:r=!1}=e;(o=this.projection)==null||o.setOptions({layout:n,layoutId:s,alwaysMeasureLayout:!!s||!!i||r&&Qt(r),visualElement:this.state.visualElement,animationType:typeof e.layout=="string"?e.layout:"both",layoutRoot:e.layoutRoot,layoutScroll:e.layoutScroll,crossfade:e.crossfade,onExitComplete:()=>{var a;!((a=this.projection)!=null&&a.isPresent)&&this.state.options.layoutId&&!this.state.isExiting&&queueMicrotask(()=>{var l;(l=this.state.getFeature("exit"))==null||l.completeExitFromProjection()})}})}update(){this.setOptions()}mount(){var e;(e=this.projection)==null||e.mount(this.state.element)}},We.key="projection",We);function os(t,e,s,n){return vs(t,e,Tg(s),n)}var da=new Set(["auto","scroll"]),Oc=class{constructor(t,e,{transformPagePoint:s,contextWindow:n,dragSnapToOrigin:i=!1,distanceThreshold:r=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Bs(this.lastRawMoveEventInfo,this.transformPagePoint));const h=Wn(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=Cm(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!m)return;const{point:_}=h;this.history.push({..._,timestamp:kt.now()});const{onStart:g,onMove:k}=this.handlers;f||(g&&g(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.handleScroll(window),this.lastMoveEvent=h,this.lastRawMoveEventInfo=f,this.lastMoveEventInfo=Bs(f,this.transformPagePoint),this.hasPendingMove=!0,ot.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:m,onSessionEnd:_,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=Wn(h.type==="pointercancel"?this.lastMoveEventInfo:Bs(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(h,k),_&&_(h,k)},!yo(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=n||window;const a=Bs(Xe(t),this.transformPagePoint),{point:l}=a,{timestamp:u}=xt;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=e;c&&c(t,Wn(a,this.history));const d={passive:!0,capture:!0};this.removeListeners=Ss(os(this.contextWindow,"pointermove",this.handlePointerMove,d),os(this.contextWindow,"pointerup",this.handlePointerUp,d),os(this.contextWindow,"pointercancel",this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(t){let e=t.parentElement;for(;e;){const s=getComputedStyle(e);(da.has(s.overflowX)||da.has(s.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const s=t===window,n=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:n.x-e.x,y:n.y-e.y};i.x===0&&i.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,n),ot.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){var t;this.removeListeners&&this.removeListeners(),(t=this.removeScrollListeners)==null||t.call(this),this.scrollPositions.clear(),fe(this.updatePoint)}};function Bs(t,e){return e?{point:e(t.point)}:t}function ha(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Wn({point:t},e){return{point:t,delta:ha(t,Lc(e)),offset:ha(t,Dg(e)),velocity:Rg(e,.1)}}function Dg(t){return t[0]}function Lc(t){return t[t.length-1]}function Rg(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,n=null;const i=Lc(t);for(;s>=0&&(n=t[s],!(i.timestamp-n.timestamp>Rt(e)));)s--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&i.timestamp-n.timestamp>Rt(e)*2&&(n=t[1]);const r=Dt(i.timestamp-n.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-n.x)/r,y:(i.y-n.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function zn(t){return(e,s)=>{t&&ot.update(()=>t(e,s),!1,!0)}}var ze,$g=(ze=class extends Zt{constructor(...e){super(...e),this.removePointerDownListener=Ot}onPointerDown(e){this.session=new Oc(e,this.createPanHandlers(),{transformPagePoint:this.state.visualElement.getTransformPagePoint(),contextWindow:Pc(this.state.visualElement)})}createPanHandlers(){return{onSessionStart:zn((e,s)=>{const{onPanSessionStart:n}=this.state.options;n&&n(e,s)}),onStart:zn((e,s)=>{const{onPanStart:n}=this.state.options;n&&n(e,s)}),onMove:zn((e,s)=>{const{onPan:n}=this.state.options;n&&n(e,s)}),onEnd:(e,s)=>{const{onPanEnd:n}=this.state.options;delete this.session,n&&ot.postRender(()=>n(e,s))}}}mount(){this.removePointerDownListener=os(this.state.element,"pointerdown",this.onPointerDown.bind(this))}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},ze.key="pan",ze);function Og(t,{min:e,max:s},n){return e!==void 0&&t<e?t=n?mt(e,t,n.min):Math.max(t,e):s!==void 0&&t>s&&(t=n?mt(s,t,n.max):Math.min(t,s)),t}var _i=.35;function Lg(t,{top:e,left:s,bottom:n,right:i}){return{x:fa(t.x,s,i),y:fa(t.y,e,n)}}function fa(t,e,s){return{min:e!==void 0?t.min+e:void 0,max:s!==void 0?t.max+s-(t.max-t.min):void 0}}function Ig(t=_i){return t===!1?t=0:t===!0&&(t=_i),{x:pa(t,"left","right"),y:pa(t,"top","bottom")}}function pa(t,e,s){return{min:ma(t,e),max:ma(t,s)}}function ma(t,e){return typeof t=="number"?t:t[e]||0}function Bg(t,e){const s={};return e.min!==void 0&&(s.min=e.min-t.min),e.max!==void 0&&(s.max=e.max-t.min),s}function Fg(t,e){return{x:ga(t.x,e.x),y:ga(t.y,e.y)}}function ga(t,e){let s=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([s,n]=[n,s]),{min:s,max:n}}function jg(t,e){let s=.5;const n=Mt(t),i=Mt(e);return i>n?s=he(e.min,e.max-n,t.min):n>i&&(s=he(t.min,t.max-i,e.min)),Xt(0,1,s)}var Ng=new WeakMap;function ya(t){let e="";for(const s of t.path){s.scroll=void 0,s.updateScroll();const{scroll:n}=s;s!==t.root&&n&&(e+=`${n.offset.x},${n.offset.y},`)}return e}var Ug=class{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Tt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.state=t}get visualElement(){return this.state.visualElement}start(t,{snapToCursor:e=!1,distanceThreshold:s}={}){if(this.state.isExiting)return;const n=u=>{e&&this.snapToCursor(u),this.stopAnimation()},i=(u,c)=>{this.stopAnimation();const{drag:d,dragPropagation:h,onDragStart:f}=this.getProps();d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Dm(d),!this.openGlobalLock)||(this.latestPointerEvent=u,this.latestPanInfo=c,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ft(m=>{let _=this.getAxisMotionValue(m).get()||0;if(pn(_)&&(_=io(_,this.visualElement.current)||0),Y.test(_))_=parseFloat(_);else if(Gt.test(_)){const{projection:g}=this.visualElement;if(g&&g.layout){const k=g.layout.layoutBox[m];k&&(_=Mt(k)*(parseFloat(_)/100))}}this.originPoint[m]=_}),f&&ot.update(()=>f(u,c),!1,!0),fi(this.visualElement,"transform"),this.state.setActive("whileDrag",!0))},r=(u,c)=>{this.latestPointerEvent=u,this.latestPanInfo=c;const{dragPropagation:d,dragDirectionLock:h,onDirectionLock:f,onDrag:m}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:_}=c;if(h&&this.currentDirection===null){if(this.currentDirection=zg(_),this.currentDirection===null)return;f&&f(this.currentDirection)}this.updateAxis("x",_),this.updateAxis("y",_),this.visualElement.render(),m&&ot.update(()=>m(u,c),!1,!0)},o=(u,c)=>{this.latestPointerEvent=u,this.latestPanInfo=c,this.stop(u,c),this.latestPointerEvent=null,this.latestPanInfo=null},a=()=>{const{dragSnapToOrigin:u}=this.getProps();(u||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Oc(t,{onSessionStart:n,onStart:i,onMove:r,onSessionEnd:o,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:s,contextWindow:Pc(this.visualElement),element:this.state.element})}stop(t,e,s){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!n)return;const{velocity:o}=i;this.startAnimation(o,s);const{onDragEnd:a}=this.getProps();a&&ot.postRender(()=>a(n,i))}cancel(){this.isDragging=!1;const{projection:t}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:e}=this.getProps();!e&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),this.state.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e){const{drag:s}=this.getProps();if(!e||!es(t,s,this.currentDirection))return;const n=this.getAxisMotionValue(t);let i=this.originPoint[t]+e[t];this.constraints&&this.constraints[t]&&(i=Og(i,this.constraints[t],this.elastic[t])),n.set(i)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:e}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,n=this.constraints;if(t&&Qt(t)){const{projection:r}=this.visualElement;(!this.constraints||!r||this.scroll!==ya(r))&&(this.constraints=this.resolveRefConstraints())}else t&&s?this.constraints=Lg(s.layoutBox,t):this.constraints=!1;this.elastic=Ig(e),n!==this.constraints&&!Qt(t)&&s&&this.constraints&&!this.hasMutatedConstraints&&Ft(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Bg(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Qt(t))return!1;const s=t,{projection:n}=this.visualElement;if(!n||!n.layout)return!1;this.scroll=ya(n);const i=gp(s,n.root,this.visualElement.getTransformPagePoint());let r=Fg(n.layout.layoutBox,n.removeElementScroll(i));if(e){const o=e(fp(r));this.hasMutatedConstraints=!!o,o&&(r=Jl(o))}return r}startAnimation(t,e){const{drag:s,dragMomentum:n,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Ft(c=>{if(!es(c,e||s,this.currentDirection))return;let d=l&&l[c]||{};(o===!0||o===c)&&(d={min:0,max:0});const h=i?200:1e6,f=i?40:1e7,m={type:"inertia",velocity:n?t[c]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(t,e){const s=this.getAxisMotionValue(t);return fi(this.visualElement,t),s.start(mn(t,s,0,e,this.visualElement,!1))}stopAnimation(){var t;(t=this.visualElement.projection)!=null&&t.isPresent&&Ft(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`;return this.visualElement.getProps()[e]||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:e}){var o;const{drag:s}=this.getProps(),n={x:t,y:e},i=((o=this.visualElement.getTransformPagePoint())==null?void 0:o(n))||n,r=this.visualElement.measureViewportBox();Ft(a=>{if(!es(a,s,this.currentDirection))return;const l=this.getAxisMotionValue(a),{min:u,max:c}=r[a];l.set((l.get()||0)+i[a]-mt(u,c,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:s}=this.visualElement;if(!Qt(e)||!s||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};Ft(r=>{const o=this.getAxisMotionValue(r);if(o&&this.constraints!==!1){const a=o.get();n[r]=jg({min:a,max:a},this.constraints[r])}});const{transformTemplate:i}=this.visualElement.getProps();this.state.element.style.transform=i?i({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ft(r=>{const o=this.getAxisMotionValue(r);if(!es(r,t,null)||!o.get())return;const{min:a,max:l}=this.constraints[r];o.set(mt(a,l,n[r]))}),this.visualElement.render()}addListeners(){if(!this.state.element)return;Ng.set(this.visualElement,this);const t=this.state.element,e=os(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps(),d=l.target,h=d!==t&&Vm(d);u&&c&&!h&&this.start(l)});let s;const n=()=>{const{dragConstraints:l}=this.getProps();Qt(l)&&(this.constraints=this.resolveRefConstraints(),s||(s=Wg(t,l,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,r=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ot.read(n);const o=vs(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ft(c=>{if(!es(c,this.getProps().drag,this.currentDirection))return;const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())}));return()=>{o(),e(),r(),a&&a(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:s=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:r=_i,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:s,dragPropagation:n,dragConstraints:i,dragElastic:r,dragMomentum:o}}};function va(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Wg(t,e,s){const n=Jr(t,va(s)),i=Jr(e,va(s));return()=>{n(),i()}}function es(t,e,s){return(e===!0||e===t)&&(s===null||s===t)}function zg(t,e=10){let s=null;return Math.abs(t.y)>e?s="y":Math.abs(t.x)>e&&(s="x"),s}var He,Hg=(He=class extends Zt{constructor(e){super(e),this.removeGroupControls=Ot,this.removeListeners=Ot,this.controls=new Ug(e)}mount(){const{dragControls:e,drag:s}=this.state.options;e&&(this.removeGroupControls=e.subscribe(this.controls)),this.prevDragControls=e,this.prevDrag=s,this.removeListeners=this.controls.addListeners()||Ot}update(){const{dragControls:e,drag:s}=this.state.options;e!==this.prevDragControls&&(this.removeGroupControls(),this.removeGroupControls=e?e.subscribe(this.controls):Ot,this.prevDragControls=e),this.prevDrag&&!s&&this.controls.stop(void 0,void 0,this.prevDrag),this.prevDrag=s}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},He.key="drag",He),Ke,Kg=(Ke=class extends Zt{constructor(e){super(e),nc($c)}updatePrevLead(e){const s=this.state.visualElement.projection;s.isPresent!==e&&(s.isPresent=e,e?!s.isLead()&&(s==null||s.promote()):s.isLead()&&(s==null||s.relegate()))}updateLayoutGroup(){var o,a;const{layout:e,layoutId:s,layoutGroup:n}=this.state.options;(e||s)&&(Hs.hasEverUpdated=!0);const i=e||s?n==null?void 0:n.group:void 0;if(i===this.registeredGroup)return;const r=this.state.visualElement.projection;r&&((o=this.registeredGroup)==null||o.remove(r)),this.registeredGroup=i,r&&((a=this.registeredGroup)==null||a.add(r))}didUpdate(){var e,s;(this.state.options.layout||this.state.options.layoutId||this.state.options.drag)&&((s=(e=this.state.visualElement.projection)==null?void 0:e.root)==null||s.didUpdate())}mount(){const e=this.state.options;if(e.layout||e.layoutId){const s=this.state.visualElement.projection;if(e.layoutId){const n=!Dc(this.state.element);s.isPresent=n,n?s==null||s.promote():s==null||s.relegate()}}this.updateLayoutGroup(),this.didUpdate()}update(){this.updateLayoutGroup()}unmount(){var s;const e=this.state.visualElement.projection;e&&((s=this.registeredGroup)==null||s.remove(e)),this.registeredGroup=void 0}getSnapshot(e){const s=this.state.visualElement.projection;this.updateLayoutGroup();const{layout:n,layoutId:i,drag:r,layoutDependency:o}=this.state.visualElement.props,a=this.state.visualElement.prevProps;!s||!n&&!i&&!r||((r||a.layoutDependency!==o||o===void 0||e!==s.isPresent)&&s.willUpdate(),i&&this.updatePrevLead(e),this.didUpdate())}refreshRootScroll(){var s,n,i;const e=(n=(s=this.state.visualElement)==null?void 0:s.projection)==null?void 0:n.root;e&&this.state.options.layoutId&&(e.scroll=void 0,(i=e.updateScroll)==null||i.call(e))}},Ke.key="layout",Ke),Gg={renderer:Sg,features:[kg,xg,Ag,Cg,Pg,Eg,Vg,$g,Hg,Kg]},[Yg]=xs("LazyMotionContext"),[qg,Xg]=xs("AnimatePresenceContext");function Zg(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function Ic(){return{transform:{},transformOrigin:{},style:{},vars:{}}}function Jg(){return{...Ic(),attrs:{}}}function Qg(t,e){const s=Ic();uo(s,t,e);const n={...s.style};n.transform===""&&delete n.transform;for(const i in s.vars)n[i]=s.vars[i];return Object.keys(n).length===0?null:n}function ty(t,e,s){const n=Jg();Xl(n,t,xc(e),void 0,s);const i={};for(const r in n.attrs){const o=vo.has(r)?r:Zg(r);i[o]=n.attrs[r]}return{attrs:i,style:{...n.style,...n.vars}}}function ey(t,e={}){var g,k,A;const s=ug(null),n=hg({}),i=_o(),r=qg({}),o=Yg({features:Q({}),strict:!1}),a=su();function l(){return Md(t,{layoutGroup:n,presenceContext:r,config:i.value})}function u(){return{...a,...l()}}const c=u();t.initial&&c.layoutId&&((k=(g=Ks.current)==null?void 0:g.sharedNodes.get(c.layoutId))!=null&&k.lead)&&(c.initial=!1);const d=new bg(c,s,e);dg(d),_t(o.features,S=>{d.setBundle(S)},{immediate:!0,flush:"pre"});function h(){var b;const S=d.type==="svg",C={...a};Object.keys(a).forEach(T=>{Ct(a[T])&&(C[T]=a[T].get())});const W=((b=d.visualElement)==null?void 0:b.latestValues)||d.latestValues;let U={...t.style,...S?{}:W};for(const T in U)Ct(U[T])&&(U[T]=U[T].get());if(S){const{attrs:T,style:L}=ty({...W,...U},d.options.as,t.style);Object.assign(C,T),U=L}t.drag&&t.dragListener!==!1&&Object.assign(U,{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`});const v=Qg(U,t.transformTemplate);return v&&(C.style=v),C}const f=(A=nu())==null?void 0:A.proxy;function m(){const S=wi(f==null?void 0:f.$el);d.mount(S)}iu(()=>{d.updateOptions(u()),d.beforeUnmount()}),ws(m);function _(){var S;(S=wi(f==null?void 0:f.$el))!=null&&S.isConnected||d.unmount()}return Pa(_),ou(_),ru(()=>{d.isMounted()||m()}),au(()=>{d.updateOptions(u()),d.beforeUpdate()}),lu(()=>{d.update()}),{getProps:l,getAttrs:h,layoutGroup:n,state:d}}var sy={ignoreStrict:{type:Boolean},forwardMotionProps:{type:Boolean,default:!1},asChild:{type:Boolean,default:!1},whileDrag:{type:[String,Array,Object]},whileHover:{type:[String,Array,Object]},whilePress:{type:[String,Array,Object]},whileInView:{type:[String,Array,Object]},whileFocus:{type:[String,Array,Object]},custom:{type:[String,Number,Object,Array]},initial:{type:[String,Array,Object,Boolean],default:void 0},animate:{type:[String,Array,Object],default:void 0},exit:{type:[String,Array,Object]},variants:{type:Object},inherit:{type:Boolean,default:void 0},style:{type:Object},transformTemplate:{type:Function},transition:{type:Object},onAnimationComplete:{type:Function},onUpdate:{type:Function},layout:{type:[Boolean,String],default:!1},layoutId:{type:String,default:void 0},layoutScroll:{type:Boolean,default:!1},layoutRoot:{type:Boolean,default:!1},"data-framer-portal-id":{type:String},crossfade:{type:Boolean,default:!0},layoutDependency:{type:null,default:void 0},onBeforeLayoutMeasure:{type:Function},onLayoutMeasure:{type:Function},onLayoutAnimationStart:{type:Function},onLayoutAnimationComplete:{type:Function},globalPressTarget:{type:Boolean},onPressStart:{type:Function},onPress:{type:Function},onPressCancel:{type:Function},onHoverStart:{type:Function},onHoverEnd:{type:Function},inViewOptions:{type:Object},onViewportEnter:{type:Function},onViewportLeave:{type:Function},drag:{type:[Boolean,String]},dragSnapToOrigin:{type:[Boolean,String]},dragDirectionLock:{type:Boolean},dragPropagation:{type:Boolean},dragConstraints:{type:[Boolean,Object]},dragElastic:{type:[Boolean,Number,Object],default:.5},dragMomentum:{type:Boolean,default:!0},dragTransition:{type:Object},dragListener:{type:Boolean,default:!0},dragControls:{type:Object},onDragStart:{type:Function},onDragEnd:{type:Function},onDrag:{type:Function},onDirectionLock:{type:Function},onDragTransitionEnd:{type:Function},onMeasureDragConstraints:{type:Function},onPanSessionStart:{type:Function},onPanStart:{type:Function},onPan:{type:Function},onPanEnd:{type:Function}},ny=new Map,iy=new Map;function oy(t){if(!Array.isArray(t))return[t];const e=[];for(const s of t)Array.isArray(s)?e.push(...s):e.push(s);return e}var ry=["area","img","input"];function ay(t,e,s){var n,i;if(typeof t=="string"&&ry.includes(t))return Ea(t,e);if(t==="template"){if(!s.default)return null;const r=oy(s.default()),o=r.findIndex(c=>c.type!==cu);if(o===-1)return r;const a=r[o];(n=a.props)==null||delete n.ref;const l=a.props?pt(e,a.props):e;e.class&&((i=a.props)!=null&&i.class)&&delete a.props.class;const u=uu(a,l);for(const c in l)c.startsWith("on")&&(u.props||(u.props={}),u.props[c]=l[c]);return r.length===1?u:(r[o]=u,r)}return null}function wa(t,e={}){const s=typeof t=="string",n=s?t:t.name||"",i=e.renderer?ny:iy;if(s&&i.has(t))return i.get(t);const r=rt({inheritAttrs:!1,props:{...sy,as:{type:[String,Object],default:t||"div"}},name:n?`motion.${n}`:"Motion",setup(o,{slots:a}){const{getProps:l,getAttrs:u,state:c}=ey(o,e);function d(){const h=c.element;if((typeof o.as!="object"||o.asChild)&&h){const{style:f}=u();if(f)for(const[m,_]of Object.entries(f))h.style[m]=_}}return()=>{const h=l(),f=u(),m=o.asChild?"template":o.as,_={...o.forwardMotionProps?h:{},...f,onVnodeUpdated:d},g=ay(m,_,a);return g!==null?g:Ea(m,{..._},a)}}});return s&&i.set(t,r),r}function ly(t){return new Proxy({},{get(e,s){return s==="create"?(n,i)=>wa(n,{...i,...t}):wa(s,{...t})}})}var cy=ly(Gg),wt=cy.create("div"),uy=0;function dy(t){const e=new Map;function s(l){if(t.props.mode!=="popLayout")return;const u=l.el,c=u.offsetParent,d=c instanceof HTMLElement&&c.offsetWidth||0,h={height:u.offsetHeight||0,width:u.offsetWidth||0,top:u.offsetTop,left:u.offsetLeft,right:0};h.right=d-h.width-h.left;const f=t.props.anchorX==="left"?`left: ${h.left}px`:`right: ${h.right}px`,m=`pop-${uy++}`;u.dataset.motionPopId=m;const _=u.ownerDocument,g=_.createElement("style"),k=t.getNonce();k&&(g.nonce=k),l.popStyle=g,_.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${m}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${h.width}px !important;
|
|
5
|
+
height: ${h.height}px !important;
|
|
6
|
+
top: ${h.top}px !important;
|
|
7
|
+
${f} !important;
|
|
8
|
+
}
|
|
9
|
+
`)}function n(l){const u=l.popStyle;u&&(l.popStyle=void 0,ot.render(()=>{var c;(c=u.parentNode)==null||c.removeChild(u)}))}function i(l,u,c,d=[]){const h={el:l,states:u,handlers:d,done:c,aborted:!1};e.set(l,h),s(h);const f=u.map(m=>{var _;return((_=m.getFeature("exit"))==null?void 0:_.exit())??Promise.resolve()});for(const m of d)f.push(Promise.resolve(m.onExit()));Promise.all(f).then(()=>{h.aborted||o(h)})}function r(l){const u=e.get(l);u&&(u.aborted=!0,e.delete(l),n(u),u.handlers.forEach(c=>{var d;return(d=c.onEnter)==null?void 0:d.call(c)}))}function o(l){e.delete(l.el),n(l),l.states.forEach(u=>{u.getSnapshot(!1)}),l.done(),l.el.isConnected||l.states.forEach(u=>{u.unmount()}),t.onAllComplete()}function a(){e.forEach(l=>{l.states.forEach(u=>{u.unmount()})}),e.clear()}return{track:i,abort:r,dispose:a}}function hy(t){const e=_o(),s=dy({props:t,getNonce:()=>e.value.nonce,onAllComplete:()=>{var c;return(c=t.onExitComplete)==null?void 0:c.call(t)}}),n=new Set,i=new Set;let r=!1;Xg({get initial(){return r?void 0:t.initial},get custom(){return t.custom},register:c=>n.add(c),unregister:c=>n.delete(c),registerHandler:c=>i.add(c),unregisterHandler:c=>i.delete(c)}),ws(()=>{r=!0});function o(c){const d=[];for(const h of n){const f=h.element;f&&(f===c||c.contains(f))&&d.push(h)}return d}function a(c){const d=[];for(const h of i){const f=h.element();f&&(f===c||c.contains(f))&&d.push(h)}return d}function l(c,d){s.abort(c),o(c).forEach(h=>{var f;(f=h.getFeature("exit"))==null||f.reenter()}),d()}function u(c,d){var _;const h=c,f=o(h),m=a(h);if(f.length===0&&m.length===0){d(),(_=t.onExitComplete)==null||_.call(t);return}s.track(h,f,d,m)}return Pa(()=>{s.dispose()}),{enter:l,exit:u}}var fy=rt({name:"AnimatePresence",inheritAttrs:!0,__name:"AnimatePresence",props:{mode:{default:"sync"},initial:{type:Boolean,default:!0},as:{},custom:{},onExitComplete:{},anchorX:{default:"left"}},setup(t){const e=t,{enter:s,exit:n}=hy(e),i=I(()=>e.mode!=="wait"?{tag:e.as}:{mode:e.mode==="wait"?"out-in":void 0});return(r,o)=>(w(),H(Ma(t.mode==="wait"?du:hu),pt(i.value,{appear:"",css:!1,onLeave:p(n),onEnter:p(s)}),{default:F(()=>[te(r.$slots,"default")]),_:3},16,["onLeave","onEnter"]))}}),vt=fy;const wn={fast:.32,base:.48,slow:.64},py=[.33,1,.68,1],my={type:"spring",stiffness:170,damping:26,mass:1},gy=Tu(),Ps=I(()=>gy.value==="reduce"),Bc=t=>Ps.value?{duration:0}:{duration:t,ease:py},bo=(t,e)=>I(()=>({initial:t,animate:Object.fromEntries(Object.keys(t).map(s=>[s,s==="opacity"?1:0])),exit:t,transition:Bc(e)})),St=bo({opacity:0},wn.base),yy=bo({opacity:0,y:12},wn.slow),Hn=bo({opacity:0,x:-10},wn.base),Es=I(()=>({...Hn.value,layout:"position",transition:Ps.value?Hn.value.transition:{default:Hn.value.transition,layout:{...my}}})),_a=(t,e)=>e==="height"?t.offsetHeight+"px":getComputedStyle(t).gridTemplateColumns,bi=async(t,e,s)=>{const n=t?_a(t,e):"";if(s(),!t)return;await ie();const i=_a(t,e);if(Ps.value||n===i)return;const r=e==="height"?{flex:"none",minHeight:"0",maxHeight:"none",boxSizing:"border-box"}:{};Object.assign(t.style,r),t.style[e]=n;try{await ag(t,{[e]:[n,i]},Bc(wn.base))}finally{t.style[e]="";for(const o of Object.keys(r))t.style.removeProperty(o.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()))}},vy="M12 2.5l1.9 5.6 5.6 1.9-5.6 1.9L12 17.5l-1.9-5.6L4.5 10l5.6-1.9L12 2.5zM5 15l.9 2.6 2.6.9-2.6.9L5 22l-.9-2.6-2.6-.9 2.6-.9L5 15zm14-2l.7 2 2 .7-2 .7-.7 2-.7-2-2-.7 2-.7.7-2z",wy="M16 1H6a2 2 0 0 0-2 2v12h2V3h10V1zm3 4H10a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zm0 16h-9V7h9v14z",_y="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",Fc="M19.4 13a7.6 7.6 0 0 0 0-2l2-1.5-2-3.4-2.4 1a7.5 7.5 0 0 0-1.7-1L15 3.5H9l-.3 2.6a7.5 7.5 0 0 0-1.7 1l-2.4-1-2 3.4 2 1.5a7.6 7.6 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a7.5 7.5 0 0 0 1.7 1l.3 2.6h6l.3-2.6a7.5 7.5 0 0 0 1.7-1l2.4 1 2-3.4-2-1.5zM12 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7z",by="M23 12l-2.4-2.8.3-3.7-3.6-.8-1.9-3.2L12 3 8.6 1.5 6.7 4.7l-3.6.8.3 3.7L1 12l2.4 2.8-.3 3.7 3.6.8 1.9 3.2L12 21l3.4 1.5 1.9-3.2 3.6-.8-.3-3.7L23 12zm-10 5h-2v-2h2v2zm0-4h-2V7h2v6z",ky="M19 8h-1.8a5.9 5.9 0 0 0-1.3-1.9l1.6-1.6-1.4-1.4-1.9 1.9A5.7 5.7 0 0 0 12 4.5a5.7 5.7 0 0 0-2.2.5L7.9 3.1 6.5 4.5l1.6 1.6A5.9 5.9 0 0 0 6.8 8H5v2h1.2a7 7 0 0 0 0 1v1H5v2h1.3a6 6 0 0 0 11.4 0H19v-2h-1.2v-1a7 7 0 0 0 0-1H19V8zm-7 10a4 4 0 0 1-4-4v-3a4 4 0 0 1 8 0v3a4 4 0 0 1-4 4zm-1-7h2v5h-2z",xy=t=>{let e=2166136261;for(let s=0;s<t.length;s+=1)e^=t.charCodeAt(s),e=Math.imul(e,16777619);return e>>>0},jc=t=>{const e=String(t||"").trim().split(/[\s_-]+/).filter(Boolean);return(e.length>=2?e.slice(0,3).map(n=>n.charAt(0)):(e[0]||"?").slice(0,2).split("")).join("").toUpperCase()},Sy=t=>({1:17,2:14,3:11})[t.length]||11,Nc=(t,e)=>{const s=e(xy(t.id)),n=[],i=3+Math.floor(s()*3);for(let o=0;o<i;o+=1){const a=s()*Math.PI*2,l=9+s()*7;n.push({cx:(18+Math.cos(a)*l).toFixed(1),cy:(18+Math.sin(a)*l).toFixed(1),r:(1.6+s()*2.2).toFixed(1),opacity:(.35+s()*.4).toFixed(2)})}const r=jc(t.name||t.id);return{dots:n,glyph:r,fontSize:Sy(r)}},Ty=(t,e)=>{const s=t.dots.map(r=>`<circle cx="${r.cx}" cy="${r.cy}" r="${r.r}" fill="${e.dot}" opacity="${r.opacity}"/>`).join(""),n=t.fontSize>=17?24:23,i=t.glyph.replace(/[&<>]/g,"");return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><rect width="36" height="36" rx="10" fill="${e.fill}"/>${s}<text x="18" y="${n}" text-anchor="middle" font-size="${t.fontSize}" font-weight="700" letter-spacing="-0.5" font-family="Roboto, Inter, system-ui, sans-serif" fill="${e.ink}">${i}</text></svg>`},Ay="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z",Cy="M20 18.69L7.84 6.14 5.27 3.49 4 4.76l2.8 2.8v.01c-.52.99-.8 2.16-.8 3.42v5l-2 2v1h13.73l2 2L21 19.72l-1-1.03zM12 22c1.11 0 2-.89 2-2h-4c0 1.11.89 2 2 2zm6-7.32V11c0-3.08-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68c-.15.03-.29.08-.42.12-.1.03-.2.07-.3.11h-.01c-.01 0-.01 0-.02.01-.23.09-.46.2-.68.31 0 0-.01 0-.01.01L18 14.68z",ba='a[href], button:not([disabled]), input:not([disabled]), select, textarea, [tabindex]:not([tabindex="-1"])',Py="input, textarea, select, [contenteditable]",Ey=(t,e,s)=>{if(!t.length)return null;const n=s?t[0]:t[t.length-1];return e===n||!t.some(i=>i===e)?s?t[t.length-1]:t[0]:null},My=t=>{let e=null;_t(t,s=>{s?(e=document.activeElement,ie(()=>{var r;const n=document.querySelectorAll(".modal"),i=n[n.length-1];i&&!i.contains(document.activeElement)&&((r=i.querySelector(ba))==null||r.focus())})):(e==null||e.focus(),e=null)}),Ai("Tab",s=>{if(!t.value)return;const n=document.querySelectorAll(".modal"),i=n[n.length-1],r=i?[...i.querySelectorAll(ba)]:[],o=Ey(r,document.activeElement,s.shiftKey);o&&(s.preventDefault(),o.focus())},{target:document})},ka={"/":".feed__search-input",t:".todos__input"},Vy=t=>Ai(Object.keys(ka),e=>{const s=e.target;if(t.value||e.metaKey||e.ctrlKey||e.altKey||s!=null&&s.closest(Py))return;const n=document.querySelector(ka[e.key]);n&&(e.preventDefault(),n.focus())},{target:document}),Dy=30,xa=(t,e,s)=>Math.round(Math.max(e,Math.min(s,t))),Ry=(t,e)=>Math.ceil(t+(e>1?Dy:0)),$y=(t,e,s)=>t-e*s.length-s.reduce((n,i)=>n+(i.collapsed?i.height:i.floor),0),ko=t=>{const e=Ze("wt-panel-sizes",{},{writeDefaults:!1});return{size:I(()=>e.value[Mo(t)]??null),set:i=>{const r=Mo(t);if(!r)return;const{[r]:o,...a}=e.value;e.value=i===null?a:{...a,[r]:i}}}},xo=t=>{const e=Ze("wt-collapsed",[],{writeDefaults:!1}),s=I(()=>e.value.includes(t));return{collapsed:s,toggle:()=>{e.value=s.value?e.value.filter(i=>i!==t):[...e.value,t]}}},Oy="Unreleased",Ly=(t,e,s)=>{const n=t.filter(o=>o.version!==Oy),i=n.findIndex(o=>o.version===s);if(!e||i<0||e===s)return[];const r=n.findIndex(o=>o.version===e);return n.slice(i,r<0?i+1:r)},Iy=t=>t.sections.map(e=>`### ${e.kind}
|
|
10
|
+
${e.items.map(s=>`- ${s}`).join(`
|
|
11
|
+
`)}`).join(`
|
|
12
|
+
|
|
13
|
+
`),By="wt-seen-version",So=Au(()=>{const t=Ze(By,""),e=Q(null),s=Q(""),n=I(()=>e.value?Ly(e.value.versions,t.value,e.value.current):[]);return{changelog:e,problem:s,unseen:n,load:async()=>{s.value="";try{const o=await bs("/api/changelog");if(o.error){s.value=Ci(o.error).join(" · ");return}e.value=o,t.value||(t.value=o.current)}catch{s.value=cs}},markSeen:()=>{e.value&&(t.value=e.value.current)}}}),Fy={class:"rail","aria-label":"Workspaces"},jy={viewBox:"0 0 36 36",class:"rail__icon","aria-hidden":"true"},Ny=["fill"],Uy=["cx","cy","r","fill","opacity"],Wy=["y","font-size","fill"],zy={class:"rail__label"},Hy={key:0,class:"rail__warn",title:"A source of this workspace fails"},Ky={key:1,class:"rail__dot",title:"Back in the rail: something needs you"},Gy={key:2,class:"rail__badge"},Yy={viewBox:"0 0 24 24",class:"rail__gear","aria-hidden":"true"},qy=["d"],Xy={class:"rail__hidden-count","aria-hidden":"true"},Zy={class:"rail__label"},Jy={viewBox:"0 0 24 24",class:"rail__gear","aria-hidden":"true"},Qy=["d"],tv={key:0,class:"rail__dot",title:"Unseen changes"},ev={viewBox:"0 0 24 24",class:"rail__gear","aria-hidden":"true"},sv=["d"],nv=rt({__name:"Rail",emits:["settings","addWorkspace","whatsNew"],setup(t,{emit:e}){const s=e,{unseen:n}=So(),i=I(()=>M.workspaces.filter(v=>!v.hidden)),r=I(()=>M.workspaces.length-i.value.length),o=I(()=>{const v=b=>M.workspaces.filter(T=>T.hidden===b).length;return[`${v("parked")} parked`,`${v("paused")} paused`].filter(b=>!b.startsWith("0 ")).join(" · ")}),a=I(()=>Object.fromEntries(i.value.map(v=>[v.id,Nc(v,Ti)]))),l=I(()=>Object.fromEntries(i.value.map(v=>{const b=v.theme?v.theme[_s.value?"dark":"light"]:null;return[v.id,{fill:b?b["--md-primary-container"]:"var(--md-primary-container)",ink:b?b["--md-on-primary-container"]:"var(--md-on-primary-container)",dot:b?b["--md-primary"]:"var(--md-primary)"}]}))),u=v=>v.id===M.workspace.id?Object.keys(M.errors||{}).length>0:!!v.failing_sources,c=v=>{v.detail>0&&v.currentTarget.blur()},d=(v,b)=>{c(v),Za(b)},h=v=>{s("settings"),c(v)},f=v=>{s("addWorkspace"),c(v)},m=v=>{s("whatsNew"),c(v)},_=async(v,b)=>{const T=v.key==="ArrowUp"?-1:v.key==="ArrowDown"?1:0,L=i.value.map(R=>R.id),X=L.indexOf(b.id);if(!v.altKey||!T||X+T<0||X+T>=L.length)return;v.preventDefault();const V=v.currentTarget;L.splice(X+T,0,...L.splice(X,1)),await Fo(L),await ie(),V.focus()},g=Q(""),k=Q({}),A=v=>{const b=v.currentTarget;return v.clientY-b.getBoundingClientRect().top<b.offsetHeight/2},S=(v,b)=>{g.value=b.id,v.dataTransfer&&(v.dataTransfer.effectAllowed="move",v.dataTransfer.setData("text/plain",b.id))},C=()=>{g.value="",k.value={}},W=(v,b)=>{if(!g.value||g.value===b.id)return;v.preventDefault(),v.dataTransfer&&(v.dataTransfer.dropEffect="move");const T=A(v)?"before":"after";(k.value.id!==b.id||k.value.side!==T)&&(k.value={id:b.id,side:T})},U=(v,b)=>{if(!g.value||g.value===b.id)return;v.preventDefault();const T=od(i.value.map(L=>L.id),g.value,b.id,A(v));k.value={},Fo(T)};return(v,b)=>(w(),x("nav",Fy,[q(p(vt),null,{default:F(()=>[(w(!0),x(it,null,ft(i.value,T=>(w(),H(p(wt),pt({key:T.id},{ref_for:!0},p(Es),{as:"a",class:["rail__item",{"rail__item--dragging":g.value===T.id}],"data-drop":k.value.id===T.id?k.value.side:null,href:"?ws="+encodeURIComponent(T.id),"aria-label":T.name,"aria-selected":T.id===p(M).workspace.id,draggable:"true",onClick:Pt(L=>d(L,T.id),["prevent"]),onKeydown:L=>_(L,T),onDragstart:L=>S(L,T),onDragend:C,onDragover:L=>W(L,T),onDragleave:b[0]||(b[0]=L=>k.value={}),onDrop:L=>U(L,T)}),{default:F(()=>[(w(),x("svg",jy,[y("rect",{x:"0",y:"0",width:"36",height:"36",rx:"10",fill:l.value[T.id].fill},null,8,Ny),(w(!0),x(it,null,ft(a.value[T.id].dots,(L,X)=>(w(),x("circle",{key:X,cx:L.cx,cy:L.cy,r:L.r,fill:l.value[T.id].dot,opacity:L.opacity},null,8,Uy))),128)),y("text",{x:"18",y:a.value[T.id].fontSize>=17?24:23,"text-anchor":"middle","font-size":a.value[T.id].fontSize,"font-weight":"700","letter-spacing":"-0.5","font-family":"Roboto, Inter, system-ui, sans-serif",fill:l.value[T.id].ink},P(a.value[T.id].glyph),9,Wy)])),y("span",zy,P(T.name),1),u(T)?(w(),x("span",Hy,"!")):O("",!0),T.returned?(w(),x("span",Ky)):O("",!0),T.open_moves?(w(),x("span",Gy,P(T.open_moves),1)):O("",!0)]),_:2},1040,["class","data-drop","href","aria-label","aria-selected","onClick","onKeydown","onDragstart","onDragover","onDrop"]))),128))]),_:1}),y("a",{class:"rail__item",href:"#add-workspace","aria-label":"Add workspace",onClick:Pt(f,["prevent"])},[(w(),x("svg",Yy,[y("path",{d:p(_y),fill:"currentColor"},null,8,qy)])),b[1]||(b[1]=y("span",{class:"rail__label"},"Add workspace",-1))]),b[4]||(b[4]=y("span",{class:"rail__spacer"},null,-1)),q(p(vt),null,{default:F(()=>[o.value?(w(),H(p(wt),pt({key:0},p(St),{as:"a",class:"rail__item rail__hidden",href:"#hidden-workspaces","aria-label":r.value+" hidden","data-tip":"Hidden workspaces: "+o.value+". Open to bring one back.",onClick:Pt(h,["prevent"])}),{default:F(()=>[y("span",Xy,P(r.value),1),y("span",Zy,P(r.value)+" hidden",1)]),_:1},16,["aria-label","data-tip"])):O("",!0)]),_:1}),y("a",{class:"rail__item",href:"#whats-new","aria-label":"What's new",onClick:Pt(m,["prevent"])},[(w(),x("svg",Jy,[y("path",{d:p(by),fill:"currentColor"},null,8,Qy)])),b[2]||(b[2]=y("span",{class:"rail__label"},"What's new",-1)),p(n).length?(w(),x("span",tv)):O("",!0)]),y("a",{class:"rail__item",href:"#settings","aria-label":"Monitor settings",onClick:Pt(h,["prevent"])},[(w(),x("svg",ev,[y("path",{d:p(Fc),fill:"currentColor"},null,8,sv)])),b[3]||(b[3]=y("span",{class:"rail__label"},"Monitor settings",-1))])]))}}),iv=dt(nv,[["__scopeId","data-v-5f865c48"]]),Kn=" · checks every minute",Uc=(t,e,s,n)=>{const i=t.failing.map(o=>o.source),r=e?ce(e):"—";return i.length&&i.length>=s?{dot:"off",text:"No data: "+i.join(", ")+" failing · last data "+ce(t.fresh_at),failing:i,noData:!0}:t.stale?{dot:"off",text:"Stale · last data "+ce(t.fresh_at)+Kn,failing:i,noData:!1}:i.length?{dot:n?"warn":"off",text:i.join(", ")+" failing · last check "+r+Kn,failing:i,noData:!1}:{dot:n?"ok":"off",text:"Live · last check "+r+Kn,failing:i,noData:!1}},ov=1200,rv=12e3,av=t=>{const e=Q(!1),s=Ba(()=>e.value=!1,ov,{immediate:!1}),n=()=>{Ps.value||(e.value=!0,s.start())},i=Ia(n,rv,{immediate:!1});return _t(t,r=>{r?(n(),i.resume()):(i.pause(),s.stop(),e.value=!1)},{immediate:!0}),e},lv=["data-tip"],cv={class:"ai-button__icon",viewBox:"0 0 24 24","aria-hidden":"true"},uv=["d"],dv={class:"ai-button__badge",viewBox:"0 0 24 24","aria-hidden":"true"},hv=["d"],fv=rt({__name:"AiButton",props:{query:{},big:{type:Boolean}},setup(t){const e=t,s={"":"Copy for AI: this with its context as text, ready to paste into Claude or any other assistant",sent:"Copied",failed:"Could not copy"},n=dn("",1600),i=I(()=>s[n.value]),r=Q(null);_t(i,a=>{var l,u;return(u=(l=r.value)==null?void 0:l._tippy)==null?void 0:u.setContent(a)});const o=()=>$u(e.query).then(a=>navigator.clipboard.writeText(a)).then(()=>{n.value="sent"},()=>{n.value="failed"});return(a,l)=>(w(),x("button",{ref_key:"button",ref:r,type:"button",class:ht(["ai-button",{"ai-button--big":t.big,"ai-button--sent":p(n)==="sent","ai-button--failed":p(n)==="failed"}]),"aria-label":"Copy for AI","data-tip":i.value,onClick:Pt(o,["stop"])},[(w(),x("svg",cv,[y("path",{d:p(wy),fill:"currentColor"},null,8,uv)])),(w(),x("svg",dv,[y("path",{d:p(vy),fill:"currentColor"},null,8,hv)]))],10,lv))}}),Te=dt(fv,[["__scopeId","data-v-2375cb82"]]),ki="wt-updated-to",pv=()=>window.location.reload(),mv=t=>{try{sessionStorage.setItem(ki,t)}catch{}},gv=()=>{try{const t=sessionStorage.getItem(ki)||"";return sessionStorage.removeItem(ki),t}catch{return""}},yv=15e3,vv=9e4,wv=rt({__name:"UpdateChip",setup(t){const e=Q("");let s="";const n=Q(""),i=Q(!1),r=dn("",yv),o=I(()=>M.update),a=I(()=>o.value.state==="restarting"||!!e.value&&!D.live),l=I(()=>!n.value&&(o.value.state==="installing"||a.value||!!e.value)),{start:u,stop:c}=Ba(()=>i.value=!0,vv,{immediate:!1});ws(()=>{r.value=gv()}),_t(()=>o.value.current,f=>{if(f){if(!s){s=f;return}f!==s&&(n.value=f,e.value="",c())}},{immediate:!0});const d=()=>{if(l.value)return;i.value=!1,e.value=o.value.latest,u();const f=m=>{if(!Yt(m,{refused:"The update did not start"})){e.value="",c();return}M.update=m.update};qt("/api/update").then(f,f)},h=()=>{n.value&&mv(n.value),pv()};return(f,m)=>(w(),H(p(vt),{mode:"wait"},{default:F(()=>[p(r)?(w(),H(p(wt),pt({key:"done"},p(St),{as:"button",type:"button",class:"update-chip update-chip--done",title:"See what changed",onClick:m[0]||(m[0]=_=>p(D).whatsNew=!0)}),{default:F(()=>[lt(" Updated to "+P(p(r)),1)]),_:1},16)):n.value?(w(),H(p(wt),pt({key:"ready"},p(St),{as:"button",type:"button",class:"update-chip update-chip--ready",title:"Reload the window to apply the changes",onClick:h}),{default:F(()=>[lt(" Updated to "+P(n.value)+" · Reload ",1)]),_:1},16)):l.value?(w(),H(p(wt),pt({key:"busy"},p(St),{as:"span",class:"update-chip update-chip--busy",role:"status"}),{default:F(()=>[m[1]||(m[1]=y("span",{class:"update-chip__spinner","aria-hidden":"true"},null,-1)),lt(P(a.value?"Restarting…":`Installing ${e.value||o.value.latest}…`),1),i.value?(w(),x("button",{key:0,type:"button",class:"update-chip__link",title:"The restart is taking longer than usual",onClick:h}," Reload ")):O("",!0)]),_:1},16)):o.value.available&&o.value.state==="failed"?(w(),H(p(wt),pt({key:"failed"},p(St),{as:"button",type:"button",class:"update-chip update-chip--failed",title:o.value.reason,onClick:d}),{default:F(()=>[...m[2]||(m[2]=[lt(" Update failed · Retry ",-1)])]),_:1},16,["title"])):o.value.available?(w(),H(p(wt),pt({key:"out"},p(St),{as:"button",type:"button",class:"update-chip",onClick:d}),{default:F(()=>[lt(P(o.value.latest)+" is out · Update ",1)]),_:1},16)):O("",!0)]),_:1}))}}),_v=dt(wv,[["__scopeId","data-v-01cf9b01"]]),bv=["aria-checked","data-tip"],kv={class:"notifications-toggle__icon",viewBox:"0 0 24 24","aria-hidden":"true"},xv=["d"],Sv=rt({__name:"NotificationsToggle",setup(t){const e=I(()=>M.notifications.desktop);return(s,n)=>(w(),x("button",{type:"button",role:"switch",class:ht(["btn notifications-toggle",{"notifications-toggle--off":!e.value}]),"aria-checked":e.value,"data-tip":e.value?"Desktop notifications are on for every workspace. Click to turn them all off; the window and Claude's session summary keep updating.":"Desktop notifications are off for every workspace. The window and Claude's session summary still update. Click to turn them back on.",onClick:n[0]||(n[0]=(...i)=>p(Qs)&&p(Qs)(...i))},[(w(),x("svg",kv,[y("path",{d:e.value?p(Ay):p(Cy),fill:"currentColor"},null,8,xv)])),lt(P(e.value?"Notifications on":"Notifications off"),1)],10,bv))}}),Tv=dt(Sv,[["__scopeId","data-v-5ff19ab2"]]),Av={class:"status-bar"},Cv={class:"status-bar__icon",viewBox:"0 0 24 24","aria-hidden":"true"},Pv=["d"],Ev=["href"],Mv=["aria-disabled"],Vv=5e3,Dv=rt({__name:"StatusBar",emits:["report"],setup(t,{emit:e}){const s=e,n=av(I(()=>D.reportNews)),i=I(()=>(Se.value,Uc(M.health,M.polled_at,M.workspace.connectors.length,D.live))),r=Q(!1),o=Q(!1),a=I(()=>o.value?"Opened in the app window. You can close this tab.":D.status||i.value.text),l=c=>Yt(c,{refused:"The app window did not open"}),u=()=>{if(r.value)return;r.value=!0,setTimeout(()=>r.value=!1,Vv);const c=d=>{l(d),o.value=!de(d)};qt("/api/open",{mode:"app"}).then(c,c)};return(c,d)=>(w(),x("div",Av,[y("button",{type:"button",class:ht(["btn status-bar__btn status-bar__report",{"status-bar__report--wiggle":p(n)}]),title:"A bug or a wish about this monitor, straight to its backlog",onClick:d[0]||(d[0]=h=>s("report"))},[(w(),x("svg",Cv,[y("path",{d:p(ky),fill:"currentColor"},null,8,Pv)])),d[2]||(d[2]=lt("Report",-1)),q(p(vt),null,{default:F(()=>[p(D).reportNews?(w(),H(p(wt),pt({key:0},p(St),{as:"span",class:"status-bar__dot",title:"A report has news"}),null,16)):O("",!0)]),_:1})],2),y("span",{class:ht(["status-bar__live",{"status-bar__live--off":i.value.dot==="off","status-bar__live--warn":i.value.dot==="warn"}])},null,2),y("span",null,P(a.value),1),q(p(vt),null,{default:F(()=>[p(Js)?(w(),H(p(wt),pt({key:0},p(St),{as:"span",class:"status-bar__notice",role:"alert"}),{default:F(()=>[lt(P(p(Js)),1)]),_:1},16)):O("",!0)]),_:1}),q(_v),q(Tv),y("button",{type:"button",class:"btn status-bar__btn",onClick:d[1]||(d[1]=(...h)=>p(jo)&&p(jo)(...h))},"Refresh now"),p(D).mode==="app"?(w(),x("a",{key:0,class:"btn status-bar__btn",href:p(yd)(p(D).ws),target:"_blank",rel:"noopener"},"Open in browser",8,Ev)):(w(),x("button",{key:1,type:"button",class:ht(["btn status-bar__btn",{"status-bar__btn--busy":r.value}]),"aria-disabled":r.value,onClick:u},P(r.value?"Opening…":"Open as app"),11,Mv)),q(Te,{query:{all:"1"}}),d[3]||(d[3]=y("span",{class:"ai-hint status-bar__ai-hint"},"Copy for AI: everything",-1))]))}}),Rv=dt(Dv,[["__scopeId","data-v-2c54a945"]]),$v=["href"],Ov={key:1},ne=rt({__name:"ExtLink",props:{text:{default:""},url:{default:""}},setup(t){const e=t,s=I(()=>Pi(e.url));return(n,i)=>s.value?(w(),x("a",{key:0,href:s.value,target:"_blank",rel:"noopener"},P(t.text),9,$v)):(w(),x("span",Ov,P(t.text),1))}}),Lv={class:"workspace-header__title"},Iv={class:"workspace-header__name"},Bv={key:0,class:"workspace-header__line workspace-header__strip"},Fv={class:"workspace-header__count"},jv={class:"workspace-header__count"},Nv={class:"workspace-header__count"},Uv={class:"workspace-header__count"},Wv={class:"workspace-header__line workspace-header__give"},zv={class:"workspace-header__links"},Hv={class:"workspace-header__tools"},Kv={viewBox:"0 0 24 24",class:"workspace-header__gear","aria-hidden":"true"},Gv=["d"],Yv={class:"workspace-header__tiles"},qv={class:"workspace-header__tile-value"},Xv={class:"workspace-header__tile"},Zv={class:"workspace-header__tile-value"},Jv={class:"workspace-header__tile-value"},Qv={class:"workspace-header__tile"},t0={class:"workspace-header__tile-value"},e0=rt({__name:"WorkspaceHeader",setup(t){const{collapsed:e,toggle:s}=xo("header"),n=Ge("header"),i=()=>bi(n.value,"height",s);return(r,o)=>(w(),x("header",{id:"summary",ref_key:"header",ref:n,class:ht(["island workspace-header",{"workspace-header--collapsed":p(e)}])},[y("div",Lv,[y("h1",Iv,P(p(M).workspace.name||"Whose Turn"),1),p(e)?(w(),x("p",Bv,[o[1]||(o[1]=lt(" Your move ",-1)),y("b",Fv,P(p(Ht).mine),1),o[2]||(o[2]=lt(" · Waiting on others ",-1)),y("b",jv,P(p(Ht).others),1),o[3]||(o[3]=lt(" · Failing ",-1)),y("b",Nv,P(p(Ht).failing),1),o[4]||(o[4]=lt(" · Done ",-1)),y("b",Uv,P(p(Ht).done),1)])):O("",!0),y("p",Wv,[q(Te,{query:{ws:p(M).workspace.id,kind:"workspace"},big:""},null,8,["query"]),o[5]||(o[5]=y("span",{class:"ai-hint"},"Copy for AI: this workspace",-1)),y("span",zv,[(w(!0),x(it,null,ft(p(M).workspace.links||[],a=>(w(),H(ne,{key:a.url,text:a.label,url:a.url,title:a.url},null,8,["text","url","title"]))),128))])])]),y("div",Hv,[y("button",{type:"button",class:"fold-toggle workspace-header__settings","aria-label":"Workspace settings","data-tip":"Workspace settings: this workspace's name and links, its look, sources and rules",onClick:o[0]||(o[0]=Pt(a=>p(Mi)(),["stop"]))},[(w(),x("svg",Kv,[y("path",{d:p(Fc),fill:"currentColor"},null,8,Gv)]))]),y("button",{type:"button",class:ht(["fold-toggle workspace-header__fold",{"fold-toggle--folded":p(e)}]),"aria-label":"Fold the header","data-tip":"Fold the header; it stays folded until you open it again",onClick:Pt(i,["stop"])}," ▾ ",2)]),y("div",Yv,[y("div",{class:ht(["workspace-header__tile",{"workspace-header__tile--you":p(Ht).mine>0}])},[o[6]||(o[6]=y("span",{class:"workspace-header__tile-label"},"Your move",-1)),y("strong",qv,P(p(Ht).mine),1)],2),y("div",Xv,[o[7]||(o[7]=y("span",{class:"workspace-header__tile-label"},"Waiting on others",-1)),y("strong",Zv,P(p(Ht).others),1)]),y("div",{class:ht(["workspace-header__tile",{"workspace-header__tile--fail":p(Ht).failing}])},[o[8]||(o[8]=y("span",{class:"workspace-header__tile-label"},"Open PRs with failing checks",-1)),y("strong",Jv,P(p(Ht).failing),1)],2),y("div",Qv,[o[9]||(o[9]=y("span",{class:"workspace-header__tile-label"},"Done in the last 30 days",-1)),y("strong",t0,P(p(Ht).done),1)])])],2))}}),s0=dt(e0,[["__scopeId","data-v-af68db26"]]),To=t=>{_t(()=>D.reconnects,t)},n0=rt({__name:"Chevron",props:{open:{type:Boolean},tag:{default:"button"}},setup(t){return(e,s)=>(w(),H(Ma(t.tag),{class:ht(["chevron",{"chevron--open":t.open}]),type:t.tag==="button"?"button":void 0,"aria-expanded":t.tag==="button"?t.open:void 0},null,8,["class","type","aria-expanded"]))}}),_n=dt(n0,[["__scopeId","data-v-26e91cbb"]]),i0=["aria-orientation","aria-label"],Sa=16,o0=rt({__name:"ResizeHandle",props:{label:{},axis:{},bounds:{type:Function},grow:{},top:{type:Boolean}},emits:["resize","reset"],setup(t,{emit:e}){const s=t,n=e,i=s.grow??1;let r={pointer:0,size:0,min:0,max:0};const o=c=>s.axis==="y"?c.clientY:c.clientX,a=c=>{const{current:d,min:h,max:f}=s.bounds();r={pointer:o(c),size:d,min:h,max:f},c.currentTarget.setPointerCapture(c.pointerId)},l=c=>{if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const d=(o(c)-r.pointer)*i;n("resize",xa(r.size+d,r.min,r.max))},u=c=>{const d=s.axis==="y"?"ArrowDown":"ArrowRight",h=s.axis==="y"?"ArrowUp":"ArrowLeft";if(c.key!==d&&c.key!==h)return;c.preventDefault();const{current:f,min:m,max:_}=s.bounds(),g=(c.key===d?Sa:-Sa)*i;n("resize",xa(f+g,m,_))};return(c,d)=>(w(),x("div",{class:ht(["resize-handle",["resize-handle--"+t.axis,{"resize-handle--top":t.top}]]),role:"separator",tabindex:"0","aria-orientation":t.axis==="y"?"horizontal":"vertical","aria-label":t.label,"data-tip":"Drag to resize; double click to reset",onPointerdown:Pt(a,["prevent"]),onPointermove:l,onKeydown:u,onDblclick:d[0]||(d[0]=h=>n("reset"))},null,42,i0))}}),Wc=dt(o0,[["__scopeId","data-v-0605e68e"]]),r0=["id"],a0={class:"island__title"},l0={class:"island__note"},c0={class:"island__note-text"},u0=["aria-label","data-tip"],d0=280,h0=360,f0=":scope > .row-scroll tbody > tr, :scope > .todos__list > li",p0=rt({__name:"Island",props:{id:{},sizeKey:{default:""},title:{},note:{default:""},tip:{default:""},column:{type:Boolean},resize:{default:"height"}},setup(t){const e=t,{collapsed:s,toggle:n}=xo(e.id),i=I(()=>s.value&&e.resize==="width"),{size:r,set:o}=ko(()=>e.sizeKey),a=Ge("root");let l=!1;const u=async()=>{var v;l=!0;try{await(e.resize==="width"?bi((v=a.value)==null?void 0:v.parentElement,"gridTemplateColumns",n):bi(a.value,"height",n))}finally{l=!1,A()}},c=Q(0),d=Q(!0),h=v=>parseFloat(v)||0,f=(v,b)=>{let T=0;for(let L=v.parentElement;L&&L!==b;L=L.parentElement)T+=L.scrollTop;return T},m=v=>{const b=v.classList.contains("row-scroll")?v.firstElementChild:null,T=b instanceof HTMLElement?b.offsetHeight:v.offsetHeight;return Math.max(T,h(getComputedStyle(v).minHeight))},_=(v,b)=>{const T=[...v.children].find(X=>X.contains(b));return(T?[...v.children].slice([...v.children].indexOf(T)+1):[]).filter(X=>!X.classList.contains("row-scroll__more")).reduce((X,V)=>X+m(V),0)},g=()=>{const v=a.value,b=v==null?void 0:v.querySelector(".island__body");if(!v||!b||s.value||e.resize!=="height")return;const T=b.querySelectorAll(f0),L=d.value;d.value=T.length>0;const X=v.getBoundingClientRect().top,V=h(getComputedStyle(b).paddingBottom);if(!T.length){const B=[...b.children].reduce((E,$)=>E+m($),0);c.value=L?0:Math.ceil(b.offsetTop+B+V);return}const R=T[0].getBoundingClientRect().bottom-X+f(T[0],v);c.value=Ry(R+_(b,T[0])+V+2,T.length)};let k=0;const A=()=>{l||(cancelAnimationFrame(k),k=requestAnimationFrame(g))},S=Ge("body");Cu(S,A,{childList:!0,subtree:!0}),Pu(S,A),ws(A),_t(s,()=>ie(A));const C=I(()=>r.value!==null&&e.resize==="height"&&d.value),W=v=>{var b;return[...((b=v.parentElement)==null?void 0:b.children)??[]].filter(T=>T!==v&&T instanceof HTMLElement).map(T=>({collapsed:T.classList.contains("island--collapsed"),height:T.offsetHeight,floor:h(T.style.getPropertyValue("--island-floor"))}))},U=()=>{const v=a.value;if(g(),e.resize==="width"){const L=v.parentElement,X=h(getComputedStyle(L).columnGap);return{current:v.offsetWidth,min:d0,max:L.clientWidth-X-h0}}const b=v.parentElement,T=h(getComputedStyle(b).rowGap);return{current:v.offsetHeight,min:c.value,max:Math.max($y(b.clientHeight,T,W(v)),b.clientHeight)}};return(v,b)=>(w(),x("section",{id:t.id,ref_key:"root",ref:a,class:ht(["island",{"island--collapsed":p(s),"island--column":t.column,"island--strip":i.value,"island--sized":C.value}]),style:rs(t.resize==="height"?{"--island-floor":c.value+"px","--island-height":(C.value?p(r):0)+"px"}:void 0)},[y("div",{class:"island__head",onClick:b[0]||(b[0]=T=>i.value&&u())},[q(_n,{open:!p(s),"aria-label":(p(s)?"Open ":"Fold ")+t.title,"data-tip":p(s)?"Open this panel":"Fold this panel; it stays folded until you open it again","data-tippy-placement":i.value?"left":void 0,onClick:Pt(u,["stop"])},null,8,["open","aria-label","data-tip","data-tippy-placement"]),y("h2",a0,[lt(P(t.title)+" ",1),te(v.$slots,"head",{},void 0,!0)]),y("p",l0,[y("span",c0,P(t.note),1),t.tip?(w(),x("button",{key:0,type:"button",class:"hint-icon","aria-label":"About "+t.title,"data-tip":t.tip,"data-tip-click":""}," ? ",8,u0)):O("",!0)])]),p(s)?O("",!0):(w(),x("div",{key:0,ref_key:"body",ref:S,class:"island__body"},[te(v.$slots,"default",{},void 0,!0)],512)),p(s)?O("",!0):(w(),H(Wc,{key:1,label:"Resize "+t.title,axis:t.resize==="width"?"x":"y",grow:t.resize==="width"?-1:1,bounds:U,onResize:p(o),onReset:b[1]||(b[1]=T=>p(o)(null))},null,8,["label","axis","grow","onResize"]))],14,r0))}}),bn=dt(p0,[["__scopeId","data-v-f169ec42"]]),m0=["aria-label"],g0=["aria-pressed","onClick"],y0={key:0,class:"count"},v0=rt({__name:"Segmented",props:Yn({options:{},label:{default:""},chips:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=Va(t,"modelValue");return(s,n)=>(w(),x("span",{class:ht(["segmented",{"segmented--chips":t.chips}]),role:"group","aria-label":t.label},[(w(!0),x(it,null,ft(t.options,i=>(w(),x("button",{key:i.id,type:"button",class:"segmented__option","aria-pressed":e.value===i.id,onClick:r=>e.value=i.id},[lt(P(i.label),1),i.count!==void 0?(w(),x("b",y0,P(i.count),1)):O("",!0)],8,g0))),128))],10,m0))}}),un=dt(v0,[["__scopeId","data-v-201d5e2f"]]),w0={class:"ticket-cell"},_0={class:"ticket-cell__summary"},b0=rt({__name:"TicketCell",props:{row:{}},setup(t){return(e,s)=>(w(),x("td",w0,[q(ne,{text:t.row.key,url:p(ja)(t.row)?t.row.pr_url:t.row.ticket_url,class:"ticket-key"},null,8,["text","url"]),y("span",_0,P(t.row.summary),1)]))}}),Ao=dt(b0,[["__scopeId","data-v-e2d11a0b"]]),k0={key:0,class:"pr-cell"},x0={key:1,class:"pill"},S0=rt({__name:"PrCell",props:{row:{}},setup(t){return(e,s)=>(w(),x("td",null,[t.row.pr&&!p(ja)(t.row)?(w(),x("span",k0,[q(ne,{text:t.row.pr,url:t.row.pr_url,class:"pr-cell__link"},null,8,["text","url"]),t.row.pr_state==="OPEN"&&t.row.checks?(w(),x("span",{key:0,class:ht(["pill",p(ks)("pill",p(Ou)(t.row.checks))])},P(t.row.checks),3)):t.row.pr_state?(w(),x("span",x0,P(t.row.pr_state.toLowerCase()),1)):O("",!0)])):O("",!0)]))}}),zc=dt(S0,[["__scopeId","data-v-6078ccbd"]]),T0=["open"],A0={class:"recently-done__summary"},C0={class:"count"},P0={class:"table"},E0=["data-tip"],M0={class:"table__actions"},V0=480,D0=rt({__name:"RecentlyDone",setup(t){const{size:e,set:s}=ko(()=>`${M.workspace.id}:recently-done`),n=Ge("list"),i=u=>{var d;const c=(d=u.closest(".island__body"))==null?void 0:d.querySelector(".row-scroll");return c?Math.max(0,c.clientHeight-(parseFloat(getComputedStyle(c).minHeight)||0)):0},r=()=>{const u=n.value,d=(u.querySelector("tbody > tr")??u).getBoundingClientRect().bottom-u.getBoundingClientRect().top,h=parseFloat(getComputedStyle(u).paddingBottom)||0;return{current:u.offsetHeight,min:Math.ceil(d+u.scrollTop+h),max:Math.min(V0,u.offsetHeight+i(u))}},o=Ze("wt-recent-open",!1,{writeDefaults:!1,serializer:{read:u=>u==="1",write:u=>u?"1":"0"}}),a=u=>{o.value=u.target.open},l=I(()=>(Se.value,Lu(M.turn).map(u=>({row:u,since:Ei(u.status_since||u.updated)}))));return(u,c)=>l.value.length?(w(),x("details",{key:0,class:"recently-done",open:p(o),onToggle:a},[y("summary",A0,[q(_n,{tag:"span",open:p(o)},null,8,["open"]),c[1]||(c[1]=lt(" Recently done ",-1)),y("span",C0,P(l.value.length),1)]),y("div",{ref_key:"list",ref:n,class:"recently-done__list",style:rs(p(e)===null?void 0:{maxHeight:p(e)+"px",height:p(e)+"px"})},[y("table",P0,[c[2]||(c[2]=y("thead",null,[y("tr",null,[y("th",null,"Ticket"),y("th",null,"Status"),y("th",null,"Done"),y("th",{class:"table__actions-col"},[y("span",{class:"visually-hidden"},"Copy for AI")])])],-1)),y("tbody",null,[(w(!0),x(it,null,ft(l.value,({row:d,since:h})=>(w(),x("tr",{key:d.row_id},[q(Ao,{row:d},null,8,["row"]),y("td",null,[y("span",{class:ht(["pill",p(ks)("pill",p(Na)(d.status_group))])},P(d.status),3)]),y("td",null,[y("span",{class:"age","data-tip":"Done "+p(hn)(d.status_since||d.updated)},P(h.text),9,E0)]),y("td",M0,[q(Te,{class:"table__ai",query:{ws:p(M).workspace.id,kind:"row",ref:d.row_id}},null,8,["query"])])]))),128))])])],4),p(o)?(w(),H(Wc,{key:0,label:"Resize Recently done",axis:"y",top:"",grow:-1,bounds:r,onResize:p(s),onReset:c[0]||(c[0]=d=>p(s)(null))},null,8,["onResize"])):O("",!0)],40,T0)):O("",!0)}}),R0=dt(D0,[["__scopeId","data-v-6eb34f0c"]]),$0=13,O0=rt({__name:"RowScroll",props:{floor:{type:Boolean}},setup(t){const e=Q(null),s=Q(null),{y:n}=Eu(e),{height:i}=kn(e),{height:r}=kn(s),o=I(()=>{var h;return r.value,((h=s.value)==null?void 0:h.querySelector("thead"))??null}),{height:a}=kn(o),l=()=>{var h,f;return[...((f=(h=s.value)==null?void 0:h.querySelector("table"))==null?void 0:f.tBodies)||[]]},u=()=>{const h=e.value;return h?h.getBoundingClientRect().top+h.clientTop+h.clientHeight:0},c=I(()=>(n.value,i.value,r.value,Iu(l().map(h=>h.getBoundingClientRect().bottom),u(),$0))),d=()=>{var k,A;const h=e.value,f=l(),m=f[f.length-c.value];if(!h||!m)return;const g=((A=(k=s.value)==null?void 0:k.querySelector("thead"))==null?void 0:A.getBoundingClientRect().bottom)??h.getBoundingClientRect().top;h.scrollBy({top:m.getBoundingClientRect().top-g,behavior:"smooth"})};return(h,f)=>(w(),x(it,null,[y("div",{ref_key:"scroller",ref:e,class:ht(["row-scroll",{"row-scroll--floor":t.floor}]),style:rs({scrollPaddingTop:p(a)+"px"})},[y("div",{ref_key:"content",ref:s},[te(h.$slots,"default",{},void 0,!0)],512)],6),c.value?(w(),x("button",{key:0,type:"button",class:"row-scroll__more",onClick:d}," +"+P(c.value)+" more ",1)):O("",!0)],64))}}),Hc=dt(O0,[["__scopeId","data-v-76b6d07a"]]),L0=Q("open"),I0=()=>L0,B0={class:"table"},F0={key:0},j0={key:1,class:"hide-narrow"},N0={class:"hint-row"},U0={class:"your-move__next"},W0=["data-tip"],z0=["data-tip"],H0=["data-tip"],K0={class:"table__actions"},G0=["aria-label","onClick"],Y0={colspan:"99",class:"your-move__line-cell"},q0=["onClick"],X0={class:"your-move__outcome"},Z0={class:"your-move__time"},J0={key:0,class:"empty"},Q0=rt({__name:"YourMove",setup(t){const e=I0(),s=I(()=>{Se.value;const d=Bu(M.turn,e.value,M.marks.info),h=d.rows.map(f=>{const m=M.marks.info[f.row.row_id],_=!!(m!=null&&m.auto);return{...f,age:Ei(f.row.activity_at),auto:_,lined:_||!!(m!=null&&m.note),line:(_?m==null?void 0:m.outcome:m==null?void 0:m.note)||""}});return{...d,rows:h}}),n=I(()=>Ua(s.value.rows.map(d=>d.row))),i=I(()=>s.value.rows.some(d=>d.row.comment)),r=I(()=>[{id:"open",label:"Open",count:s.value.open},{id:"handled",label:"Handled",count:s.value.handled}]),o=I(()=>{if(e.value==="handled")return"Nothing marked as handled.";const{noData:d,failing:h}=Uc(M.health,M.polled_at,M.workspace.connectors.length,D.live);return d?"No data: "+h.join(", ")+(h.length===1?" is":" are")+" failing. Check the workspace settings.":"Nothing is waiting on you."}),a=Si(new Map);To(()=>a.clear());const l=d=>new Date(M.marks.handled[d.row.row_id]||"").toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"}),u=async d=>{const h=d.row.row_id;if(!d.handled){D.note=h;return}const f=await Re({handled:{[h]:null}});f?a.set(h,f):(a.delete(h),ss.value="")},c=()=>{const d=ss.value;return ss.value="",Re({handled:{[d]:null}})};return(d,h)=>(w(),H(bn,{id:"your-move","size-key":`${p(M).workspace.id}:your-move`,title:"Your move",note:"Next step is yours",tip:"Each row is something where the next step is yours. Ticket, PR and comment open in a new tab."},{head:F(()=>[q(un,{modelValue:p(e),"onUpdate:modelValue":h[0]||(h[0]=f=>fu(e)?e.value=f:null),options:r.value,label:"Show",class:"your-move__view"},null,8,["modelValue","options"])]),default:F(()=>[q(p(vt),null,{default:F(()=>[p(ss)?(w(),H(p(wt),pt({key:0},p(St),{as:"p",class:"your-move__undo",role:"status"}),{default:F(()=>[h[1]||(h[1]=lt(" Marked handled. ",-1)),y("button",{type:"button",class:"your-move__undo-btn",onClick:c},"Undo")]),_:1},16)):O("",!0)]),_:1}),q(Hc,{floor:""},{default:F(()=>[y("table",B0,[y("thead",null,[y("tr",null,[h[2]||(h[2]=y("th",null,"Ticket",-1)),h[3]||(h[3]=y("th",null,"Next step",-1)),n.value?(w(),x("th",F0,"PR")):O("",!0),i.value?(w(),x("th",j0,"Last comment")):O("",!0),h[4]||(h[4]=y("th",{class:"table__actions-col"},[y("span",{class:"visually-hidden"},"Mark")],-1))])]),q(p(vt),null,{default:F(()=>[(w(!0),x(it,null,ft(s.value.rows,f=>(w(),H(p(wt),pt({key:f.row.row_id},{ref_for:!0},p(Es),{as:"tbody"}),{default:F(()=>[y("tr",{class:ht(["your-move__row",{"your-move__row--handled":f.handled,"your-move__row--lined":f.lined}])},[q(Ao,{row:f.row},null,8,["row"]),y("td",null,[y("span",N0,[y("span",U0,P(f.row.next),1),f.age.text?(w(),x("span",{key:0,class:ht(["age",{"age--old":f.age.old}]),"data-tip":"Waiting since "+p(hn)(f.row.activity_at)},P(f.age.text),11,W0)):O("",!0),f.row.why?(w(),x("button",{key:1,type:"button",class:"hint-label","aria-label":"Why this is your move","data-tip":f.row.why,"data-tip-click":""}," why ",8,z0)):O("",!0),f.handled&&!f.auto?(w(),x("span",{key:2,class:"handled-chip","data-tip":"Marked "+p(ce)(p(M).marks.handled[f.row.row_id]||"")+". Comes back in 7 days if it is still open, or sooner when something new happens."},"handled",8,H0)):O("",!0)]),q(p(vt),null,{default:F(()=>[a.get(f.row.row_id)?(w(),H(p(wt),pt({key:0,ref_for:!0},p(St),{as:"p",class:"alert alert--inline your-move__problem",role:"alert"}),{default:F(()=>[lt(P(a.get(f.row.row_id)),1)]),_:2},1040)):O("",!0)]),_:2},1024)]),n.value?(w(),H(zc,{key:0,row:f.row},null,8,["row"])):O("",!0),i.value?(w(),x("td",{key:1,class:ht(["hide-narrow",{"your-move__quote":f.row.comment}])},[f.row.comment?(w(),H(ne,{key:0,text:f.row.comment,url:f.row.comment_url},null,8,["text","url"])):O("",!0)],2)):O("",!0),y("td",K0,[q(Te,{class:"table__ai",query:{ws:p(M).workspace.id,kind:"row",ref:f.row.row_id}},null,8,["query"]),f.auto?O("",!0):(w(),x("button",{key:0,type:"button",class:ht(["your-move__mark",{"your-move__mark--undo":f.handled}]),"aria-label":(f.handled?"Move back to open: ":"Mark as handled: ")+f.row.key,onClick:Pt(m=>u(f),["stop"])},P(f.handled?"Undo":"Handled"),11,G0))])],2),q(p(vt),null,{default:F(()=>[f.lined?(w(),H(p(wt),pt({key:0,ref_for:!0},p(St),{as:"tr",class:["your-move__line-row",{"your-move__line-row--handled":f.handled}]}),{default:F(()=>[y("td",Y0,[y("button",{type:"button",class:"your-move__line","data-tip":"Open the full text and edit the note",onClick:m=>p(D).note=f.row.row_id},[h[5]||(h[5]=y("span",{class:"your-move__arrow","aria-hidden":"true"},"→",-1)),y("span",X0,P(f.line),1),y("time",Z0,P(l(f)),1)],8,q0)])]),_:2},1040,["class"])):O("",!0)]),_:2},1024)]),_:2},1040))),128))]),_:1})])]),_:1}),s.value.rows.length?O("",!0):(w(),x("p",J0,P(o.value),1)),p(e)==="open"?(w(),H(R0,{key:1})):O("",!0)]),_:1},8,["size-key"]))}}),tw=dt(Q0,[["__scopeId","data-v-90f4dc8e"]]),ew=Q(!1),sw=()=>ew,nw={class:"todos__add"},iw={class:"todos__list"},ow=["aria-checked","aria-label","onClick"],rw=["onKeydown"],aw=["onDblclick"],lw={class:"todos__meta"},cw=["onClick"],uw=["onClick"],dw={key:0,class:"empty todos__empty"},hw=rt({__name:"Todos",setup(t){const e=sw(),s=Q(""),n=I(()=>(M.todos||[]).filter(v=>!v.done)),i=I(()=>(M.todos||[]).filter(v=>v.done)),r=I(()=>new RegExp(M.workspace.key_pattern||"(?!)","g")),o=v=>{const b=[];let T=0;const L=v.text;for(const X of L.matchAll(r.value))X.index>T&&b.push({text:L.slice(T,X.index)}),b.push({text:X[0],url:X[0]===v.key?v.ticket_url:""}),T=X.index+X[0].length;return T<L.length&&b.push({text:L.slice(T)}),b},a=I(()=>(Se.value,(e.value?n.value.concat(i.value):n.value).map(v=>({todo:v,parts:o(v),meta:(v.by&&v.by!=="you"?v.by+" · ":"")+ce(v.created)})))),l=Q("");To(()=>{l.value=""});const u=async v=>(l.value=await Pd(v),!l.value),c=async()=>{const v=s.value.trim();v&&await u({action:"add",text:v})&&s.value.trim()===v&&(s.value="")},d=v=>u({action:v.done?"undo":"done",id:v.id}),h=Q(null),f=async v=>{await u({action:"delete",id:v.id})&&(h.value=v)},m=async()=>{const v=h.value;if(h.value=null,v&&await u({action:"add",text:v.text})&&v.done){const b=(M.todos||[]).find(T=>T.text===v.text&&!T.done);b&&await u({action:"done",id:b.id})}},_=Q(""),g=Q(""),k=Ge("editBox"),A=async v=>{var b,T;_.value=v.id,g.value=v.text,await ie(),(T=(b=k.value)==null?void 0:b[0])==null||T.focus()},S=()=>{_.value=""},C=async v=>{const b=g.value.trim();if(!b||b===v.text)return S();await u({action:"edit",id:v.id,text:b})&&S()},W=I({get:()=>e.value?"done":"open",set:v=>{e.value=v==="done"}}),U=I(()=>[{id:"open",label:"Open",count:n.value.length},{id:"done",label:"Done",count:i.value.length}]);return(v,b)=>(w(),H(bn,{id:"todo","size-key":`${p(M).workspace.id}:todo`,title:"To do",note:"Your own notes",tip:'Your personal to-dos, kept on this machine. Add here, or ask Claude: "add to my to-do: …". A ticket key like PROJ-123 in the text becomes a link.'},{head:F(()=>[q(un,{modelValue:W.value,"onUpdate:modelValue":b[0]||(b[0]=T=>W.value=T),options:U.value,label:"Show",class:"todos__view"},null,8,["modelValue","options"])]),default:F(()=>[y("div",nw,[as(y("input",{"onUpdate:modelValue":b[1]||(b[1]=T=>s.value=T),class:"input todos__input",type:"text",placeholder:"Add a to-do and press Enter","aria-label":"New to-do",autocomplete:"off",onKeydown:De(c,["enter"])},null,544),[[ls,s.value]]),y("button",{type:"button",class:"btn btn--tonal",onClick:c},"Add")]),q(p(vt),null,{default:F(()=>[l.value?(w(),H(p(wt),pt({key:0},p(St),{as:"p",class:"alert alert--inline",role:"alert"}),{default:F(()=>[lt(P(l.value),1)]),_:1},16)):O("",!0)]),_:1}),q(p(vt),null,{default:F(()=>[h.value?(w(),H(p(wt),pt({key:0},p(St),{as:"p",class:"todos__undo",role:"status"}),{default:F(()=>[b[3]||(b[3]=lt(" To-do deleted. ",-1)),y("button",{type:"button",class:"todos__undo-btn",onClick:m},"Undo")]),_:1},16)):O("",!0)]),_:1}),y("ul",iw,[q(p(vt),null,{default:F(()=>[(w(!0),x(it,null,ft(a.value,({todo:T,parts:L,meta:X})=>(w(),H(p(wt),pt({key:T.id},{ref_for:!0},p(Es),{as:"li",class:["todos__item",{"todos__item--done":T.done}]}),{default:F(()=>[y("button",{type:"button",class:ht(["todos__check",{"todos__check--on":T.done}]),role:"checkbox","aria-checked":!!T.done,"aria-label":T.done?"Mark not done":"Mark done",onClick:V=>d(T)},null,10,ow),_.value===T.id?as((w(),x("input",{key:0,ref_for:!0,ref_key:"editBox",ref:k,"onUpdate:modelValue":b[2]||(b[2]=V=>g.value=V),class:"input todos__edit",type:"text",maxlength:"500","aria-label":"Edit to-do",autocomplete:"off",onKeydown:[De(V=>C(T),["enter"]),De(S,["esc"])],onBlur:S},null,40,rw)),[[ls,g.value]]):(w(),x("span",{key:1,class:"todos__text",onDblclick:V=>A(T)},[(w(!0),x(it,null,ft(L,(V,R)=>(w(),x(it,{key:R},[V.url!==void 0?(w(),H(ne,{key:0,text:V.text,url:V.url},null,8,["text","url"])):(w(),x(it,{key:1},[lt(P(V.text),1)],64))],64))),128))],40,aw)),y("span",lw,P(X),1),y("button",{type:"button",class:"todos__pencil","aria-label":"Edit to-do",onClick:V=>A(T)}," ✎ ",8,cw),y("button",{type:"button",class:"todos__delete","aria-label":"Delete to-do",onClick:V=>f(T)}," × ",8,uw)]),_:2},1040,["class"]))),128))]),_:1}),a.value.length?O("",!0):(w(),x("span",dw,P(p(e)?"Nothing here yet.":"Nothing to do. Add one above, or ask Claude."),1))])]),_:1},8,["size-key"]))}}),fw=dt(hw,[["__scopeId","data-v-fda7d50b"]]),pw={key:0,class:"count"},mw={key:0,class:"empty"},gw={class:"table waiting__table"},yw={key:0,class:"hide-narrow"},vw={key:1,class:"waiting__col waiting__col--pr"},ww={class:"waiting__mark","aria-hidden":"true"},_w={class:"visually-hidden"},bw=["data-tip"],kw={key:0,class:"hide-narrow"},xw={key:0,class:"hint-row"},Sw=["data-tip"],Tw={class:"table__actions"},Aw=rt({__name:"Waiting",setup(t){const e=I(()=>(Se.value,Fu(M.turn).map(r=>({row:r,since:r.status_since?Ei(r.status_since):null,own:r.status_group==="backlog"})))),s=I(()=>Ua(e.value.map(({row:r})=>r))),n=I(()=>e.value.some(({row:r,own:o})=>r.hold_url||!o&&r.next)),i=I(()=>e.value.length&&e.value.every(({own:r})=>r)?"Your backlog":"Someone else holds the next step");return(r,o)=>(w(),H(bn,{id:"waiting","size-key":`${p(M).workspace.id}:waiting`,title:"Waiting on others",note:i.value,tip:"Tickets you touched in the last 30 days where someone else holds the next step: a reviewer, QA, or a new owner."},{head:F(()=>[e.value.length?(w(),x("span",pw,P(e.value.length),1)):O("",!0)]),default:F(()=>[e.value.length?(w(),H(Hc,{key:1},{default:F(()=>[y("table",gw,[y("thead",null,[y("tr",null,[o[0]||(o[0]=y("th",{class:"waiting__col waiting__col--ticket"},"Ticket",-1)),o[1]||(o[1]=y("th",{class:"waiting__col waiting__col--status"},"Status",-1)),o[2]||(o[2]=y("th",{class:"waiting__col waiting__col--with"},"With",-1)),n.value?(w(),x("th",yw,"Waiting for")):O("",!0),s.value?(w(),x("th",vw,"PR")):O("",!0),o[3]||(o[3]=y("th",{class:"table__actions-col waiting__col waiting__col--actions"},[y("span",{class:"visually-hidden"},"Copy for AI")],-1))])]),q(p(vt),null,{default:F(()=>[(w(!0),x(it,null,ft(e.value,({row:a,since:l,own:u})=>(w(),H(p(wt),pt({key:a.row_id},{ref_for:!0},p(Es),{as:"tbody"}),{default:F(()=>{var c;return[y("tr",null,[q(Ao,{row:a},null,8,["row"]),y("td",null,[y("span",{class:ht(["pill",p(ks)("pill",p(Na)(a.status_group))])},P(a.status),3)]),y("td",null,[!u&&((c=a.reviewers)!=null&&c.length)?(w(!0),x(it,{key:0},ft(a.reviewers,d=>(w(),x("span",{key:d.name,class:"waiting__reviewer"},[d.state?(w(),x(it,{key:0},[y("span",ww,P(d.state==="approved"?"✓":"✗"),1),y("span",_w,P(d.state==="approved"?" approved by ":" changes requested by "),1)],64)):O("",!0),lt(P(d.name)+P(" "),1)]))),128)):(w(),x(it,{key:1},[lt(P(u?"you":a.whose),1)],64)),l?(w(),x("span",{key:2,class:ht(["age",{"age--old":l.hours>=72}]),"data-tip":a.status+" since "+p(hn)(a.status_since)},P(l.text),11,bw)):O("",!0)]),n.value?(w(),x("td",kw,[a.hold_url?(w(),x("span",xw,[q(ne,{text:a.next,url:a.hold_url,class:"waiting__reason"},null,8,["text","url"]),y("button",{type:"button",class:"hint-label","aria-label":"Full reason","data-tip":a.hold_full||a.next}," full ",8,Sw)])):u?O("",!0):(w(),x(it,{key:1},[lt(P(a.next),1)],64))])):O("",!0),s.value?(w(),H(zc,{key:1,row:a},null,8,["row"])):O("",!0),y("td",Tw,[q(Te,{class:"table__ai",query:{ws:p(M).workspace.id,kind:"row",ref:a.row_id}},null,8,["query"])])])]}),_:2},1040))),128))]),_:1})])]),_:1})):(w(),x("p",mw,"Nothing is waiting on someone else."))]),_:1},8,["size-key","note"]))}}),Cw=dt(Aw,[["__scopeId","data-v-f1507a9b"]]),Pw=(t,e)=>t.seen instanceof Set?t.seen.has(e):t.seen.includes(e),Kc=(t,e)=>new Date(t.at).getTime()>(e.base||0)&&!Pw(e,t.id),Ew=(t,e)=>{const s=String(e||"").toLowerCase().split(/\s+/).filter(Boolean);if(!s.length)return!0;const n=[t.ref,t.key,t.title,t.kind,t.who,t.text,t.body].join(" ").toLowerCase();return s.every(i=>n.includes(i))},Mw=t=>t.key||t.ref||t.id,Vw=(t,e)=>{const s=new Map;for(const n of t){const i=Mw(n),r=s.get(i)||{id:i,items:[],newest:n.at,unread:0,title:""};s.set(i,r),r.items.push(n),r.title||(r.title=n.title||""),n.at>r.newest&&(r.newest=n.at),Kc(n,e)&&(r.unread+=1)}return[...s.values()].sort((n,i)=>String(i.newest).localeCompare(String(n.newest)))},Dw=t=>new Set(t.filter(e=>e.group==="you"&&!e.handled).map(e=>e.key)),Rw=(t,e=2)=>{const s=[...new Set(t.map(i=>i.kind))],n=s.length-e;return s.slice(0,e).join(" · ")+(n>0?` +${n}`:"")},$w=t=>/fail|changes/.test(t)?"bad":/approved|merged|passed/.test(t)?"ok":"",Ow=t=>/comment|approved|changes|mentioned|review requested/.test(t.kind)&&String(t.body||"").trim()!=="",Gc=t=>t.ref!==t.key&&(t.key||t.title)||"",Lw=t=>[Gc(t),t.text===t.title?"":t.text].filter(Boolean).join(" · "),Iw=t=>t.type==="github"&&t.label==="GitHub"?"GH":jc(t.label),Bw={class:"feed-item__body"},Fw={class:"feed-item__top"},jw={key:1,class:"feed-item__who"},Nw={key:2,class:"at-you"},Uw={class:"feed-item__right"},Ww={class:"timestamp feed-item__when"},zw={key:0,class:"feed-item__text"},Hw={class:"feed-item__full"},Kw={class:"feed-item__actions"},Gw={key:1,class:"feed-item__text"},Yw=rt({__name:"FeedItem",props:{item:{},source:{},fresh:{type:Boolean},flash:{type:Boolean},expanded:{type:Boolean}},emits:["open","toggle","seen"],setup(t,{emit:e}){const s=t,n=e,i=I(()=>Iw(s.source)),r=I(()=>Gc(s.item)),o=I(()=>Lw(s.item)),a=I(()=>$w(s.item.kind)),l=I(()=>a.value||(s.source.type==="github"?"":"jira")),u=I(()=>Ow(s.item)),c=I(()=>u.value&&s.expanded),d=I(()=>(Se.value,ce(s.item.at))),h=()=>{s.fresh&&n("seen",s.item.id)},f=()=>{n("toggle",s.item.id),h()};return(m,_)=>(w(),H(p(wt),pt(p(St),{id:"feed-"+t.item.id,as:"li",class:["feed-item",{"feed-item--new":t.fresh,"feed-item--open":c.value,"feed-item--flash":t.flash}],onClick:h}),{default:F(()=>[y("span",{class:ht(["feed-item__icon",p(ks)("feed-item__icon",l.value)])},P(i.value),3),y("div",Bw,[y("div",Fw,[u.value?(w(),H(_n,{key:0,open:c.value,"aria-label":c.value?"Collapse":"Expand",onClick:Pt(f,["stop"])},null,8,["open","aria-label"])):O("",!0),q(ne,{text:t.item.ref,url:t.item.url},null,8,["text","url"]),y("span",{class:ht(["feed-item__kind",{"feed-item__kind--bad":a.value==="bad"}])},P(t.item.kind),3),t.item.who?(w(),x("span",jw,P(t.item.who),1)):O("",!0),t.item.mention?(w(),x("span",Nw,"@you")):O("",!0),y("span",Uw,[y("span",Ww,P(d.value),1)])]),c.value?(w(),x(it,{key:0},[r.value?(w(),x("span",zw,P(r.value),1)):O("",!0),y("div",Hw,P(t.item.body),1),y("div",Kw,[y("button",{type:"button",class:"btn btn--tonal",onClick:_[0]||(_[0]=Pt(g=>n("open",t.item),["stop"]))}," Open formatted "),q(Te,{query:{ws:p(M).workspace.id,kind:"feed",ref:t.item.id}},null,8,["query"]),q(ne,{text:"Open in "+t.source.label,url:t.item.url,class:"btn"},null,8,["text","url"])])],64)):o.value?(w(),x("span",Gw,P(o.value),1)):O("",!0)])]),_:1},16,["id","class"]))}}),Ta=dt(Yw,[["__scopeId","data-v-a5e23e75"]]),qw=Si({source:"all",view:Ze("wt-feed-view","ticket",{writeDefaults:!1}),query:"",openGroups:new Set}),Xw=()=>qw,Zw={class:"feed__bar"},Jw={class:"feed__search"},Qw={class:"feed__search-count"},t_={key:0,class:"empty"},e_={key:1,class:"feed__list"},s_=["title","onClick"],n_={class:"feed__group-text"},i_={class:"feed__group-key"},o_={key:0,class:"feed__group-sum"},r_={class:"feed__group-meta"},a_={class:"feed__group-kinds"},l_={class:"timestamp feed__group-when"},c_={key:0,class:"feed__children"},u_=150,d_=2500,h_=rt({__name:"Feed",emits:["open"],setup(t,{emit:e}){const s=e,n=Xw(),i=[{id:"ticket",label:"By ticket"},{id:"flat",label:"Flat"}],r=I(()=>M.workspace.connectors||[]),o=I(()=>Object.fromEntries(r.value.map(V=>[V.id,V]))),a=V=>o.value[V]||{id:V,type:V,label:V},l=I(()=>r.value.length>1?[{id:"all",label:"All"}].concat(r.value.map(V=>({id:V.id,label:V.label}))):[]),u=I({get:()=>l.value.some(V=>V.id===n.source)?n.source:"all",set:V=>{n.source=V}}),c=Q(n.query);_t(()=>n.query,V=>c.value=V),Mu(c,V=>n.query=V,{debounce:u_}),_t(()=>M.workspace.id,()=>{n.query=""});const d=Q("");_t(()=>D.focusFeed,async V=>{var B;const R=M.feed.find(E=>E.id===V);D.focusFeed="",R&&(n.source="all",n.query="",n.openGroups.add(R.key||R.ref||R.id),d.value=V,await ie(),(B=document.getElementById(`feed-${V}`))==null||B.scrollIntoView({block:"center"}),setTimeout(()=>{d.value=""},d_))});const h=I(()=>({base:M.marks.base,seen:new Set(M.marks.seen)})),f=V=>Kc(V,h.value),m=I(()=>M.feed.filter(f).length),_=I(()=>M.feed.filter(V=>u.value==="all"||V.source===u.value)),g=I(()=>_.value.filter(V=>Ew(V,n.query)).slice(0,200)),k=I(()=>new Map(M.turn.map(V=>[V.key,V]))),A=I(()=>Dw(M.turn)),S=I(()=>(Se.value,Vw(g.value,h.value).map(V=>({...V,row:k.value.get(V.id),move:A.value.has(V.id),when:ce(V.newest),kinds:Rw(V.items),open:n.openGroups.has(V.id)||!!n.query})))),C=(V,R)=>{V.has(R)?V.delete(R):V.add(R)},W=V=>C(n.openGroups,V.id),U=V=>C(D.open,V),v=V=>Re({seen:[V]}).then(Yt),b=Q("");To(()=>{b.value=""});const T=Q(null),L=async()=>{const V=new Set(M.marks.seen),R={base:M.marks.base,added:M.feed.map(B=>B.id).filter(B=>!V.has(B))};b.value=await Re({seen:M.feed.map(B=>B.id),base:Date.now()}),T.value=b.value?null:R},X=async()=>{const V=T.value;T.value=null,V&&(b.value=await Re({unseen:V.added,base:V.base}))};return(V,R)=>(w(),H(bn,{id:"feed","size-key":`${p(M).workspace.id}:feed`,title:"What changed",note:"Newest first, every source",tip:"Newest first: comments, reviews, merges and failed checks on your PRs, and ticket changes. Each item opens where it happened.",class:"feed",column:"",resize:"width"},{head:F(()=>[q(p(vt),null,{default:F(()=>[m.value?(w(),H(p(wt),pt({key:0},p(St),{as:"span",class:"feed__new-count"}),{default:F(()=>[lt(P(m.value)+" new",1)]),_:1},16)):O("",!0)]),_:1})]),default:F(()=>[y("div",Zw,[l.value.length?(w(),H(un,{key:0,modelValue:u.value,"onUpdate:modelValue":R[0]||(R[0]=B=>u.value=B),options:l.value,label:"Feed source"},null,8,["modelValue","options"])):O("",!0),q(un,{modelValue:p(n).view,"onUpdate:modelValue":R[1]||(R[1]=B=>p(n).view=B),options:i,label:"Feed view"},null,8,["modelValue"])]),q(p(vt),null,{default:F(()=>[b.value?(w(),H(p(wt),pt({key:0},p(St),{as:"p",class:"alert alert--inline",role:"alert"}),{default:F(()=>[lt(P(b.value),1)]),_:1},16)):O("",!0)]),_:1}),q(p(vt),null,{default:F(()=>[T.value?(w(),H(p(wt),pt({key:0},p(St),{as:"p",class:"feed__undo",role:"status"}),{default:F(()=>[R[5]||(R[5]=lt(" Marked all read. ",-1)),y("button",{type:"button",class:"feed__undo-btn",onClick:X},"Undo")]),_:1},16)):O("",!0)]),_:1}),y("div",Jw,[as(y("input",{"onUpdate:modelValue":R[2]||(R[2]=B=>c.value=B),class:"input feed__search-input",type:"search",placeholder:"Search the feed: key, author, words…","aria-label":"Search the feed",autocomplete:"off"},null,512),[[ls,c.value,void 0,{trim:!0}]]),y("span",Qw,P(p(n).query?g.value.length+" of "+_.value.length:""),1),y("button",{type:"button",class:"feed__mark-read",onClick:L},"Mark all read")]),p(M).feed.length?(w(),x("ol",e_,[p(n).view==="ticket"?(w(),H(p(vt),{key:0,initial:!1},{default:F(()=>[(w(!0),x(it,null,ft(S.value,B=>(w(),H(p(wt),pt({key:B.id},{ref_for:!0},p(St),{as:"li",class:["feed__group",{"feed__group--new":B.unread,"feed__group--open":B.open,"feed__group--move":B.move}]}),{default:F(()=>[y("div",{class:"feed__group-head",title:B.move?"Your move on this ticket":void 0,onClick:E=>W(B)},[q(_n,{open:B.open,"aria-label":"Fold "+B.id},null,8,["open","aria-label"]),y("div",n_,[y("div",i_,[q(ne,{text:B.id,url:B.row?B.row.ticket_url:B.items[0].url,class:"ticket-key feed__group-ticket"},null,8,["text","url"]),B.row||B.title?(w(),x("span",o_,P(B.row?B.row.summary:B.title),1)):O("",!0)]),y("div",r_,[y("span",{class:ht(["feed__group-count",{"feed__group-count--new":B.unread}])},P(B.unread?B.unread+" new":B.items.length+(B.items.length===1?" event":" events")),3),y("span",a_,P(B.kinds),1),y("span",l_,P(B.when),1)])]),q(Te,{class:"feed__group-copy",query:{ws:p(M).workspace.id,kind:"thread",ref:B.id}},null,8,["query"])],8,s_),B.open?(w(),x("ul",c_,[q(p(vt),null,{default:F(()=>[(w(!0),x(it,null,ft(B.items,E=>(w(),H(Ta,{key:E.id,item:E,source:a(E.source),fresh:f(E),flash:d.value===E.id,expanded:p(D).open.has(E.id),onOpen:R[3]||(R[3]=$=>s("open",$)),onToggle:U,onSeen:v},null,8,["item","source","fresh","flash","expanded"]))),128))]),_:2},1024)])):O("",!0)]),_:2},1040,["class"]))),128))]),_:1})):(w(),H(p(vt),{key:1,initial:!1},{default:F(()=>[(w(!0),x(it,null,ft(g.value,B=>(w(),H(Ta,{key:B.id,item:B,source:a(B.source),fresh:f(B),flash:d.value===B.id,expanded:p(D).open.has(B.id),onOpen:R[4]||(R[4]=E=>s("open",E)),onToggle:U,onSeen:v},null,8,["item","source","fresh","flash","expanded"]))),128))]),_:1}))])):(w(),x("p",t_," No changes yet. New comments, reviews and status changes show up here. "))]),_:1},8,["size-key"]))}}),f_=dt(h_,[["__scopeId","data-v-cf52cbc2"]]),p_={id:"first-run",class:"island first-run","aria-labelledby":"first-run-title"},m_={class:"first-run__text"},g_=rt({__name:"FirstRun",setup(t){const e=()=>Mi("connectors");return(s,n)=>(w(),x("section",p_,[n[1]||(n[1]=y("h2",{id:"first-run-title",class:"first-run__title"}," Whose Turn watches your tickets and pull requests and shows what is waiting on you. ",-1)),y("p",m_,[y("b",null,P(p(M).workspace.name),1),n[0]||(n[0]=lt(" has no sources yet, so there is nothing to watch. Connect a repository or a tracker. ",-1))]),y("div",{class:"first-run__actions"},[y("button",{type:"button",class:"btn btn--tonal",onClick:e},"Add a source")]),n[2]||(n[2]=y("p",{class:"first-run__text first-run__ai"},' Or ask Claude: "add my GitHub repository to Whose Turn." ',-1))]))}}),y_=dt(g_,[["__scopeId","data-v-84359c2d"]]),v_={class:"modal__head"},w_=["id"],__={key:0,class:"modal__foot"},b_=rt({__name:"Modal",props:{title:{},labelId:{},flush:{type:Boolean},cardClass:{}},emits:["close"],setup(t,{emit:e}){const s=e;return(n,i)=>(w(),H(p(wt),pt(p(St),{class:"modal",role:"dialog","aria-modal":"true","aria-labelledby":t.labelId,onClick:i[1]||(i[1]=Pt(r=>s("close"),["self"]))}),{default:F(()=>[q(p(wt),pt(p(yy),{class:["modal__card",t.cardClass]}),{default:F(()=>[y("div",v_,[y("h3",{id:t.labelId,class:"modal__title"},P(t.title),9,w_),te(n.$slots,"head",{},void 0,!0),y("button",{type:"button",class:"btn",onClick:i[0]||(i[0]=r=>s("close"))},"Close")]),y("div",{class:ht(["modal__body",{"modal__body--flush":t.flush}])},[te(n.$slots,"default",{},void 0,!0)],2),n.$slots.footer?(w(),x("div",__,[te(n.$slots,"footer",{},void 0,!0)])):O("",!0)]),_:3},16,["class"])]),_:3},16,["aria-labelledby"]))}}),Ms=dt(b_,[["__scopeId","data-v-68df91bd"]]),k_=new RegExp("(`[^`]{1,500}`)|(\\*\\*[^*]{1,500}\\*\\*)|(\\[[^\\]]{1,300}\\]\\(https?:\\/\\/[^)\\s]{1,2000}\\))|(https?:\\/\\/[^\\s<>()]{1,2000})|(@[A-Za-z0-9-]+(?: [A-Z][a-z]+)?)|((?<![A-Za-z0-9])\\*[^*\\s][^*]{0,500}\\*(?![A-Za-z0-9])|(?<![A-Za-z0-9])_[^_\\s][^_]{0,500}_(?![A-Za-z0-9]))","g"),Aa=(t,e)=>{const s=Pi(e);return s?{type:"link",text:t,href:s}:{type:"text",text:t}},x_=t=>{const e=t[0];if(t[1])return{type:"code",text:e.slice(1,-1)};if(t[2])return{type:"strong",text:e.slice(2,-2)};if(t[3]){const s=e.indexOf("](");return Aa(e.slice(1,s),e.slice(s+2,-1))}return t[4]?Aa(e,e):t[5]?{type:"mention",text:e}:{type:"em",text:e.slice(1,-1)}},Fs=t=>{const e=new RegExp(k_),s=[];let n=0,i;for(;i=e.exec(t);)i.index>n&&s.push({type:"text",text:t.slice(n,i.index)}),s.push(x_(i)),n=i.index+i[0].length;return n<t.length&&s.push({type:"text",text:t.slice(n)}),s},S_=t=>{const e=String(t||"").replace(/<!--[\s\S]*?-->/g,"").split(`
|
|
14
|
+
`),s=[];let n=[],i=null;const r=()=>{n.length&&(s.push({type:"paragraph",lines:n.map(Fs)}),n=[]),i=null};for(let o=0;o<e.length;o++){const a=e[o];if(/^\s*```/.test(a)){r();const d=[];for(o++;o<e.length&&!/^\s*```/.test(e[o]);o++)d.push(e[o]);s.push({type:"fence",text:d.join(`
|
|
15
|
+
`)});continue}const l=a.match(/^(#{1,6})\s+(.*)$/);if(l){r(),s.push({type:"heading",level:l[1].length<=2?4:5,inline:Fs(l[2])});continue}const u=a.match(/^>\s?(.*)$/);if(u){r(),s.push({type:"quote",inline:Fs(u[1])});continue}const c=a.match(/^\s*([-*+]|\d+[.)])\s+(.*)$/);if(c){const d=i;n.length&&(r(),i=d);const h=/\d/.test(c[1]),f=i,m=f&&f.ordered===h?f:{type:"list",ordered:h,items:[]};m!==f&&s.push(m),i=m,m.items.push(Fs(c[2]));continue}if(!a.trim()){r();continue}i=null,n.push(a)}return r(),s},Xs=(t,e,s="")=>{const n=document.createElement(t);return n.textContent=e,s&&(n.className=s),n},T_=t=>{if(t.type==="text")return document.createTextNode(t.text);if(t.type==="link"){const e=Xs("a",t.text);return e.setAttribute("href",t.href),e.setAttribute("target","_blank"),e.setAttribute("rel","noopener"),e}return t.type==="mention"?Xs("span",t.text,"markdown-view__mention"):Xs(t.type,t.text)},Yc=(t,e)=>{t.forEach(s=>e.append(T_(s)))},Gn=(t,e)=>{const s=document.createElement(t);return Yc(e,s),s},A_=t=>{if(t.type==="fence"){const s=document.createElement("pre");return s.append(Xs("code",t.text)),s}if(t.type==="heading")return Gn(`h${t.level}`,t.inline);if(t.type==="quote")return Gn("blockquote",t.inline);if(t.type==="list"){const s=document.createElement(t.ordered?"ol":"ul");return t.items.forEach(n=>s.append(Gn("li",n))),s}const e=document.createElement("p");return t.lines.forEach((s,n)=>{n&&e.append(document.createElement("br")),Yc(s,e)}),e},C_=t=>{const e=document.createDocumentFragment();return S_(t).forEach(s=>e.append(A_(s))),e},P_=rt({__name:"MarkdownView",props:{source:{default:""}},setup(t){const e=t,s=Q(null);return pu(()=>{s.value&&s.value.replaceChildren(C_(e.source))}),(n,i)=>(w(),x("div",{ref_key:"host",ref:s,class:"markdown-view"},null,512))}}),qc=dt(P_,[["__scopeId","data-v-dcf42e95"]]),E_=["href"],M_=rt({__name:"CommentModal",setup(t){const e=I(()=>D.modal),s=I(()=>e.value?[e.value.ref,e.value.kind,e.value.who].filter(Boolean).join(" · "):""),n=I(()=>e.value?Pi(e.value.url):""),i=I(()=>{var a;const o=(M.workspace.connectors||[]).find(l=>{var u;return l.id===((u=e.value)==null?void 0:u.source)});return"Open in "+(o?o.label:(a=e.value)==null?void 0:a.source)}),r=()=>{D.modal=null};return(o,a)=>(w(),H(p(vt),null,{default:F(()=>[e.value?(w(),H(Ms,{key:0,title:s.value,"label-id":"modal-title",flush:"",onClose:r},{head:F(()=>[n.value?(w(),x("a",{key:0,class:"btn",href:n.value,target:"_blank",rel:"noopener"},P(i.value),9,E_)):O("",!0)]),default:F(()=>[q(qc,{source:e.value.body||e.value.text||""},null,8,["source"])]),_:1},8,["title"])):O("",!0)]),_:1}))}}),V_={class:"note-modal__summary"},D_={key:0,class:"note-modal__facts"},R_={class:"note-modal__author"},$_={class:"note-modal__label",for:"note-text"},O_=["onKeydown"],L_={key:1,class:"alert alert--inline",role:"alert"},I_=rt({__name:"NoteModal",setup(t){const e=I(()=>M.turn.find(g=>g.row_id===D.note)),s=I(()=>M.marks.info[D.note]),n=I(()=>{var g;return((g=e.value)==null?void 0:g.group)==="you"&&!e.value.handled}),i=I(()=>{var g;return((g=s.value)==null?void 0:g.note)||""}),r=Q(""),o=Q(""),a=Q(null);_t(()=>D.note,async g=>{var k;g&&(r.value=i.value,o.value="",await ie(),(k=a.value)==null||k.focus())},{immediate:!0,flush:"post"});const l=()=>{D.note=""},u=async g=>{const k=D.note,A=n.value;o.value=await Re(A?{handled:{[k]:new Date().toISOString()},...g&&{notes:{[k]:g}}}:{notes:{[k]:g}}),!o.value&&(A&&(ss.value=k),l())},c=()=>{const g=r.value.replace(/\s+/g," ").trim();if(!n.value&&g===i.value){l();return}return u(g)},d=()=>n.value?u(""):l(),h=()=>{var k;const g=((k=s.value)==null?void 0:k.event)||"";l(),Cd(g)},f=I(()=>{var g;return(g=s.value)==null?void 0:g.detail}),m=I(()=>{var A;const g=(A=f.value)==null?void 0:A.comment;if(typeof g!="string")return g;const k=M.feed.find(S=>S.id===g);return k&&{author:k.who||"",text:k.body||k.text||""}}),_=I(()=>{var g,k;return((g=f.value)==null?void 0:g.what)||((k=s.value)==null?void 0:k.outcome)||""});return(g,k)=>(w(),H(p(vt),null,{default:F(()=>{var A,S;return[p(D).note&&e.value?(w(),H(Ms,{key:0,title:e.value.key+" · "+((A=s.value)!=null&&A.auto?"Passed on":"Handled"),"label-id":"note-title",onClose:l},Da({footer:F(()=>[y("button",{type:"button",class:"btn",onClick:d},P(i.value&&!n.value?"Cancel":"Skip"),1),y("button",{type:"button",class:"btn btn--tonal",onClick:c},"Save")]),default:F(()=>{var C,W,U,v,b;return[y("p",V_,P(e.value.summary),1),(C=s.value)!=null&&C.auto?(w(),x("dl",D_,[k[5]||(k[5]=y("dt",null,"What happened",-1)),y("dd",null,P(_.value),1),(W=f.value)!=null&&W.assignee?(w(),x(it,{key:0},[k[1]||(k[1]=y("dt",null,"Assignee",-1)),y("dd",null,P(f.value.assignee),1)],64)):O("",!0),(U=f.value)!=null&&U.status?(w(),x(it,{key:1},[k[2]||(k[2]=y("dt",null,"Status",-1)),y("dd",null,P(f.value.status),1)],64)):O("",!0),(v=f.value)!=null&&v.summary?(w(),x(it,{key:2},[k[3]||(k[3]=y("dt",null,"Event",-1)),y("dd",null,P(f.value.summary),1)],64)):O("",!0),m.value?(w(),x(it,{key:3},[k[4]||(k[4]=y("dt",null,"Comment",-1)),y("dd",null,[y("span",R_,P(m.value.author)+":",1),lt(" "+P(m.value.text),1)])],64)):O("",!0),k[6]||(k[6]=y("dt",null,"When",-1)),y("dd",null,P(p(hn)(p(M).marks.handled[p(D).note]||"")),1)])):O("",!0),y("label",$_,P((b=s.value)!=null&&b.auto?"Your note on top":"Note")+" (optional)",1),as(y("textarea",{id:"note-text",ref_key:"field",ref:a,"onUpdate:modelValue":k[0]||(k[0]=T=>r.value=T),class:"input note-modal__text",rows:"3",maxlength:"200",placeholder:"Add a note…",onKeydown:De(Pt(c,["prevent"]),["enter"])},null,40,O_),[[ls,r.value]]),o.value?(w(),x("p",L_,P(o.value),1)):O("",!0)]}),_:2},[(S=s.value)!=null&&S.auto?{name:"head",fn:F(()=>[s.value.event?(w(),x("button",{key:0,type:"button",class:"btn",onClick:h},"Open in feed")):O("",!0)]),key:"0"}:void 0]),1032,["title"])):O("",!0)]}),_:1}))}}),B_=dt(I_,[["__scopeId","data-v-ad4fa239"]]),F_={"Google Chrome":"Chrome","Microsoft Edge":"Edge",Opera:"Opera",Brave:"Brave",Chromium:"Chromium"},j_=[[/Edg(?:e|A|iOS)?\/(\d+)/,"Edge"],[/OPR\/(\d+)/,"Opera"],[/(?:Firefox|FxiOS)\/(\d+)/,"Firefox"],[/(?:Chrome|CriOS)\/(\d+)/,"Chrome"],[/Version\/(\d+)[^]*Safari/,"Safari"]],Ca=t=>{var e;return((e=/^\d{1,6}/.exec(t))==null?void 0:e[0])??""},N_=t=>{var n;const e=(((n=t.userAgentData)==null?void 0:n.brands)??[]).filter(i=>!/^not.?a.?brand/i.test(i.brand.replace(/[^\w ]/g,""))),s=e.find(i=>i.brand!=="Chromium")??e[0];if(s&&Ca(s.version))return{name:F_[s.brand]??"Other",version:Ca(s.version)};for(const[i,r]of j_){const o=i.exec(t.userAgent);if(o)return{name:r,version:o[1]}}return null},U_=t=>({browser:N_(t.navigator),display:{width:t.screen.width,height:t.screen.height,scale:t.devicePixelRatio,viewport:[t.innerWidth,t.innerHeight]},locale:t.navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,theme:t.dark?"dark":"light",mode:t.mode}),W_=["aria-disabled"],z_={key:0,class:"alert"},H_={class:"sheet-form"},K_=["onKeydown"],G_={key:0,class:"empty"},Y_=["href"],q_={key:1,class:"feedback-sheet__reports"},X_={class:"sheet-form__heading"},Z_=["href"],J_={class:"feedback-sheet__report-title"},Q_={key:0,class:"pill"},tb={class:"timestamp"},eb=rt({__name:"FeedbackSheet",setup(t){const e=Q(""),s=Q(null),n=Q(!1),i=Q([]),r=Q(null),o=Q([]),a=h=>"/report?id="+encodeURIComponent(h),l=()=>bs("/api/feedback").then(h=>{o.value=h.reports||[]},()=>{i.value=[cs+"; past reports cannot be loaded."]}),u=I(()=>o.value.some(h=>h.mine!==void 0)),c=()=>{D.feedback=!1},d=()=>{if(n.value)return;const h=e.value.trim();if(!h){i.value=["Write at least one line."];return}n.value=!0,qt("/api/feedback",{text:h,from:"the window",ws:M.workspace.id,client:U_({navigator,screen,devicePixelRatio,innerWidth,innerHeight,dark:_s.value,mode:D.mode})}).then(f=>{if(n.value=!1,f.error){i.value=Ci(f.error);return}r.value=f.issue||null,e.value="",o.value=f.reports||o.value}).catch(f=>{n.value=!1,i.value=[de(f,{refused:"Not sent",unreachable:qn})]})};return _t(()=>D.feedback,h=>{h&&(D.reportNews=!1,i.value=[],r.value=null,l().then(()=>ie(()=>{var f;return(f=s.value)==null?void 0:f.focus()})))}),(h,f)=>(w(),H(p(vt),null,{default:F(()=>[p(D).feedback?(w(),H(Ms,{key:0,title:"Report a problem or a wish","label-id":"feedback-title",flush:"","card-class":"feedback-sheet__card",onClose:c},{head:F(()=>[y("button",{type:"button",class:"btn btn--tonal","aria-disabled":n.value,onClick:d},P(n.value?"Composing…":"Send"),9,W_)]),default:F(()=>[i.value.length?(w(),x("div",z_,P(i.value.join(" · ")),1)):O("",!0),y("div",H_,[as(y("textarea",{ref_key:"field",ref:s,"onUpdate:modelValue":f[0]||(f[0]=m=>e.value=m),class:"input feedback-sheet__text",rows:"5",placeholder:"Describe the problem or the wish in your own words. Cmd+Enter sends.",autocomplete:"off",onKeydown:[De(Pt(d,["meta","prevent"]),["enter"]),De(Pt(d,["ctrl","prevent"]),["enter"])]},null,40,K_),[[ls,e.value]]),f[2]||(f[2]=y("p",{class:"feedback-sheet__note"}," Only what you write, the monitor version and a description of your system are sent: OS and processor type, Node version, how the monitor was installed, browser, screen and window size, language, time zone, light or dark, app or tab, and which kinds of source you use. ",-1)),r.value?(w(),x("p",G_,[f[1]||(f[1]=lt(" Filed as ",-1)),y("a",{href:a(r.value.identifier),target:"_blank",rel:"noopener"},P(r.value.identifier),9,Y_),lt(" · "+P(r.value.title),1)])):O("",!0),o.value.length?(w(),x("div",q_,[y("h4",X_,P(u.value?"All reports":"Your reports"),1),(w(!0),x(it,null,ft(o.value,m=>(w(),x("div",{key:m.id,class:"feedback-sheet__report"},[y("a",{href:a(m.id),target:"_blank",rel:"noopener"},P(m.id),9,Z_),y("span",J_,P(m.title),1),m.mine?(w(),x("span",Q_,"yours")):O("",!0),y("span",{class:ht(["pill",p(ks)("pill",p(ju)(m.outcome))])},P(m.state||"filed"),3),y("span",tb,P(p(ce)(m.changed_at||m.filed_at)),1)]))),128))])):O("",!0)])]),_:1})):O("",!0)]),_:1}))}}),sb=dt(eb,[["__scopeId","data-v-1bc7805d"]]),nb={class:"field-row"},ib={class:"field-row__label"},ob={key:0,class:"field-row__check"},rb=["checked"],ab=["aria-invalid","value"],lb={key:0,value:""},cb=["value"],ub=["value"],db={key:3,class:"field-row__inline"},hb=["value"],fb=["value"],pb=["aria-invalid","value"],mb=["aria-invalid","placeholder","value"],gb={key:6,class:"field-row__error",role:"alert"},yb={key:7,class:"field-row__hint"},vb=rt({__name:"FieldRow",props:Yn({spec:{},placeholder:{default:""},hint:{default:""},error:{default:""}},{modelValue:{type:[String,Array,Boolean]},modelModifiers:{}}),emits:Yn(["secret"],["update:modelValue"]),setup(t,{emit:e}){const s=t,n=e,i=Va(t,"modelValue"),r=/^#[0-9a-f]{6}$/i,o=()=>String(i.value??""),a=()=>i.value||[],l=f=>{i.value=f},u=()=>i.value??s.spec.default??!1,c=f=>{i.value=f===(s.spec.default??!1)?void 0:f},d=f=>f.target.value,h=f=>l(f.split(",").map(m=>m.trim()).filter(Boolean));return(f,m)=>(w(),x("div",nb,[y("label",ib,P(t.spec.label)+P(t.spec.required?" *":""),1),t.spec.boolean?(w(),x("label",ob,[y("input",{type:"checkbox",checked:u(),onChange:m[0]||(m[0]=_=>c(_.target.checked))},null,40,rb),lt(" "+P(t.hint||t.spec.hint),1)])):t.spec.choices?(w(),x("select",{key:1,class:"input","aria-invalid":!!t.error,value:o(),onChange:m[1]||(m[1]=_=>l(d(_)))},[!t.spec.required&&!t.spec.choices.includes(o())?(w(),x("option",lb,"(default)")):O("",!0),o()&&!t.spec.choices.includes(o())?(w(),x("option",{key:1,value:o()},P(o()),9,cb)):O("",!0),(w(!0),x(it,null,ft(t.spec.choices,_=>(w(),x("option",{key:_,value:_},P(_),9,ub))),128))],40,ab)):t.spec.secret?(w(),x("input",{key:2,class:"input",type:"password",placeholder:"paste to replace",autocomplete:"off",onInput:m[2]||(m[2]=_=>n("secret",t.spec.key,d(_)))},null,32)):t.spec.colour?(w(),x("div",db,[y("input",{class:"input field-row__colour",type:"color",value:r.test(o())?o():"#888888",onInput:m[3]||(m[3]=_=>l(d(_)))},null,40,hb),y("input",{class:"input",type:"text",placeholder:"#rrggbb",value:o(),onInput:m[4]||(m[4]=_=>l(d(_)))},null,40,fb),y("button",{type:"button",class:"btn",onClick:m[5]||(m[5]=_=>l(""))},"None")])):t.spec.list?(w(),x("input",{key:4,class:"input",type:"text","aria-invalid":!!t.error,value:a().join(", "),onInput:m[6]||(m[6]=_=>h(d(_)))},null,40,pb)):(w(),x("input",{key:5,class:"input",type:"text","aria-invalid":!!t.error,placeholder:t.placeholder,value:o(),onInput:m[7]||(m[7]=_=>l(d(_)))},null,40,mb)),t.error?(w(),x("small",gb,P(t.error),1)):O("",!0),!t.spec.boolean&&(t.hint||t.spec.hint)?(w(),x("small",yb,P(t.hint||t.spec.hint),1)):O("",!0)]))}}),le=dt(vb,[["__scopeId","data-v-33714840"]]),wb={key:0,class:"settings-frame__dirty"},_b={key:0,class:"settings-frame__confirm",role:"alertdialog"},bb={class:"settings-frame__confirm-text"},kb={key:1,class:"alert settings-frame__alert",role:"alert"},xb={key:2,class:"alert settings-frame__alert"},Sb={key:3,class:"settings-frame__body"},Tb=rt({__name:"SettingsFrame",props:{title:{},labelId:{},dirty:{type:Boolean},ask:{},unloaded:{},problems:{},wide:{type:Boolean}},emits:["close","save","answer"],setup(t,{emit:e}){const s=e;return(n,i)=>(w(),H(Ms,{title:t.title,"label-id":t.labelId,flush:"","card-class":t.wide?"settings-frame__card settings-frame__card--wide":"settings-frame__card",onClose:i[3]||(i[3]=r=>s("close"))},{head:F(()=>[t.dirty?(w(),x("span",wb,"Unsaved changes")):O("",!0),t.unloaded?O("",!0):(w(),x("button",{key:1,type:"button",class:"btn btn--tonal",onClick:i[0]||(i[0]=r=>s("save"))}," Save "))]),default:F(()=>[t.ask?(w(),x("div",_b,[y("span",bb,P(t.ask.text),1),y("button",{type:"button",class:"btn btn--danger",onClick:i[1]||(i[1]=r=>s("answer",!0))},P(t.ask.yes),1),y("button",{type:"button",class:"btn",onClick:i[2]||(i[2]=r=>s("answer",!1))},P(t.ask.no),1)])):O("",!0),t.unloaded?(w(),x("div",kb,P(t.unloaded),1)):t.problems.length?(w(),x("div",xb,P(t.problems.join(" · ")),1)):O("",!0),t.unloaded?O("",!0):(w(),x("div",Sb,[te(n.$slots,"default",{},void 0,!0)]))]),_:3},8,["title","label-id","card-class"]))}}),Xc=dt(Tb,[["__scopeId","data-v-b9791642"]]),Ab=(t,e,s)=>{const n=Q(null),i=()=>{n.value={text:"Discard changes?",yes:"Discard",no:"Keep editing",run:s}},r=()=>e()?i():s(),o=a=>{const l=n.value;n.value=null,a&&(l==null||l.run())};return _t(e,a=>{D.settingsDirty=a},{immediate:!0}),_t(()=>D.settingsAsk,a=>{a&&t()&&(D.settingsAsk=!1,i())}),{ask:n,requestClose:r,answer:o}},Zc=t=>{const e=Q([]),s=Q({}),n=Q(""),i=I(()=>t.isOpen()&&!n.value&&t.changed()),{ask:r,requestClose:o,answer:a}=Ab(t.isOpen,()=>i.value,t.close),l=(d,h,f,m)=>{r.value={text:d,yes:h,no:f,run:m}},u=()=>bs("/api/config").then(d=>(n.value="",r.value=null,e.value=d.problems||[],s.value={},t.apply(d))).catch(()=>{n.value=cs+"; settings cannot be loaded."}),c=async(d,h)=>{try{const f=await qt("/api/config",d);if(f.error){const m=Nu(f.error);s.value=Object.fromEntries(m.filter(_=>_.field!=="workspaces").map(_=>[_.field,_.description])),e.value=m.length?m.filter(_=>_.field==="workspaces").map(_=>_.description):Ci(f.error),m.length&&!e.value.length&&(e.value=["Fix the marked fields; nothing was saved."]);return}await h()}catch(f){e.value=[de(f,{unreachable:cs+"; your changes are kept, save again."})]}};return _t(t.isOpen,d=>{d&&u()}),{ask:r,requestClose:o,answer:a,confirm:l,problems:e,fieldErrors:s,unloaded:n,dirty:i,save:c}},Cb={class:"sheet-form"},Pb={class:"settings-sheet__modes"},Eb=["checked","onChange"],Mb={class:"settings-sheet__mode-name"},Vb={class:"settings-sheet__mode-line"},Db={ref:"connectors-head",class:"sheet-form__heading"},Rb={class:"settings-sheet__connector-head"},$b={class:"settings-sheet__connector-name"},Ob=["onClick"],Lb={class:"settings-sheet__actions"},Ib=["onClick"],Bb={key:0,class:"settings-sheet__rules"},Fb={class:"settings-sheet__rule-when"},jb={class:"settings-sheet__rule-then"},Nb={key:1,class:"empty"},Ub={key:2,class:"settings-sheet__actions"},Wb=rt({__name:"WorkspaceSettingsSheet",setup(t){const e=[{value:"",label:"Visible",line:"Checked every minute and shown in the list."},{value:"parked",label:"Park",line:"Hidden from the list, checked every 15 minutes. Comes back by itself when something needs you."},{value:"paused",label:"Pause",line:"Hidden and not checked at all. Stays hidden until you bring it back."}],s=Q([]),n=Q(0),i=Q([]),r=Q({workspace:[],theme:[],rules:[],statuses:[]}),o=new Map,a=Q({}),l=Q({}),u=Q({}),c=Ge("connectors-head"),d=new Map,h=Q(0),f=Q(""),m=Q(!1),_=()=>{D.settings=!1,D.settingsNew=!1,D.settingsAt=""},{ask:g,requestClose:k,answer:A,confirm:S,problems:C,fieldErrors:W,unloaded:U,dirty:v,save:b}=Zc({isOpen:()=>D.settings,close:_,changed:()=>h.value>0||Tn(s.value)!==f.value,apply:J=>(s.value=(J.workspaces||[]).map(Oo),i.value=J.connectors||[],r.value=J.fields,d.clear(),h.value=0,n.value=Math.max(0,s.value.findIndex(tt=>tt.id===M.workspace.id)),o.clear(),s.value.forEach(tt=>o.set(Sn(tt),tt.id)),a.value=J.facts||{},l.value=J.tables||{},u.value=J.table_warnings||{},f.value=Tn(s.value),m.value=D.settingsNew||!s.value.length,m.value&&(gt(),f.value=Tn(s.value)),ie().then(()=>{var tt;D.settingsAt==="connectors"&&((tt=c.value)==null||tt.scrollIntoView({block:"start"})),D.settingsAt=""}))}),T=J=>W.value[`workspaces[${n.value}].${J}`]||"",L=I(()=>{const J=R.value&&o.get(Sn(R.value));return J&&R.value&&J!==R.value.id?`Its to-dos and marks stay under the old id "${J}"; they do not follow the rename.`:""}),X={key:"id",label:"Source id"},V={key:"label",label:"Label"},R=I(()=>s.value[n.value]),B=I(()=>(R.value&&l.value[R.value.id]||[]).map(J=>pd(J,a.value))),E=I(()=>R.value&&u.value[R.value.id]||[]),$=J=>i.value.find(tt=>tt.type===J.type)||{type:J.type,label:J.type,fields:[]},N=I(()=>{var J;return(((J=R.value)==null?void 0:J.connectors)||[]).map(tt=>({entry:tt,uid:Sn(tt),spec:$(tt)}))}),j=J=>{var G;const tt=(G=M.workspaces.find(ut=>ut.id===J))==null?void 0:G.theme_seed;return tt?`empty: ${tt}, derived from the workspace id`:"empty derives one from the workspace id"},K=(J,tt)=>J[tt],st=(J,tt,G)=>{d.set(J,Object.assign(d.get(J)||{},{[tt]:G})),h.value+=1},at=(J,tt,G)=>tt==="id"?J.id=String(G??""):re(J,tt,G),gt=()=>{s.value.push(Oo({id:""})),n.value=s.value.length-1},Z=()=>{s.value.splice(n.value,1),n.value=Math.max(0,n.value-1)},z=()=>{R.value&&S(`Delete ${R.value.name||R.value.id}? Its to-dos and marks stay on disk.`,"Delete","Keep",Z)},nt=J=>{var tt;return(tt=R.value)==null?void 0:tt.connectors.push({type:J.type})},et=J=>{R.value&&(d.delete(R.value.connectors[J]),R.value.connectors.splice(J,1))},yt=J=>{if(!R.value)return;const tt=$(R.value.connectors[J]).label;S(`Remove the ${tt} source from ${R.value.name||R.value.id}?`,"Remove","Keep",()=>et(J))},Et=()=>b({workspaces:s.value.map(J=>ed(J)),secrets:nd(s.value,d)},async()=>{var tt;const J=m.value?(tt=R.value)==null?void 0:tt.id:"";_(),await fn(),J&&await Za(J)});return(J,tt)=>(w(),H(p(vt),null,{default:F(()=>[p(D).settings?(w(),H(Xc,{key:0,title:m.value?"New workspace":"Workspace settings","label-id":"settings-title",dirty:p(v),ask:p(g),unloaded:p(U),problems:p(C),wide:"",onClose:p(k),onSave:Et,onAnswer:p(A)},{default:F(()=>[y("div",Cb,[R.value?(w(),x(it,{key:0},[tt[1]||(tt[1]=y("h4",{class:"sheet-form__heading"},"Workspace",-1)),(w(!0),x(it,null,ft(r.value.workspace,G=>(w(),H(le,{key:G.key,spec:G,hint:G.key==="id"?L.value:"",error:T(G.key),"model-value":K(R.value,G.key),"onUpdate:modelValue":ut=>at(R.value,G.key,ut)},null,8,["spec","hint","error","model-value","onUpdate:modelValue"]))),128)),y("fieldset",Pb,[tt[0]||(tt[0]=y("legend",{class:"field-row__label"},"In the list",-1)),(w(),x(it,null,ft(e,G=>y("label",{key:G.value,class:"settings-sheet__mode"},[y("input",{type:"radio",name:"hidden-mode",checked:(R.value.hidden||"")===G.value,onChange:ut=>p(re)(R.value,"hidden",G.value||void 0)},null,40,Eb),y("span",Mb,P(G.label),1),y("span",Vb,P(G.line),1)])),64))]),tt[2]||(tt[2]=y("h4",{class:"sheet-form__heading"},"Look",-1)),(w(!0),x(it,null,ft(r.value.theme,G=>{var ut;return w(),H(le,{key:G.key,spec:G,hint:G.key==="seed"&&!((ut=R.value.theme)!=null&&ut.seed)?j(R.value.id):"","model-value":K(R.value.theme,G.key),"onUpdate:modelValue":bt=>p(re)(R.value.theme,G.key,bt)},null,8,["spec","hint","model-value","onUpdate:modelValue"])}),128)),y("h4",Db,"Sources",512),(w(!0),x(it,null,ft(N.value,({entry:G,spec:ut,uid:bt},zt)=>(w(),x("div",{key:bt,class:"settings-sheet__connector"},[y("div",Rb,[y("strong",$b,P(ut.label),1),y("button",{type:"button",class:"btn btn--danger",onClick:Vt=>yt(zt)}," Remove ",8,Ob)]),q(le,{spec:X,placeholder:ut.type,hint:"only needed when one type appears twice","model-value":K(G,"id"),"onUpdate:modelValue":Vt=>p(re)(G,"id",Vt)},null,8,["placeholder","model-value","onUpdate:modelValue"]),q(le,{spec:V,placeholder:ut.label,hint:"its name in the feed","model-value":K(G,"label"),"onUpdate:modelValue":Vt=>p(re)(G,"label",Vt)},null,8,["placeholder","model-value","onUpdate:modelValue"]),(w(!0),x(it,null,ft(ut.fields,Vt=>(w(),H(le,{key:Vt.key,spec:Vt,error:T("connectors["+zt+"]."+Vt.key),"model-value":K(G,Vt.key),"onUpdate:modelValue":Ae=>p(re)(G,Vt.key,Ae),onSecret:(Ae,Vs)=>st(G,Ae,Vs)},null,8,["spec","error","model-value","onUpdate:modelValue","onSecret"]))),128))]))),128)),y("div",Lb,[(w(!0),x(it,null,ft(i.value,G=>(w(),x("button",{key:G.type,type:"button",class:"btn",onClick:ut=>nt(G)}," + Add "+P(G.label)+" source ",9,Ib))),128))]),tt[3]||(tt[3]=y("h4",{class:"sheet-form__heading"},"Rules",-1)),(w(!0),x(it,null,ft(r.value.rules,G=>(w(),H(le,{key:G.key,spec:G,error:T("rules."+G.key),"model-value":K(R.value.rules,G.key),"onUpdate:modelValue":ut=>p(re)(R.value.rules,G.key,ut)},null,8,["spec","error","model-value","onUpdate:modelValue"]))),128)),(w(!0),x(it,null,ft(r.value.statuses,G=>(w(),H(le,{key:G.key,spec:G,"model-value":K(R.value.rules.statuses,G.key),"onUpdate:modelValue":ut=>p(re)(R.value.rules.statuses,G.key,ut)},null,8,["spec","model-value","onUpdate:modelValue"]))),128)),tt[4]||(tt[4]=y("h4",{class:"sheet-form__heading"},"Whose turn table",-1)),tt[5]||(tt[5]=y("p",{class:"settings-sheet__rules-note"}," The rows in force, top to bottom: the first one that fits decides. Read-only here: ask Claude to change them. ",-1)),(w(!0),x(it,null,ft(E.value,G=>(w(),x("p",{key:G,class:"settings-sheet__rules-warning"},P(G),1))),128)),B.value.length?(w(),x("ol",Bb,[(w(!0),x(it,null,ft(B.value,(G,ut)=>(w(),x("li",{key:ut,class:"settings-sheet__rule"},[y("span",Fb,P(G.when),1),y("span",jb,P(G.then),1)]))),128))])):(w(),x("p",Nb,"Save the workspace to see its rows.")),m.value?O("",!0):(w(),x("div",Ub,[y("button",{type:"button",class:"btn btn--danger",onClick:z}," Delete workspace ")]))],64)):O("",!0)])]),_:1},8,["title","dirty","ask","unloaded","problems","onClose","onAnswer"])):O("",!0)]),_:1}))}}),zb=dt(Wb,[["__scopeId","data-v-eb55d8fe"]]),Hb={class:"sheet-form"},Kb={class:"monitor-settings__switch"},Gb=["checked"],Yb={class:"monitor-settings__hidden-name"},qb={class:"monitor-settings__hidden-mode"},Xb=["aria-label","onClick"],Zb={class:"monitor-settings__file"},Jb=rt({__name:"MonitorSettingsSheet",setup(t){const e=Q({}),s=Q([]),n=Q(""),i=Q(""),r=I(()=>M.workspaces.filter(_=>_.hidden)),{ask:o,requestClose:a,answer:l,problems:u,fieldErrors:c,unloaded:d,dirty:h,save:f}=Zc({isOpen:()=>D.monitor,close:()=>{D.monitor=!1},changed:()=>JSON.stringify(e.value)!==i.value,apply:_=>{const g=_.settings_fields||{};s.value=Object.entries(g).map(([k,A])=>({key:k,label:A.label,hint:A.hint})),e.value=Object.fromEntries(Object.keys(g).map(k=>{var A;return[k,String(((A=_.settings)==null?void 0:A[k])??"")]})),i.value=JSON.stringify(e.value),n.value=_.config_file||""}}),m=()=>f({settings:Object.fromEntries(Object.entries(e.value).map(([_,g])=>[_,Number(g)]))},()=>{D.monitor=!1,fn()});return(_,g)=>(w(),H(p(vt),null,{default:F(()=>[p(D).monitor?(w(),H(Xc,{key:0,title:"Monitor settings","label-id":"monitor-title",dirty:p(h),ask:p(o),unloaded:p(d),problems:p(u),onClose:p(a),onSave:m,onAnswer:p(l)},{default:F(()=>[y("div",Hb,[g[4]||(g[4]=y("h4",{class:"sheet-form__heading"},"Notifications",-1)),y("label",Kb,[y("input",{type:"checkbox",role:"switch",checked:p(M).notifications.desktop,onChange:g[0]||(g[0]=(...k)=>p(Qs)&&p(Qs)(...k))},null,40,Gb),g[1]||(g[1]=lt(" Desktop notifications for every workspace; saved as you click, like the bell in the status bar ",-1))]),g[5]||(g[5]=y("h4",{class:"sheet-form__heading"},"Polling and health",-1)),(w(!0),x(it,null,ft(s.value,k=>(w(),H(le,{key:k.key,modelValue:e.value[k.key],"onUpdate:modelValue":A=>e.value[k.key]=A,spec:k,error:p(c)["settings."+k.key]},null,8,["modelValue","onUpdate:modelValue","spec","error"]))),128)),r.value.length?(w(),x(it,{key:0},[g[2]||(g[2]=y("h4",{class:"sheet-form__heading"},"Parked and paused workspaces",-1)),g[3]||(g[3]=y("p",{class:"monitor-settings__note"}," Parked: checked every 15 minutes, back in the rail when something needs you. Paused: not checked at all, back only when you restore it. ",-1)),q(p(vt),null,{default:F(()=>[(w(!0),x(it,null,ft(r.value,k=>(w(),H(p(wt),pt({key:k.id},{ref_for:!0},p(Es),{class:"monitor-settings__hidden"}),{default:F(()=>[y("strong",Yb,P(k.name),1),y("span",qb,P(k.hidden),1),y("button",{type:"button",class:"btn","aria-label":"Restore "+k.name,"data-tip":"Show it in the list again and check it every minute.",onClick:A=>p(Ed)(k.id)}," Restore ",8,Xb)]),_:2},1040))),128))]),_:1})],64)):O("",!0),g[6]||(g[6]=y("h4",{class:"sheet-form__heading"},"Config file",-1)),y("p",Zb,P(n.value),1)])]),_:1},8,["dirty","ask","unloaded","problems","onClose","onAnswer"])):O("",!0)]),_:1}))}}),Qb=dt(Jb,[["__scopeId","data-v-b4e08939"]]),t1={class:"modal__meta"},e1={key:0,class:"alert",role:"alert"},s1={class:"whats-new__head"},n1={class:"whats-new__name"},i1={key:0,class:"whats-new__date"},o1={key:1,class:"whats-new__tag whats-new__tag--running"},r1={key:2,class:"whats-new__tag"},a1={key:1,class:"whats-new__empty"},l1=rt({__name:"WhatsNewSheet",setup(t){const{changelog:e,problem:s,unseen:n,load:i,markSeen:r}=So(),o=Q([]),a=()=>{D.whatsNew=!1};return _t(()=>D.whatsNew,async l=>{l&&(e.value||await i(),o.value=n.value.map(u=>u.version),r())}),(l,u)=>(w(),H(p(vt),null,{default:F(()=>[p(D).whatsNew?(w(),H(Ms,{key:0,title:"What's new","label-id":"whats-new-title",flush:"",onClose:a},Da({default:F(()=>{var c;return[p(s)?(w(),x("div",e1,P(p(s)),1)):O("",!0),(w(!0),x(it,null,ft((c=p(e))==null?void 0:c.versions,d=>{var h;return w(),x("article",{key:d.version,class:"whats-new__version"},[y("header",s1,[y("h4",n1,P(d.version),1),d.date?(w(),x("span",i1,P(d.date),1)):O("",!0),d.version===((h=p(e))==null?void 0:h.current)?(w(),x("span",o1,"Running")):O("",!0),o.value.includes(d.version)?(w(),x("span",r1,"New")):O("",!0)]),d.sections.length?(w(),H(qc,{key:0,source:p(Iy)(d)},null,8,["source"])):(w(),x("p",a1,"No notes for this version."))])}),128))]}),_:2},[p(e)?{name:"head",fn:F(()=>[y("span",t1,"Running "+P(p(e).current),1)]),key:"0"}:void 0]),1024)):O("",!0)]),_:1}))}}),c1=dt(l1,[["__scopeId","data-v-77166608"]]),u1={class:"app__shell"},d1={id:"wt",class:"dashboard dashboard--fit"},h1={key:0,id:"backdrop",class:"dashboard__backdrop","aria-hidden":"true"},f1=["inert"],p1={class:"dashboard__main"},m1=rt({__name:"App",setup(t){const e=I(()=>!!M.workspace.id&&!M.workspace.connectors.length),{size:s}=ko(()=>`${M.workspace.id}:feed`),n=I(()=>s.value===null?void 0:{"--feed-width":s.value+"px"}),{collapsed:i}=xo("feed"),r=So(),o=I(()=>Xa.value!==null);My(o),Vy(o),_t(Cn,Ro,{flush:"post"}),_t(()=>M.workspace.backdrop!==!1,Ro,{flush:"post"});const a={light:{fill:"#d8e2ff",ink:"#001a41",dot:"#2c5697"},dark:{fill:"#2b4678",ink:"#d8e2ff",dot:"#adc6ff"}},l=I(()=>{const{id:u,name:c}=M.workspace;if(!u)return null;const d=Cn.value,h=a[_s.value?"dark":"light"],f={fill:d["--md-primary-container"]||h.fill,ink:d["--md-on-primary-container"]||h.ink,dot:d["--md-primary"]||h.dot};return"data:image/svg+xml,"+encodeURIComponent(Ty(Nc({id:u,name:c},Ti),f))});return Vu(l),Ai("Escape",bd,{target:document}),ws(()=>{wd(),r.load()}),(u,c)=>(w(),H(p(gg),{"reduced-motion":"user","skip-animations":p(Ps)},{default:F(()=>[y("div",{class:"app",style:rs(p(Cn))},[q(iv,{inert:o.value,onSettings:c[0]||(c[0]=d=>p(D).monitor=!0),onAddWorkspace:c[1]||(c[1]=d=>p(_d)()),onWhatsNew:c[2]||(c[2]=d=>p(D).whatsNew=!0)},null,8,["inert"]),y("div",u1,[q(Rv,{inert:o.value,onReport:c[3]||(c[3]=d=>p(D).feedback=!0)},null,8,["inert"]),q(p(vt),null,{default:F(()=>[p(Io).length?(w(),H(p(wt),pt({key:0},p(St),{class:"alert",inert:o.value}),{default:F(()=>[lt(P(p(Io).join(" · "))+" ",1),y("button",{type:"button",class:"alert__action",onClick:c[4]||(c[4]=d=>p(Mi)())}," Open workspace settings ")]),_:1},16,["inert"])):O("",!0)]),_:1}),y("div",d1,[p(M).workspace.backdrop!==!1?(w(),x("canvas",h1)):O("",!0),q(s0,{inert:o.value},null,8,["inert"]),e.value?(w(),H(y_,{key:1,inert:o.value},null,8,["inert"])):(w(),x("div",{key:2,class:ht(["dashboard__layout",{"dashboard__layout--feed-folded":p(i)}]),style:rs(n.value),inert:o.value},[y("div",p1,[q(tw,{class:"dashboard__move"}),q(fw,{class:"dashboard__todo"}),q(Cw,{class:"dashboard__waiting"})]),q(f_,{class:"dashboard__feed",onOpen:c[5]||(c[5]=d=>p(D).modal=d)})],14,f1)),q(sb),q(zb),q(Qb),q(c1),q(M_),q(B_)])])],4)]),_:1},8,["skip-animations"]))}}),g1=dt(m1,[["__scopeId","data-v-567b132d"]]);mu(g1).mount("#app");Ad();Qu();
|