@chrome-acp/proxy-server 1.0.15 → 1.0.17
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/dist/server.d.ts.map +1 -1
- package/dist/server.js +12 -3
- package/dist/server.js.map +1 -1
- package/package.json +2 -3
- package/public/assets/{architectureDiagram-VXUJARFQ-ERfmZBZO.js → architectureDiagram-VXUJARFQ-B47Ndmy5.js} +2 -2
- package/public/assets/{architectureDiagram-VXUJARFQ-ERfmZBZO.js.map → architectureDiagram-VXUJARFQ-B47Ndmy5.js.map} +1 -1
- package/public/assets/{blockDiagram-VD42YOAC-Do2HjB0Z.js → blockDiagram-VD42YOAC-DHW2Yy3m.js} +2 -2
- package/public/assets/{blockDiagram-VD42YOAC-Do2HjB0Z.js.map → blockDiagram-VD42YOAC-DHW2Yy3m.js.map} +1 -1
- package/public/assets/{c4Diagram-YG6GDRKO-DJnxx7fH.js → c4Diagram-YG6GDRKO-DB1gnVDd.js} +2 -2
- package/public/assets/{c4Diagram-YG6GDRKO-DJnxx7fH.js.map → c4Diagram-YG6GDRKO-DB1gnVDd.js.map} +1 -1
- package/public/assets/channel--lAGecNa.js +2 -0
- package/public/assets/{channel-ByUlP8on.js.map → channel--lAGecNa.js.map} +1 -1
- package/public/assets/{chunk-ABZYJK2D-4V3xBx2D.js → chunk-ABZYJK2D-HgbyFrVX.js} +3 -3
- package/public/assets/{chunk-ABZYJK2D-4V3xBx2D.js.map → chunk-ABZYJK2D-HgbyFrVX.js.map} +1 -1
- package/public/assets/{chunk-ATLVNIR6-DCub4004.js → chunk-ATLVNIR6-BQ-FSJNL.js} +2 -2
- package/public/assets/{chunk-ATLVNIR6-DCub4004.js.map → chunk-ATLVNIR6-BQ-FSJNL.js.map} +1 -1
- package/public/assets/{chunk-B4BG7PRW-DH_dyws5.js → chunk-B4BG7PRW-CyTjkY1o.js} +2 -2
- package/public/assets/{chunk-B4BG7PRW-DH_dyws5.js.map → chunk-B4BG7PRW-CyTjkY1o.js.map} +1 -1
- package/public/assets/{chunk-DI55MBZ5-BdKNset0.js → chunk-DI55MBZ5-D-I-DYs-.js} +2 -2
- package/public/assets/{chunk-DI55MBZ5-BdKNset0.js.map → chunk-DI55MBZ5-D-I-DYs-.js.map} +1 -1
- package/public/assets/{chunk-EXTU4WIE-BhjM7T9E.js → chunk-EXTU4WIE-ClPY4-W1.js} +2 -2
- package/public/assets/{chunk-EXTU4WIE-BhjM7T9E.js.map → chunk-EXTU4WIE-ClPY4-W1.js.map} +1 -1
- package/public/assets/{chunk-JA3XYJ7Z-DFEpfAPm.js → chunk-JA3XYJ7Z-YYTBY02i.js} +2 -2
- package/public/assets/{chunk-JA3XYJ7Z-DFEpfAPm.js.map → chunk-JA3XYJ7Z-YYTBY02i.js.map} +1 -1
- package/public/assets/{chunk-JZLCHNYA--0HCyKSB.js → chunk-JZLCHNYA-D-Iiencc.js} +2 -2
- package/public/assets/{chunk-JZLCHNYA--0HCyKSB.js.map → chunk-JZLCHNYA-D-Iiencc.js.map} +1 -1
- package/public/assets/{chunk-N4CR4FBY-BbZEJGzH.js → chunk-N4CR4FBY-B--mrRvj.js} +3 -3
- package/public/assets/{chunk-N4CR4FBY-BbZEJGzH.js.map → chunk-N4CR4FBY-B--mrRvj.js.map} +1 -1
- package/public/assets/{chunk-QN33PNHL-BUlRs8Gu.js → chunk-QN33PNHL-Cui1-yfr.js} +2 -2
- package/public/assets/{chunk-QN33PNHL-BUlRs8Gu.js.map → chunk-QN33PNHL-Cui1-yfr.js.map} +1 -1
- package/public/assets/{chunk-QXUST7PY-t91kbxTi.js → chunk-QXUST7PY-YBa5hlIO.js} +2 -2
- package/public/assets/{chunk-QXUST7PY-t91kbxTi.js.map → chunk-QXUST7PY-YBa5hlIO.js.map} +1 -1
- package/public/assets/{chunk-S3R3BYOJ-DKNuA38_.js → chunk-S3R3BYOJ-Wd1A1moT.js} +2 -2
- package/public/assets/{chunk-S3R3BYOJ-DKNuA38_.js.map → chunk-S3R3BYOJ-Wd1A1moT.js.map} +1 -1
- package/public/assets/{chunk-TZMSLE5B-ZI5Is7DP.js → chunk-TZMSLE5B-Dvd5lWom.js} +2 -2
- package/public/assets/{chunk-TZMSLE5B-ZI5Is7DP.js.map → chunk-TZMSLE5B-Dvd5lWom.js.map} +1 -1
- package/public/assets/classDiagram-2ON5EDUG-CKK0a4Zs.js +2 -0
- package/public/assets/{classDiagram-2ON5EDUG-DvJh-abz.js.map → classDiagram-2ON5EDUG-CKK0a4Zs.js.map} +1 -1
- package/public/assets/classDiagram-v2-WZHVMYZB-B1Vm7gRS.js +2 -0
- package/public/assets/{classDiagram-v2-WZHVMYZB-DPnIn5s9.js.map → classDiagram-v2-WZHVMYZB-B1Vm7gRS.js.map} +1 -1
- package/public/assets/clone-zgtJV3S6.js +2 -0
- package/public/assets/{clone--vBohEtN.js.map → clone-zgtJV3S6.js.map} +1 -1
- package/public/assets/{code-block-IT6T5CEO-nC1YczKC.js → code-block-IT6T5CEO-GXnQl8M7.js} +2 -2
- package/public/assets/{code-block-IT6T5CEO-nC1YczKC.js.map → code-block-IT6T5CEO-GXnQl8M7.js.map} +1 -1
- package/public/assets/{dagre-6UL2VRFP-CUvrKiYW.js → dagre-6UL2VRFP-CNp3Eal9.js} +2 -2
- package/public/assets/{dagre-6UL2VRFP-CUvrKiYW.js.map → dagre-6UL2VRFP-CNp3Eal9.js.map} +1 -1
- package/public/assets/{dagre-yyBB715u.js → dagre-je-VuoV3.js} +2 -2
- package/public/assets/{dagre-yyBB715u.js.map → dagre-je-VuoV3.js.map} +1 -1
- package/public/assets/{diagram-PSM6KHXK-D1PbEKpY.js → diagram-PSM6KHXK-ZZhGRDjY.js} +2 -2
- package/public/assets/{diagram-PSM6KHXK-D1PbEKpY.js.map → diagram-PSM6KHXK-ZZhGRDjY.js.map} +1 -1
- package/public/assets/{diagram-QEK2KX5R-43BWK26_.js → diagram-QEK2KX5R-BRwEHJ9v.js} +2 -2
- package/public/assets/{diagram-QEK2KX5R-43BWK26_.js.map → diagram-QEK2KX5R-BRwEHJ9v.js.map} +1 -1
- package/public/assets/{diagram-S2PKOQOG-BqCGm98C.js → diagram-S2PKOQOG-DMxzSGyi.js} +2 -2
- package/public/assets/{diagram-S2PKOQOG-BqCGm98C.js.map → diagram-S2PKOQOG-DMxzSGyi.js.map} +1 -1
- package/public/assets/{erDiagram-Q2GNP2WA-DT8X0Bkj.js → erDiagram-Q2GNP2WA-p2z5m2J9.js} +2 -2
- package/public/assets/{erDiagram-Q2GNP2WA-DT8X0Bkj.js.map → erDiagram-Q2GNP2WA-p2z5m2J9.js.map} +1 -1
- package/public/assets/{flowDiagram-NV44I4VS-t9Tw5aTg.js → flowDiagram-NV44I4VS-lZL8iHMB.js} +2 -2
- package/public/assets/{flowDiagram-NV44I4VS-t9Tw5aTg.js.map → flowDiagram-NV44I4VS-lZL8iHMB.js.map} +1 -1
- package/public/assets/{ganttDiagram-JELNMOA3-BBKujC33.js → ganttDiagram-JELNMOA3-M6ETimdM.js} +2 -2
- package/public/assets/{ganttDiagram-JELNMOA3-BBKujC33.js.map → ganttDiagram-JELNMOA3-M6ETimdM.js.map} +1 -1
- package/public/assets/{gitGraphDiagram-NY62KEGX-9rrEkUeV.js → gitGraphDiagram-NY62KEGX-B8pIRXqX.js} +2 -2
- package/public/assets/{gitGraphDiagram-NY62KEGX-9rrEkUeV.js.map → gitGraphDiagram-NY62KEGX-B8pIRXqX.js.map} +1 -1
- package/public/assets/{graphlib-CDA3kMcX.js → graphlib-q5A9GXR_.js} +2 -2
- package/public/assets/{graphlib-CDA3kMcX.js.map → graphlib-q5A9GXR_.js.map} +1 -1
- package/public/assets/{infoDiagram-WHAUD3N6-BGL4Sxno.js → infoDiagram-WHAUD3N6-BDkuJktd.js} +2 -2
- package/public/assets/{infoDiagram-WHAUD3N6-BGL4Sxno.js.map → infoDiagram-WHAUD3N6-BDkuJktd.js.map} +1 -1
- package/public/assets/{journeyDiagram-XKPGCS4Q-CHcHWwKh.js → journeyDiagram-XKPGCS4Q-CEjj-_HO.js} +2 -2
- package/public/assets/{journeyDiagram-XKPGCS4Q-CHcHWwKh.js.map → journeyDiagram-XKPGCS4Q-CEjj-_HO.js.map} +1 -1
- package/public/assets/{kanban-definition-3W4ZIXB7-BMr9yQtH.js → kanban-definition-3W4ZIXB7-DbtQzM5J.js} +2 -2
- package/public/assets/{kanban-definition-3W4ZIXB7-BMr9yQtH.js.map → kanban-definition-3W4ZIXB7-DbtQzM5J.js.map} +1 -1
- package/public/assets/katex-CiqNjb1N.js +1 -0
- package/public/assets/{line-BxFlNVl2.js → line-B595UT0e.js} +2 -2
- package/public/assets/{line-BxFlNVl2.js.map → line-B595UT0e.js.map} +1 -1
- package/public/assets/{main-rtUrro6N.js → main-DbEuNKip.js} +6 -6
- package/public/assets/main-DbEuNKip.js.map +1 -0
- package/public/assets/{mermaid-VLURNSYL-Dt6lsMZf.js → mermaid-VLURNSYL-DEjZVUum.js} +1 -1
- package/public/assets/{mermaid.core-CHOGuA8G.js → mermaid.core-DpdbzASN.js} +4 -4
- package/public/assets/{mermaid.core-CHOGuA8G.js.map → mermaid.core-DpdbzASN.js.map} +1 -1
- package/public/assets/{mindmap-definition-VGOIOE7T-CQ3jo7T_.js → mindmap-definition-VGOIOE7T-BEy7XXtV.js} +2 -2
- package/public/assets/{mindmap-definition-VGOIOE7T-CQ3jo7T_.js.map → mindmap-definition-VGOIOE7T-BEy7XXtV.js.map} +1 -1
- package/public/assets/{pieDiagram-ADFJNKIX-BskQ5vji.js → pieDiagram-ADFJNKIX-BCijKn09.js} +2 -2
- package/public/assets/{pieDiagram-ADFJNKIX-BskQ5vji.js.map → pieDiagram-ADFJNKIX-BCijKn09.js.map} +1 -1
- package/public/assets/{quadrantDiagram-AYHSOK5B-Bim0kCz4.js → quadrantDiagram-AYHSOK5B-DXS57dMS.js} +2 -2
- package/public/assets/{quadrantDiagram-AYHSOK5B-Bim0kCz4.js.map → quadrantDiagram-AYHSOK5B-DXS57dMS.js.map} +1 -1
- package/public/assets/{requirementDiagram-UZGBJVZJ-BThYhHgo.js → requirementDiagram-UZGBJVZJ-B0NPSe12.js} +2 -2
- package/public/assets/{requirementDiagram-UZGBJVZJ-BThYhHgo.js.map → requirementDiagram-UZGBJVZJ-B0NPSe12.js.map} +1 -1
- package/public/assets/{sankeyDiagram-TZEHDZUN-Cu7jxbPR.js → sankeyDiagram-TZEHDZUN-Dl64TeN-.js} +2 -2
- package/public/assets/{sankeyDiagram-TZEHDZUN-Cu7jxbPR.js.map → sankeyDiagram-TZEHDZUN-Dl64TeN-.js.map} +1 -1
- package/public/assets/{sequenceDiagram-WL72ISMW-CYpkyiQa.js → sequenceDiagram-WL72ISMW-DQvpFwrV.js} +2 -2
- package/public/assets/{sequenceDiagram-WL72ISMW-CYpkyiQa.js.map → sequenceDiagram-WL72ISMW-DQvpFwrV.js.map} +1 -1
- package/public/assets/{stateDiagram-FKZM4ZOC-CpduAaAE.js → stateDiagram-FKZM4ZOC-BQ3MkoI5.js} +2 -2
- package/public/assets/{stateDiagram-FKZM4ZOC-CpduAaAE.js.map → stateDiagram-FKZM4ZOC-BQ3MkoI5.js.map} +1 -1
- package/public/assets/stateDiagram-v2-4FDKWEC3-jQFwl8yw.js +2 -0
- package/public/assets/{stateDiagram-v2-4FDKWEC3-BbGisRuk.js.map → stateDiagram-v2-4FDKWEC3-jQFwl8yw.js.map} +1 -1
- package/public/assets/{timeline-definition-IT6M3QCI-zPIkl5WF.js → timeline-definition-IT6M3QCI-B73sqQEY.js} +2 -2
- package/public/assets/{timeline-definition-IT6M3QCI-zPIkl5WF.js.map → timeline-definition-IT6M3QCI-B73sqQEY.js.map} +1 -1
- package/public/assets/{xychartDiagram-PRI3JC2R-BqEbqHoy.js → xychartDiagram-PRI3JC2R-BT9nxs4e.js} +2 -2
- package/public/assets/{xychartDiagram-PRI3JC2R-BqEbqHoy.js.map → xychartDiagram-PRI3JC2R-BT9nxs4e.js.map} +1 -1
- package/public/index.html +1 -1
- package/public/sw.js +1 -1
- package/public/assets/channel-ByUlP8on.js +0 -2
- package/public/assets/classDiagram-2ON5EDUG-DvJh-abz.js +0 -2
- package/public/assets/classDiagram-v2-WZHVMYZB-DPnIn5s9.js +0 -2
- package/public/assets/clone--vBohEtN.js +0 -2
- package/public/assets/katex-BXZ6-Hmb.js +0 -1
- package/public/assets/main-rtUrro6N.js.map +0 -1
- package/public/assets/stateDiagram-v2-4FDKWEC3-BbGisRuk.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-DpdbzASN.js","assets/shiki-BE3D5Aiv.js","assets/rolldown-runtime-jAP2zfWt.js","assets/dist-CINaey7q.js","assets/chunk-JA3XYJ7Z-YYTBY02i.js","assets/src-CK1-XQNk.js","assets/chunk-S3R3BYOJ-Wd1A1moT.js","assets/math-DYgObbJ6.js","assets/chunk-ABZYJK2D-HgbyFrVX.js","assets/_baseFor-OepriVua.js","assets/isEmpty-_5bEsqJf.js","assets/chunk-ATLVNIR6-BQ-FSJNL.js","assets/chunk-CVBHYZKI-D5XSWNoQ.js","assets/chunk-EXTU4WIE-ClPY4-W1.js","assets/chunk-HN2XXSSU-CNPMRzR_.js","assets/chunk-JZLCHNYA-D-Iiencc.js","assets/chunk-MI3HLSF2-uJR7wcvf.js","assets/chunk-N4CR4FBY-B--mrRvj.js","assets/chunk-QXUST7PY-YBa5hlIO.js","assets/line-B595UT0e.js","assets/path-Bn8S1d5m.js","assets/array-rFRq91wH.js","assets/chunk-XAJISQIX-BsYFeKst.js","assets/code-block-IT6T5CEO-GXnQl8M7.js","assets/react-DC6mq9sj.js","assets/mermaid-VLURNSYL-DEjZVUum.js","assets/katex-CFjS3_y4.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{a as e,n as t,o as n,r,t as i}from"./rolldown-runtime-jAP2zfWt.js";import{d as a,p as o,u as s}from"./react-DC6mq9sj.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as ee}from"./radix-CWcw-_TU.js";import{_ as C,c as te,d as ne,f as re,g as ie,h as ae,l as oe,m as se,o as ce,p as le,r as w,s as ue,u as de,v as fe,y as pe}from"./shiki-BE3D5Aiv.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var me=a(),T=n(o(),1);function he(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=he(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function ge(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=he(e))&&(r&&(r+=` `),r+=t);return r}var _e=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e;const ve=ge,ye=(e,t)=>n=>{if(t?.variants==null)return ve(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=_e(t)||_e(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ve(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};var be=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},xe=(e,t)=>({classGroupId:e,validator:t}),Se=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ce=`-`,we=[],Te=`arbitrary..`,Ee=e=>{let t=ke(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Oe(e);let n=e.split(Ce);return De(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?be(i,t):t:i||we}return n[e]||we}}},De=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=De(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ce):e.slice(t).join(Ce),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Oe=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Te+r:void 0})(),ke=e=>{let{theme:t,classGroups:n}=e;return Ae(n,t)},Ae=(e,t)=>{let n=Se();for(let r in e){let i=e[r];je(i,n,r,t)}return n},je=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Me(i,t,n,r)}},Me=(e,t,n,r)=>{if(typeof e==`string`){Ne(e,t,n);return}if(typeof e==`function`){Pe(e,t,n,r);return}Fe(e,t,n,r)},Ne=(e,t,n)=>{let r=e===``?t:Ie(t,e);r.classGroupId=n},Pe=(e,t,n,r)=>{if(Le(e)){je(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(xe(n,e))},Fe=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];je(o,Ie(t,a),n,r)}},Ie=(e,t)=>{let n=e,r=t.split(Ce),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Se(),n.nextPart.set(t,i)),n=i}return n},Le=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Re=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ze=`!`,Be=`:`,Ve=[],He=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ue=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Be){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ze)?(c=s.slice(0,-1),l=!0):s.startsWith(ze)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return He(t,l,c,u)};if(t){let e=t+Be,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):He(Ve,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},We=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ge=e=>({cache:Re(e.cacheSize),parseClassName:Ue(e),sortModifiers:We(e),...Ee(e)}),Ke=/\s+/,qe=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Ke),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+ze:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},Je=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Ye(n))&&(i&&(i+=` `),i+=r);return i},Ye=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Ye(e[r]))&&(n&&(n+=` `),n+=t);return n},Xe=(e,...t)=>{let n,r,i,a,o=o=>(n=Ge(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=qe(e,n);return i(e,a),a};return a=o,(...e)=>a(Je(...e))},Ze=[],Qe=e=>{let t=t=>t[e]||Ze;return t.isThemeGetter=!0,t},$e=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,et=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tt=/^\d+\/\d+$/,nt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,it=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,at=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ot=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,st=e=>tt.test(e),ct=e=>!!e&&!Number.isNaN(Number(e)),lt=e=>!!e&&Number.isInteger(Number(e)),ut=e=>e.endsWith(`%`)&&ct(e.slice(0,-1)),dt=e=>nt.test(e),ft=()=>!0,pt=e=>rt.test(e)&&!it.test(e),mt=()=>!1,ht=e=>at.test(e),gt=e=>ot.test(e),_t=e=>!E(e)&&!D(e),vt=e=>At(e,Pt,mt),E=e=>$e.test(e),yt=e=>At(e,Ft,pt),bt=e=>At(e,It,ct),xt=e=>At(e,Mt,mt),St=e=>At(e,Nt,gt),Ct=e=>At(e,Rt,ht),D=e=>et.test(e),wt=e=>jt(e,Ft),Tt=e=>jt(e,Lt),Et=e=>jt(e,Mt),Dt=e=>jt(e,Pt),Ot=e=>jt(e,Nt),kt=e=>jt(e,Rt,!0),At=(e,t,n)=>{let r=$e.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},jt=(e,t,n=!1)=>{let r=et.exec(e);return r?r[1]?t(r[1]):n:!1},Mt=e=>e===`position`||e===`percentage`,Nt=e=>e===`image`||e===`url`,Pt=e=>e===`length`||e===`size`||e===`bg-size`,Ft=e=>e===`length`,It=e=>e===`number`,Lt=e=>e===`family-name`,Rt=e=>e===`shadow`,zt=Xe(()=>{let e=Qe(`color`),t=Qe(`font`),n=Qe(`text`),r=Qe(`font-weight`),i=Qe(`tracking`),a=Qe(`leading`),o=Qe(`breakpoint`),s=Qe(`container`),c=Qe(`spacing`),l=Qe(`radius`),u=Qe(`shadow`),d=Qe(`inset-shadow`),f=Qe(`text-shadow`),p=Qe(`drop-shadow`),m=Qe(`blur`),h=Qe(`perspective`),g=Qe(`aspect`),_=Qe(`ease`),v=Qe(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),D,E],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],ee=()=>[`auto`,`contain`,`none`],C=()=>[D,E,c],te=()=>[st,`full`,`auto`,...C()],ne=()=>[lt,`none`,`subgrid`,D,E],re=()=>[`auto`,{span:[`full`,lt,D,E]},lt,D,E],ie=()=>[lt,`auto`,D,E],ae=()=>[`auto`,`min`,`max`,`fr`,D,E],oe=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],se=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ce=()=>[`auto`,...C()],le=()=>[st,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],w=()=>[e,D,E],ue=()=>[...b(),Et,xt,{position:[D,E]}],de=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],fe=()=>[`auto`,`cover`,`contain`,Dt,vt,{size:[D,E]}],pe=()=>[ut,wt,yt],me=()=>[``,`none`,`full`,l,D,E],T=()=>[``,ct,wt,yt],he=()=>[`solid`,`dashed`,`dotted`,`double`],ge=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],_e=()=>[ct,ut,Et,xt],ve=()=>[``,`none`,m,D,E],ye=()=>[`none`,ct,D,E],be=()=>[`none`,ct,D,E],xe=()=>[ct,D,E],Se=()=>[st,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[dt],breakpoint:[dt],color:[ft],container:[dt],"drop-shadow":[dt],ease:[`in`,`out`,`in-out`],font:[_t],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[dt],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[dt],shadow:[dt],spacing:[`px`,ct],text:[dt],"text-shadow":[dt],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,st,E,D,g]}],container:[`container`],columns:[{columns:[ct,E,D,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{start:te()}],end:[{end:te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[lt,`auto`,D,E]}],basis:[{basis:[st,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[ct,st,`auto`,`initial`,`none`,E]}],grow:[{grow:[``,ct,D,E]}],shrink:[{shrink:[``,ct,D,E]}],order:[{order:[lt,`first`,`last`,`none`,D,E]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...oe(),`normal`]}],"justify-items":[{"justify-items":[...se(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...se()]}],"align-content":[{content:[`normal`,...oe()]}],"align-items":[{items:[...se(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...se(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...se(),`baseline`]}],"place-self":[{"place-self":[`auto`,...se()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:ce()}],mx:[{mx:ce()}],my:[{my:ce()}],ms:[{ms:ce()}],me:[{me:ce()}],mt:[{mt:ce()}],mr:[{mr:ce()}],mb:[{mb:ce()}],ml:[{ml:ce()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:le()}],w:[{w:[s,`screen`,...le()]}],"min-w":[{"min-w":[s,`screen`,`none`,...le()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...le()]}],h:[{h:[`screen`,`lh`,...le()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...le()]}],"max-h":[{"max-h":[`screen`,`lh`,...le()]}],"font-size":[{text:[`base`,n,wt,yt]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,D,bt]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ut,E]}],"font-family":[{font:[Tt,E,t]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,D,E]}],"line-clamp":[{"line-clamp":[ct,`none`,D,bt]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,D,E]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,D,E]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:w()}],"text-color":[{text:w()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...he(),`wavy`]}],"text-decoration-thickness":[{decoration:[ct,`from-font`,`auto`,D,yt]}],"text-decoration-color":[{decoration:w()}],"underline-offset":[{"underline-offset":[ct,`auto`,D,E]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,D,E]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,D,E]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ue()}],"bg-repeat":[{bg:de()}],"bg-size":[{bg:fe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},lt,D,E],radial:[``,D,E],conic:[lt,D,E]},Ot,St]}],"bg-color":[{bg:w()}],"gradient-from-pos":[{from:pe()}],"gradient-via-pos":[{via:pe()}],"gradient-to-pos":[{to:pe()}],"gradient-from":[{from:w()}],"gradient-via":[{via:w()}],"gradient-to":[{to:w()}],rounded:[{rounded:me()}],"rounded-s":[{"rounded-s":me()}],"rounded-e":[{"rounded-e":me()}],"rounded-t":[{"rounded-t":me()}],"rounded-r":[{"rounded-r":me()}],"rounded-b":[{"rounded-b":me()}],"rounded-l":[{"rounded-l":me()}],"rounded-ss":[{"rounded-ss":me()}],"rounded-se":[{"rounded-se":me()}],"rounded-ee":[{"rounded-ee":me()}],"rounded-es":[{"rounded-es":me()}],"rounded-tl":[{"rounded-tl":me()}],"rounded-tr":[{"rounded-tr":me()}],"rounded-br":[{"rounded-br":me()}],"rounded-bl":[{"rounded-bl":me()}],"border-w":[{border:T()}],"border-w-x":[{"border-x":T()}],"border-w-y":[{"border-y":T()}],"border-w-s":[{"border-s":T()}],"border-w-e":[{"border-e":T()}],"border-w-t":[{"border-t":T()}],"border-w-r":[{"border-r":T()}],"border-w-b":[{"border-b":T()}],"border-w-l":[{"border-l":T()}],"divide-x":[{"divide-x":T()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":T()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...he(),`hidden`,`none`]}],"divide-style":[{divide:[...he(),`hidden`,`none`]}],"border-color":[{border:w()}],"border-color-x":[{"border-x":w()}],"border-color-y":[{"border-y":w()}],"border-color-s":[{"border-s":w()}],"border-color-e":[{"border-e":w()}],"border-color-t":[{"border-t":w()}],"border-color-r":[{"border-r":w()}],"border-color-b":[{"border-b":w()}],"border-color-l":[{"border-l":w()}],"divide-color":[{divide:w()}],"outline-style":[{outline:[...he(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[ct,D,E]}],"outline-w":[{outline:[``,ct,wt,yt]}],"outline-color":[{outline:w()}],shadow:[{shadow:[``,`none`,u,kt,Ct]}],"shadow-color":[{shadow:w()}],"inset-shadow":[{"inset-shadow":[`none`,d,kt,Ct]}],"inset-shadow-color":[{"inset-shadow":w()}],"ring-w":[{ring:T()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:w()}],"ring-offset-w":[{"ring-offset":[ct,yt]}],"ring-offset-color":[{"ring-offset":w()}],"inset-ring-w":[{"inset-ring":T()}],"inset-ring-color":[{"inset-ring":w()}],"text-shadow":[{"text-shadow":[`none`,f,kt,Ct]}],"text-shadow-color":[{"text-shadow":w()}],opacity:[{opacity:[ct,D,E]}],"mix-blend":[{"mix-blend":[...ge(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[ct]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":w()}],"mask-image-linear-to-color":[{"mask-linear-to":w()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":w()}],"mask-image-t-to-color":[{"mask-t-to":w()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":w()}],"mask-image-r-to-color":[{"mask-r-to":w()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":w()}],"mask-image-b-to-color":[{"mask-b-to":w()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":w()}],"mask-image-l-to-color":[{"mask-l-to":w()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":w()}],"mask-image-x-to-color":[{"mask-x-to":w()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":w()}],"mask-image-y-to-color":[{"mask-y-to":w()}],"mask-image-radial":[{"mask-radial":[D,E]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":w()}],"mask-image-radial-to-color":[{"mask-radial-to":w()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ct]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":w()}],"mask-image-conic-to-color":[{"mask-conic-to":w()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ue()}],"mask-repeat":[{mask:de()}],"mask-size":[{mask:fe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,D,E]}],filter:[{filter:[``,`none`,D,E]}],blur:[{blur:ve()}],brightness:[{brightness:[ct,D,E]}],contrast:[{contrast:[ct,D,E]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,kt,Ct]}],"drop-shadow-color":[{"drop-shadow":w()}],grayscale:[{grayscale:[``,ct,D,E]}],"hue-rotate":[{"hue-rotate":[ct,D,E]}],invert:[{invert:[``,ct,D,E]}],saturate:[{saturate:[ct,D,E]}],sepia:[{sepia:[``,ct,D,E]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,D,E]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[ct,D,E]}],"backdrop-contrast":[{"backdrop-contrast":[ct,D,E]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,ct,D,E]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,D,E]}],"backdrop-invert":[{"backdrop-invert":[``,ct,D,E]}],"backdrop-opacity":[{"backdrop-opacity":[ct,D,E]}],"backdrop-saturate":[{"backdrop-saturate":[ct,D,E]}],"backdrop-sepia":[{"backdrop-sepia":[``,ct,D,E]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,D,E]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[ct,`initial`,D,E]}],ease:[{ease:[`linear`,`initial`,_,D,E]}],delay:[{delay:[ct,D,E]}],animate:[{animate:[`none`,v,D,E]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,D,E]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":[`scale-3d`],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[D,E,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":[`translate-none`],accent:[{accent:w()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:w()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,D,E]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,D,E]}],fill:[{fill:[`none`,...w()]}],"stroke-w":[{stroke:[ct,wt,yt,bt]}],stroke:[{stroke:[`none`,...w()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Bt(...e){return zt(ge(e))}var O=n(s(),1),Vt=ye(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Ht({className:e,variant:t,size:n,asChild:r=!1,...i}){return(0,O.jsx)(r?f:`button`,{"data-slot":`button`,className:Bt(Vt({variant:t,size:n,className:e})),...i})}function Ut({className:e,type:t,...n}){return(0,O.jsx)(`input`,{type:t,"data-slot":`input`,className:Bt(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,e),...n})}function Wt({className:e,...t}){return(0,O.jsx)(p,{"data-slot":`label`,className:Bt(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function Gt({className:e,...t}){return(0,O.jsx)(`div`,{"data-slot":`card`,className:Bt(`bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm`,e),...t})}function Kt({className:e,...t}){return(0,O.jsx)(`div`,{"data-slot":`card-header`,className:Bt(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function qt({className:e,...t}){return(0,O.jsx)(`div`,{"data-slot":`card-title`,className:Bt(`leading-none font-semibold`,e),...t})}function Jt({className:e,...t}){return(0,O.jsx)(`div`,{"data-slot":`card-content`,className:Bt(`px-6`,e),...t})}const Yt={proxyUrl:`ws://localhost:9315/ws`};var Xt=class{ws=null;settings;connectionState=`disconnected`;sessionId=null;_promptCapabilities=null;onConnectionStateChange=null;onSessionUpdate=null;onSessionCreated=null;onPromptComplete=null;onPermissionRequest=null;onBrowserToolCall=null;connectResolve=null;connectReject=null;constructor(e){this.settings=e}updateSettings(e){this.settings=e}setConnectionStateHandler(e){this.onConnectionStateChange=e}setSessionUpdateHandler(e){this.onSessionUpdate=e}setSessionCreatedHandler(e){this.onSessionCreated=e}setPromptCompleteHandler(e){this.onPromptComplete=e}setPermissionRequestHandler(e){this.onPermissionRequest=e}setBrowserToolCallHandler(e){this.onBrowserToolCall=e}setState(e,t){this.connectionState=e,this.onConnectionStateChange?.(e,t)}getState(){return this.connectionState}getSessionId(){return this.sessionId}get supportsImages(){return this._promptCapabilities?.image===!0}getPromptCapabilities(){return this._promptCapabilities}async connect(){return this.ws&&this.disconnect(),this.setState(`connecting`),new Promise((e,t)=>{this.connectResolve=e,this.connectReject=t;try{this.ws=new WebSocket(this.settings.proxyUrl),this.ws.onopen=()=>{console.log(`[ACPClient] WebSocket connected, sending connect command`),this.send({type:`connect`})},this.ws.onmessage=e=>{try{let t=JSON.parse(e.data);this.handleResponse(t)}catch(e){console.error(`[ACPClient] Failed to parse message:`,e)}},this.ws.onerror=()=>{console.error(`[ACPClient] WebSocket error`),this.setState(`error`,`WebSocket connection error`),this.connectReject?.(Error(`WebSocket connection error`)),this.connectResolve=null,this.connectReject=null},this.ws.onclose=()=>{console.log(`[ACPClient] WebSocket closed`),this.setState(`disconnected`),this.ws=null,this.sessionId=null}}catch(e){this.setState(`error`,e.message),t(e)}})}handleResponse(e){switch(console.log(`[ACPClient] Received:`,e.type),e.type){case`status`:e.payload.connected?(this.setState(`connected`),this.connectResolve?.()):this.setState(`disconnected`),this.connectResolve=null,this.connectReject=null;break;case`error`:console.error(`[ACPClient] Error:`,e.payload.message),this.connectReject?.(Error(e.payload.message)),this.connectResolve=null,this.connectReject=null;break;case`session_created`:this.sessionId=e.payload.sessionId,this._promptCapabilities=e.payload.promptCapabilities??null,console.log(`[ACPClient] Session created, promptCapabilities:`,this._promptCapabilities),this.onSessionCreated?.(e.payload.sessionId);break;case`session_update`:this.onSessionUpdate?.(e.payload.update);break;case`prompt_complete`:this.onPromptComplete?.(e.payload.stopReason);break;case`permission_request`:console.log(`[ACPClient] Permission request:`,e.payload),this.onPermissionRequest?.(e.payload);break;case`browser_tool_call`:this.handleBrowserToolCall(e.callId,e.params);break}}async handleBrowserToolCall(e,t){if(console.log(`[ACPClient] Browser tool call:`,e,t),!this.onBrowserToolCall){console.error(`[ACPClient] No browser tool handler registered`),this.send({type:`browser_tool_result`,callId:e,result:{error:`No browser tool handler registered`}});return}try{let n=await this.onBrowserToolCall(t);this.send({type:`browser_tool_result`,callId:e,result:n})}catch(t){console.error(`[ACPClient] Browser tool error:`,t),this.send({type:`browser_tool_result`,callId:e,result:{error:t.message}})}}send(e){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw Error(`WebSocket not connected`);this.ws.send(JSON.stringify(e))}async createSession(e){this.send({type:`new_session`,payload:{cwd:e}})}async sendPrompt(e){if(!this.sessionId)throw Error(`No active session`);let t=typeof e==`string`?[{type:`text`,text:e}]:e;this.send({type:`prompt`,payload:{content:t}})}cancel(){this.send({type:`cancel`})}respondToPermission(e,t){let n=t?{outcome:`selected`,optionId:t}:{outcome:`cancelled`};this.send({type:`permission_response`,payload:{requestId:e,outcome:n}})}disconnect(){if(this.ws){try{this.send({type:`disconnect`})}catch{}this.ws.close(),this.ws=null}this.setState(`disconnected`),this.sessionId=null}},Zt=`acp_settings`;function Qt(){try{let e=localStorage.getItem(Zt);if(e)return{...Yt,...JSON.parse(e)}}catch(e){console.error(`Failed to load settings:`,e)}return Yt}function $t(e){localStorage.setItem(Zt,JSON.stringify(e))}function en({onClientReady:e,onConnectionStateChange:t}){let[n,r]=(0,T.useState)(Qt),[i,a]=(0,T.useState)(`disconnected`),[o,s]=(0,T.useState)(null),[c,l]=(0,T.useState)(null);(0,T.useEffect)(()=>{let e=new Xt(n);return e.setConnectionStateHandler((e,t)=>{a(e),s(t||null)}),l(e),()=>{e.disconnect()}},[]),(0,T.useEffect)(()=>{c&&(c.updateSettings(n),$t(n))},[n,c]),(0,T.useEffect)(()=>{e?.(i===`connected`?c:null)},[i,c,e]),(0,T.useEffect)(()=>{t?.(i,n.proxyUrl)},[i,n.proxyUrl,t]);let u=(0,T.useCallback)(async()=>{if(c){s(null);try{await c.connect()}catch(e){s(e.message)}}},[c]),d=(0,T.useCallback)(()=>{c?.disconnect()},[c]),f=(e,t)=>{r(n=>({...n,[e]:t}))},p=i===`connected`,m=i===`connecting`;return(0,O.jsxs)(Gt,{children:[(0,O.jsx)(Kt,{children:(0,O.jsxs)(qt,{className:`flex items-center justify-between`,children:[(0,O.jsx)(`span`,{children:`ACP Connection`}),(0,O.jsx)(tn,{state:i})]})}),(0,O.jsxs)(Jt,{className:`space-y-4`,children:[(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsx)(Wt,{htmlFor:`proxyUrl`,children:`Proxy URL`}),(0,O.jsx)(Ut,{id:`proxyUrl`,value:n.proxyUrl,onChange:e=>f(`proxyUrl`,e.target.value),placeholder:`ws://localhost:9315/ws`,disabled:p||m})]}),o&&(0,O.jsx)(`div`,{className:`text-sm text-destructive bg-destructive/10 p-2 rounded`,children:o}),(0,O.jsx)(`div`,{className:`flex gap-2`,children:p?(0,O.jsx)(Ht,{onClick:d,variant:`destructive`,className:`flex-1`,children:`Disconnect`}):(0,O.jsx)(Ht,{onClick:u,disabled:m,className:`flex-1`,children:m?`Connecting...`:`Connect`})})]})]})}function tn({state:e}){return(0,O.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-normal`,children:[(0,O.jsx)(`span`,{className:`w-2 h-2 rounded-full ${{disconnected:`bg-gray-400`,connecting:`bg-yellow-400 animate-pulse`,connected:`bg-green-500`,error:`bg-red-500`}[e]}`}),e]})}var nn=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),rn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),an=e=>{let t=rn(e);return t.charAt(0).toUpperCase()+t.slice(1)},on=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),sn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},cn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ln=(0,T.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,T.createElement)(`svg`,{ref:c,...cn,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:on(`lucide`,i),...!a&&!sn(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,T.createElement)(e,t)),...Array.isArray(a)?a:[a]])),un=(e,t)=>{let n=(0,T.forwardRef)(({className:n,...r},i)=>(0,T.createElement)(ln,{ref:i,iconNode:t,className:on(`lucide-${nn(an(e))}`,`lucide-${e}`,n),...r}));return n.displayName=an(e),n},dn=un(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),fn=un(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),pn=un(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),mn=un(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),hn=un(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),gn=un(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),_n=un(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),vn=un(`clock`,[[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),yn=un(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),bn=un(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),xn=un(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Sn=un(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Cn=un(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),wn=un(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Tn=un(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),En=un(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Dn=un(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),On={damping:.7,stiffness:.05,mass:1.25},kn=70,An=1e3/60,jn=350,Mn=!1;globalThis.document?.addEventListener(`mousedown`,()=>{Mn=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{Mn=!1}),globalThis.document?.addEventListener(`click`,()=>{Mn=!1});const Nn=(e={})=>{let[t,n]=(0,T.useState)(!1),[r,i]=(0,T.useState)(e.initial!==!1),[a,o]=(0,T.useState)(!1),s=(0,T.useRef)(null);s.current=e;let c=(0,T.useCallback)(()=>{if(!Mn)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,T.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,T.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,T.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){g.current&&(g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop)},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=kn}}},[]),f=(0,T.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=In(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/An;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:In(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,T.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,T.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,T.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=Pn(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=Pn(e=>{if(d.resizeObserver?.disconnect(),!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=In(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:jn})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function Pn(e,t){let n=(0,T.useCallback)(t=>(n.current=t,e(t)),t);return n}var Fn=new Map;function In(...e){let t={...On},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return Fn.has(r)||Fn.set(r,Object.freeze(t)),n?`instant`:Fn.get(r)}var Ln=(0,T.createContext)(null),Rn=typeof window<`u`?T.useLayoutEffect:T.useEffect;function zn({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,T.useRef)(null),d=Nn({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:T.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,T.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,T.useImperativeHandle)(c,()=>y,[y]),Rn(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),T.createElement(Ln.Provider,{value:y},T.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=Bn();return T.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},T.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(zn||={});function Bn(){let e=(0,T.useContext)(Ln);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}const Vn=({className:e,...t})=>(0,O.jsx)(zn,{className:Bt(`relative flex-1 overflow-y-hidden overflow-x-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),Hn=({className:e,...t})=>(0,O.jsx)(zn.Content,{className:Bt(`flex flex-col gap-8 p-4 min-w-0`,e),...t}),Un=({className:e,title:t=`No messages yet`,description:n=`Start a conversation to see messages here`,icon:r,children:i,...a})=>(0,O.jsx)(`div`,{className:Bt(`flex size-full flex-col items-center justify-center gap-3 p-8 text-center`,e),...a,children:i??(0,O.jsxs)(O.Fragment,{children:[r&&(0,O.jsx)(`div`,{className:`text-muted-foreground`,children:r}),(0,O.jsxs)(`div`,{className:`space-y-1`,children:[(0,O.jsx)(`h3`,{className:`font-medium text-sm`,children:t}),n&&(0,O.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:n})]})]})}),Wn=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=Bn(),i=(0,T.useCallback)(()=>{r()},[r]);return!n&&(0,O.jsx)(Ht,{className:Bt(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,O.jsx)(dn,{className:`size-4`})})};function Gn({delayDuration:e=0,...t}){return(0,O.jsx)(u,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Kn({...e}){return(0,O.jsx)(Gn,{children:(0,O.jsx)(d,{"data-slot":`tooltip`,...e})})}function qn({...e}){return(0,O.jsx)(y,{"data-slot":`tooltip-trigger`,...e})}function Jn({className:e,sideOffset:t=0,children:n,...r}){return(0,O.jsx)(ee,{children:(0,O.jsxs)(h,{"data-slot":`tooltip-content`,sideOffset:t,className:Bt(`bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance`,e),...r,children:[n,(0,O.jsx)(l,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})})}const Yn=(function(e){if(e==null)return er;if(typeof e==`function`)return $n(e);if(typeof e==`object`)return Array.isArray(e)?Xn(e):Zn(e);if(typeof e==`string`)return Qn(e);throw Error(`Expected function, string, or object as test`)});function Xn(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Yn(e[n]);return $n(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Zn(e){let t=e;return $n(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Qn(e){return $n(t);function t(t){return t&&t.type===e}}function $n(e){return t;function t(t,n,r){return!!(tr(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function er(){return!0}function tr(e){return typeof e==`object`&&!!e&&`type`in e}function nr(e){return e}var rr=[];const ir=`skip`;function ar(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Yn(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+nr(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=rr,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=or(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function or(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?rr:[e]}function sr(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),ar(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function cr({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`}){let s=t.length&&!t.every(e=>e===`*`),c=n.length&&!n.every(e=>e===`*`);if(!e&&(s||c))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return s=>{sr(s,hr(e,t,n,r,i,a,o))}}function lr(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function ur(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var dr=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),fr=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function pr(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=lr(e,n);if(!o||fr.has(o.protocol)||!(dr.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=ur(e);return o&&t.some(e=>{let t=lr(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}var mr=Symbol(`node-seen`),hr=(e,t,n,r,i,a,o)=>{let s=(c,l,u)=>{if(c.type!==`element`||c[mr])return!0;if(c.tagName===`a`){let n=pr(c.properties.href,t,e,!1,!1,i);return n===null?(c[mr]=!0,sr(c,s),u&&typeof l==`number`&&(u.children[l]={type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(c.properties.href),class:o},children:[...c.children,{type:`text`,value:` [blocked]`}]}),ir):(c.properties.href=n,c.properties.target=`_blank`,c.properties.rel=`noopener noreferrer`,!0)}if(c.tagName===`img`){let t=pr(c.properties.src,n,e,r,!0,i);return t===null?(c[mr]=!0,sr(c,s),u&&typeof l==`number`&&(u.children[l]={type:`element`,tagName:`span`,properties:{class:a},children:[{type:`text`,value:`[Image blocked: `+String(c.properties.alt||`No description`)+`]`}]}),ir):(c.properties.src=t,!0)}return!0};return s},gr=/[#.]/g;function _r(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){gr.lastIndex=i;let e=gr.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function vr(e,t,n){let r=n?wr(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=_r(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,yr(i))a.unshift(i);else for(let[t,n]of Object.entries(i))br(e,o.properties,t,n)}for(let e of a)xr(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function yr(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function br(e,t,n,r){let i=C(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?ne(r):i.commaSeparated?le(r):i.commaOrSpaceSeparated?ne(le(r).join(` `)):Sr(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?Cr(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(Sr(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function xr(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)xr(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?xr(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function Sr(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||pe(n)===pe(t)))return!0}return n}function Cr(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function wr(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}const Tr=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.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.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),Er=vr(ae,`div`),Dr=vr(ie,`g`,Tr),Or={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function kr(e,t){return Ar(e,t||{})||{type:`root`,children:[]}}function Ar(e,t){let n=jr(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function jr(e,t){switch(e.nodeType){case 1:return Ir(e,t);case 3:return Pr(e);case 8:return Fr(e);case 9:return Mr(e,t);case 10:return Nr();case 11:return Mr(e,t);default:return}}function Mr(e,t){return{type:`root`,children:Lr(e,t)}}function Nr(){return{type:`doctype`}}function Pr(e){return{type:`text`,value:e.nodeValue||``}}function Fr(e){return{type:`comment`,value:e.nodeValue||``}}function Ir(e,t){let n=e.namespaceURI,r=n===Or.svg?Dr:Er,i=n===Or.html?e.tagName.toLowerCase():e.tagName,a=n===Or.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,Lr(a,t))}function Lr(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=Ar(n[i],t);e!==void 0&&r.push(e)}return r}var Rr=new DOMParser;function zr(e,t){return kr(t?.fragment?Br(e):Rr.parseFromString(e,`text/html`))}function Br(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}const Vr=(function(e,t,n){let r=Yn(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Hr=(function(e){if(e==null)return Kr;if(typeof e==`string`)return Wr(e);if(typeof e==`object`)return Ur(e);if(typeof e==`function`)return Gr(e);throw Error("Expected function, string, or array as `test`")});function Ur(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Hr(e[n]);return Gr(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Wr(e){return Gr(t);function t(t){return t.tagName===e}}function Gr(e){return t;function t(t,n,r){return!!(qr(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Kr(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function qr(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var Jr=/\n/g,Yr=/[\t ]+/g,Xr=Hr(`br`),Zr=Hr(ui),Qr=Hr(`p`),$r=Hr(`tr`),ei=Hr([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,li,di]),ti=Hr(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function ni(e,t){let n=t||{},r=`children`in e?e.children:[],i=ti(e),a=ci(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...ai(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...ri(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?Xr(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
|
|
3
3
|
`.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function ri(e,t,n){return e.type===`element`?ii(e,t,n):e.type===`text`?n.whitespace===`normal`?ai(e,n):oi(e):[]}function ii(e,t,n){let r=ci(e,n),i=e.children||[],a=-1,o=[];if(ei(e))return o;let s,c;for(Xr(e)||$r(e)&&Vr(t,e,$r)?c=`
|
|
4
4
|
`:Qr(e)?(s=2,c=2):ti(e)&&(s=1,c=1);++a<i.length;)o=o.concat(ri(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?Xr(i[a+1]):c}));return Zr(e)&&Vr(t,e,Zr)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function ai(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){Jr.lastIndex=a;let e=Jr.exec(n),i=e&&`index`in e?e.index:n.length;r.push(si(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function oi(e){return[String(e.value)]}function si(e,t,n){let r=[],i=0,a;for(;i<e.length;){Yr.lastIndex=i;let n=Yr.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function ci(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function li(e){return!!(e.properties||{}).hidden}function ui(e){return e.tagName===`td`||e.tagName===`th`}function di(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var fi=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},pi=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,fi.range(this,t))}},k=class e{constructor(t,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}var d=Error(r);return d.name=`ParseError`,d.__proto__=e.prototype,d.position=i,i!=null&&a!=null&&(d.length=a-i),d.rawMessage=t,d}};k.prototype.__proto__=Error.prototype;var mi=function(e,t){return e===void 0?t:e},hi=/([A-Z])/g,gi=function(e){return e.replace(hi,`-$1`).toLowerCase()},_i={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},vi=/[&><"']/g;function yi(e){return String(e).replace(vi,e=>_i[e])}var bi=function e(t){return t.type===`ordgroup`||t.type===`color`?t.body.length===1?e(t.body[0]):t:t.type===`font`?e(t.body):t},xi=function(e){var t=bi(e);return t.type===`mathord`||t.type===`textord`||t.type===`atom`},Si=function(e){if(!e)throw Error(`Expected non-null, but got `+String(e));return e},Ci={deflt:mi,escape:yi,hyphenate:gi,getBaseElem:bi,isCharacterBox:xi,protocolFromUrl:function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`}},wi={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function Ti(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if(typeof n!=`string`)return n.enum[0];switch(n){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{}}}var Ei=class{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={},wi)if(wi.hasOwnProperty(t)){var n=wi[t];this[t]=e[t]===void 0?Ti(n):n.processor?n.processor(e[t]):e[t]}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new k(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(e.url&&!e.protocol){var t=Ci.protocolFromUrl(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},Di=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Ii[Li[this.id]]}sub(){return Ii[Ri[this.id]]}fracNum(){return Ii[zi[this.id]]}fracDen(){return Ii[Bi[this.id]]}cramp(){return Ii[Vi[this.id]]}text(){return Ii[Hi[this.id]]}isTight(){return this.size>=2}},Oi=0,ki=1,Ai=2,ji=3,Mi=4,Ni=5,Pi=6,Fi=7,Ii=[new Di(Oi,0,!1),new Di(ki,0,!0),new Di(Ai,1,!1),new Di(ji,1,!0),new Di(Mi,2,!1),new Di(Ni,2,!0),new Di(Pi,3,!1),new Di(Fi,3,!0)],Li=[Mi,Ni,Mi,Ni,Pi,Fi,Pi,Fi],Ri=[Ni,Ni,Ni,Ni,Fi,Fi,Fi,Fi],zi=[Ai,ji,Mi,Ni,Pi,Fi,Pi,Fi],Bi=[ji,ji,Ni,Ni,Fi,Fi,Fi,Fi],Vi=[ki,ki,ji,ji,Ni,Ni,Fi,Fi],Hi=[Oi,ki,Ai,ji,Ai,ji,Ai,ji],A={DISPLAY:Ii[Oi],TEXT:Ii[Ai],SCRIPT:Ii[Mi],SCRIPTSCRIPT:Ii[Pi]},Ui=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Wi(e){for(var t=0;t<Ui.length;t++)for(var n=Ui[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Gi=[];Ui.forEach(e=>e.blocks.forEach(e=>Gi.push(...e)));function Ki(e){for(var t=0;t<Gi.length;t+=2)if(e>=Gi[t]&&e<=Gi[t+1])return!0;return!1}var qi=80,Ji=function(e,t){return`M95,`+(622+e+t)+`
|
|
@@ -365,15 +365,15 @@ ${e}</tr>
|
|
|
365
365
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
366
366
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${yD(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=bD(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+yD(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=bD(e);if(i===null)return yD(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${yD(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:yD(e.text)}},kD=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},AD=class e{options;renderer;textRenderer;constructor(e){this.options=e||cE,this.options.renderer=this.options.renderer||new OD,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new kD}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`def`:n+=this.renderer.def(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
|
|
367
367
|
`+this.renderer.text(i);t?n+=this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):n+=o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},jD=class{options;block;constructor(e){this.options=e||cE}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?DD.lex:DD.lexInline}provideParser(){return this.block?AD.parse:AD.parseInline}},MD=new class{defaults=sE();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=AD;Renderer=OD;TextRenderer=kD;Lexer=DD;Tokenizer=ED;Hooks=jD;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new OD(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ED(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new jD;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];jD.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&jD.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return DD.lex(e,t??this.defaults)}parser(e,t){return AD.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?DD.lex:DD.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?AD.parse:AD.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?DD.lex:DD.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?AD.parse:AD.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
368
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+yD(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function ND(e,t){return MD.parse(e,t)}ND.options=ND.setOptions=function(e){return MD.setOptions(e),ND.defaults=MD.defaults,lE(ND.defaults),ND},ND.getDefaults=sE,ND.defaults=cE,ND.use=function(...e){return MD.use(...e),ND.defaults=MD.defaults,lE(ND.defaults),ND},ND.walkTokens=function(e,t){return MD.walkTokens(e,t)},ND.parseInline=MD.parseInline,ND.Parser=AD,ND.parser=AD.parse,ND.Renderer=OD,ND.TextRenderer=kD,ND.Lexer=DD,ND.lexer=DD.lex,ND.Tokenizer=ED,ND.Hooks=jD,ND.parse=ND,ND.options,ND.setOptions,ND.use,ND.walkTokens,ND.parseInline,AD.parse,DD.lex;var PD=(...e)=>zt(ge(e)),FD=(e,t,n)=>{let r=typeof t==`string`?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},ID=(0,T.createContext)({code:``}),LD=()=>(0,T.useContext)(ID),RD=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let[s,c]=(0,T.useState)(!1),l=(0,T.useRef)(0),{code:u}=LD(),{isAnimating:d}=(0,T.useContext)(ik),f=a??u,p=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{s||(await navigator.clipboard.writeText(f),c(!0),e?.(),l.current=window.setTimeout(()=>c(!1),n))}catch(e){t?.(e)}};(0,T.useEffect)(()=>()=>{window.clearTimeout(l.current)},[]);let m=s?ZS:QS;return(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:d,onClick:p,title:`Copy Code`,type:`button`,...o,children:r??(0,O.jsx)(m,{size:14})})},zD={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},BD=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let{code:s}=LD(),{isAnimating:c}=(0,T.useContext)(ik),l=a??s,u=`file.${n&&n in zD?zD[n]:`txt`}`,d=()=>{try{FD(u,l,`text/plain`),e?.()}catch(e){t?.(e)}};return(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:c,onClick:d,title:`Download file`,type:`button`,...o,children:r??(0,O.jsx)($S,{size:14})})},VD=()=>(0,O.jsxs)(`div`,{className:`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`,children:[(0,O.jsx)(`div`,{className:`h-[46px] w-full bg-muted/80`}),(0,O.jsx)(`div`,{className:`flex w-full items-center justify-center p-4`,children:(0,O.jsx)(eC,{className:`size-4 animate-spin`})})]}),HD=/\.[^/.]+$/,UD=({node:e,className:t,src:n,alt:r,...i})=>{let a=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(HD,``)}.${i}`}FD(o,e,e.type)}catch(e){console.error(`Failed to download image:`,e)}};return n?(0,O.jsxs)(`div`,{className:`group relative my-4 inline-block`,"data-streamdown":`image-wrapper`,children:[(0,O.jsx)(`img`,{alt:r,className:PD(`max-w-full rounded-lg`,t),"data-streamdown":`image`,src:n,...i}),(0,O.jsx)(`div`,{className:`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`}),(0,O.jsx)(`button`,{className:PD(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:a,title:`Download image`,type:`button`,children:(0,O.jsx)($S,{size:14})})]}):null},WD=async e=>{let t={startOnLoad:!1,theme:`default`,securityLevel:`strict`,fontFamily:`monospace`,suppressErrorRendering:!0,...e},n=(await ce(async()=>{let{default:e}=await import(`./mermaid.core-CHOGuA8G.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]))).default;return n.initialize(t),n},GD=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),KD=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let[o,s]=(0,T.useState)(!1),c=(0,T.useRef)(null),{isAnimating:l}=(0,T.useContext)(ik),u=async t=>{try{if(t===`mmd`){FD(`diagram.mmd`,e,`text/plain`),s(!1),r?.(t);return}let n=await WD(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),c=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(c,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}if(t===`svg`){FD(`diagram.svg`,l,`image/svg+xml`),s(!1),r?.(t);return}if(t===`png`){FD(`diagram.png`,await GD(l),`image/png`),r?.(t),s(!1);return}}catch(e){a?.(e)}};return(0,T.useEffect)(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,O.jsxs)(`div`,{className:`relative`,ref:c,children:[(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:l,onClick:()=>s(!o),title:`Download diagram`,type:`button`,children:t??(0,O.jsx)($S,{size:14})}),o&&(0,O.jsxs)(`div`,{className:`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`,children:[(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>u(`svg`),title:`Download diagram as SVG`,type:`button`,children:`SVG`}),(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>u(`png`),title:`Download diagram as PNG`,type:`button`,children:`PNG`}),(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>u(`mmd`),title:`Download diagram as MMD`,type:`button`,children:`MMD`})]})]})},qD=0,JD=()=>{qD+=1,qD===1&&(document.body.style.overflow=`hidden`)},YD=()=>{qD=Math.max(0,qD-1),qD===0&&(document.body.style.overflow=``)},XD=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let[o,s]=(0,T.useState)(!1),{isAnimating:c,controls:l}=(0,T.useContext)(ik),u=(()=>{if(typeof l==`boolean`)return l;let e=l.mermaid;return e===!1?!1:e===!0||e===void 0?!0:e.panZoom!==!1})(),d=()=>{s(!o)};return(0,T.useEffect)(()=>{if(o){JD();let e=e=>{e.key===`Escape`&&s(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),YD()}}},[o]),(0,T.useEffect)(()=>{o?n?.():r&&r()},[o,n,r]),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:c,onClick:d,title:`View fullscreen`,type:`button`,...a,children:(0,O.jsx)(tC,{size:14})}),o&&(0,O.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`,onClick:d,onKeyDown:e=>{e.key===`Escape`&&d()},role:`button`,tabIndex:0,children:[(0,O.jsx)(`button`,{className:`absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`,onClick:d,title:`Exit fullscreen`,type:`button`,children:(0,O.jsx)(rC,{size:20})}),(0,O.jsx)(`div`,{className:`flex h-full w-full items-center justify-center p-4`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,O.jsx)(lk,{chart:e,className:`h-full w-full [&>div]:h-full [&>div]:overflow-hidden [&_svg]:h-auto [&_svg]:w-auto`,config:t,fullscreen:!0,showControls:u})})]})]})},ZD=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(e.textContent?.trim()||``);let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(e.textContent?.trim()||``);n.push(t)}return{headers:t,rows:n}},QD=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i===`"`){t=!0,n=!0;break}(i===`,`||i===`
|
|
368
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+yD(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function ND(e,t){return MD.parse(e,t)}ND.options=ND.setOptions=function(e){return MD.setOptions(e),ND.defaults=MD.defaults,lE(ND.defaults),ND},ND.getDefaults=sE,ND.defaults=cE,ND.use=function(...e){return MD.use(...e),ND.defaults=MD.defaults,lE(ND.defaults),ND},ND.walkTokens=function(e,t){return MD.walkTokens(e,t)},ND.parseInline=MD.parseInline,ND.Parser=AD,ND.parser=AD.parse,ND.Renderer=OD,ND.TextRenderer=kD,ND.Lexer=DD,ND.lexer=DD.lex,ND.Tokenizer=ED,ND.Hooks=jD,ND.parse=ND,ND.options,ND.setOptions,ND.use,ND.walkTokens,ND.parseInline,AD.parse,DD.lex;var PD=(...e)=>zt(ge(e)),FD=(e,t,n)=>{let r=typeof t==`string`?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},ID=(0,T.createContext)({code:``}),LD=()=>(0,T.useContext)(ID),RD=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let[s,c]=(0,T.useState)(!1),l=(0,T.useRef)(0),{code:u}=LD(),{isAnimating:d}=(0,T.useContext)(ik),f=a??u,p=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{s||(await navigator.clipboard.writeText(f),c(!0),e?.(),l.current=window.setTimeout(()=>c(!1),n))}catch(e){t?.(e)}};(0,T.useEffect)(()=>()=>{window.clearTimeout(l.current)},[]);let m=s?ZS:QS;return(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:d,onClick:p,title:`Copy Code`,type:`button`,...o,children:r??(0,O.jsx)(m,{size:14})})},zD={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},BD=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let{code:s}=LD(),{isAnimating:c}=(0,T.useContext)(ik),l=a??s,u=`file.${n&&n in zD?zD[n]:`txt`}`,d=()=>{try{FD(u,l,`text/plain`),e?.()}catch(e){t?.(e)}};return(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:c,onClick:d,title:`Download file`,type:`button`,...o,children:r??(0,O.jsx)($S,{size:14})})},VD=()=>(0,O.jsxs)(`div`,{className:`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`,children:[(0,O.jsx)(`div`,{className:`h-[46px] w-full bg-muted/80`}),(0,O.jsx)(`div`,{className:`flex w-full items-center justify-center p-4`,children:(0,O.jsx)(eC,{className:`size-4 animate-spin`})})]}),HD=/\.[^/.]+$/,UD=({node:e,className:t,src:n,alt:r,...i})=>{let a=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(HD,``)}.${i}`}FD(o,e,e.type)}catch(e){console.error(`Failed to download image:`,e)}};return n?(0,O.jsxs)(`div`,{className:`group relative my-4 inline-block`,"data-streamdown":`image-wrapper`,children:[(0,O.jsx)(`img`,{alt:r,className:PD(`max-w-full rounded-lg`,t),"data-streamdown":`image`,src:n,...i}),(0,O.jsx)(`div`,{className:`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`}),(0,O.jsx)(`button`,{className:PD(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:a,title:`Download image`,type:`button`,children:(0,O.jsx)($S,{size:14})})]}):null},WD=async e=>{let t={startOnLoad:!1,theme:`default`,securityLevel:`strict`,fontFamily:`monospace`,suppressErrorRendering:!0,...e},n=(await ce(async()=>{let{default:e}=await import(`./mermaid.core-DpdbzASN.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]))).default;return n.initialize(t),n},GD=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),KD=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let[o,s]=(0,T.useState)(!1),c=(0,T.useRef)(null),{isAnimating:l}=(0,T.useContext)(ik),u=async t=>{try{if(t===`mmd`){FD(`diagram.mmd`,e,`text/plain`),s(!1),r?.(t);return}let n=await WD(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),c=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(c,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}if(t===`svg`){FD(`diagram.svg`,l,`image/svg+xml`),s(!1),r?.(t);return}if(t===`png`){FD(`diagram.png`,await GD(l),`image/png`),r?.(t),s(!1);return}}catch(e){a?.(e)}};return(0,T.useEffect)(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,O.jsxs)(`div`,{className:`relative`,ref:c,children:[(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:l,onClick:()=>s(!o),title:`Download diagram`,type:`button`,children:t??(0,O.jsx)($S,{size:14})}),o&&(0,O.jsxs)(`div`,{className:`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`,children:[(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>u(`svg`),title:`Download diagram as SVG`,type:`button`,children:`SVG`}),(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>u(`png`),title:`Download diagram as PNG`,type:`button`,children:`PNG`}),(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>u(`mmd`),title:`Download diagram as MMD`,type:`button`,children:`MMD`})]})]})},qD=0,JD=()=>{qD+=1,qD===1&&(document.body.style.overflow=`hidden`)},YD=()=>{qD=Math.max(0,qD-1),qD===0&&(document.body.style.overflow=``)},XD=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let[o,s]=(0,T.useState)(!1),{isAnimating:c,controls:l}=(0,T.useContext)(ik),u=(()=>{if(typeof l==`boolean`)return l;let e=l.mermaid;return e===!1?!1:e===!0||e===void 0?!0:e.panZoom!==!1})(),d=()=>{s(!o)};return(0,T.useEffect)(()=>{if(o){JD();let e=e=>{e.key===`Escape`&&s(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),YD()}}},[o]),(0,T.useEffect)(()=>{o?n?.():r&&r()},[o,n,r]),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:c,onClick:d,title:`View fullscreen`,type:`button`,...a,children:(0,O.jsx)(tC,{size:14})}),o&&(0,O.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`,onClick:d,onKeyDown:e=>{e.key===`Escape`&&d()},role:`button`,tabIndex:0,children:[(0,O.jsx)(`button`,{className:`absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`,onClick:d,title:`Exit fullscreen`,type:`button`,children:(0,O.jsx)(rC,{size:20})}),(0,O.jsx)(`div`,{className:`flex h-full w-full items-center justify-center p-4`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,O.jsx)(lk,{chart:e,className:`h-full w-full [&>div]:h-full [&>div]:overflow-hidden [&_svg]:h-auto [&_svg]:w-auto`,config:t,fullscreen:!0,showControls:u})})]})]})},ZD=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(e.textContent?.trim()||``);let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(e.textContent?.trim()||``);n.push(t)}return{headers:t,rows:n}},QD=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i===`"`){t=!0,n=!0;break}(i===`,`||i===`
|
|
369
369
|
`)&&(t=!0)}return t?n?`"${e.replace(/"/g,`""`)}"`:`"${e}"`:e},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(`,`),o+=1);for(let e of n)a[o]=e.map(r).join(`,`),o+=1;return a.join(`
|
|
370
370
|
`)},$D=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n=0;n<e.length;n+=1){let r=e[n];if(r===` `||r===`
|
|
371
371
|
`||r===`\r`){t=!0;break}}if(!t)return e;let n=[];for(let t=0;t<e.length;t+=1){let r=e[t];r===` `?n.push(`\\t`):r===`
|
|
372
372
|
`?n.push(`\\n`):r===`\r`?n.push(`\\r`):n.push(r)}return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
373
373
|
`)},eO=e=>{let t=!1;for(let n=0;n<e.length;n+=1){let r=e[n];if(r===`\\`||r===`|`){t=!0;break}}if(!t)return e;let n=[];for(let t=0;t<e.length;t+=1){let r=e[t];r===`\\`?n.push(`\\\\`):r===`|`?n.push(`\\|`):n.push(r)}return n.join(``)},tO=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0;r[i]=`| ${t.map(e=>eO(e)).join(` | `)} |`,i+=1;let a=Array(t.length);for(let e=0;e<t.length;e+=1)a[e]=`---`;r[i]=`| ${a.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?eO(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else r[i]=`| ${e.map(e=>eO(e)).join(` | `)} |`,i+=1;return r.join(`
|
|
374
|
-
`)},nO=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[a,o]=(0,T.useState)(!1),[s,c]=(0,T.useState)(!1),l=(0,T.useRef)(null),u=(0,T.useRef)(0),{isAnimating:d}=(0,T.useContext)(ik),f=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(l.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=ZD(t),s=e===`csv`?QD(a):$D(a),d=new ClipboardItem({"text/plain":new Blob([s],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([d]),c(!0),o(!1),n?.(e),u.current=window.setTimeout(()=>c(!1),i)}catch(e){r?.(e)}};(0,T.useEffect)(()=>{let e=e=>{l.current&&!l.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(u.current)}},[]);let p=s?ZS:QS;return(0,O.jsxs)(`div`,{className:`relative`,ref:l,children:[(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:d,onClick:()=>o(!a),title:`Copy table`,type:`button`,children:e??(0,O.jsx)(p,{size:14})}),a&&(0,O.jsxs)(`div`,{className:`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`,children:[(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>f(`csv`),title:`Copy table as CSV`,type:`button`,children:`CSV`}),(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>f(`tsv`),title:`Copy table as TSV`,type:`button`,children:`TSV`})]})]})},rO=({children:e,className:t,onDownload:n,onError:r})=>{let[i,a]=(0,T.useState)(!1),o=(0,T.useRef)(null),{isAnimating:s}=(0,T.useContext)(ik),c=e=>{try{let t=(o.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=ZD(t),s=e===`csv`?QD(i):tO(i);FD(`table.${e===`csv`?`csv`:`md`}`,s,e===`csv`?`text/csv`:`text/markdown`),a(!1),n?.(e)}catch(e){r?.(e)}};return(0,T.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,O.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:s,onClick:()=>a(!i),title:`Download table`,type:`button`,children:e??(0,O.jsx)($S,{size:14})}),i&&(0,O.jsxs)(`div`,{className:`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`,children:[(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>c(`csv`),title:`Download table as CSV`,type:`button`,children:`CSV`}),(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>c(`markdown`),title:`Download table as Markdown`,type:`button`,children:`Markdown`})]})]})},iO=({children:e,className:t,showControls:n,...r})=>(0,O.jsxs)(`div`,{className:`my-4 flex flex-col space-y-2`,"data-streamdown":`table-wrapper`,children:[n&&(0,O.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,O.jsx)(nO,{}),(0,O.jsx)(rO,{})]}),(0,O.jsx)(`div`,{className:`overflow-x-auto`,children:(0,O.jsx)(`table`,{className:PD(`w-full border-collapse border border-border`,t),"data-streamdown":`table`,...r,children:e})})]}),aO=(0,T.lazy)(()=>ce(()=>import(`./code-block-IT6T5CEO-nC1YczKC.js`),__vite__mapDeps([23,1,2,24])).then(e=>({default:e.CodeBlock}))),oO=(0,T.lazy)(()=>ce(()=>import(`./mermaid-VLURNSYL-Dt6lsMZf.js`),__vite__mapDeps([25,1,2,24])).then(e=>({default:e.Mermaid}))),sO=/language-([^\s]+)/;function cO(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function lO(e,t){return e.className===t.className&&cO(e.node,t.node)}var uO=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,dO=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},fO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`ol`,{className:PD(`list-inside list-decimal whitespace-normal`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>lO(e,t));fO.displayName=`MarkdownOl`;var pO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`li`,{className:PD(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&cO(e.node,t.node));pO.displayName=`MarkdownLi`;var mO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`ul`,{className:PD(`list-inside list-disc whitespace-normal`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>lO(e,t));mO.displayName=`MarkdownUl`;var hO=(0,T.memo)(({className:e,node:t,...n})=>(0,O.jsx)(`hr`,{className:PD(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>lO(e,t));hO.displayName=`MarkdownHr`;var gO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`span`,{className:PD(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>lO(e,t));gO.displayName=`MarkdownStrong`;var _O=(0,T.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=n===`streamdown:incomplete-link`;return(0,O.jsx)(`a`,{className:PD(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":a,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>lO(e,t)&&e.href===t.href);_O.displayName=`MarkdownA`;var vO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h1`,{className:PD(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>lO(e,t));vO.displayName=`MarkdownH1`;var yO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h2`,{className:PD(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>lO(e,t));yO.displayName=`MarkdownH2`;var bO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h3`,{className:PD(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>lO(e,t));bO.displayName=`MarkdownH3`;var xO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h4`,{className:PD(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>lO(e,t));xO.displayName=`MarkdownH4`;var SO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h5`,{className:PD(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>lO(e,t));SO.displayName=`MarkdownH5`;var CO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h6`,{className:PD(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>lO(e,t));CO.displayName=`MarkdownH6`;var wO=(0,T.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,T.useContext)(ik),a=uO(i,`table`);return(0,O.jsx)(iO,{className:t,"data-streamdown":`table-wrapper`,showControls:a,...r,children:e})},(e,t)=>lO(e,t));wO.displayName=`MarkdownTable`;var TO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`thead`,{className:PD(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>lO(e,t));TO.displayName=`MarkdownThead`;var EO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`tbody`,{className:PD(`divide-y divide-border bg-muted/40`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>lO(e,t));EO.displayName=`MarkdownTbody`;var DO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`tr`,{className:PD(`border-border border-b`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>lO(e,t));DO.displayName=`MarkdownTr`;var OO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`th`,{className:PD(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>lO(e,t));OO.displayName=`MarkdownTh`;var kO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`td`,{className:PD(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>lO(e,t));kO.displayName=`MarkdownTd`;var AO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`blockquote`,{className:PD(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>lO(e,t));AO.displayName=`MarkdownBlockquote`;var jO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`sup`,{className:PD(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>lO(e,t));jO.displayName=`MarkdownSup`;var MO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`sub`,{className:PD(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>lO(e,t));MO.displayName=`MarkdownSub`;var NO=(0,T.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,T.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,T.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,T.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,T.isValidElement)(e))return e;if(e.type===fO){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,O.jsx)(`section`,{className:t,...r,children:i}):null}return(0,O.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>lO(e,t));NO.displayName=`MarkdownSection`;var PO=(0,T.memo)(({node:e,className:t,children:n,...r})=>{let i=(e?.position)?.start.line===(e?.position)?.end.line,{mermaid:a,controls:o}=(0,T.useContext)(ik);if(i)return(0,O.jsx)(`code`,{className:PD(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let s=(t?.match(sO))?.at(1)??``,c=``;if((0,T.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?c=n.props.children:typeof n==`string`&&(c=n),s===`mermaid`){let e=uO(o,`mermaid`),n=dO(o,`download`),r=dO(o,`copy`),i=dO(o,`fullscreen`),s=dO(o,`panZoom`);return(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(VD,{}),children:(0,O.jsxs)(`div`,{className:PD(`group relative my-4 h-auto rounded-xl border p-4`,t),"data-streamdown":`mermaid-block`,children:[e&&(n||r||i)&&(0,O.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[n&&(0,O.jsx)(KD,{chart:c,config:a?.config}),r&&(0,O.jsx)(RD,{code:c}),i&&(0,O.jsx)(XD,{chart:c,config:a?.config})]}),(0,O.jsx)(oO,{chart:c,config:a?.config,showControls:s})]})})}let l=uO(o,`code`);return(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(VD,{}),children:(0,O.jsx)(aO,{className:PD(`overflow-x-auto border-border border-t`,t),code:c,language:s,children:l&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(BD,{code:c,language:s}),(0,O.jsx)(RD,{})]})})})},(e,t)=>e.className===t.className&&cO(e.node,t.node));PO.displayName=`MarkdownCode`;var FO=(0,T.memo)(UD,(e,t)=>e.className===t.className&&cO(e.node,t.node));FO.displayName=`MarkdownImg`;var IO=(0,T.memo)(({children:e,className:t,node:n,...r})=>{let i=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);return i.length===1&&(0,T.isValidElement)(i[0])&&i[0].props.node?.tagName===`img`?(0,O.jsx)(O.Fragment,{children:e}):(0,O.jsx)(`p`,{className:t,...r,children:e})},(e,t)=>lO(e,t));IO.displayName=`MarkdownParagraph`;var LO={ol:fO,li:pO,ul:mO,hr:hO,strong:gO,a:_O,h1:vO,h2:yO,h3:bO,h4:xO,h5:SO,h6:CO,table:wO,thead:TO,tbody:EO,tr:DO,th:OO,td:kO,blockquote:AO,code:PO,img:FO,pre:({children:e})=>e,sup:jO,sub:MO,p:IO,section:NO},RO=[],zO={allowDangerousHtml:!0},BO=new WeakMap,VO=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=BO.get(e);n||(n=e.name,BO.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=BO.get(r);e||(e=r.name,BO.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},HO=e=>{let t=UO(e),n=e.children||``;return GO(t.runSync(t.parse(n),n),e)},UO=e=>{let t=VO.get(e);if(t)return t;let n=WO(e);return VO.set(e,n),n},WO=e=>{let t=e.rehypePlugins||RO,n=e.remarkPlugins||RO,r=e.remarkRehypeOptions?{...zO,...e.remarkRehypeOptions}:zO;return ZT().use(Mw).use(n).use(CT,r).use(t)},GO=(e,t)=>EC(e,{Fragment:O.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0}),KO=/\[\^[^\]\s]{1,200}\](?!:)/,qO=/\[\^[^\]\s]{1,200}\]:/,JO=/<\/(\w+)>/,YO=/<(\w+)[\s>]/,XO=e=>{let t=0;for(;t<e.length&&(e[t]===` `||e[t]===` `||e[t]===`
|
|
374
|
+
`)},nO=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[a,o]=(0,T.useState)(!1),[s,c]=(0,T.useState)(!1),l=(0,T.useRef)(null),u=(0,T.useRef)(0),{isAnimating:d}=(0,T.useContext)(ik),f=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(l.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=ZD(t),s=e===`csv`?QD(a):$D(a),d=new ClipboardItem({"text/plain":new Blob([s],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([d]),c(!0),o(!1),n?.(e),u.current=window.setTimeout(()=>c(!1),i)}catch(e){r?.(e)}};(0,T.useEffect)(()=>{let e=e=>{l.current&&!l.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(u.current)}},[]);let p=s?ZS:QS;return(0,O.jsxs)(`div`,{className:`relative`,ref:l,children:[(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:d,onClick:()=>o(!a),title:`Copy table`,type:`button`,children:e??(0,O.jsx)(p,{size:14})}),a&&(0,O.jsxs)(`div`,{className:`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`,children:[(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>f(`csv`),title:`Copy table as CSV`,type:`button`,children:`CSV`}),(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>f(`tsv`),title:`Copy table as TSV`,type:`button`,children:`TSV`})]})]})},rO=({children:e,className:t,onDownload:n,onError:r})=>{let[i,a]=(0,T.useState)(!1),o=(0,T.useRef)(null),{isAnimating:s}=(0,T.useContext)(ik),c=e=>{try{let t=(o.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=ZD(t),s=e===`csv`?QD(i):tO(i);FD(`table.${e===`csv`?`csv`:`md`}`,s,e===`csv`?`text/csv`:`text/markdown`),a(!1),n?.(e)}catch(e){r?.(e)}};return(0,T.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,O.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,O.jsx)(`button`,{className:PD(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:s,onClick:()=>a(!i),title:`Download table`,type:`button`,children:e??(0,O.jsx)($S,{size:14})}),i&&(0,O.jsxs)(`div`,{className:`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`,children:[(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>c(`csv`),title:`Download table as CSV`,type:`button`,children:`CSV`}),(0,O.jsx)(`button`,{className:`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,onClick:()=>c(`markdown`),title:`Download table as Markdown`,type:`button`,children:`Markdown`})]})]})},iO=({children:e,className:t,showControls:n,...r})=>(0,O.jsxs)(`div`,{className:`my-4 flex flex-col space-y-2`,"data-streamdown":`table-wrapper`,children:[n&&(0,O.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,O.jsx)(nO,{}),(0,O.jsx)(rO,{})]}),(0,O.jsx)(`div`,{className:`overflow-x-auto`,children:(0,O.jsx)(`table`,{className:PD(`w-full border-collapse border border-border`,t),"data-streamdown":`table`,...r,children:e})})]}),aO=(0,T.lazy)(()=>ce(()=>import(`./code-block-IT6T5CEO-GXnQl8M7.js`),__vite__mapDeps([23,1,2,24])).then(e=>({default:e.CodeBlock}))),oO=(0,T.lazy)(()=>ce(()=>import(`./mermaid-VLURNSYL-DEjZVUum.js`),__vite__mapDeps([25,1,2,24])).then(e=>({default:e.Mermaid}))),sO=/language-([^\s]+)/;function cO(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function lO(e,t){return e.className===t.className&&cO(e.node,t.node)}var uO=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,dO=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},fO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`ol`,{className:PD(`list-inside list-decimal whitespace-normal`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>lO(e,t));fO.displayName=`MarkdownOl`;var pO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`li`,{className:PD(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&cO(e.node,t.node));pO.displayName=`MarkdownLi`;var mO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`ul`,{className:PD(`list-inside list-disc whitespace-normal`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>lO(e,t));mO.displayName=`MarkdownUl`;var hO=(0,T.memo)(({className:e,node:t,...n})=>(0,O.jsx)(`hr`,{className:PD(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>lO(e,t));hO.displayName=`MarkdownHr`;var gO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`span`,{className:PD(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>lO(e,t));gO.displayName=`MarkdownStrong`;var _O=(0,T.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=n===`streamdown:incomplete-link`;return(0,O.jsx)(`a`,{className:PD(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":a,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>lO(e,t)&&e.href===t.href);_O.displayName=`MarkdownA`;var vO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h1`,{className:PD(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>lO(e,t));vO.displayName=`MarkdownH1`;var yO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h2`,{className:PD(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>lO(e,t));yO.displayName=`MarkdownH2`;var bO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h3`,{className:PD(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>lO(e,t));bO.displayName=`MarkdownH3`;var xO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h4`,{className:PD(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>lO(e,t));xO.displayName=`MarkdownH4`;var SO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h5`,{className:PD(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>lO(e,t));SO.displayName=`MarkdownH5`;var CO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`h6`,{className:PD(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>lO(e,t));CO.displayName=`MarkdownH6`;var wO=(0,T.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,T.useContext)(ik),a=uO(i,`table`);return(0,O.jsx)(iO,{className:t,"data-streamdown":`table-wrapper`,showControls:a,...r,children:e})},(e,t)=>lO(e,t));wO.displayName=`MarkdownTable`;var TO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`thead`,{className:PD(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>lO(e,t));TO.displayName=`MarkdownThead`;var EO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`tbody`,{className:PD(`divide-y divide-border bg-muted/40`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>lO(e,t));EO.displayName=`MarkdownTbody`;var DO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`tr`,{className:PD(`border-border border-b`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>lO(e,t));DO.displayName=`MarkdownTr`;var OO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`th`,{className:PD(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>lO(e,t));OO.displayName=`MarkdownTh`;var kO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`td`,{className:PD(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>lO(e,t));kO.displayName=`MarkdownTd`;var AO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`blockquote`,{className:PD(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>lO(e,t));AO.displayName=`MarkdownBlockquote`;var jO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`sup`,{className:PD(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>lO(e,t));jO.displayName=`MarkdownSup`;var MO=(0,T.memo)(({children:e,className:t,node:n,...r})=>(0,O.jsx)(`sub`,{className:PD(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>lO(e,t));MO.displayName=`MarkdownSub`;var NO=(0,T.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,T.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,T.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,T.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,T.isValidElement)(e))return e;if(e.type===fO){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,O.jsx)(`section`,{className:t,...r,children:i}):null}return(0,O.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>lO(e,t));NO.displayName=`MarkdownSection`;var PO=(0,T.memo)(({node:e,className:t,children:n,...r})=>{let i=(e?.position)?.start.line===(e?.position)?.end.line,{mermaid:a,controls:o}=(0,T.useContext)(ik);if(i)return(0,O.jsx)(`code`,{className:PD(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let s=(t?.match(sO))?.at(1)??``,c=``;if((0,T.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?c=n.props.children:typeof n==`string`&&(c=n),s===`mermaid`){let e=uO(o,`mermaid`),n=dO(o,`download`),r=dO(o,`copy`),i=dO(o,`fullscreen`),s=dO(o,`panZoom`);return(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(VD,{}),children:(0,O.jsxs)(`div`,{className:PD(`group relative my-4 h-auto rounded-xl border p-4`,t),"data-streamdown":`mermaid-block`,children:[e&&(n||r||i)&&(0,O.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[n&&(0,O.jsx)(KD,{chart:c,config:a?.config}),r&&(0,O.jsx)(RD,{code:c}),i&&(0,O.jsx)(XD,{chart:c,config:a?.config})]}),(0,O.jsx)(oO,{chart:c,config:a?.config,showControls:s})]})})}let l=uO(o,`code`);return(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(VD,{}),children:(0,O.jsx)(aO,{className:PD(`overflow-x-auto border-border border-t`,t),code:c,language:s,children:l&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(BD,{code:c,language:s}),(0,O.jsx)(RD,{})]})})})},(e,t)=>e.className===t.className&&cO(e.node,t.node));PO.displayName=`MarkdownCode`;var FO=(0,T.memo)(UD,(e,t)=>e.className===t.className&&cO(e.node,t.node));FO.displayName=`MarkdownImg`;var IO=(0,T.memo)(({children:e,className:t,node:n,...r})=>{let i=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);return i.length===1&&(0,T.isValidElement)(i[0])&&i[0].props.node?.tagName===`img`?(0,O.jsx)(O.Fragment,{children:e}):(0,O.jsx)(`p`,{className:t,...r,children:e})},(e,t)=>lO(e,t));IO.displayName=`MarkdownParagraph`;var LO={ol:fO,li:pO,ul:mO,hr:hO,strong:gO,a:_O,h1:vO,h2:yO,h3:bO,h4:xO,h5:SO,h6:CO,table:wO,thead:TO,tbody:EO,tr:DO,th:OO,td:kO,blockquote:AO,code:PO,img:FO,pre:({children:e})=>e,sup:jO,sub:MO,p:IO,section:NO},RO=[],zO={allowDangerousHtml:!0},BO=new WeakMap,VO=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=BO.get(e);n||(n=e.name,BO.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=BO.get(r);e||(e=r.name,BO.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},HO=e=>{let t=UO(e),n=e.children||``;return GO(t.runSync(t.parse(n),n),e)},UO=e=>{let t=VO.get(e);if(t)return t;let n=WO(e);return VO.set(e,n),n},WO=e=>{let t=e.rehypePlugins||RO,n=e.remarkPlugins||RO,r=e.remarkRehypeOptions?{...zO,...e.remarkRehypeOptions}:zO;return ZT().use(Mw).use(n).use(CT,r).use(t)},GO=(e,t)=>EC(e,{Fragment:O.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0}),KO=/\[\^[^\]\s]{1,200}\](?!:)/,qO=/\[\^[^\]\s]{1,200}\]:/,JO=/<\/(\w+)>/,YO=/<(\w+)[\s>]/,XO=e=>{let t=0;for(;t<e.length&&(e[t]===` `||e[t]===` `||e[t]===`
|
|
375
375
|
`||e[t]===`\r`);)t+=1;return t+1<e.length&&e[t]===`$`&&e[t+1]===`$`},ZO=e=>{let t=e.length-1;for(;t>=0&&(e[t]===` `||e[t]===` `||e[t]===`
|
|
376
|
-
`||e[t]===`\r`);)--t;return t>=1&&e[t]===`$`&&e[t-1]===`$`},QO=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},$O=e=>{let t=KO.test(e),n=qO.test(e);if(t||n)return[e];let r=DD.lex(e,{gfm:!0}),i=[],a=[];for(let e of r){let t=e.raw,n=i.length;if(a.length>0){if(i[n-1]+=t,e.type===`html`){let e=t.match(JO);if(e){let t=e[1];a.at(-1)===t&&a.pop()}}continue}if(e.type===`html`&&e.block){let e=t.match(YO);if(e){let n=e[1];t.includes(`</${n}>`)||a.push(n)}}if(t.trim()===`$$`&&n>0){let e=i[n-1],r=XO(e),a=QO(e);if(r&&a%2==1){i[n-1]=e+t;continue}}if(n>0&&ZO(t)){let e=i[n-1],r=XO(e),a=QO(e),o=QO(t);if(r&&a%2==1&&!XO(t)&&o===1){i[n-1]=e+t;continue}}i.push(t)}return i},ek={raw:gh,katex:[ru,{errorColor:`var(--color-muted-foreground)`}],sanitize:[Fh,{}],harden:[cr,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},tk={gfm:[Bx,{}],math:[Qx,{singleDollarTextMath:!1}],cjkFriendly:[Rg,{}],cjkFriendlyGfmStrikethrough:[Bg,{}]},nk=Object.values(ek),rk=Object.values(tk),ik=(0,T.createContext)({shikiTheme:[`github-light`,`github-dark`],controls:!0,isAnimating:!1,mode:`streaming`,mermaid:void 0}),ak=(0,T.memo)(({content:e,shouldParseIncompleteMarkdown:t,...n})=>{let r=(0,T.useMemo)(()=>typeof e==`string`&&t?HS(e.trim()):e,[e,t]);return(0,O.jsx)(HO,{...n,children:r})},(e,t)=>{if(e.content!==t.content||e.shouldParseIncompleteMarkdown!==t.shouldParseIncompleteMarkdown||e.index!==t.index)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});ak.displayName=`Block`;var ok=[`github-light`,`github-dark`],sk=(0,T.memo)(({children:e,mode:t=`streaming`,parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=nk,remarkPlugins:a=rk,className:o,shikiTheme:s=ok,mermaid:c,controls:l=!0,isAnimating:u=!1,BlockComponent:d=ak,parseMarkdownIntoBlocksFn:f=$O,...p})=>{let m=(0,T.useId)(),[h,g]=(0,T.useTransition)(),[_,v]=(0,T.useState)([]),y=(0,T.useMemo)(()=>f(typeof e==`string`?e:``),[e,f]);(0,T.useEffect)(()=>{t===`streaming`?g(()=>{v(y)}):v(y)},[y,t]);let b=t===`streaming`?_:y,x=(0,T.useMemo)(()=>b.map((e,t)=>`${m}-${t}`),[b.length,m]),S=(0,T.useMemo)(()=>({shikiTheme:s,controls:l,isAnimating:u,mode:t,mermaid:c}),[s,l,u,t,c]),ee=(0,T.useMemo)(()=>({...LO,...r}),[r]);return(0,T.useEffect)(()=>{if(!(Array.isArray(i)&&i.some(e=>Array.isArray(e)?e[0]===ru:e===ru)))return;let t=!1;if(Array.isArray(a)){let e=a.find(e=>Array.isArray(e)?e[0]===Qx:e===Qx);e&&Array.isArray(e)&&e[1]&&(t=e[1].singleDollarTextMath===!0)}let n=typeof e==`string`?e:``,r=n.includes(`$$`),o=t&&(/[^$]\$[^$]/.test(n)||/^\$[^$]/.test(n)||/[^$]\$$/.test(n));(r||o)&&ce(()=>Promise.resolve({}),__vite__mapDeps([26]))},[i,a,e]),t===`static`?(0,O.jsx)(ik.Provider,{value:S,children:(0,O.jsx)(`div`,{className:PD(`space-y-4 whitespace-normal`,o),children:(0,O.jsx)(HO,{components:ee,rehypePlugins:i,remarkPlugins:a,...p,children:e})})}):(0,O.jsx)(ik.Provider,{value:S,children:(0,O.jsx)(`div`,{className:PD(`space-y-4 whitespace-normal`,o),children:b.map((e,t)=>(0,O.jsx)(d,{components:ee,content:e,index:t,rehypePlugins:i,remarkPlugins:a,shouldParseIncompleteMarkdown:n,...p},x[t]))})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode);sk.displayName=`Streamdown`;var ck=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let c=(0,T.useRef)(null),l=(0,T.useRef)(null),[u,d]=(0,T.useState)(o),[f,p]=(0,T.useState)({x:0,y:0}),[m,h]=(0,T.useState)(!1),[g,_]=(0,T.useState)({x:0,y:0}),[v,y]=(0,T.useState)({x:0,y:0}),b=(0,T.useCallback)(e=>{d(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),x=(0,T.useCallback)(()=>{b(i)},[b,i]),S=(0,T.useCallback)(()=>{b(-i)},[b,i]),ee=(0,T.useCallback)(()=>{d(o),p({x:0,y:0})},[o]),C=(0,T.useCallback)(e=>{e.preventDefault(),b(e.deltaY>0?-i:i)},[b,i]),te=(0,T.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;h(!0),_({x:e.clientX,y:e.clientY}),y(f);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[f]),ne=(0,T.useCallback)(e=>{if(!m)return;e.preventDefault();let t=e.clientX-g.x,n=e.clientY-g.y;p({x:v.x+t,y:v.y+n})},[m,g,v]),re=(0,T.useCallback)(e=>{h(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,T.useEffect)(()=>{let e=c.current;if(e)return e.addEventListener(`wheel`,C,{passive:!1}),()=>{e.removeEventListener(`wheel`,C)}},[C]),(0,T.useEffect)(()=>{let e=l.current;if(e&&m)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,ne,{passive:!1}),e.addEventListener(`pointerup`,re),e.addEventListener(`pointercancel`,re),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,ne),e.removeEventListener(`pointerup`,re),e.removeEventListener(`pointercancel`,re)}},[m,ne,re]),(0,O.jsxs)(`div`,{className:PD(`relative`,s?`h-full w-full`:`w-full`,t),ref:c,style:{cursor:m?`grabbing`:`grab`},children:[a&&(0,O.jsxs)(`div`,{className:PD(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,O.jsx)(`button`,{className:`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,disabled:u>=r,onClick:x,title:`Zoom in`,type:`button`,children:(0,O.jsx)(iC,{size:16})}),(0,O.jsx)(`button`,{className:`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,disabled:u<=n,onClick:S,title:`Zoom out`,type:`button`,children:(0,O.jsx)(aC,{size:16})}),(0,O.jsx)(`button`,{className:`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,onClick:ee,title:`Reset zoom and pan`,type:`button`,children:(0,O.jsx)(nC,{size:16})})]}),(0,O.jsx)(`div`,{className:PD(`origin-center transition-transform duration-150 ease-out`,s&&`flex w-full items-center justify-center`),onPointerDown:te,ref:l,role:`application`,style:{transform:`translate(${f.x}px, ${f.y}px) scale(${u})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},lk=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[a,o]=(0,T.useState)(null),[s,c]=(0,T.useState)(!0),[l,u]=(0,T.useState)(``),[d,f]=(0,T.useState)(``),[p,m]=(0,T.useState)(0),{mermaid:h}=(0,T.useContext)(ik),g=h?.errorComponent;if((0,T.useEffect)(()=>{(async()=>{try{o(null),c(!0);let t=await WD(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);u(a),f(a)}catch(e){d||l||o(e instanceof Error?e.message:`Failed to render Mermaid chart`)}finally{c(!1)}})()},[e,n,p]),s&&!l&&!d)return(0,O.jsx)(`div`,{className:PD(`my-4 flex justify-center p-4`,t),children:(0,O.jsxs)(`div`,{className:`flex items-center space-x-2 text-muted-foreground`,children:[(0,O.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-current border-b-2`}),(0,O.jsx)(`span`,{className:`text-sm`,children:`Loading diagram...`})]})});if(a&&!l&&!d)return g?(0,O.jsx)(g,{chart:e,error:a,retry:()=>m(e=>e+1)}):(0,O.jsxs)(`div`,{className:PD(`rounded-lg border border-red-200 bg-red-50 p-4`,t),children:[(0,O.jsxs)(`p`,{className:`font-mono text-red-700 text-sm`,children:[`Mermaid Error: `,a]}),(0,O.jsxs)(`details`,{className:`mt-2`,children:[(0,O.jsx)(`summary`,{className:`cursor-pointer text-red-600 text-xs`,children:`Show Code`}),(0,O.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`,children:e})]})]});let _=l||d;return(0,O.jsx)(ck,{className:PD(r?`h-full w-full overflow-hidden`:`my-4 overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,O.jsx)(`div`,{"aria-label":`Mermaid chart`,className:PD(`flex justify-center`,r&&`h-full w-full items-center`),dangerouslySetInnerHTML:{__html:_},role:`img`})})};const uk=({className:e,from:t,...n})=>(0,O.jsx)(`div`,{className:Bt(`group flex w-full max-w-[80%] min-w-0 flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant`,e),...n}),dk=({children:e,className:t,...n})=>(0,O.jsx)(`div`,{className:Bt(`is-user:dark flex w-fit max-w-full flex-col gap-2 overflow-hidden text-sm break-words`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-foreground`,t),style:{overflowWrap:`anywhere`},...n,children:e});(0,T.createContext)(null);const fk=(0,T.memo)(({className:e,...t})=>(0,O.jsx)(sk,{className:Bt(`size-full break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),style:{overflowWrap:`anywhere`},...t}),(e,t)=>e.children===t.children);fk.displayName=`MessageResponse`;function pk({data:e,className:t,onRemove:n,...r}){let i=e.filename||``,a=(e.mediaType?.startsWith(`image/`)&&e.url?`image`:`file`)==`image`,o=i||(a?`Image`:`Attachment`);return(0,O.jsx)(`div`,{className:Bt(`group relative size-24 overflow-hidden rounded-lg`,t),...r,children:a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`img`,{alt:i||`attachment`,className:`size-full object-cover`,height:100,src:e.url,width:100}),n&&(0,O.jsxs)(Ht,{"aria-label":`Remove attachment`,className:`absolute top-2 right-2 size-6 rounded-full bg-background/80 p-0 opacity-0 backdrop-blur-sm transition-opacity hover:bg-background group-hover:opacity-100 [&>svg]:size-3`,onClick:e=>{e.stopPropagation(),n()},type:`button`,variant:`ghost`,children:[(0,O.jsx)(Dn,{}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Remove`})]})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(Kn,{children:[(0,O.jsx)(qn,{asChild:!0,children:(0,O.jsx)(`div`,{className:`flex size-full shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,O.jsx)(Sn,{className:`size-4`})})}),(0,O.jsx)(Jn,{children:(0,O.jsx)(`p`,{children:o})})]}),n&&(0,O.jsxs)(Ht,{"aria-label":`Remove attachment`,className:`size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-accent group-hover:opacity-100 [&>svg]:size-3`,onClick:e=>{e.stopPropagation(),n()},type:`button`,variant:`ghost`,children:[(0,O.jsx)(Dn,{}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Remove`})]})]})})}function mk({children:e,className:t,...n}){return e?(0,O.jsx)(`div`,{className:Bt(`ml-auto flex w-fit flex-wrap items-start gap-2`,t),...n,children:e}):null}function hk({...e}){return(0,O.jsx)(v,{"data-slot":`hover-card`,...e})}function gk({...e}){return(0,O.jsx)(x,{"data-slot":`hover-card-trigger`,...e})}function _k({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,O.jsx)(c,{"data-slot":`hover-card-portal`,children:(0,O.jsx)(m,{"data-slot":`hover-card-content`,align:t,sideOffset:n,className:Bt(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...r})})}function vk({className:e,...t}){return(0,O.jsx)(`textarea`,{"data-slot":`textarea`,className:Bt(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),...t})}function yk({className:e,...t}){return(0,O.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:Bt(`group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none`,`h-9 min-w-0 has-[>textarea]:h-auto`,`has-[>[data-align=inline-start]]:[&>input]:pl-2`,`has-[>[data-align=inline-end]]:[&>input]:pr-2`,`has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3`,`has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3`,`has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]`,`has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40`,e),...t})}var bk=ye(`text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50`,{variants:{align:{"inline-start":`order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]`,"inline-end":`order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]`,"block-start":`order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5`,"block-end":`order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5`}},defaultVariants:{align:`inline-start`}});function xk({className:e,align:t=`inline-start`,...n}){return(0,O.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:Bt(bk({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var Sk=ye(`text-sm shadow-none flex gap-2 items-center`,{variants:{size:{xs:`h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2`,sm:`h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5`,"icon-xs":`size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function Ck({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,O.jsx)(Ht,{type:t,"data-size":r,variant:n,className:Bt(Sk({size:r}),e),...i})}function wk({className:e,...t}){return(0,O.jsx)(vk,{"data-slot":`input-group-control`,className:Bt(`flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent`,e),...t})}let Tk=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[n[e]&63];return t};var Ek=(0,T.createContext)(null),Dk=(0,T.createContext)(null),Ok=()=>(0,T.useContext)(Ek),kk=()=>(0,T.useContext)(Dk),Ak=(0,T.createContext)(null);const jk=()=>{let e=kk(),t=(0,T.useContext)(Ak),n=e??t;if(!n)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return n};function Mk({data:e,className:t,...n}){let r=jk(),i=e.filename||``,a=(e.mediaType?.startsWith(`image/`)&&e.url?`image`:`file`)==`image`,o=i||(a?`Image`:`Attachment`);return(0,O.jsxs)(Bk,{children:[(0,O.jsx)(gk,{asChild:!0,children:(0,O.jsxs)(`div`,{className:Bt(`group relative flex h-8 cursor-pointer select-none items-center gap-1.5 rounded-md border border-border px-1.5 font-medium text-sm transition-all hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,t),...n,children:[(0,O.jsxs)(`div`,{className:`relative size-5 shrink-0`,children:[(0,O.jsx)(`div`,{className:`absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded bg-background transition-opacity group-hover:opacity-0`,children:a?(0,O.jsx)(`img`,{alt:i||`attachment`,className:`size-5 object-cover`,height:20,src:e.url,width:20}):(0,O.jsx)(`div`,{className:`flex size-5 items-center justify-center text-muted-foreground`,children:(0,O.jsx)(Sn,{className:`size-3`})})}),(0,O.jsxs)(Ht,{"aria-label":`Remove attachment`,className:`absolute inset-0 size-5 cursor-pointer rounded p-0 opacity-0 transition-opacity group-hover:pointer-events-auto group-hover:opacity-100 [&>svg]:size-2.5`,onClick:t=>{t.stopPropagation(),r.remove(e.id)},type:`button`,variant:`ghost`,children:[(0,O.jsx)(Dn,{}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Remove`})]})]}),(0,O.jsx)(`span`,{className:`flex-1 truncate`,children:o})]},e.id)}),(0,O.jsx)(Vk,{className:`w-auto p-2`,children:(0,O.jsxs)(`div`,{className:`w-auto space-y-3`,children:[a&&(0,O.jsx)(`div`,{className:`flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border`,children:(0,O.jsx)(`img`,{alt:i||`attachment preview`,className:`max-h-full max-w-full object-contain`,height:384,src:e.url,width:448})}),(0,O.jsx)(`div`,{className:`flex items-center gap-2.5`,children:(0,O.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1 px-0.5`,children:[(0,O.jsx)(`h4`,{className:`truncate font-semibold text-sm leading-none`,children:i||(a?`Image`:`Attachment`)}),e.mediaType&&(0,O.jsx)(`p`,{className:`truncate font-mono text-muted-foreground text-xs`,children:e.mediaType})]})})]})})]})}function Nk({children:e,className:t,...n}){let r=jk();return r.files.length?(0,O.jsx)(`div`,{className:Bt(`flex flex-wrap items-center gap-2 p-3 w-full`,t),...n,children:r.files.map(t=>(0,O.jsx)(T.Fragment,{children:e(t)},t.id))}):null}const Pk=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=Ok(),f=!!d,p=(0,T.useRef)(null),m=(0,T.useRef)(null),[h,g]=(0,T.useState)([]),_=f?d.attachments.files:h,v=(0,T.useRef)(_);v.current=_;let y=(0,T.useCallback)(()=>{p.current?.click()},[]),b=(0,T.useCallback)(e=>!t||t.trim()===``?!0:t.includes(`image/*`)?e.type.startsWith(`image/`):!0,[t]),x=(0,T.useCallback)(e=>{let t=Array.from(e),n=t.filter(e=>b(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>o?e.size<=o:!0);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}g(e=>{let t=typeof a==`number`?Math.max(0,a-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&s?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({id:Tk(),type:`file`,url:URL.createObjectURL(e),mediaType:e.type,filename:e.name});return e.concat(i)})},[b,a,o,s]),S=(0,T.useCallback)(e=>g(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),ee=(0,T.useCallback)(()=>g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[]),C=f?d.attachments.add:x,te=f?d.attachments.remove:S,ne=f?d.attachments.clear:ee,re=f?d.attachments.openFileDialog:y;(0,T.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,T.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,T.useEffect)(()=>{let e=m.current;if(!e)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&C(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[C]),(0,T.useEffect)(()=>{if(!r)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&C(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[C,r]),(0,T.useEffect)(()=>()=>{if(!f)for(let e of v.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let ie=e=>{e.currentTarget.files&&C(e.currentTarget.files),e.currentTarget.value=``},ae=async e=>{try{let t=await(await fetch(e)).blob();return new Promise(e=>{let n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>e(null),n.readAsDataURL(t)})}catch{return null}},oe=(0,T.useMemo)(()=>({files:_.map(e=>({...e,id:e.id})),add:C,remove:te,clear:ne,openFileDialog:re,fileInputRef:p}),[_,C,te,ne,re]),se=e=>{e.preventDefault();let t=e.currentTarget,n=f?d.textInput.value:(()=>new FormData(t).get(`message`)||``)();f||t.reset(),Promise.all(_.map(async({id:e,...t})=>{if(t.url&&t.url.startsWith(`blob:`)){let e=await ae(t.url);return{...t,url:e??t.url}}return t})).then(t=>{try{let r=c({text:n,files:t},e);r instanceof Promise?r.then(()=>{ne(),f&&d.textInput.clear()}).catch(()=>{}):(ne(),f&&d.textInput.clear())}catch{}}).catch(()=>{})},ce=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:ie,ref:p,title:`Upload files`,type:`file`}),(0,O.jsx)(`form`,{className:Bt(`w-full`,e),onSubmit:se,ref:m,...u,children:(0,O.jsx)(yk,{className:`overflow-hidden`,children:l})})]});return f?ce:(0,O.jsx)(Ak.Provider,{value:oe,children:ce})},Fk=({onChange:e,className:t,placeholder:n=`What would you like to know?`,...r})=>{let i=Ok(),a=jk(),[o,s]=(0,T.useState)(!1),c=e=>{if(e.key===`Enter`){if(o||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let t=e.currentTarget.form;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&a.files.length>0){e.preventDefault();let t=a.files.at(-1);t&&a.remove(t.id)}},l=e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),a.add(n))},u=i?{value:i.textInput.value,onChange:t=>{i.textInput.setInput(t.currentTarget.value),e?.(t)}}:{onChange:e};return(0,O.jsx)(wk,{className:Bt(`field-sizing-content max-h-48 min-h-16`,t),name:`message`,onCompositionEnd:()=>s(!1),onCompositionStart:()=>s(!0),onKeyDown:c,onPaste:l,placeholder:n,...r,...u})},Ik=({className:e,...t})=>(0,O.jsx)(xk,{align:`block-end`,className:Bt(`order-first flex-wrap gap-1`,e),...t}),Lk=({className:e,...t})=>(0,O.jsx)(xk,{align:`block-end`,className:Bt(`justify-between gap-1`,e),...t}),Rk=({variant:e=`ghost`,className:t,size:n,...r})=>{let i=n??(T.Children.count(r.children)>1?`sm`:`icon-sm`);return(0,O.jsx)(Ck,{className:Bt(t),size:i,type:`button`,variant:e,...r})},zk=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,children:i,...a})=>{let o=(0,O.jsx)(yn,{className:`size-4`});return r===`submitted`?o=(0,O.jsx)(xn,{className:`size-4 animate-spin`}):r===`streaming`?o=(0,O.jsx)(Tn,{className:`size-4`}):r===`error`&&(o=(0,O.jsx)(Dn,{className:`size-4`})),(0,O.jsx)(Ck,{"aria-label":`Submit`,className:Bt(e),size:n,type:`submit`,variant:t,...a,children:i??o})},Bk=({openDelay:e=0,closeDelay:t=0,...n})=>(0,O.jsx)(hk,{closeDelay:t,openDelay:e,...n}),Vk=({align:e=`start`,...t})=>(0,O.jsx)(_k,{align:e,...t});var Hk=ye(`inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`}},defaultVariants:{variant:`default`}});function Uk({className:e,variant:t,asChild:n=!1,...r}){return(0,O.jsx)(n?f:`span`,{"data-slot":`badge`,className:Bt(Hk({variant:t}),e),...r})}function Wk({...e}){return(0,O.jsx)(b,{"data-slot":`collapsible`,...e})}function Gk({...e}){return(0,O.jsx)(_,{"data-slot":`collapsible-trigger`,...e})}function Kk({...e}){return(0,O.jsx)(S,{"data-slot":`collapsible-content`,...e})}var qk=(0,T.createContext)({code:``}),Jk={name:`line-numbers`,line(e,t){e.children.unshift({type:`element`,tagName:`span`,properties:{className:[`inline-block`,`min-w-10`,`mr-4`,`text-right`,`select-none`,`text-muted-foreground`]},children:[{type:`text`,value:String(t)}]})}};async function Yk(e,t,n=!1){let r=n?[Jk]:[];return await Promise.all([w(e,{lang:t,theme:`one-light`,transformers:r}),w(e,{lang:t,theme:`one-dark-pro`,transformers:r})])}const Xk=({code:e,language:t,showLineNumbers:n=!1,className:r,children:i,...a})=>{let[o,s]=(0,T.useState)(``),[c,l]=(0,T.useState)(``),u=(0,T.useRef)(!1);return(0,T.useEffect)(()=>(Yk(e,t,n).then(([e,t])=>{u.current||=(s(e),l(t),!0)}),()=>{u.current=!1}),[e,t,n]),(0,O.jsx)(qk.Provider,{value:{code:e},children:(0,O.jsx)(`div`,{className:Bt(`group relative w-full overflow-hidden rounded-md border bg-background text-foreground`,r),...a,children:(0,O.jsxs)(`div`,{className:`relative`,children:[(0,O.jsx)(`div`,{className:`overflow-x-auto dark:hidden [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&>pre]:whitespace-pre-wrap [&>pre]:break-all [&_code]:font-mono [&_code]:text-sm [&_code]:whitespace-pre-wrap [&_code]:break-all`,dangerouslySetInnerHTML:{__html:o}}),(0,O.jsx)(`div`,{className:`hidden overflow-x-auto dark:block [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&>pre]:whitespace-pre-wrap [&>pre]:break-all [&_code]:font-mono [&_code]:text-sm [&_code]:whitespace-pre-wrap [&_code]:break-all`,dangerouslySetInnerHTML:{__html:c}}),i&&(0,O.jsx)(`div`,{className:`absolute top-2 right-2 flex items-center gap-2`,children:i})]})})})},Zk=({className:e,...t})=>(0,O.jsx)(Wk,{className:Bt(`not-prose mb-4 w-full max-w-full overflow-hidden rounded-md border`,e),...t});var Qk=e=>{let t={"input-streaming":`Pending`,"input-available":`Running`,"approval-requested":`Awaiting Approval`,"approval-responded":`Responded`,"output-available":`Completed`,"output-error":`Error`,"output-denied":`Denied`,"waiting-for-confirmation":`Awaiting Approval`,rejected:`Rejected`};return(0,O.jsxs)(Uk,{className:`gap-1.5 rounded-full text-xs`,variant:`secondary`,children:[{"input-streaming":(0,O.jsx)(_n,{className:`size-4`}),"input-available":(0,O.jsx)(vn,{className:`size-4 animate-pulse`}),"approval-requested":(0,O.jsx)(vn,{className:`size-4 text-yellow-600`}),"approval-responded":(0,O.jsx)(hn,{className:`size-4 text-blue-600`}),"output-available":(0,O.jsx)(hn,{className:`size-4 text-green-600`}),"output-error":(0,O.jsx)(gn,{className:`size-4 text-red-600`}),"output-denied":(0,O.jsx)(gn,{className:`size-4 text-orange-600`}),"waiting-for-confirmation":(0,O.jsx)(vn,{className:`size-4 text-yellow-600`}),rejected:(0,O.jsx)(gn,{className:`size-4 text-orange-600`})}[e],t[e]]})};const $k=({className:e,title:t,type:n,state:r,...i})=>(0,O.jsxs)(Gk,{className:Bt(`flex w-full items-center justify-between gap-4 p-3`,e),...i,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(En,{className:`size-4 text-muted-foreground`}),(0,O.jsx)(`span`,{className:`font-medium text-sm`,children:t??n.split(`-`).slice(1).join(`-`)}),Qk(r)]}),(0,O.jsx)(mn,{className:`size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]}),eA=({className:e,...t})=>(0,O.jsx)(Kk,{className:Bt(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),tA=({className:e,input:t,...n})=>(0,O.jsxs)(`div`,{className:Bt(`space-y-2 overflow-hidden p-4 max-w-full`,e),...n,children:[(0,O.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:`Parameters`}),(0,O.jsx)(`div`,{className:`rounded-md bg-muted/50 overflow-hidden`,children:(0,O.jsx)(Xk,{code:JSON.stringify(t,null,2),language:`json`})})]}),nA=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,O.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,T.isValidElement)(t)?i=(0,O.jsx)(Xk,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,O.jsx)(Xk,{code:t,language:`json`})),(0,O.jsxs)(`div`,{className:Bt(`space-y-2 p-4 max-w-full overflow-hidden`,e),...r,children:[(0,O.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:n?`Error`:`Result`}),(0,O.jsxs)(`div`,{className:Bt(`overflow-hidden rounded-md text-xs [&_table]:w-full`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,O.jsx)(`div`,{className:`p-2`,children:n}),i]})]})};var rA=(0,T.createContext)({});function iA(e){let t=(0,T.useRef)(null);return t.current===null&&(t.current=e()),t.current}var aA=typeof window<`u`,oA=aA?T.useLayoutEffect:T.useEffect,sA=(0,T.createContext)(null);function cA(e,t){e.indexOf(t)===-1&&e.push(t)}function lA(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var uA=(e,t,n)=>n>t?t:n<e?e:n,dA={},fA=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function pA(e){return typeof e==`object`&&!!e}var mA=e=>/^0[^.\s]+$/u.test(e);function hA(e){let t;return()=>(t===void 0&&(t=e()),t)}var gA=e=>e,_A=(e,t)=>n=>t(e(n)),vA=(...e)=>e.reduce(_A),yA=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},bA=class{constructor(){this.subscriptions=[]}add(e){return cA(this.subscriptions,e),()=>lA(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},xA=e=>e*1e3,SA=e=>e/1e3;function CA(e,t){return t?1e3/t*e:0}var wA=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,TA=1e-7,EA=12;function DA(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=wA(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>TA&&++s<EA);return o}function OA(e,t,n,r){if(e===t&&n===r)return gA;let i=t=>DA(t,0,1,e,n);return e=>e===0||e===1?e:wA(i(e),t,r)}var kA=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,AA=e=>t=>1-e(1-t),jA=OA(.33,1.53,.69,.99),MA=AA(jA),NA=kA(MA),PA=e=>(e*=2)<1?.5*MA(e):.5*(2-2**(-10*(e-1))),FA=e=>1-Math.sin(Math.acos(e)),IA=AA(FA),LA=kA(FA),RA=OA(.42,0,1,1),zA=OA(0,0,.58,1),BA=OA(.42,0,.58,1),VA=e=>Array.isArray(e)&&typeof e[0]!=`number`,HA=e=>Array.isArray(e)&&typeof e[0]==`number`,UA={linear:gA,easeIn:RA,easeInOut:BA,easeOut:zA,circIn:FA,circInOut:LA,circOut:IA,backIn:MA,backInOut:NA,backOut:jA,anticipate:PA},WA=e=>typeof e==`string`,GA=e=>{if(HA(e)){e.length;let[t,n,r,i]=e;return OA(t,n,r,i)}else if(WA(e))return UA[e],`${e}`,UA[e];return e},KA=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],qA={value:null,addProjectionMetrics:null};function JA(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),t&&qA.value&&qA.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var YA=40;function XA(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=KA.reduce((e,n)=>(e[n]=JA(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=dA.useManualTiming?i.timestamp:performance.now();n=!1,dA.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,YA),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:KA.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<KA.length;t++)o[KA[t]].cancel(e)},state:i,steps:o}}var{schedule:ZA,cancel:QA,state:$A,steps:ej}=XA(typeof requestAnimationFrame<`u`?requestAnimationFrame:gA,!0),tj;function nj(){tj=void 0}var rj={now:()=>(tj===void 0&&rj.set($A.isProcessing||dA.useManualTiming?$A.timestamp:performance.now()),tj),set:e=>{tj=e,queueMicrotask(nj)}},ij={layout:0,mainThread:0,waapi:0},aj=e=>t=>typeof t==`string`&&t.startsWith(e),oj=aj(`--`),sj=aj(`var(--`),cj=e=>sj(e)?lj.test(e.split(`/*`)[0].trim()):!1,lj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function uj(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var dj={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},fj={...dj,transform:e=>uA(0,1,e)},pj={...dj,default:1},mj=e=>Math.round(e*1e5)/1e5,hj=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gj(e){return e==null}var _j=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vj=(e,t)=>n=>!!(typeof n==`string`&&_j.test(n)&&n.startsWith(e)||t&&!gj(n)&&Object.prototype.hasOwnProperty.call(n,t)),yj=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(hj);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},bj=e=>uA(0,255,e),xj={...dj,transform:e=>Math.round(bj(e))},Sj={test:vj(`rgb`,`red`),parse:yj(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+xj.transform(e)+`, `+xj.transform(t)+`, `+xj.transform(n)+`, `+mj(fj.transform(r))+`)`};function Cj(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var wj={test:vj(`#`),parse:Cj,transform:Sj.transform},Tj=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ej=Tj(`deg`),Dj=Tj(`%`),$=Tj(`px`),Oj=Tj(`vh`),kj=Tj(`vw`),Aj=(()=>({...Dj,parse:e=>Dj.parse(e)/100,transform:e=>Dj.transform(e*100)}))(),jj={test:vj(`hsl`,`hue`),parse:yj(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Dj.transform(mj(t))+`, `+Dj.transform(mj(n))+`, `+mj(fj.transform(r))+`)`},Mj={test:e=>Sj.test(e)||wj.test(e)||jj.test(e),parse:e=>Sj.test(e)?Sj.parse(e):jj.test(e)?jj.parse(e):wj.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Sj.transform(e):jj.transform(e),getAnimatableNone:e=>{let t=Mj.parse(e);return t.alpha=0,Mj.transform(t)}},Nj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Pj(e){return isNaN(e)&&typeof e==`string`&&(e.match(hj)?.length||0)+(e.match(Nj)?.length||0)>0}var Fj=`number`,Ij=`color`,Lj=`var`,Rj=`var(`,zj="${}",Bj=/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+)/giu;function Vj(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Bj,e=>(Mj.test(e)?(r.color.push(a),i.push(Ij),n.push(Mj.parse(e))):e.startsWith(Rj)?(r.var.push(a),i.push(Lj),n.push(e)):(r.number.push(a),i.push(Fj),n.push(parseFloat(e))),++a,zj)).split(zj),indexes:r,types:i}}function Hj(e){return Vj(e).values}function Uj(e){let{split:t,types:n}=Vj(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===Fj?i+=mj(e[a]):t===Ij?i+=Mj.transform(e[a]):i+=e[a]}return i}}var Wj=e=>typeof e==`number`?0:Mj.test(e)?Mj.getAnimatableNone(e):e;function Gj(e){let t=Hj(e);return Uj(e)(t.map(Wj))}var Kj={test:Pj,parse:Hj,createTransformer:Uj,getAnimatableNone:Gj};function qj(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Jj({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=qj(s,r,e+1/3),a=qj(s,r,e),o=qj(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Yj(e,t){return n=>n>0?t:e}var Xj=(e,t,n)=>e+(t-e)*n,Zj=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Qj=[wj,Sj,jj],$j=e=>Qj.find(t=>t.test(e));function eM(e){let t=$j(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===jj&&(n=Jj(n)),n}var tM=(e,t)=>{let n=eM(e),r=eM(t);if(!n||!r)return Yj(e,t);let i={...n};return e=>(i.red=Zj(n.red,r.red,e),i.green=Zj(n.green,r.green,e),i.blue=Zj(n.blue,r.blue,e),i.alpha=Xj(n.alpha,r.alpha,e),Sj.transform(i))},nM=new Set([`none`,`hidden`]);function rM(e,t){return nM.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function iM(e,t){return n=>Xj(e,t,n)}function aM(e){return typeof e==`number`?iM:typeof e==`string`?cj(e)?Yj:Mj.test(e)?tM:lM:Array.isArray(e)?oM:typeof e==`object`?Mj.test(e)?tM:sM:Yj}function oM(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>aM(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function sM(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=aM(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function cM(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var lM=(e,t)=>{let n=Kj.createTransformer(t),r=Vj(e),i=Vj(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?nM.has(e)&&!i.values.length||nM.has(t)&&!r.values.length?rM(e,t):vA(oM(cM(r,i),i.values),n):(`${e}${t}`,Yj(e,t))};function uM(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Xj(e,t,n):aM(e)(e,t)}var dM=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>ZA.update(t,e),stop:()=>QA(t),now:()=>$A.isProcessing?$A.timestamp:rj.now()}},fM=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},pM=2e4;function mM(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function hM(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(mM(r),pM);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:SA(i)}}var gM=5;function _M(e,t,n){let r=Math.max(t-gM,0);return CA(n-e(r),t-r)}var vM={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},yM=.001;function bM({duration:e=vM.duration,bounce:t=vM.bounce,velocity:n=vM.velocity,mass:r=vM.mass}){let i,a;vM.maxDuration;let o=1-t;o=uA(vM.minDamping,vM.maxDamping,o),e=uA(vM.minDuration,vM.maxDuration,SA(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=CM(t,o),c=Math.exp(-i);return yM-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=CM(t**2,o);return(-i(t)+yM>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-yM+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=SM(i,a,s);if(e=xA(e),isNaN(c))return{stiffness:vM.stiffness,damping:vM.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var xM=12;function SM(e,t,n){let r=n;for(let n=1;n<xM;n++)r-=e(r)/t(r);return r}function CM(e,t){return e*Math.sqrt(1-t*t)}var wM=[`duration`,`bounce`],TM=[`stiffness`,`damping`,`mass`];function EM(e,t){return t.some(t=>e[t]!==void 0)}function DM(e){let t={velocity:vM.velocity,stiffness:vM.stiffness,damping:vM.damping,mass:vM.mass,isResolvedFromDuration:!1,...e};if(!EM(e,TM)&&EM(e,wM))if(e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*uA(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:vM.mass,stiffness:i,damping:a}}else{let n=bM(e);t={...t,...n,mass:vM.mass},t.isResolvedFromDuration=!0}return t}function OM(e=vM.visualDuration,t=vM.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=DM({...n,velocity:-SA(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=SA(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?vM.restSpeed.granular:vM.restSpeed.default,i||=v?vM.restDelta.granular:vM.restDelta.default;let y;if(h<1){let e=CM(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=e===0?m:0;h<1&&(n=e===0?xA(m):_M(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(mM(b),pM),t=fM(t=>b.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return b}OM.applyToOptions=e=>{let t=hM(e,100,OM);return e.ease=t.ease,e.duration=xA(t.duration),e.type=`keyframes`,e};function kM({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,ee=e=>{p(f.value)&&(x=e,S=OM({keyframes:[f.value,m(f.value)],velocity:_M(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return ee(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),ee(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function AM(e,t,n){let r=[],i=n||dA.mix||uM,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=vA(Array.isArray(t)?t[n]||gA:t,a)),r.push(a)}return r}function jM(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=AM(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=yA(e[r],e[r+1],n);return s[r](i)};return n?t=>l(uA(e[0],e[a-1],t)):l}function MM(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=yA(0,t,r);e.push(Xj(n,1,i))}}function NM(e){let t=[0];return MM(t,e.length-1),t}function PM(e,t){return e.map(e=>e*t)}function FM(e,t){return e.map(()=>t||BA).splice(0,e.length-1)}function IM({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=VA(r)?r.map(GA):GA(r),a={done:!1,value:t[0]},o=jM(PM(n&&n.length===t.length?n:NM(t),e),t,{ease:Array.isArray(i)?i:FM(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var LM=e=>e!==null;function RM(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(LM),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var zM={decay:kM,inertia:kM,tween:IM,keyframes:IM,spring:OM};function BM(e){typeof e.type==`string`&&(e.type=zM[e.type])}var VM=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},HM=e=>e/100,UM=class extends VM{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==rj.now()&&this.tick(rj.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},ij.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;BM(e);let{type:t=IM,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||IM;s!==IM&&typeof o[0]!=`number`&&(this.mixKeyframes=vA(HM,uM(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=mM(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=uA(0,1,n)*o}let b=_?{done:!1,value:l[0]}:y.next(v);i&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==kM&&(b.value=RM(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return SA(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+SA(e)}get time(){return SA(this.currentTime)}set time(e){e=xA(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?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(rj.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=SA(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=dM,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,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(rj.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,ij.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function WM(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var GM=e=>e*180/Math.PI,KM=e=>JM(GM(Math.atan2(e[1],e[0]))),qM={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:KM,rotateZ:KM,skewX:e=>GM(Math.atan(e[1])),skewY:e=>GM(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},JM=e=>(e%=360,e<0&&(e+=360),e),YM=KM,XM=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ZM=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),QM={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:XM,scaleY:ZM,scale:e=>(XM(e)+ZM(e))/2,rotateX:e=>JM(GM(Math.atan2(e[6],e[5]))),rotateY:e=>JM(GM(Math.atan2(-e[2],e[0]))),rotateZ:YM,rotate:YM,skewX:e=>GM(Math.atan(e[4])),skewY:e=>GM(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function $M(e){return e.includes(`scale`)?1:0}function eN(e,t){if(!e||e===`none`)return $M(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=QM,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=qM,i=t}if(!i)return $M(t);let a=r[t],o=i[1].split(`,`).map(nN);return typeof a==`function`?a(o):o[a]}var tN=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return eN(n,t)};function nN(e){return parseFloat(e.trim())}var rN=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],iN=(()=>new Set(rN))(),aN=e=>e===dj||e===$,oN=new Set([`x`,`y`,`z`]),sN=rN.filter(e=>!oN.has(e));function cN(e){let t=[];return sN.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var lN={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>eN(t,`x`),y:(e,{transform:t})=>eN(t,`y`)};lN.translateX=lN.x,lN.translateY=lN.y;var uN=new Set,dN=!1,fN=!1,pN=!1;function mN(){if(fN){let e=Array.from(uN).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=cN(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}fN=!1,dN=!1,uN.forEach(e=>e.complete(pN)),uN.clear()}function hN(){uN.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fN=!0)})}function gN(){pN=!0,hN(),mN(),pN=!1}var _N=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(uN.add(this),dN||(dN=!0,ZA.read(hN),ZA.resolveKeyframes(mN))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}WM(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),uN.delete(this)}cancel(){this.state===`scheduled`&&(uN.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},vN=e=>e.startsWith(`--`);function yN(e,t,n){vN(t)?e.style.setProperty(t,n):e.style[t]=n}var bN=hA(()=>window.ScrollTimeline!==void 0),xN={};function SN(e,t){let n=hA(e);return()=>xN[t]??n()}var CN=SN(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),wN=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,TN={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:wN([0,.65,.55,1]),circOut:wN([.55,0,1,.45]),backIn:wN([.31,.01,.66,-.59]),backOut:wN([.33,1.53,.69,.99])};function EN(e,t){if(e)return typeof e==`function`?CN()?fM(e,t):`ease-out`:HA(e)?wN(e):Array.isArray(e)?e.map(e=>EN(e,t)||TN.easeOut):TN[e]}function DN(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=EN(s,i);Array.isArray(d)&&(u.easing=d),qA.value&&ij.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return qA.value&&p.finished.finally(()=>{ij.waapi--}),p}function ON(e){return typeof e==`function`&&`applyToOptions`in e}function kN({type:e,...t}){return ON(e)&&CN()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var AN=class extends VM{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=kN(e);this.animation=DN(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=RM(r,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(e):yN(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return SA(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+SA(e)}get time(){return SA(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=xA(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&bN()?(this.animation.timeline=e,gA):t(this)}},jN={anticipate:PA,backInOut:NA,circInOut:LA};function MN(e){return e in jN}function NN(e){typeof e.ease==`string`&&MN(e.ease)&&(e.ease=jN[e.ease])}var PN=10,FN=class extends AN{constructor(e){NN(e),BM(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new UM({...a,autoplay:!1}),s=Math.max(PN,rj.now()-this.startTime),c=uA(0,PN,s-PN);t.setWithVelocity(o.sample(Math.max(0,s-c)).value,o.sample(s).value,c),o.stop()}},IN=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Kj.test(e)||e===`0`)&&!e.startsWith(`url(`));function LN(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function RN(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=IN(i,t),s=IN(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:LN(e)||(n===`spring`||ON(n))&&r}function zN(e){e.duration=0,e.type=`keyframes`}var BN=new Set([`opacity`,`clipPath`,`filter`,`transform`]),VN=hA(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function HN(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return VN()&&n&&BN.has(n)&&(n!==`transform`||!c)&&!s&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var UN=40,WN=class extends VM{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=rj.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||_N)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=rj.now(),RN(e,i,a,o)||((dA.instantAnimations||!s)&&l?.(RM(e,n,t)),e[0]=e[e.length-1],zN(n),n.repeat=0);let u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>UN?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!c&&HN(u),f=u.motionValue?.owner?.current,p=d?new FN({...u,element:f}):new UM(u);p.finished.then(()=>{this.notifyFinished()}).catch(gA),this.pendingTimeline&&=(this.stopTimeline=p.attachTimeline(this.pendingTimeline),void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),gN()),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(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function GN(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var KN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function qN(e){let t=KN.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function JN(e,t,n=1){`${e}`;let[r,i]=qN(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return fA(e)?parseFloat(e):e}return cj(i)?JN(i,t,n+1):i}var YN={type:`spring`,stiffness:500,damping:25,restSpeed:10},XN=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ZN={type:`keyframes`,duration:.8},QN={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},$N=(e,{keyframes:t})=>t.length>2?ZN:iN.has(e)?e.startsWith(`scale`)?XN(t[1]):YN:QN,eP=e=>e!==null;function tP(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(eP),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}function nP(e,t){return e?.[t]??e?.default??e}function rP({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}var iP=(e,t,n,r={},i,a)=>o=>{let s=nP(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=xA(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};rP(s)||Object.assign(u,$N(e,u)),u.duration&&=xA(u.duration),u.repeatDelay&&=xA(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(zN(u),u.delay===0&&(d=!0)),(dA.instantAnimations||dA.skipAnimations)&&(d=!0,zN(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=tP(u.keyframes,s);if(e!==void 0){ZA.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new UM(u):new WN(u)};function aP(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function oP(e,t,n,r){if(typeof t==`function`){let[i,a]=aP(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=aP(r);t=t(n===void 0?e.custom:n,i,a)}return t}function sP(e,t,n){let r=e.getProps();return oP(r,t,n===void 0?r.custom:n,e)}var cP=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...rN]),lP=30,uP=e=>!isNaN(parseFloat(e)),dP={current:void 0},fP=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=rj.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=rj.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uP(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new bA);let n=this.events[e].add(t);return e===`change`?()=>{n(),ZA.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return dP.current&&dP.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=rj.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>lP)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,lP);return CA(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function pP(e,t){return new fP(e,t)}var mP=e=>Array.isArray(e);function hP(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,pP(n))}function gP(e){return mP(e)?e[e.length-1]||0:e}function _P(e,t){let{transitionEnd:n={},transition:r={},...i}=sP(e,t)||{};for(let t in i={...i,...n},i)hP(e,t,gP(i[t]))}var vP=e=>!!(e&&e.getVelocity);function yP(e){return!!(vP(e)&&e.add)}function bP(e,t){let n=e.getValue(`willChange`);if(yP(n))return n.add(t);if(!n&&dA.WillChange){let n=new dA.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function xP(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var SP=`data-`+xP(`framerAppearId`);function CP(e){return e.props[SP]}function wP({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function TP(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=t,c=a?.reduceMotion;r&&(a=r);let l=[],u=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||u&&wP(u,t))continue;let o={delay:n,...nP(a||{},t)},d=r.get();if(d!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===d&&!o.velocity)continue;let f=!1;if(window.MotionHandoffAnimation){let n=CP(e);if(n){let e=window.MotionHandoffAnimation(n,t,ZA);e!==null&&(o.startTime=e,f=!0)}}bP(e,t);let p=c??e.shouldReduceMotion;r.start(iP(t,r,i,p&&cP.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&l.push(m)}return o&&Promise.all(l).then(()=>{ZA.update(()=>{o&&_P(e,o)})}),l}function EP(e,t,n={}){let r=sP(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(TP(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return DP(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function DP(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(EP(c,t,{...o,delay:n+(typeof r==`function`?0:r)+GN(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function OP(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>EP(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=EP(e,t,n);else{let i=typeof t==`function`?sP(e,t,n.custom):t;r=Promise.all(TP(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var kP={test:e=>e===`auto`,parse:e=>e},AP=e=>t=>t.test(e),jP=[dj,$,Dj,Ej,kj,Oj,kP],MP=e=>jP.find(AP(e));function NP(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||mA(e)}var PP=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function FP(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(hj)||[];if(!r)return e;let i=n.replace(r,``),a=PP.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var IP=/\b([a-z-]*)\(.*?\)/gu,LP={...Kj,getAnimatableNone:e=>{let t=e.match(IP);return t?t.map(FP).join(` `):e}},RP={...dj,transform:Math.round},zP={borderWidth:$,borderTopWidth:$,borderRightWidth:$,borderBottomWidth:$,borderLeftWidth:$,borderRadius:$,borderTopLeftRadius:$,borderTopRightRadius:$,borderBottomRightRadius:$,borderBottomLeftRadius:$,width:$,maxWidth:$,height:$,maxHeight:$,top:$,right:$,bottom:$,left:$,inset:$,insetBlock:$,insetBlockStart:$,insetBlockEnd:$,insetInline:$,insetInlineStart:$,insetInlineEnd:$,padding:$,paddingTop:$,paddingRight:$,paddingBottom:$,paddingLeft:$,paddingBlock:$,paddingBlockStart:$,paddingBlockEnd:$,paddingInline:$,paddingInlineStart:$,paddingInlineEnd:$,margin:$,marginTop:$,marginRight:$,marginBottom:$,marginLeft:$,marginBlock:$,marginBlockStart:$,marginBlockEnd:$,marginInline:$,marginInlineStart:$,marginInlineEnd:$,fontSize:$,backgroundPositionX:$,backgroundPositionY:$,rotate:Ej,rotateX:Ej,rotateY:Ej,rotateZ:Ej,scale:pj,scaleX:pj,scaleY:pj,scaleZ:pj,skew:Ej,skewX:Ej,skewY:Ej,distance:$,translateX:$,translateY:$,translateZ:$,x:$,y:$,z:$,perspective:$,transformPerspective:$,opacity:fj,originX:Aj,originY:Aj,originZ:$,zIndex:RP,fillOpacity:fj,strokeOpacity:fj,numOctaves:RP},BP={...zP,color:Mj,backgroundColor:Mj,outlineColor:Mj,fill:Mj,stroke:Mj,borderColor:Mj,borderTopColor:Mj,borderRightColor:Mj,borderBottomColor:Mj,borderLeftColor:Mj,filter:LP,WebkitFilter:LP},VP=e=>BP[e];function HP(e,t){let n=VP(e);return n!==LP&&(n=Kj),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var UP=new Set([`auto`,`none`,`0`]);function WP(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!UP.has(t)&&Vj(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=HP(n,i)}var GP=class extends _N{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),cj(r))){let i=JN(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!cP.has(n)||e.length!==2)return;let[r,i]=e,a=MP(r),o=MP(i);if(uj(r)!==uj(i)&&lN[n]){this.needsMeasurement=!0;return}if(a!==o)if(aN(a)&&aN(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else lN[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||NP(e[t]))&&n.push(t);n.length&&WP(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=lN[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=lN[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function KP(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var qP=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function JP(e){return pA(e)&&`offsetHeight`in e}var{schedule:YP,cancel:XP}=XA(queueMicrotask,!1),ZP={x:!1,y:!1};function QP(){return ZP.x||ZP.y}function $P(e){return e===`x`||e===`y`?ZP[e]?null:(ZP[e]=!0,()=>{ZP[e]=!1}):ZP.x||ZP.y?null:(ZP.x=ZP.y=!0,()=>{ZP.x=ZP.y=!1})}function eF(e,t){let n=KP(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function tF(e){return!(e.pointerType===`touch`||QP())}function nF(e,t,n={}){let[r,i,a]=eF(e,n),o=e=>{if(!tF(e))return;let{target:n}=e,r=t(n,e);if(typeof r!=`function`||!n)return;let a=e=>{tF(e)&&(r(e),n.removeEventListener(`pointerleave`,a))};n.addEventListener(`pointerleave`,a,i)};return r.forEach(e=>{e.addEventListener(`pointerenter`,o,i)}),a}var rF=(e,t)=>t?e===t?!0:rF(e,t.parentElement):!1,iF=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,aF=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function oF(e){return aF.has(e.tagName)||e.isContentEditable===!0}var sF=new WeakSet;function cF(e){return t=>{t.key===`Enter`&&e(t)}}function lF(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var uF=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=cF(()=>{if(sF.has(n))return;lF(n,`down`);let e=cF(()=>{lF(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>lF(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function dF(e){return iF(e)&&!QP()}function fF(e,t,n={}){let[r,i,a]=eF(e,n),o=e=>{let r=e.currentTarget;if(!dF(e))return;sF.add(r);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),sF.has(r)&&sF.delete(r),dF(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||rF(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),JP(e)&&(e.addEventListener(`focus`,e=>uF(e,i)),!oF(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function pF(e){return pA(e)&&`ownerSVGElement`in e}function mF(e){return pF(e)&&e.tagName===`svg`}var hF=[...jP,Mj,Kj],gF=e=>hF.find(AP(e)),_F=()=>({translate:0,scale:1,origin:0,originPoint:0}),vF=()=>({x:_F(),y:_F()}),yF=()=>({min:0,max:0}),bF=()=>({x:yF(),y:yF()}),xF={current:null},SF={current:!1},CF=typeof window<`u`;function wF(){if(SF.current=!0,CF)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>xF.current=e.matches;e.addEventListener(`change`,t),t()}else xF.current=!1}var TF=new WeakMap;function EF(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function DF(e){return typeof e==`string`||Array.isArray(e)}var OF=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],kF=[`initial`,...OF];function AF(e){return EF(e.animate)||kF.some(t=>DF(e[t]))}function jF(e){return!!(AF(e)||e.variants)}function MF(e,t,n){for(let r in t){let i=t[r],a=n[r];if(vP(i))e.addValue(r,i);else if(vP(a))e.addValue(r,pP(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,pP(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var NF=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],PF={};function FF(e){PF=e}function IF(){return PF}var LF=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=_N,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=()=>{let e=rj.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,ZA.render(this.render,!1,!0))};let{latestValues:s,renderState:c}=a;this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=AF(t),this.isVariantNode=jF(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:l,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in u){let t=u[e];s[e]!==void 0&&vP(t)&&t.set(s[e])}}mount(e){this.current=e,TF.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(SF.current||wF(),this.shouldReduceMotion=xF.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),QA(this.notifyUpdate),QA(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=iN.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&ZA.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in PF){let t=PF[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):bF()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<NF.length;t++){let n=NF[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=MF(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=pP(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){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`&&(fA(n)||mA(n))?n=parseFloat(n):!gF(n)&&Kj.test(t)&&(n=HP(e,t)),this.setBaseTarget(e,vP(n)?n.get():n)),vP(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=oP(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!vP(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new bA),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){YP.render(this.render)}},RF=class extends LF{constructor(){super(...arguments),this.KeyframeResolver=GP}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;vP(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},zF=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function BF({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function VF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function HF(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function UF(e){return e===void 0||e===1}function WF({scale:e,scaleX:t,scaleY:n}){return!UF(e)||!UF(t)||!UF(n)}function GF(e){return WF(e)||KF(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function KF(e){return qF(e.x)||qF(e.y)}function qF(e){return e&&e!==`0%`}function JF(e,t,n){return n+t*(e-n)}function YF(e,t,n,r,i){return i!==void 0&&(e=JF(e,i,r)),JF(e,n,r)+t}function XF(e,t=0,n=1,r,i){e.min=YF(e.min,t,n,r,i),e.max=YF(e.max,t,n,r,i)}function ZF(e,{x:t,y:n}){XF(e.x,t.translate,t.scale,t.originPoint),XF(e.y,n.translate,n.scale,n.originPoint)}var QF=.999999999999,$F=1.0000000000001;function eI(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&rI(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ZF(e,o)),r&&GF(a.latestValues)&&rI(e,a.latestValues))}t.x<$F&&t.x>QF&&(t.x=1),t.y<$F&&t.y>QF&&(t.y=1)}function tI(e,t){e.min+=t,e.max+=t}function nI(e,t,n,r,i=.5){XF(e,t,n,Xj(e.min,e.max,i),r)}function rI(e,t){nI(e.x,t.x,t.scaleX,t.scale,t.originX),nI(e.y,t.y,t.scaleY,t.scale,t.originY)}function iI(e,t){return BF(HF(e.getBoundingClientRect(),t))}function aI(e,t,n){let r=iI(e,n),{scroll:i}=t;return i&&(tI(r.x,i.offset.x),tI(r.y,i.offset.y)),r}var oI={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},sI=rN.length;function cI(e,t,n){let r=``,i=!0;for(let a=0;a<sI;a++){let o=rN[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===(o.startsWith(`scale`)?1:0);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=qP(s,zP[o]);if(!c){i=!1;let t=oI[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function lI(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(iN.has(e)){o=!0;continue}else if(oj(e)){i[e]=n;continue}else{let t=qP(n,zP[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=cI(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function uI(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function dI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var fI={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if($.test(e))e=parseFloat(e);else return e;return`${dI(e,t.target.x)}% ${dI(e,t.target.y)}%`}},pI={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Kj.parse(e);if(i.length>5)return r;let a=Kj.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Xj(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},mI={borderRadius:{...fI,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:fI,borderTopRightRadius:fI,borderBottomLeftRadius:fI,borderBottomRightRadius:fI,boxShadow:pI};function hI(e,{layout:t,layoutId:n}){return iN.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!mI[e]||e===`opacity`)}function gI(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(vP(r[t])||i&&vP(i[t])||hI(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function _I(e){return window.getComputedStyle(e)}var vI=class extends RF{constructor(){super(...arguments),this.type=`html`,this.renderInstance=uI}readValueFromInstance(e,t){if(iN.has(t))return this.projection?.isProjecting?$M(t):tN(e,t);{let n=_I(e),r=(oj(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return iI(e,t)}build(e,t,n){lI(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return gI(e,t,n)}},yI={offset:`stroke-dashoffset`,array:`stroke-dasharray`},bI={offset:`strokeDashoffset`,array:`strokeDasharray`};function xI(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?yI:bI;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var SI=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function CI(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(lI(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of SI)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&xI(d,i,a,o,!1)}var wI=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`]),TI=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function EI(e,t,n,r){for(let n in uI(e,t,void 0,r),t.attrs)e.setAttribute(wI.has(n)?n:xP(n),t.attrs[n])}function DI(e,t,n){let r=gI(e,t,n);for(let n in e)if(vP(e[n])||vP(t[n])){let t=rN.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var OI=class extends RF{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=bF}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(iN.has(t)){let e=VP(t);return e&&e.default||0}return t=wI.has(t)?t:xP(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return DI(e,t,n)}build(e,t,n){CI(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){EI(e,t,n,r)}mount(e){this.isSVGTag=TI(e.tagName),super.mount(e)}},kI=kF.length;function AI(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&AI(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<kI;n++){let r=kF[n],i=e.props[r];(DF(i)||i===!1)&&(t[r]=i)}return t}function jI(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var MI=[...OF].reverse(),NI=OF.length;function PI(e){return t=>Promise.all(t.map(({animation:t,options:n})=>OP(e,t,n)))}function FI(e){let t=PI(e),n=RI(),r=!0,i=t=>(n,r)=>{let i=sP(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(n){t=n(e)}function o(a){let{props:o}=e,s=AI(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<NI;t++){let f=MI[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=DF(m),g=f===a?p.isActive:null;g===!1&&(d=t);let _=m===s[f]&&m!==o[f]&&h;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),p.protectedKeys={...u},!p.isActive&&g===null||!m&&!p.prevProp||EF(m)||typeof m==`boolean`)continue;let v=II(p.prevProp,m),y=v||f===a&&p.isActive&&!_&&h||t>d&&h,b=!1,x=Array.isArray(m)?m:[m],S=x.reduce(i(f),{});g===!1&&(S={});let{prevResolvedValues:ee={}}=p,C={...ee,...S},te=t=>{y=!0,l.has(t)&&(b=!0,l.delete(t)),p.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in C){let t=S[e],n=ee[e];if(u.hasOwnProperty(e))continue;let r=!1;r=mP(t)&&mP(n)?!jI(t,n):t!==n,r?t==null?l.add(e):te(e):t!==void 0&&l.has(e)?te(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(y=!1);let ne=_&&v;y&&(!ne||b)&&c.push(...x.map(t=>{let n={type:f};if(typeof t==`string`&&r&&!ne&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=sP(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=GN(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(l.size){let t={};if(typeof o.initial!=`boolean`){let n=sP(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}l.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let f=!!c.length;return r&&(o.initial===!1||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}function s(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=o(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=RI()}}}function II(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!jI(t,e):!1}function LI(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function RI(){return{animate:LI(!0),whileInView:LI(),whileHover:LI(),whileTap:LI(),whileDrag:LI(),whileFocus:LI(),exit:LI()}}function zI(e,t){e.min=t.min,e.max=t.max}function BI(e,t){zI(e.x,t.x),zI(e.y,t.y)}function VI(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var HI=1e-4,UI=1-HI,WI=1+HI,GI=.01,KI=0-GI,qI=0+GI;function JI(e){return e.max-e.min}function YI(e,t,n){return Math.abs(e-t)<=n}function XI(e,t,n,r=.5){e.origin=r,e.originPoint=Xj(t.min,t.max,e.origin),e.scale=JI(n)/JI(t),e.translate=Xj(n.min,n.max,e.origin)-e.originPoint,(e.scale>=UI&&e.scale<=WI||isNaN(e.scale))&&(e.scale=1),(e.translate>=KI&&e.translate<=qI||isNaN(e.translate))&&(e.translate=0)}function ZI(e,t,n,r){XI(e.x,t.x,n.x,r?r.originX:void 0),XI(e.y,t.y,n.y,r?r.originY:void 0)}function QI(e,t,n){e.min=n.min+t.min,e.max=e.min+JI(t)}function $I(e,t,n){QI(e.x,t.x,n.x),QI(e.y,t.y,n.y)}function eL(e,t,n){e.min=t.min-n.min,e.max=e.min+JI(t)}function tL(e,t,n){eL(e.x,t.x,n.x),eL(e.y,t.y,n.y)}function nL(e,t,n,r,i){return e-=t,e=JF(e,1/n,r),i!==void 0&&(e=JF(e,1/i,r)),e}function rL(e,t=0,n=1,r=.5,i,a=e,o=e){if(Dj.test(t)&&(t=parseFloat(t),t=Xj(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Xj(a.min,a.max,r);e===a&&(s-=t),e.min=nL(e.min,t,n,s,i),e.max=nL(e.max,t,n,s,i)}function iL(e,t,[n,r,i],a,o){rL(e,t[n],t[r],t[i],t.scale,a,o)}var aL=[`x`,`scaleX`,`originX`],oL=[`y`,`scaleY`,`originY`];function sL(e,t,n,r){iL(e.x,t,aL,n?n.x:void 0,r?r.x:void 0),iL(e.y,t,oL,n?n.y:void 0,r?r.y:void 0)}function cL(e){return e.translate===0&&e.scale===1}function lL(e){return cL(e.x)&&cL(e.y)}function uL(e,t){return e.min===t.min&&e.max===t.max}function dL(e,t){return uL(e.x,t.x)&&uL(e.y,t.y)}function fL(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function pL(e,t){return fL(e.x,t.x)&&fL(e.y,t.y)}function mL(e){return JI(e.x)/JI(e.y)}function hL(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function gL(e){return[e(`x`),e(`y`)]}function _L(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var vL=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],yL=vL.length,bL=e=>typeof e==`string`?parseFloat(e):e,xL=e=>typeof e==`number`||$.test(e);function SL(e,t,n,r,i,a){i?(e.opacity=Xj(0,n.opacity??1,wL(r)),e.opacityExit=Xj(t.opacity??1,0,TL(r))):a&&(e.opacity=Xj(t.opacity??1,n.opacity??1,r));for(let i=0;i<yL;i++){let a=`border${vL[i]}Radius`,o=CL(t,a),s=CL(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||xL(o)===xL(s)?(e[a]=Math.max(Xj(bL(o),bL(s),r),0),(Dj.test(s)||Dj.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Xj(t.rotate||0,n.rotate||0,r))}function CL(e,t){return e[t]===void 0?e.borderRadius:e[t]}var wL=EL(0,.5,IA),TL=EL(.5,.95,gA);function EL(e,t,n){return r=>r<e?0:r>t?1:n(yA(e,t,r))}function DL(e,t,n){let r=vP(e)?e:pP(e);return r.start(iP(``,r,t,n)),r.animation}function OL(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var kL=(e,t)=>e.depth-t.depth,AL=class{constructor(){this.children=[],this.isDirty=!1}add(e){cA(this.children,e),this.isDirty=!0}remove(e){lA(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(kL),this.isDirty=!1,this.children.forEach(e)}};function jL(e,t){let n=rj.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(QA(r),e(a-t))};return ZA.setup(r,!0),()=>QA(r)}function ML(e){return vP(e)?e.get():e}var NL=class{constructor(){this.members=[]}add(e){cA(this.members,e),e.scheduleRender()}remove(e){if(lA(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender();let r=n.options.layoutDependency,i=e.options.layoutDependency;r!==void 0&&i!==void 0&&r===i||(e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0));let{crossfade:a}=e.options;a===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}},PL={hasAnimatedSinceResize:!0,hasEverUpdated:!1},FL={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},IL=[``,`X`,`Y`,`Z`],LL=1e3,RL=0;function zL(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function BL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=CP(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,ZA,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&BL(r)}function VL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=RL++,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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,qA.value&&(FL.nodes=FL.calculatedTargetDeltas=FL.calculatedProjections=0),this.nodes.forEach(WL),this.nodes.forEach(ZL),this.nodes.forEach(QL),this.nodes.forEach(GL),qA.addProjectionMetrics&&qA.addProjectionMetrics(FL)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new AL)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new bA),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=pF(t)&&!mF(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;ZA.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=jL(i,250),PL.hasAnimatedSinceResize&&(PL.hasAnimatedSinceResize=!1,this.nodes.forEach(XL)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||aR,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!pL(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...nP(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||XL(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),QA(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach($L),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&BL(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(qL);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(JL);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(YL),this.nodes.forEach(HL),this.nodes.forEach(UL)):this.nodes.forEach(JL),this.clearAllSnapshots();let e=rj.now();$A.delta=uA(0,1e3/60,e-$A.timestamp),$A.timestamp=e,$A.isProcessing=!0,ej.update.process($A),ej.preRender.process($A),ej.render.process($A),$A.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,YP.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(KL),this.sharedNodes.forEach(eR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ZA.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ZA.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!JI(this.snapshot.measuredBox.x)&&!JI(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 e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=bF(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!lL(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||GF(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),lR(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return bF();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(dR))){let{scroll:e}=this.root;e&&(tI(t.x,e.offset.x),tI(t.y,e.offset.y))}return t}removeElementScroll(e){let t=bF();if(BI(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&BI(t,e),tI(t.x,i.offset.x),tI(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=bF();BI(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&rI(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),GF(r.latestValues)&&rI(n,r.latestValues)}return GF(this.latestValues)&&rI(n,this.latestValues),n}removeTransform(e){let t=bF();BI(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!GF(n.latestValues))continue;WF(n.latestValues)&&n.updateSnapshot();let r=bF();BI(r,n.measurePageBox()),sL(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return GF(this.latestValues)&&sL(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}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!==$A.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=$A.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=bF(),this.targetWithTransforms=bF()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),$I(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):BI(this.target,this.layout.layoutBox),ZF(this.target,this.targetDelta)):BI(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),qA.value&&FL.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||WF(this.parent.latestValues)||KF(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=bF(),this.relativeTargetOrigin=bF(),tL(this.relativeTargetOrigin,t,n),BI(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===$A.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;BI(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;eI(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=bF());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(VI(this.prevProjectionDelta.x,this.projectionDelta.x),VI(this.prevProjectionDelta.y,this.projectionDelta.y)),ZI(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!hL(this.projectionDelta.x,this.prevProjectionDelta.x)||!hL(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),qA.value&&FL.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=vF(),this.projectionDelta=vF(),this.projectionDeltaWithTransform=vF()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=vF();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=bF(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(iR));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;tR(a.x,e.x,n),tR(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(tL(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),rR(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&dL(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=bF(),BI(d,this.relativeTarget)),s&&(this.animationValues=i,SL(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(QA(this.pendingAnimation),void 0),this.pendingAnimation=ZA.update(()=>{PL.hasAnimatedSinceResize=!0,ij.layout++,this.motionValue||=pP(0),this.currentAnimation=DL(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{ij.layout--},onComplete:()=>{ij.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(LL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&uR(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||bF();let t=JI(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=JI(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}BI(t,n),rI(t,i),ZI(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new NL),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&zL(`z`,e,r,this.animationValues);for(let t=0;t<IL.length;t++)zL(`rotate${IL[t]}`,e,r,this.animationValues),zL(`skew${IL[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=ML(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=ML(t?.pointerEvents)||``),this.hasProjected&&!GF(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=_L(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;for(let t in e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit,mI){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=mI[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?ML(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(qL),this.root.sharedNodes.clear()}}}function HL(e){e.updateLayout()}function UL(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?gL(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=JI(r);r.min=n[e].min,r.max=r.min+i}):uR(i,t.layoutBox,n)&&gL(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=JI(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=vF();ZI(o,n,t.layoutBox);let s=vF();a?ZI(s,e.applyTransform(r,!0),t.measuredBox):ZI(s,n,t.layoutBox);let c=!lL(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=bF();tL(o,t.layoutBox,i.layoutBox);let s=bF();tL(s,n,a.layoutBox),pL(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function WL(e){qA.value&&FL.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function GL(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KL(e){e.clearSnapshot()}function qL(e){e.clearMeasurements()}function JL(e){e.isLayoutDirty=!1}function YL(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function XL(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ZL(e){e.resolveTargetDelta()}function QL(e){e.calcProjection()}function $L(e){e.resetSkewAndRotation()}function eR(e){e.removeLeadSnapshot()}function tR(e,t,n){e.translate=Xj(t.translate,0,n),e.scale=Xj(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function nR(e,t,n,r){e.min=Xj(t.min,n.min,r),e.max=Xj(t.max,n.max,r)}function rR(e,t,n,r){nR(e.x,t.x,n.x,r),nR(e.y,t.y,n.y,r)}function iR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var aR={duration:.45,ease:[.4,0,.1,1]},oR=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),sR=oR(`applewebkit/`)&&!oR(`chrome/`)?Math.round:gA;function cR(e){e.min=sR(e.min),e.max=sR(e.max)}function lR(e){cR(e.x),cR(e.y)}function uR(e,t,n){return e===`position`||e===`preserve-aspect`&&!YI(mL(t),mL(n),.2)}function dR(e){return e!==e.root&&e.scroll?.wasRoot}var fR=VL({attachResizeListener:(e,t)=>OL(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),pR={current:void 0},mR=VL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pR.current){let e=new fR({});e.mount(window),e.setOptions({layoutScroll:!0}),pR.current=e}return pR.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),hR=(0,T.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function gR(e=!0){let t=(0,T.useContext)(sA);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,T.useId)();(0,T.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,T.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var _R=(0,T.createContext)({strict:!1}),vR={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},yR=!1;function bR(){if(yR)return;let e={};for(let t in vR)e[t]={isEnabled:e=>vR[t].some(t=>!!e[t])};FF(e),yR=!0}function xR(){return bR(),IF()}function SR(e){let t=xR();for(let n in e)t[n]={...t[n],...e[n]};FF(t)}var CR=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function wR(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||CR.has(e)}var TR=r({default:()=>ER},1),ER,DR=t((()=>{throw ER={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),OR=e=>!wR(e);function kR(e){typeof e==`function`&&(OR=t=>t.startsWith(`on`)?!wR(t):e(t))}try{kR((DR(),e(TR)).default)}catch{}function AR(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(OR(i)||n===!0&&wR(i)||!t&&!wR(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var jR=(0,T.createContext)({});function MR(e,t){if(AF(e)){let{initial:t,animate:n}=e;return{initial:t===!1||DF(t)?t:void 0,animate:DF(n)?n:void 0}}return e.inherit===!1?{}:t}function NR(e){let{initial:t,animate:n}=MR(e,(0,T.useContext)(jR));return(0,T.useMemo)(()=>({initial:t,animate:n}),[PR(t),PR(n)])}function PR(e){return Array.isArray(e)?e.join(` `):e}var FR=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function IR(e,t,n){for(let r in t)!vP(t[r])&&!hI(r,n)&&(e[r]=t[r])}function LR({transformTemplate:e},t){return(0,T.useMemo)(()=>{let n=FR();return lI(n,t,e),Object.assign({},n.vars,n.style)},[t])}function RR(e,t){let n=e.style||{},r={};return IR(r,n,e),Object.assign(r,LR(e,t)),r}function zR(e,t){let n={},r=RR(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var BR=()=>({...FR(),attrs:{}});function VR(e,t,n,r){let i=(0,T.useMemo)(()=>{let n=BR();return CI(n,t,TI(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};IR(t,e.style,e),i.style={...t,...i.style}}return i}var HR=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function UR(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(HR.indexOf(e)>-1||/[A-Z]/u.test(e))}function WR(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??UR(e)?VR:zR)(t,r,i,e),c=AR(t,typeof e==`string`,a),l=e===T.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,T.useMemo)(()=>vP(u)?u.get():u,[u]);return(0,T.createElement)(e,{...l,children:d})}function GR({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:KR(n,r,i,e),renderState:t()}}function KR(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=ML(a[e]);let{initial:o,animate:s}=e,c=AF(e),l=jF(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!EF(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=oP(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var qR=e=>(t,n)=>{let r=(0,T.useContext)(jR),i=(0,T.useContext)(sA),a=()=>GR(e,t,r,i);return n?a():iA(a)},JR=qR({scrapeMotionValuesFromProps:gI,createRenderState:FR}),YR=qR({scrapeMotionValuesFromProps:DI,createRenderState:BR}),XR=Symbol.for(`motionComponentSymbol`);function ZR(e,t,n){let r=(0,T.useRef)(n);(0,T.useInsertionEffect)(()=>{r.current=n});let i=(0,T.useRef)(null);return(0,T.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var QR=(0,T.createContext)({});function $R(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function ez(e,t,n,r,i,a){let{visualElement:o}=(0,T.useContext)(jR),s=(0,T.useContext)(_R),c=(0,T.useContext)(sA),l=(0,T.useContext)(hR).reducedMotion,u=(0,T.useRef)(null),d=(0,T.useRef)(!1);r||=s.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,isSVG:a}),d.current&&u.current&&(u.current.manuallyAnimateOnMount=!0));let f=u.current,p=(0,T.useContext)(QR);f&&!f.projection&&i&&(f.type===`html`||f.type===`svg`)&&tz(u.current,n,i,p);let m=(0,T.useRef)(!1);(0,T.useInsertionEffect)(()=>{f&&m.current&&f.update(n,c)});let h=n[SP],g=(0,T.useRef)(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return oA(()=>{d.current=!0,f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),g.current&&f.animationState&&f.animationState.animateChanges())}),(0,T.useEffect)(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),!1),f.enteringChildren=void 0)}),f}function tz(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:nz(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&$R(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function nz(e){if(e)return e.options.allowProjection===!1?nz(e.parent):e.projection}function rz(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&SR(r);let a=n?n===`svg`:UR(e),o=a?YR:JR;function s(n,s){let c,l={...(0,T.useContext)(hR),...n,layoutId:iz(n)},{isStatic:u}=l,d=NR(n),f=o(n,u);if(!u&&aA){az(l,r);let t=oz(l);c=t.MeasureLayout,d.visualElement=ez(e,f,l,i,t.ProjectionNode,a)}return(0,O.jsxs)(jR.Provider,{value:d,children:[c&&d.visualElement?(0,O.jsx)(c,{visualElement:d.visualElement,...l}):null,WR(e,n,ZR(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,T.forwardRef)(s);return c[XR]=e,c}function iz({layoutId:e}){let t=(0,T.useContext)(rA).id;return t&&e!==void 0?t+`-`+e:e}function az(e,t){(0,T.useContext)(_R).strict}function oz(e){let{drag:t,layout:n}=xR();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function sz(e,t){if(typeof Proxy>`u`)return rz;let n=new Map,r=(n,r)=>rz(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,rz(a,void 0,e,t)),n.get(a))})}var cz=(e,t)=>t.isSVG??UR(e)?new OI(t):new vI(t,{allowProjection:e!==T.Fragment}),lz=class extends zF{constructor(e){super(e),e.animationState||=FI(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();EF(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},uz=0,dz={animation:{Feature:lz},exit:{Feature:class extends zF{constructor(){super(...arguments),this.id=uz++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function fz(e){return{point:{x:e.pageX,y:e.pageY}}}var pz=e=>t=>iF(t)&&e(t,fz(t));function mz(e,t,n,r){return OL(e,t,pz(n),r)}var hz=({current:e})=>e?e.ownerDocument.defaultView:null,gz=(e,t)=>Math.abs(e-t);function _z(e,t){let n=gz(e.x,t.x),r=gz(e.y,t.y);return Math.sqrt(n**2+r**2)}var vz=new Set([`auto`,`scroll`]),yz=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=Sz(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=_z(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=$A;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=bz(t,this.transformPagePoint),ZA.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Sz(e.type===`pointercancel`?this.lastMoveEventInfo:bz(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!iF(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=bz(fz(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=$A;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Sz(s,this.history)),this.removeListeners=vA(mz(this.contextWindow,`pointermove`,this.handlePointerMove),mz(this.contextWindow,`pointerup`,this.handlePointerUp),mz(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(vz.has(e.overflowX)||vz.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.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(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?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(e,r),ZA.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),QA(this.updatePoint)}};function bz(e,t){return t?{point:t(e.point)}:e}function xz(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Sz({point:e},t){return{point:e,delta:xz(e,wz(t)),offset:xz(e,Cz(t)),velocity:Tz(t,.1)}}function Cz(e){return e[0]}function wz(e){return e[e.length-1]}function Tz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=wz(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>xA(t)));)n--;if(!r)return{x:0,y:0};let a=SA(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Ez(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Xj(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Xj(n,e,r.max):Math.min(e,n)),e}function Dz(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Oz(e,{top:t,left:n,bottom:r,right:i}){return{x:Dz(e.x,n,i),y:Dz(e.y,t,r)}}function kz(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Az(e,t){return{x:kz(e.x,t.x),y:kz(e.y,t.y)}}function jz(e,t){let n=.5,r=JI(e),i=JI(t);return i>r?n=yA(t.min,t.max-r,e.min):r>i&&(n=yA(e.min,e.max-i,t.min)),uA(0,1,n)}function Mz(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Nz=.35;function Pz(e=Nz){return e===!1?e=0:e===!0&&(e=Nz),{x:Fz(e,`left`,`right`),y:Fz(e,`top`,`bottom`)}}function Fz(e,t,n){return{min:Iz(e,t),max:Iz(e,n)}}function Iz(e,t){return typeof e==`number`?e:e[t]||0}var Lz=new WeakMap,Rz=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=bF(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t?(this.stopAnimation(),this.snapToCursor(fz(e).point)):this.pauseAnimation()},a=(e,t)=>{this.stopAnimation();let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$P(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),gL(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Dj.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=JI(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&ZA.postRender(()=>i(e,t)),bP(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Bz(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>gL(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new yz(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:hz(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&ZA.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!zz(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Ez(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&$R(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Oz(n.layoutBox,e):this.constraints=!1,this.elastic=Pz(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&gL(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Mz(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!$R(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=aI(n,r.root,this.visualElement.getTransformPagePoint()),a=Az(r.layout.layoutBox,i);if(t){let e=t(VF(a));this.hasMutatedConstraints=!!e,e&&(a=BF(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=gL(o=>{if(!zz(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return bP(this.visualElement,e),n.start(iP(e,n,0,t,this.visualElement,!1))}stopAnimation(){gL(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){gL(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){gL(t=>{let{drag:n}=this.getProps();if(!zz(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Xj(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!$R(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};gL(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=jz({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),gL(t=>{if(!zz(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Xj(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;Lz.set(this.visualElement,this);let e=this.visualElement.current,t=mz(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&oF(i);n&&r&&!a&&this.start(t)}),n=()=>{let{dragConstraints:e}=this.getProps();$R(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ZA.read(n);let a=OL(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(gL(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Nz,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function zz(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Bz(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Vz=class extends zF{constructor(e){super(e),this.removeGroupControls=gA,this.removeListeners=gA,this.controls=new Rz(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gA}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Hz=e=>(t,n)=>{e&&ZA.postRender(()=>e(t,n))},Uz=class extends zF{constructor(){super(...arguments),this.removePointerDownListener=gA}onPointerDown(e){this.session=new yz(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:hz(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Hz(e),onStart:Hz(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&ZA.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=mz(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Wz=!1,Gz=class extends T.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Wz&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),PL.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Wz=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||ZA.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),YP.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Wz=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Kz(e){let[t,n]=gR(),r=(0,T.useContext)(rA);return(0,O.jsx)(Gz,{...e,layoutGroup:r,switchLayoutGroup:(0,T.useContext)(QR),isPresent:t,safeToRemove:n})}var qz={pan:{Feature:Uz},drag:{Feature:Vz,ProjectionNode:mR,MeasureLayout:Kz}};function Jz(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&ZA.postRender(()=>i(t,fz(t)))}var Yz=class extends zF{mount(){let{current:e}=this.node;e&&(this.unmount=nF(e,(e,t)=>(Jz(this.node,t,`Start`),e=>Jz(this.node,e,`End`))))}unmount(){}},Xz=class extends zF{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=vA(OL(this.node.current,`focus`,()=>this.onFocus()),OL(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Zz(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&ZA.postRender(()=>i(t,fz(t)))}var Qz=class extends zF{mount(){let{current:e}=this.node;e&&(this.unmount=fF(e,(e,t)=>(Zz(this.node,t,`Start`),(e,{success:t})=>Zz(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}},$z=new WeakMap,eB=new WeakMap,tB=e=>{let t=$z.get(e.target);t&&t(e)},nB=e=>{e.forEach(tB)};function rB({root:e,...t}){let n=e||document;eB.has(n)||eB.set(n,{});let r=eB.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(nB,{root:e,...t})),r[i]}function iB(e,t,n){let r=rB(t);return $z.set(e,n),r.observe(e),()=>{$z.delete(e),r.unobserve(e)}}var aB={some:0,all:1},oB=class extends zF{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:aB[r]};return iB(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(sB(e,t))&&this.startObserver()}unmount(){}};function sB({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var cB={inView:{Feature:oB},tap:{Feature:Qz},focus:{Feature:Xz},hover:{Feature:Yz}},lB={layout:{ProjectionNode:mR,MeasureLayout:Kz}},uB=sz({...dz,...cB,...qz,...lB},cz);const dB=(0,T.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=uB.create(t),o=(0,T.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,O.jsx)(a,{animate:{backgroundPosition:`0% center`},className:Bt(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{repeat:1/0,duration:r,ease:`linear`},children:e})});var fB=(0,T.createContext)(null);const pB=()=>{let e=(0,T.useContext)(fB);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e};var mB=1e3,hB=1e3;const gB=(0,T.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r=!0,onOpenChange:i,duration:a,children:o,...s})=>{let[c,l]=g({prop:n,defaultProp:r,onChange:i}),[u,d]=g({prop:a,defaultProp:void 0}),[f,p]=(0,T.useState)(!1),[m,h]=(0,T.useState)(null);return(0,T.useEffect)(()=>{t?m===null&&h(Date.now()):m!==null&&(d(Math.ceil((Date.now()-m)/hB)),h(null))},[t,m,d]),(0,T.useEffect)(()=>{if(r&&!t&&c&&!f){let e=setTimeout(()=>{l(!1),p(!0)},mB);return()=>clearTimeout(e)}},[t,c,r,l,f]),(0,O.jsx)(fB.Provider,{value:{isStreaming:t,isOpen:c??!1,setIsOpen:l,duration:u},children:(0,O.jsx)(Wk,{className:Bt(`not-prose mb-4`,e),onOpenChange:e=>{l(e)},open:c,...s,children:o})})});var _B=(e,t)=>e||t===0?(0,O.jsx)(dB,{duration:1,children:`Thinking...`}):t===void 0?(0,O.jsx)(`p`,{children:`Thought for a few seconds`}):(0,O.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]});const vB=(0,T.memo)(({className:e,children:t,getThinkingMessage:n=_B,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=pB();return(0,O.jsx)(Gk,{className:Bt(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(fn,{className:`size-4`}),n(i,o),(0,O.jsx)(mn,{className:Bt(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),yB=(0,T.memo)(({className:e,children:t,...n})=>(0,O.jsx)(Kk,{className:Bt(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:t}));gB.displayName=`Reasoning`,vB.displayName=`ReasoningTrigger`,yB.displayName=`ReasoningContent`;function bB(e){switch(e){case`allow_once`:case`allow_always`:return`default`;case`reject_once`:case`reject_always`:return`destructive`;default:return`outline`}}function xB(e){switch(e){case`allow_once`:case`allow_always`:return(0,O.jsx)(pn,{className:`size-4`});case`reject_once`:case`reject_always`:return(0,O.jsx)(Dn,{className:`size-4`});default:return null}}function SB({requestId:e,options:t,onRespond:n,className:r}){let i=t=>{n(e,t.optionId,t.kind)};return(0,O.jsxs)(`div`,{className:Bt(`p-3 border-t border-yellow-500/30 bg-yellow-50/50 dark:bg-yellow-950/10`,r),children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,O.jsx)(wn,{className:`size-4 text-yellow-600 dark:text-yellow-500`}),(0,O.jsx)(`span`,{className:`text-xs font-medium text-yellow-800 dark:text-yellow-200`,children:`Permission Required`})]}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,O.jsxs)(Ht,{variant:bB(e.kind),size:`sm`,onClick:()=>i(e),className:`gap-1.5`,children:[xB(e.kind),e.name]},e.optionId))})]})}function CB(){let e=jk();return(0,O.jsxs)(Rk,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>e.openFileDialog(),children:[(0,O.jsx)(bn,{className:`size-4`}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Attach image`})]})}function wB(e,t){if(e&&e.length>0){let t=[];for(let n of e)n.type===`content`?n.content.type===`text`&&n.content.text&&t.push(n.content.text):n.type===`diff`?t.push(`📝 ${n.path}\n--- Old\n+++ New\n${n.newText}`):n.type===`terminal`&&t.push(`🖥️ Terminal: ${n.terminalId}`);if(t.length>0)return t.length===1?t[0]:t.join(`
|
|
376
|
+
`||e[t]===`\r`);)--t;return t>=1&&e[t]===`$`&&e[t-1]===`$`},QO=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},$O=e=>{let t=KO.test(e),n=qO.test(e);if(t||n)return[e];let r=DD.lex(e,{gfm:!0}),i=[],a=[];for(let e of r){let t=e.raw,n=i.length;if(a.length>0){if(i[n-1]+=t,e.type===`html`){let e=t.match(JO);if(e){let t=e[1];a.at(-1)===t&&a.pop()}}continue}if(e.type===`html`&&e.block){let e=t.match(YO);if(e){let n=e[1];t.includes(`</${n}>`)||a.push(n)}}if(t.trim()===`$$`&&n>0){let e=i[n-1],r=XO(e),a=QO(e);if(r&&a%2==1){i[n-1]=e+t;continue}}if(n>0&&ZO(t)){let e=i[n-1],r=XO(e),a=QO(e),o=QO(t);if(r&&a%2==1&&!XO(t)&&o===1){i[n-1]=e+t;continue}}i.push(t)}return i},ek={raw:gh,katex:[ru,{errorColor:`var(--color-muted-foreground)`}],sanitize:[Fh,{}],harden:[cr,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},tk={gfm:[Bx,{}],math:[Qx,{singleDollarTextMath:!1}],cjkFriendly:[Rg,{}],cjkFriendlyGfmStrikethrough:[Bg,{}]},nk=Object.values(ek),rk=Object.values(tk),ik=(0,T.createContext)({shikiTheme:[`github-light`,`github-dark`],controls:!0,isAnimating:!1,mode:`streaming`,mermaid:void 0}),ak=(0,T.memo)(({content:e,shouldParseIncompleteMarkdown:t,...n})=>{let r=(0,T.useMemo)(()=>typeof e==`string`&&t?HS(e.trim()):e,[e,t]);return(0,O.jsx)(HO,{...n,children:r})},(e,t)=>{if(e.content!==t.content||e.shouldParseIncompleteMarkdown!==t.shouldParseIncompleteMarkdown||e.index!==t.index)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});ak.displayName=`Block`;var ok=[`github-light`,`github-dark`],sk=(0,T.memo)(({children:e,mode:t=`streaming`,parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=nk,remarkPlugins:a=rk,className:o,shikiTheme:s=ok,mermaid:c,controls:l=!0,isAnimating:u=!1,BlockComponent:d=ak,parseMarkdownIntoBlocksFn:f=$O,...p})=>{let m=(0,T.useId)(),[h,g]=(0,T.useTransition)(),[_,v]=(0,T.useState)([]),y=(0,T.useMemo)(()=>f(typeof e==`string`?e:``),[e,f]);(0,T.useEffect)(()=>{t===`streaming`?g(()=>{v(y)}):v(y)},[y,t]);let b=t===`streaming`?_:y,x=(0,T.useMemo)(()=>b.map((e,t)=>`${m}-${t}`),[b.length,m]),S=(0,T.useMemo)(()=>({shikiTheme:s,controls:l,isAnimating:u,mode:t,mermaid:c}),[s,l,u,t,c]),ee=(0,T.useMemo)(()=>({...LO,...r}),[r]);return(0,T.useEffect)(()=>{if(!(Array.isArray(i)&&i.some(e=>Array.isArray(e)?e[0]===ru:e===ru)))return;let t=!1;if(Array.isArray(a)){let e=a.find(e=>Array.isArray(e)?e[0]===Qx:e===Qx);e&&Array.isArray(e)&&e[1]&&(t=e[1].singleDollarTextMath===!0)}let n=typeof e==`string`?e:``,r=n.includes(`$$`),o=t&&(/[^$]\$[^$]/.test(n)||/^\$[^$]/.test(n)||/[^$]\$$/.test(n));(r||o)&&ce(()=>Promise.resolve({}),__vite__mapDeps([26]))},[i,a,e]),t===`static`?(0,O.jsx)(ik.Provider,{value:S,children:(0,O.jsx)(`div`,{className:PD(`space-y-4 whitespace-normal`,o),children:(0,O.jsx)(HO,{components:ee,rehypePlugins:i,remarkPlugins:a,...p,children:e})})}):(0,O.jsx)(ik.Provider,{value:S,children:(0,O.jsx)(`div`,{className:PD(`space-y-4 whitespace-normal`,o),children:b.map((e,t)=>(0,O.jsx)(d,{components:ee,content:e,index:t,rehypePlugins:i,remarkPlugins:a,shouldParseIncompleteMarkdown:n,...p},x[t]))})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode);sk.displayName=`Streamdown`;var ck=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let c=(0,T.useRef)(null),l=(0,T.useRef)(null),[u,d]=(0,T.useState)(o),[f,p]=(0,T.useState)({x:0,y:0}),[m,h]=(0,T.useState)(!1),[g,_]=(0,T.useState)({x:0,y:0}),[v,y]=(0,T.useState)({x:0,y:0}),b=(0,T.useCallback)(e=>{d(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),x=(0,T.useCallback)(()=>{b(i)},[b,i]),S=(0,T.useCallback)(()=>{b(-i)},[b,i]),ee=(0,T.useCallback)(()=>{d(o),p({x:0,y:0})},[o]),C=(0,T.useCallback)(e=>{e.preventDefault(),b(e.deltaY>0?-i:i)},[b,i]),te=(0,T.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;h(!0),_({x:e.clientX,y:e.clientY}),y(f);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[f]),ne=(0,T.useCallback)(e=>{if(!m)return;e.preventDefault();let t=e.clientX-g.x,n=e.clientY-g.y;p({x:v.x+t,y:v.y+n})},[m,g,v]),re=(0,T.useCallback)(e=>{h(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,T.useEffect)(()=>{let e=c.current;if(e)return e.addEventListener(`wheel`,C,{passive:!1}),()=>{e.removeEventListener(`wheel`,C)}},[C]),(0,T.useEffect)(()=>{let e=l.current;if(e&&m)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,ne,{passive:!1}),e.addEventListener(`pointerup`,re),e.addEventListener(`pointercancel`,re),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,ne),e.removeEventListener(`pointerup`,re),e.removeEventListener(`pointercancel`,re)}},[m,ne,re]),(0,O.jsxs)(`div`,{className:PD(`relative`,s?`h-full w-full`:`w-full`,t),ref:c,style:{cursor:m?`grabbing`:`grab`},children:[a&&(0,O.jsxs)(`div`,{className:PD(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,O.jsx)(`button`,{className:`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,disabled:u>=r,onClick:x,title:`Zoom in`,type:`button`,children:(0,O.jsx)(iC,{size:16})}),(0,O.jsx)(`button`,{className:`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,disabled:u<=n,onClick:S,title:`Zoom out`,type:`button`,children:(0,O.jsx)(aC,{size:16})}),(0,O.jsx)(`button`,{className:`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,onClick:ee,title:`Reset zoom and pan`,type:`button`,children:(0,O.jsx)(nC,{size:16})})]}),(0,O.jsx)(`div`,{className:PD(`origin-center transition-transform duration-150 ease-out`,s&&`flex w-full items-center justify-center`),onPointerDown:te,ref:l,role:`application`,style:{transform:`translate(${f.x}px, ${f.y}px) scale(${u})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},lk=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[a,o]=(0,T.useState)(null),[s,c]=(0,T.useState)(!0),[l,u]=(0,T.useState)(``),[d,f]=(0,T.useState)(``),[p,m]=(0,T.useState)(0),{mermaid:h}=(0,T.useContext)(ik),g=h?.errorComponent;if((0,T.useEffect)(()=>{(async()=>{try{o(null),c(!0);let t=await WD(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);u(a),f(a)}catch(e){d||l||o(e instanceof Error?e.message:`Failed to render Mermaid chart`)}finally{c(!1)}})()},[e,n,p]),s&&!l&&!d)return(0,O.jsx)(`div`,{className:PD(`my-4 flex justify-center p-4`,t),children:(0,O.jsxs)(`div`,{className:`flex items-center space-x-2 text-muted-foreground`,children:[(0,O.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-current border-b-2`}),(0,O.jsx)(`span`,{className:`text-sm`,children:`Loading diagram...`})]})});if(a&&!l&&!d)return g?(0,O.jsx)(g,{chart:e,error:a,retry:()=>m(e=>e+1)}):(0,O.jsxs)(`div`,{className:PD(`rounded-lg border border-red-200 bg-red-50 p-4`,t),children:[(0,O.jsxs)(`p`,{className:`font-mono text-red-700 text-sm`,children:[`Mermaid Error: `,a]}),(0,O.jsxs)(`details`,{className:`mt-2`,children:[(0,O.jsx)(`summary`,{className:`cursor-pointer text-red-600 text-xs`,children:`Show Code`}),(0,O.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`,children:e})]})]});let _=l||d;return(0,O.jsx)(ck,{className:PD(r?`h-full w-full overflow-hidden`:`my-4 overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,O.jsx)(`div`,{"aria-label":`Mermaid chart`,className:PD(`flex justify-center`,r&&`h-full w-full items-center`),dangerouslySetInnerHTML:{__html:_},role:`img`})})};const uk=({className:e,from:t,...n})=>(0,O.jsx)(`div`,{className:Bt(`group flex w-full max-w-[80%] min-w-0 flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant`,e),...n}),dk=({children:e,className:t,...n})=>(0,O.jsx)(`div`,{className:Bt(`is-user:dark flex w-fit max-w-full flex-col gap-2 overflow-hidden text-sm break-words`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-foreground`,t),style:{overflowWrap:`anywhere`},...n,children:e});(0,T.createContext)(null);const fk=(0,T.memo)(({className:e,...t})=>(0,O.jsx)(sk,{className:Bt(`size-full break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),style:{overflowWrap:`anywhere`},...t}),(e,t)=>e.children===t.children);fk.displayName=`MessageResponse`;function pk({data:e,className:t,onRemove:n,...r}){let i=e.filename||``,a=(e.mediaType?.startsWith(`image/`)&&e.url?`image`:`file`)==`image`,o=i||(a?`Image`:`Attachment`);return(0,O.jsx)(`div`,{className:Bt(`group relative size-24 overflow-hidden rounded-lg`,t),...r,children:a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`img`,{alt:i||`attachment`,className:`size-full object-cover`,height:100,src:e.url,width:100}),n&&(0,O.jsxs)(Ht,{"aria-label":`Remove attachment`,className:`absolute top-2 right-2 size-6 rounded-full bg-background/80 p-0 opacity-0 backdrop-blur-sm transition-opacity hover:bg-background group-hover:opacity-100 [&>svg]:size-3`,onClick:e=>{e.stopPropagation(),n()},type:`button`,variant:`ghost`,children:[(0,O.jsx)(Dn,{}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Remove`})]})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(Kn,{children:[(0,O.jsx)(qn,{asChild:!0,children:(0,O.jsx)(`div`,{className:`flex size-full shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,O.jsx)(Sn,{className:`size-4`})})}),(0,O.jsx)(Jn,{children:(0,O.jsx)(`p`,{children:o})})]}),n&&(0,O.jsxs)(Ht,{"aria-label":`Remove attachment`,className:`size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-accent group-hover:opacity-100 [&>svg]:size-3`,onClick:e=>{e.stopPropagation(),n()},type:`button`,variant:`ghost`,children:[(0,O.jsx)(Dn,{}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Remove`})]})]})})}function mk({children:e,className:t,...n}){return e?(0,O.jsx)(`div`,{className:Bt(`ml-auto flex w-fit flex-wrap items-start gap-2`,t),...n,children:e}):null}function hk({...e}){return(0,O.jsx)(v,{"data-slot":`hover-card`,...e})}function gk({...e}){return(0,O.jsx)(x,{"data-slot":`hover-card-trigger`,...e})}function _k({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,O.jsx)(c,{"data-slot":`hover-card-portal`,children:(0,O.jsx)(m,{"data-slot":`hover-card-content`,align:t,sideOffset:n,className:Bt(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...r})})}function vk({className:e,...t}){return(0,O.jsx)(`textarea`,{"data-slot":`textarea`,className:Bt(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),...t})}function yk({className:e,...t}){return(0,O.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:Bt(`group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none`,`h-9 min-w-0 has-[>textarea]:h-auto`,`has-[>[data-align=inline-start]]:[&>input]:pl-2`,`has-[>[data-align=inline-end]]:[&>input]:pr-2`,`has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3`,`has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3`,`has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]`,`has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40`,e),...t})}var bk=ye(`text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50`,{variants:{align:{"inline-start":`order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]`,"inline-end":`order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]`,"block-start":`order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5`,"block-end":`order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5`}},defaultVariants:{align:`inline-start`}});function xk({className:e,align:t=`inline-start`,...n}){return(0,O.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:Bt(bk({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var Sk=ye(`text-sm shadow-none flex gap-2 items-center`,{variants:{size:{xs:`h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2`,sm:`h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5`,"icon-xs":`size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function Ck({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,O.jsx)(Ht,{type:t,"data-size":r,variant:n,className:Bt(Sk({size:r}),e),...i})}function wk({className:e,...t}){return(0,O.jsx)(vk,{"data-slot":`input-group-control`,className:Bt(`flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent`,e),...t})}let Tk=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[n[e]&63];return t};var Ek=(0,T.createContext)(null),Dk=(0,T.createContext)(null),Ok=()=>(0,T.useContext)(Ek),kk=()=>(0,T.useContext)(Dk),Ak=(0,T.createContext)(null);const jk=()=>{let e=kk(),t=(0,T.useContext)(Ak),n=e??t;if(!n)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return n};function Mk({data:e,className:t,...n}){let r=jk(),i=e.filename||``,a=(e.mediaType?.startsWith(`image/`)&&e.url?`image`:`file`)==`image`,o=i||(a?`Image`:`Attachment`);return(0,O.jsxs)(Bk,{children:[(0,O.jsx)(gk,{asChild:!0,children:(0,O.jsxs)(`div`,{className:Bt(`group relative flex h-8 cursor-pointer select-none items-center gap-1.5 rounded-md border border-border px-1.5 font-medium text-sm transition-all hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,t),...n,children:[(0,O.jsxs)(`div`,{className:`relative size-5 shrink-0`,children:[(0,O.jsx)(`div`,{className:`absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded bg-background transition-opacity group-hover:opacity-0`,children:a?(0,O.jsx)(`img`,{alt:i||`attachment`,className:`size-5 object-cover`,height:20,src:e.url,width:20}):(0,O.jsx)(`div`,{className:`flex size-5 items-center justify-center text-muted-foreground`,children:(0,O.jsx)(Sn,{className:`size-3`})})}),(0,O.jsxs)(Ht,{"aria-label":`Remove attachment`,className:`absolute inset-0 size-5 cursor-pointer rounded p-0 opacity-0 transition-opacity group-hover:pointer-events-auto group-hover:opacity-100 [&>svg]:size-2.5`,onClick:t=>{t.stopPropagation(),r.remove(e.id)},type:`button`,variant:`ghost`,children:[(0,O.jsx)(Dn,{}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Remove`})]})]}),(0,O.jsx)(`span`,{className:`flex-1 truncate`,children:o})]},e.id)}),(0,O.jsx)(Vk,{className:`w-auto p-2`,children:(0,O.jsxs)(`div`,{className:`w-auto space-y-3`,children:[a&&(0,O.jsx)(`div`,{className:`flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border`,children:(0,O.jsx)(`img`,{alt:i||`attachment preview`,className:`max-h-full max-w-full object-contain`,height:384,src:e.url,width:448})}),(0,O.jsx)(`div`,{className:`flex items-center gap-2.5`,children:(0,O.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1 px-0.5`,children:[(0,O.jsx)(`h4`,{className:`truncate font-semibold text-sm leading-none`,children:i||(a?`Image`:`Attachment`)}),e.mediaType&&(0,O.jsx)(`p`,{className:`truncate font-mono text-muted-foreground text-xs`,children:e.mediaType})]})})]})})]})}function Nk({children:e,className:t,...n}){let r=jk();return r.files.length?(0,O.jsx)(`div`,{className:Bt(`flex flex-wrap items-center gap-2 p-3 w-full`,t),...n,children:r.files.map(t=>(0,O.jsx)(T.Fragment,{children:e(t)},t.id))}):null}const Pk=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=Ok(),f=!!d,p=(0,T.useRef)(null),m=(0,T.useRef)(null),[h,g]=(0,T.useState)([]),_=f?d.attachments.files:h,v=(0,T.useRef)(_);v.current=_;let y=(0,T.useCallback)(()=>{p.current?.click()},[]),b=(0,T.useCallback)(e=>!t||t.trim()===``?!0:t.includes(`image/*`)?e.type.startsWith(`image/`):!0,[t]),x=(0,T.useCallback)(e=>{let t=Array.from(e),n=t.filter(e=>b(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>o?e.size<=o:!0);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}g(e=>{let t=typeof a==`number`?Math.max(0,a-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&s?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({id:Tk(),type:`file`,url:URL.createObjectURL(e),mediaType:e.type,filename:e.name});return e.concat(i)})},[b,a,o,s]),S=(0,T.useCallback)(e=>g(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),ee=(0,T.useCallback)(()=>g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[]),C=f?d.attachments.add:x,te=f?d.attachments.remove:S,ne=f?d.attachments.clear:ee,re=f?d.attachments.openFileDialog:y;(0,T.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,T.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,T.useEffect)(()=>{let e=m.current;if(!e)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&C(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[C]),(0,T.useEffect)(()=>{if(!r)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&C(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[C,r]),(0,T.useEffect)(()=>()=>{if(!f)for(let e of v.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let ie=e=>{e.currentTarget.files&&C(e.currentTarget.files),e.currentTarget.value=``},ae=async e=>{try{console.log(`[PromptInput] Converting blob URL to data URL...`);let t=await fetch(e);if(!t.ok)return console.error(`[PromptInput] Fetch failed:`,t.status,t.statusText),null;let n=await t.blob();return console.log(`[PromptInput] Blob fetched, size:`,n.size,`type:`,n.type),new Promise(e=>{let t=new FileReader;t.onloadend=()=>{console.log(`[PromptInput] FileReader complete, result length:`,t.result?.length),e(t.result)},t.onerror=()=>{console.error(`[PromptInput] FileReader error:`,t.error),e(null)},t.readAsDataURL(n)})}catch(e){return console.error(`[PromptInput] convertBlobUrlToDataUrl error:`,e),null}},oe=(0,T.useMemo)(()=>({files:_.map(e=>({...e,id:e.id})),add:C,remove:te,clear:ne,openFileDialog:re,fileInputRef:p}),[_,C,te,ne,re]),se=e=>{e.preventDefault();let t=e.currentTarget,n=f?d.textInput.value:(()=>new FormData(t).get(`message`)||``)();f||t.reset(),Promise.all(_.map(async({id:e,...t})=>{if(t.url&&t.url.startsWith(`blob:`)){let e=await ae(t.url);return{...t,url:e??t.url}}return t})).then(t=>{try{let r=c({text:n,files:t},e);r instanceof Promise?r.then(()=>{ne(),f&&d.textInput.clear()}).catch(()=>{}):(ne(),f&&d.textInput.clear())}catch{}}).catch(()=>{})},ce=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:ie,ref:p,title:`Upload files`,type:`file`}),(0,O.jsx)(`form`,{className:Bt(`w-full`,e),onSubmit:se,ref:m,...u,children:(0,O.jsx)(yk,{className:`overflow-hidden`,children:l})})]});return f?ce:(0,O.jsx)(Ak.Provider,{value:oe,children:ce})},Fk=({onChange:e,className:t,placeholder:n=`What would you like to know?`,...r})=>{let i=Ok(),a=jk(),[o,s]=(0,T.useState)(!1),c=e=>{if(e.key===`Enter`){if(o||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let t=e.currentTarget.form;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&a.files.length>0){e.preventDefault();let t=a.files.at(-1);t&&a.remove(t.id)}},l=e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),a.add(n))},u=i?{value:i.textInput.value,onChange:t=>{i.textInput.setInput(t.currentTarget.value),e?.(t)}}:{onChange:e};return(0,O.jsx)(wk,{className:Bt(`field-sizing-content max-h-48 min-h-16`,t),name:`message`,onCompositionEnd:()=>s(!1),onCompositionStart:()=>s(!0),onKeyDown:c,onPaste:l,placeholder:n,...r,...u})},Ik=({className:e,...t})=>(0,O.jsx)(xk,{align:`block-end`,className:Bt(`order-first flex-wrap gap-1`,e),...t}),Lk=({className:e,...t})=>(0,O.jsx)(xk,{align:`block-end`,className:Bt(`justify-between gap-1`,e),...t}),Rk=({variant:e=`ghost`,className:t,size:n,...r})=>{let i=n??(T.Children.count(r.children)>1?`sm`:`icon-sm`);return(0,O.jsx)(Ck,{className:Bt(t),size:i,type:`button`,variant:e,...r})},zk=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,children:i,...a})=>{let o=(0,O.jsx)(yn,{className:`size-4`});return r===`submitted`?o=(0,O.jsx)(xn,{className:`size-4 animate-spin`}):r===`streaming`?o=(0,O.jsx)(Tn,{className:`size-4`}):r===`error`&&(o=(0,O.jsx)(Dn,{className:`size-4`})),(0,O.jsx)(Ck,{"aria-label":`Submit`,className:Bt(e),size:n,type:`submit`,variant:t,...a,children:i??o})},Bk=({openDelay:e=0,closeDelay:t=0,...n})=>(0,O.jsx)(hk,{closeDelay:t,openDelay:e,...n}),Vk=({align:e=`start`,...t})=>(0,O.jsx)(_k,{align:e,...t});var Hk=ye(`inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`}},defaultVariants:{variant:`default`}});function Uk({className:e,variant:t,asChild:n=!1,...r}){return(0,O.jsx)(n?f:`span`,{"data-slot":`badge`,className:Bt(Hk({variant:t}),e),...r})}function Wk({...e}){return(0,O.jsx)(b,{"data-slot":`collapsible`,...e})}function Gk({...e}){return(0,O.jsx)(_,{"data-slot":`collapsible-trigger`,...e})}function Kk({...e}){return(0,O.jsx)(S,{"data-slot":`collapsible-content`,...e})}var qk=(0,T.createContext)({code:``}),Jk={name:`line-numbers`,line(e,t){e.children.unshift({type:`element`,tagName:`span`,properties:{className:[`inline-block`,`min-w-10`,`mr-4`,`text-right`,`select-none`,`text-muted-foreground`]},children:[{type:`text`,value:String(t)}]})}};async function Yk(e,t,n=!1){let r=n?[Jk]:[];return await Promise.all([w(e,{lang:t,theme:`one-light`,transformers:r}),w(e,{lang:t,theme:`one-dark-pro`,transformers:r})])}const Xk=({code:e,language:t,showLineNumbers:n=!1,className:r,children:i,...a})=>{let[o,s]=(0,T.useState)(``),[c,l]=(0,T.useState)(``),u=(0,T.useRef)(!1);return(0,T.useEffect)(()=>(Yk(e,t,n).then(([e,t])=>{u.current||=(s(e),l(t),!0)}),()=>{u.current=!1}),[e,t,n]),(0,O.jsx)(qk.Provider,{value:{code:e},children:(0,O.jsx)(`div`,{className:Bt(`group relative w-full overflow-hidden rounded-md border bg-background text-foreground`,r),...a,children:(0,O.jsxs)(`div`,{className:`relative`,children:[(0,O.jsx)(`div`,{className:`overflow-x-auto dark:hidden [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&>pre]:whitespace-pre-wrap [&>pre]:break-all [&_code]:font-mono [&_code]:text-sm [&_code]:whitespace-pre-wrap [&_code]:break-all`,dangerouslySetInnerHTML:{__html:o}}),(0,O.jsx)(`div`,{className:`hidden overflow-x-auto dark:block [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&>pre]:whitespace-pre-wrap [&>pre]:break-all [&_code]:font-mono [&_code]:text-sm [&_code]:whitespace-pre-wrap [&_code]:break-all`,dangerouslySetInnerHTML:{__html:c}}),i&&(0,O.jsx)(`div`,{className:`absolute top-2 right-2 flex items-center gap-2`,children:i})]})})})},Zk=({className:e,...t})=>(0,O.jsx)(Wk,{className:Bt(`not-prose mb-4 w-full max-w-full overflow-hidden rounded-md border`,e),...t});var Qk=e=>{let t={"input-streaming":`Pending`,"input-available":`Running`,"approval-requested":`Awaiting Approval`,"approval-responded":`Responded`,"output-available":`Completed`,"output-error":`Error`,"output-denied":`Denied`,"waiting-for-confirmation":`Awaiting Approval`,rejected:`Rejected`};return(0,O.jsxs)(Uk,{className:`gap-1.5 rounded-full text-xs`,variant:`secondary`,children:[{"input-streaming":(0,O.jsx)(_n,{className:`size-4`}),"input-available":(0,O.jsx)(vn,{className:`size-4 animate-pulse`}),"approval-requested":(0,O.jsx)(vn,{className:`size-4 text-yellow-600`}),"approval-responded":(0,O.jsx)(hn,{className:`size-4 text-blue-600`}),"output-available":(0,O.jsx)(hn,{className:`size-4 text-green-600`}),"output-error":(0,O.jsx)(gn,{className:`size-4 text-red-600`}),"output-denied":(0,O.jsx)(gn,{className:`size-4 text-orange-600`}),"waiting-for-confirmation":(0,O.jsx)(vn,{className:`size-4 text-yellow-600`}),rejected:(0,O.jsx)(gn,{className:`size-4 text-orange-600`})}[e],t[e]]})};const $k=({className:e,title:t,type:n,state:r,...i})=>(0,O.jsxs)(Gk,{className:Bt(`flex w-full items-center justify-between gap-4 p-3`,e),...i,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(En,{className:`size-4 text-muted-foreground`}),(0,O.jsx)(`span`,{className:`font-medium text-sm`,children:t??n.split(`-`).slice(1).join(`-`)}),Qk(r)]}),(0,O.jsx)(mn,{className:`size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]}),eA=({className:e,...t})=>(0,O.jsx)(Kk,{className:Bt(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),tA=({className:e,input:t,...n})=>(0,O.jsxs)(`div`,{className:Bt(`space-y-2 overflow-hidden p-4 max-w-full`,e),...n,children:[(0,O.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:`Parameters`}),(0,O.jsx)(`div`,{className:`rounded-md bg-muted/50 overflow-hidden`,children:(0,O.jsx)(Xk,{code:JSON.stringify(t,null,2),language:`json`})})]}),nA=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,O.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,T.isValidElement)(t)?i=(0,O.jsx)(Xk,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,O.jsx)(Xk,{code:t,language:`json`})),(0,O.jsxs)(`div`,{className:Bt(`space-y-2 p-4 max-w-full overflow-hidden`,e),...r,children:[(0,O.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:n?`Error`:`Result`}),(0,O.jsxs)(`div`,{className:Bt(`overflow-hidden rounded-md text-xs [&_table]:w-full`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,O.jsx)(`div`,{className:`p-2`,children:n}),i]})]})};var rA=(0,T.createContext)({});function iA(e){let t=(0,T.useRef)(null);return t.current===null&&(t.current=e()),t.current}var aA=typeof window<`u`,oA=aA?T.useLayoutEffect:T.useEffect,sA=(0,T.createContext)(null);function cA(e,t){e.indexOf(t)===-1&&e.push(t)}function lA(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var uA=(e,t,n)=>n>t?t:n<e?e:n,dA={},fA=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function pA(e){return typeof e==`object`&&!!e}var mA=e=>/^0[^.\s]+$/u.test(e);function hA(e){let t;return()=>(t===void 0&&(t=e()),t)}var gA=e=>e,_A=(e,t)=>n=>t(e(n)),vA=(...e)=>e.reduce(_A),yA=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},bA=class{constructor(){this.subscriptions=[]}add(e){return cA(this.subscriptions,e),()=>lA(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},xA=e=>e*1e3,SA=e=>e/1e3;function CA(e,t){return t?1e3/t*e:0}var wA=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,TA=1e-7,EA=12;function DA(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=wA(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>TA&&++s<EA);return o}function OA(e,t,n,r){if(e===t&&n===r)return gA;let i=t=>DA(t,0,1,e,n);return e=>e===0||e===1?e:wA(i(e),t,r)}var kA=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,AA=e=>t=>1-e(1-t),jA=OA(.33,1.53,.69,.99),MA=AA(jA),NA=kA(MA),PA=e=>(e*=2)<1?.5*MA(e):.5*(2-2**(-10*(e-1))),FA=e=>1-Math.sin(Math.acos(e)),IA=AA(FA),LA=kA(FA),RA=OA(.42,0,1,1),zA=OA(0,0,.58,1),BA=OA(.42,0,.58,1),VA=e=>Array.isArray(e)&&typeof e[0]!=`number`,HA=e=>Array.isArray(e)&&typeof e[0]==`number`,UA={linear:gA,easeIn:RA,easeInOut:BA,easeOut:zA,circIn:FA,circInOut:LA,circOut:IA,backIn:MA,backInOut:NA,backOut:jA,anticipate:PA},WA=e=>typeof e==`string`,GA=e=>{if(HA(e)){e.length;let[t,n,r,i]=e;return OA(t,n,r,i)}else if(WA(e))return UA[e],`${e}`,UA[e];return e},KA=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],qA={value:null,addProjectionMetrics:null};function JA(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),t&&qA.value&&qA.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var YA=40;function XA(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=KA.reduce((e,n)=>(e[n]=JA(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=dA.useManualTiming?i.timestamp:performance.now();n=!1,dA.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,YA),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:KA.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<KA.length;t++)o[KA[t]].cancel(e)},state:i,steps:o}}var{schedule:ZA,cancel:QA,state:$A,steps:ej}=XA(typeof requestAnimationFrame<`u`?requestAnimationFrame:gA,!0),tj;function nj(){tj=void 0}var rj={now:()=>(tj===void 0&&rj.set($A.isProcessing||dA.useManualTiming?$A.timestamp:performance.now()),tj),set:e=>{tj=e,queueMicrotask(nj)}},ij={layout:0,mainThread:0,waapi:0},aj=e=>t=>typeof t==`string`&&t.startsWith(e),oj=aj(`--`),sj=aj(`var(--`),cj=e=>sj(e)?lj.test(e.split(`/*`)[0].trim()):!1,lj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function uj(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var dj={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},fj={...dj,transform:e=>uA(0,1,e)},pj={...dj,default:1},mj=e=>Math.round(e*1e5)/1e5,hj=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gj(e){return e==null}var _j=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vj=(e,t)=>n=>!!(typeof n==`string`&&_j.test(n)&&n.startsWith(e)||t&&!gj(n)&&Object.prototype.hasOwnProperty.call(n,t)),yj=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(hj);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},bj=e=>uA(0,255,e),xj={...dj,transform:e=>Math.round(bj(e))},Sj={test:vj(`rgb`,`red`),parse:yj(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+xj.transform(e)+`, `+xj.transform(t)+`, `+xj.transform(n)+`, `+mj(fj.transform(r))+`)`};function Cj(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var wj={test:vj(`#`),parse:Cj,transform:Sj.transform},Tj=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ej=Tj(`deg`),Dj=Tj(`%`),$=Tj(`px`),Oj=Tj(`vh`),kj=Tj(`vw`),Aj=(()=>({...Dj,parse:e=>Dj.parse(e)/100,transform:e=>Dj.transform(e*100)}))(),jj={test:vj(`hsl`,`hue`),parse:yj(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Dj.transform(mj(t))+`, `+Dj.transform(mj(n))+`, `+mj(fj.transform(r))+`)`},Mj={test:e=>Sj.test(e)||wj.test(e)||jj.test(e),parse:e=>Sj.test(e)?Sj.parse(e):jj.test(e)?jj.parse(e):wj.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Sj.transform(e):jj.transform(e),getAnimatableNone:e=>{let t=Mj.parse(e);return t.alpha=0,Mj.transform(t)}},Nj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Pj(e){return isNaN(e)&&typeof e==`string`&&(e.match(hj)?.length||0)+(e.match(Nj)?.length||0)>0}var Fj=`number`,Ij=`color`,Lj=`var`,Rj=`var(`,zj="${}",Bj=/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+)/giu;function Vj(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Bj,e=>(Mj.test(e)?(r.color.push(a),i.push(Ij),n.push(Mj.parse(e))):e.startsWith(Rj)?(r.var.push(a),i.push(Lj),n.push(e)):(r.number.push(a),i.push(Fj),n.push(parseFloat(e))),++a,zj)).split(zj),indexes:r,types:i}}function Hj(e){return Vj(e).values}function Uj(e){let{split:t,types:n}=Vj(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===Fj?i+=mj(e[a]):t===Ij?i+=Mj.transform(e[a]):i+=e[a]}return i}}var Wj=e=>typeof e==`number`?0:Mj.test(e)?Mj.getAnimatableNone(e):e;function Gj(e){let t=Hj(e);return Uj(e)(t.map(Wj))}var Kj={test:Pj,parse:Hj,createTransformer:Uj,getAnimatableNone:Gj};function qj(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Jj({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=qj(s,r,e+1/3),a=qj(s,r,e),o=qj(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Yj(e,t){return n=>n>0?t:e}var Xj=(e,t,n)=>e+(t-e)*n,Zj=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Qj=[wj,Sj,jj],$j=e=>Qj.find(t=>t.test(e));function eM(e){let t=$j(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===jj&&(n=Jj(n)),n}var tM=(e,t)=>{let n=eM(e),r=eM(t);if(!n||!r)return Yj(e,t);let i={...n};return e=>(i.red=Zj(n.red,r.red,e),i.green=Zj(n.green,r.green,e),i.blue=Zj(n.blue,r.blue,e),i.alpha=Xj(n.alpha,r.alpha,e),Sj.transform(i))},nM=new Set([`none`,`hidden`]);function rM(e,t){return nM.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function iM(e,t){return n=>Xj(e,t,n)}function aM(e){return typeof e==`number`?iM:typeof e==`string`?cj(e)?Yj:Mj.test(e)?tM:lM:Array.isArray(e)?oM:typeof e==`object`?Mj.test(e)?tM:sM:Yj}function oM(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>aM(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function sM(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=aM(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function cM(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var lM=(e,t)=>{let n=Kj.createTransformer(t),r=Vj(e),i=Vj(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?nM.has(e)&&!i.values.length||nM.has(t)&&!r.values.length?rM(e,t):vA(oM(cM(r,i),i.values),n):(`${e}${t}`,Yj(e,t))};function uM(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Xj(e,t,n):aM(e)(e,t)}var dM=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>ZA.update(t,e),stop:()=>QA(t),now:()=>$A.isProcessing?$A.timestamp:rj.now()}},fM=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},pM=2e4;function mM(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function hM(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(mM(r),pM);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:SA(i)}}var gM=5;function _M(e,t,n){let r=Math.max(t-gM,0);return CA(n-e(r),t-r)}var vM={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},yM=.001;function bM({duration:e=vM.duration,bounce:t=vM.bounce,velocity:n=vM.velocity,mass:r=vM.mass}){let i,a;vM.maxDuration;let o=1-t;o=uA(vM.minDamping,vM.maxDamping,o),e=uA(vM.minDuration,vM.maxDuration,SA(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=CM(t,o),c=Math.exp(-i);return yM-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=CM(t**2,o);return(-i(t)+yM>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-yM+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=SM(i,a,s);if(e=xA(e),isNaN(c))return{stiffness:vM.stiffness,damping:vM.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var xM=12;function SM(e,t,n){let r=n;for(let n=1;n<xM;n++)r-=e(r)/t(r);return r}function CM(e,t){return e*Math.sqrt(1-t*t)}var wM=[`duration`,`bounce`],TM=[`stiffness`,`damping`,`mass`];function EM(e,t){return t.some(t=>e[t]!==void 0)}function DM(e){let t={velocity:vM.velocity,stiffness:vM.stiffness,damping:vM.damping,mass:vM.mass,isResolvedFromDuration:!1,...e};if(!EM(e,TM)&&EM(e,wM))if(e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*uA(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:vM.mass,stiffness:i,damping:a}}else{let n=bM(e);t={...t,...n,mass:vM.mass},t.isResolvedFromDuration=!0}return t}function OM(e=vM.visualDuration,t=vM.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=DM({...n,velocity:-SA(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=SA(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?vM.restSpeed.granular:vM.restSpeed.default,i||=v?vM.restDelta.granular:vM.restDelta.default;let y;if(h<1){let e=CM(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=e===0?m:0;h<1&&(n=e===0?xA(m):_M(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(mM(b),pM),t=fM(t=>b.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return b}OM.applyToOptions=e=>{let t=hM(e,100,OM);return e.ease=t.ease,e.duration=xA(t.duration),e.type=`keyframes`,e};function kM({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,ee=e=>{p(f.value)&&(x=e,S=OM({keyframes:[f.value,m(f.value)],velocity:_M(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return ee(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),ee(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function AM(e,t,n){let r=[],i=n||dA.mix||uM,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=vA(Array.isArray(t)?t[n]||gA:t,a)),r.push(a)}return r}function jM(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=AM(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=yA(e[r],e[r+1],n);return s[r](i)};return n?t=>l(uA(e[0],e[a-1],t)):l}function MM(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=yA(0,t,r);e.push(Xj(n,1,i))}}function NM(e){let t=[0];return MM(t,e.length-1),t}function PM(e,t){return e.map(e=>e*t)}function FM(e,t){return e.map(()=>t||BA).splice(0,e.length-1)}function IM({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=VA(r)?r.map(GA):GA(r),a={done:!1,value:t[0]},o=jM(PM(n&&n.length===t.length?n:NM(t),e),t,{ease:Array.isArray(i)?i:FM(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var LM=e=>e!==null;function RM(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(LM),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var zM={decay:kM,inertia:kM,tween:IM,keyframes:IM,spring:OM};function BM(e){typeof e.type==`string`&&(e.type=zM[e.type])}var VM=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},HM=e=>e/100,UM=class extends VM{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==rj.now()&&this.tick(rj.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},ij.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;BM(e);let{type:t=IM,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||IM;s!==IM&&typeof o[0]!=`number`&&(this.mixKeyframes=vA(HM,uM(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=mM(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=uA(0,1,n)*o}let b=_?{done:!1,value:l[0]}:y.next(v);i&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==kM&&(b.value=RM(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return SA(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+SA(e)}get time(){return SA(this.currentTime)}set time(e){e=xA(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?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(rj.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=SA(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=dM,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,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(rj.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,ij.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function WM(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var GM=e=>e*180/Math.PI,KM=e=>JM(GM(Math.atan2(e[1],e[0]))),qM={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:KM,rotateZ:KM,skewX:e=>GM(Math.atan(e[1])),skewY:e=>GM(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},JM=e=>(e%=360,e<0&&(e+=360),e),YM=KM,XM=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ZM=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),QM={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:XM,scaleY:ZM,scale:e=>(XM(e)+ZM(e))/2,rotateX:e=>JM(GM(Math.atan2(e[6],e[5]))),rotateY:e=>JM(GM(Math.atan2(-e[2],e[0]))),rotateZ:YM,rotate:YM,skewX:e=>GM(Math.atan(e[4])),skewY:e=>GM(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function $M(e){return e.includes(`scale`)?1:0}function eN(e,t){if(!e||e===`none`)return $M(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=QM,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=qM,i=t}if(!i)return $M(t);let a=r[t],o=i[1].split(`,`).map(nN);return typeof a==`function`?a(o):o[a]}var tN=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return eN(n,t)};function nN(e){return parseFloat(e.trim())}var rN=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],iN=(()=>new Set(rN))(),aN=e=>e===dj||e===$,oN=new Set([`x`,`y`,`z`]),sN=rN.filter(e=>!oN.has(e));function cN(e){let t=[];return sN.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var lN={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>eN(t,`x`),y:(e,{transform:t})=>eN(t,`y`)};lN.translateX=lN.x,lN.translateY=lN.y;var uN=new Set,dN=!1,fN=!1,pN=!1;function mN(){if(fN){let e=Array.from(uN).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=cN(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}fN=!1,dN=!1,uN.forEach(e=>e.complete(pN)),uN.clear()}function hN(){uN.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fN=!0)})}function gN(){pN=!0,hN(),mN(),pN=!1}var _N=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(uN.add(this),dN||(dN=!0,ZA.read(hN),ZA.resolveKeyframes(mN))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}WM(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),uN.delete(this)}cancel(){this.state===`scheduled`&&(uN.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},vN=e=>e.startsWith(`--`);function yN(e,t,n){vN(t)?e.style.setProperty(t,n):e.style[t]=n}var bN=hA(()=>window.ScrollTimeline!==void 0),xN={};function SN(e,t){let n=hA(e);return()=>xN[t]??n()}var CN=SN(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),wN=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,TN={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:wN([0,.65,.55,1]),circOut:wN([.55,0,1,.45]),backIn:wN([.31,.01,.66,-.59]),backOut:wN([.33,1.53,.69,.99])};function EN(e,t){if(e)return typeof e==`function`?CN()?fM(e,t):`ease-out`:HA(e)?wN(e):Array.isArray(e)?e.map(e=>EN(e,t)||TN.easeOut):TN[e]}function DN(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=EN(s,i);Array.isArray(d)&&(u.easing=d),qA.value&&ij.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return qA.value&&p.finished.finally(()=>{ij.waapi--}),p}function ON(e){return typeof e==`function`&&`applyToOptions`in e}function kN({type:e,...t}){return ON(e)&&CN()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var AN=class extends VM{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=kN(e);this.animation=DN(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=RM(r,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(e):yN(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return SA(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+SA(e)}get time(){return SA(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=xA(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&bN()?(this.animation.timeline=e,gA):t(this)}},jN={anticipate:PA,backInOut:NA,circInOut:LA};function MN(e){return e in jN}function NN(e){typeof e.ease==`string`&&MN(e.ease)&&(e.ease=jN[e.ease])}var PN=10,FN=class extends AN{constructor(e){NN(e),BM(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new UM({...a,autoplay:!1}),s=Math.max(PN,rj.now()-this.startTime),c=uA(0,PN,s-PN);t.setWithVelocity(o.sample(Math.max(0,s-c)).value,o.sample(s).value,c),o.stop()}},IN=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Kj.test(e)||e===`0`)&&!e.startsWith(`url(`));function LN(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function RN(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=IN(i,t),s=IN(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:LN(e)||(n===`spring`||ON(n))&&r}function zN(e){e.duration=0,e.type=`keyframes`}var BN=new Set([`opacity`,`clipPath`,`filter`,`transform`]),VN=hA(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function HN(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return VN()&&n&&BN.has(n)&&(n!==`transform`||!c)&&!s&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var UN=40,WN=class extends VM{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=rj.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||_N)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=rj.now(),RN(e,i,a,o)||((dA.instantAnimations||!s)&&l?.(RM(e,n,t)),e[0]=e[e.length-1],zN(n),n.repeat=0);let u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>UN?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!c&&HN(u),f=u.motionValue?.owner?.current,p=d?new FN({...u,element:f}):new UM(u);p.finished.then(()=>{this.notifyFinished()}).catch(gA),this.pendingTimeline&&=(this.stopTimeline=p.attachTimeline(this.pendingTimeline),void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),gN()),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(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function GN(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var KN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function qN(e){let t=KN.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function JN(e,t,n=1){`${e}`;let[r,i]=qN(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return fA(e)?parseFloat(e):e}return cj(i)?JN(i,t,n+1):i}var YN={type:`spring`,stiffness:500,damping:25,restSpeed:10},XN=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ZN={type:`keyframes`,duration:.8},QN={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},$N=(e,{keyframes:t})=>t.length>2?ZN:iN.has(e)?e.startsWith(`scale`)?XN(t[1]):YN:QN,eP=e=>e!==null;function tP(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(eP),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}function nP(e,t){return e?.[t]??e?.default??e}function rP({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}var iP=(e,t,n,r={},i,a)=>o=>{let s=nP(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=xA(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};rP(s)||Object.assign(u,$N(e,u)),u.duration&&=xA(u.duration),u.repeatDelay&&=xA(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(zN(u),u.delay===0&&(d=!0)),(dA.instantAnimations||dA.skipAnimations)&&(d=!0,zN(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=tP(u.keyframes,s);if(e!==void 0){ZA.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new UM(u):new WN(u)};function aP(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function oP(e,t,n,r){if(typeof t==`function`){let[i,a]=aP(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=aP(r);t=t(n===void 0?e.custom:n,i,a)}return t}function sP(e,t,n){let r=e.getProps();return oP(r,t,n===void 0?r.custom:n,e)}var cP=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...rN]),lP=30,uP=e=>!isNaN(parseFloat(e)),dP={current:void 0},fP=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=rj.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=rj.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uP(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new bA);let n=this.events[e].add(t);return e===`change`?()=>{n(),ZA.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return dP.current&&dP.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=rj.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>lP)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,lP);return CA(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function pP(e,t){return new fP(e,t)}var mP=e=>Array.isArray(e);function hP(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,pP(n))}function gP(e){return mP(e)?e[e.length-1]||0:e}function _P(e,t){let{transitionEnd:n={},transition:r={},...i}=sP(e,t)||{};for(let t in i={...i,...n},i)hP(e,t,gP(i[t]))}var vP=e=>!!(e&&e.getVelocity);function yP(e){return!!(vP(e)&&e.add)}function bP(e,t){let n=e.getValue(`willChange`);if(yP(n))return n.add(t);if(!n&&dA.WillChange){let n=new dA.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function xP(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var SP=`data-`+xP(`framerAppearId`);function CP(e){return e.props[SP]}function wP({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function TP(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=t,c=a?.reduceMotion;r&&(a=r);let l=[],u=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||u&&wP(u,t))continue;let o={delay:n,...nP(a||{},t)},d=r.get();if(d!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===d&&!o.velocity)continue;let f=!1;if(window.MotionHandoffAnimation){let n=CP(e);if(n){let e=window.MotionHandoffAnimation(n,t,ZA);e!==null&&(o.startTime=e,f=!0)}}bP(e,t);let p=c??e.shouldReduceMotion;r.start(iP(t,r,i,p&&cP.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&l.push(m)}return o&&Promise.all(l).then(()=>{ZA.update(()=>{o&&_P(e,o)})}),l}function EP(e,t,n={}){let r=sP(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(TP(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return DP(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function DP(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(EP(c,t,{...o,delay:n+(typeof r==`function`?0:r)+GN(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function OP(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>EP(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=EP(e,t,n);else{let i=typeof t==`function`?sP(e,t,n.custom):t;r=Promise.all(TP(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var kP={test:e=>e===`auto`,parse:e=>e},AP=e=>t=>t.test(e),jP=[dj,$,Dj,Ej,kj,Oj,kP],MP=e=>jP.find(AP(e));function NP(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||mA(e)}var PP=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function FP(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(hj)||[];if(!r)return e;let i=n.replace(r,``),a=PP.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var IP=/\b([a-z-]*)\(.*?\)/gu,LP={...Kj,getAnimatableNone:e=>{let t=e.match(IP);return t?t.map(FP).join(` `):e}},RP={...dj,transform:Math.round},zP={borderWidth:$,borderTopWidth:$,borderRightWidth:$,borderBottomWidth:$,borderLeftWidth:$,borderRadius:$,borderTopLeftRadius:$,borderTopRightRadius:$,borderBottomRightRadius:$,borderBottomLeftRadius:$,width:$,maxWidth:$,height:$,maxHeight:$,top:$,right:$,bottom:$,left:$,inset:$,insetBlock:$,insetBlockStart:$,insetBlockEnd:$,insetInline:$,insetInlineStart:$,insetInlineEnd:$,padding:$,paddingTop:$,paddingRight:$,paddingBottom:$,paddingLeft:$,paddingBlock:$,paddingBlockStart:$,paddingBlockEnd:$,paddingInline:$,paddingInlineStart:$,paddingInlineEnd:$,margin:$,marginTop:$,marginRight:$,marginBottom:$,marginLeft:$,marginBlock:$,marginBlockStart:$,marginBlockEnd:$,marginInline:$,marginInlineStart:$,marginInlineEnd:$,fontSize:$,backgroundPositionX:$,backgroundPositionY:$,rotate:Ej,rotateX:Ej,rotateY:Ej,rotateZ:Ej,scale:pj,scaleX:pj,scaleY:pj,scaleZ:pj,skew:Ej,skewX:Ej,skewY:Ej,distance:$,translateX:$,translateY:$,translateZ:$,x:$,y:$,z:$,perspective:$,transformPerspective:$,opacity:fj,originX:Aj,originY:Aj,originZ:$,zIndex:RP,fillOpacity:fj,strokeOpacity:fj,numOctaves:RP},BP={...zP,color:Mj,backgroundColor:Mj,outlineColor:Mj,fill:Mj,stroke:Mj,borderColor:Mj,borderTopColor:Mj,borderRightColor:Mj,borderBottomColor:Mj,borderLeftColor:Mj,filter:LP,WebkitFilter:LP},VP=e=>BP[e];function HP(e,t){let n=VP(e);return n!==LP&&(n=Kj),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var UP=new Set([`auto`,`none`,`0`]);function WP(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!UP.has(t)&&Vj(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=HP(n,i)}var GP=class extends _N{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),cj(r))){let i=JN(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!cP.has(n)||e.length!==2)return;let[r,i]=e,a=MP(r),o=MP(i);if(uj(r)!==uj(i)&&lN[n]){this.needsMeasurement=!0;return}if(a!==o)if(aN(a)&&aN(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else lN[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||NP(e[t]))&&n.push(t);n.length&&WP(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=lN[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=lN[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function KP(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var qP=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function JP(e){return pA(e)&&`offsetHeight`in e}var{schedule:YP,cancel:XP}=XA(queueMicrotask,!1),ZP={x:!1,y:!1};function QP(){return ZP.x||ZP.y}function $P(e){return e===`x`||e===`y`?ZP[e]?null:(ZP[e]=!0,()=>{ZP[e]=!1}):ZP.x||ZP.y?null:(ZP.x=ZP.y=!0,()=>{ZP.x=ZP.y=!1})}function eF(e,t){let n=KP(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function tF(e){return!(e.pointerType===`touch`||QP())}function nF(e,t,n={}){let[r,i,a]=eF(e,n),o=e=>{if(!tF(e))return;let{target:n}=e,r=t(n,e);if(typeof r!=`function`||!n)return;let a=e=>{tF(e)&&(r(e),n.removeEventListener(`pointerleave`,a))};n.addEventListener(`pointerleave`,a,i)};return r.forEach(e=>{e.addEventListener(`pointerenter`,o,i)}),a}var rF=(e,t)=>t?e===t?!0:rF(e,t.parentElement):!1,iF=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,aF=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function oF(e){return aF.has(e.tagName)||e.isContentEditable===!0}var sF=new WeakSet;function cF(e){return t=>{t.key===`Enter`&&e(t)}}function lF(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var uF=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=cF(()=>{if(sF.has(n))return;lF(n,`down`);let e=cF(()=>{lF(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>lF(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function dF(e){return iF(e)&&!QP()}function fF(e,t,n={}){let[r,i,a]=eF(e,n),o=e=>{let r=e.currentTarget;if(!dF(e))return;sF.add(r);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),sF.has(r)&&sF.delete(r),dF(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||rF(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),JP(e)&&(e.addEventListener(`focus`,e=>uF(e,i)),!oF(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function pF(e){return pA(e)&&`ownerSVGElement`in e}function mF(e){return pF(e)&&e.tagName===`svg`}var hF=[...jP,Mj,Kj],gF=e=>hF.find(AP(e)),_F=()=>({translate:0,scale:1,origin:0,originPoint:0}),vF=()=>({x:_F(),y:_F()}),yF=()=>({min:0,max:0}),bF=()=>({x:yF(),y:yF()}),xF={current:null},SF={current:!1},CF=typeof window<`u`;function wF(){if(SF.current=!0,CF)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>xF.current=e.matches;e.addEventListener(`change`,t),t()}else xF.current=!1}var TF=new WeakMap;function EF(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function DF(e){return typeof e==`string`||Array.isArray(e)}var OF=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],kF=[`initial`,...OF];function AF(e){return EF(e.animate)||kF.some(t=>DF(e[t]))}function jF(e){return!!(AF(e)||e.variants)}function MF(e,t,n){for(let r in t){let i=t[r],a=n[r];if(vP(i))e.addValue(r,i);else if(vP(a))e.addValue(r,pP(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,pP(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var NF=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],PF={};function FF(e){PF=e}function IF(){return PF}var LF=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=_N,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=()=>{let e=rj.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,ZA.render(this.render,!1,!0))};let{latestValues:s,renderState:c}=a;this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=AF(t),this.isVariantNode=jF(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:l,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in u){let t=u[e];s[e]!==void 0&&vP(t)&&t.set(s[e])}}mount(e){this.current=e,TF.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(SF.current||wF(),this.shouldReduceMotion=xF.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),QA(this.notifyUpdate),QA(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=iN.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&ZA.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in PF){let t=PF[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):bF()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<NF.length;t++){let n=NF[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=MF(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=pP(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){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`&&(fA(n)||mA(n))?n=parseFloat(n):!gF(n)&&Kj.test(t)&&(n=HP(e,t)),this.setBaseTarget(e,vP(n)?n.get():n)),vP(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=oP(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!vP(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new bA),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){YP.render(this.render)}},RF=class extends LF{constructor(){super(...arguments),this.KeyframeResolver=GP}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;vP(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},zF=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function BF({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function VF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function HF(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function UF(e){return e===void 0||e===1}function WF({scale:e,scaleX:t,scaleY:n}){return!UF(e)||!UF(t)||!UF(n)}function GF(e){return WF(e)||KF(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function KF(e){return qF(e.x)||qF(e.y)}function qF(e){return e&&e!==`0%`}function JF(e,t,n){return n+t*(e-n)}function YF(e,t,n,r,i){return i!==void 0&&(e=JF(e,i,r)),JF(e,n,r)+t}function XF(e,t=0,n=1,r,i){e.min=YF(e.min,t,n,r,i),e.max=YF(e.max,t,n,r,i)}function ZF(e,{x:t,y:n}){XF(e.x,t.translate,t.scale,t.originPoint),XF(e.y,n.translate,n.scale,n.originPoint)}var QF=.999999999999,$F=1.0000000000001;function eI(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&rI(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ZF(e,o)),r&&GF(a.latestValues)&&rI(e,a.latestValues))}t.x<$F&&t.x>QF&&(t.x=1),t.y<$F&&t.y>QF&&(t.y=1)}function tI(e,t){e.min+=t,e.max+=t}function nI(e,t,n,r,i=.5){XF(e,t,n,Xj(e.min,e.max,i),r)}function rI(e,t){nI(e.x,t.x,t.scaleX,t.scale,t.originX),nI(e.y,t.y,t.scaleY,t.scale,t.originY)}function iI(e,t){return BF(HF(e.getBoundingClientRect(),t))}function aI(e,t,n){let r=iI(e,n),{scroll:i}=t;return i&&(tI(r.x,i.offset.x),tI(r.y,i.offset.y)),r}var oI={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},sI=rN.length;function cI(e,t,n){let r=``,i=!0;for(let a=0;a<sI;a++){let o=rN[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===(o.startsWith(`scale`)?1:0);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=qP(s,zP[o]);if(!c){i=!1;let t=oI[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function lI(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(iN.has(e)){o=!0;continue}else if(oj(e)){i[e]=n;continue}else{let t=qP(n,zP[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=cI(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function uI(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function dI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var fI={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if($.test(e))e=parseFloat(e);else return e;return`${dI(e,t.target.x)}% ${dI(e,t.target.y)}%`}},pI={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Kj.parse(e);if(i.length>5)return r;let a=Kj.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Xj(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},mI={borderRadius:{...fI,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:fI,borderTopRightRadius:fI,borderBottomLeftRadius:fI,borderBottomRightRadius:fI,boxShadow:pI};function hI(e,{layout:t,layoutId:n}){return iN.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!mI[e]||e===`opacity`)}function gI(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(vP(r[t])||i&&vP(i[t])||hI(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function _I(e){return window.getComputedStyle(e)}var vI=class extends RF{constructor(){super(...arguments),this.type=`html`,this.renderInstance=uI}readValueFromInstance(e,t){if(iN.has(t))return this.projection?.isProjecting?$M(t):tN(e,t);{let n=_I(e),r=(oj(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return iI(e,t)}build(e,t,n){lI(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return gI(e,t,n)}},yI={offset:`stroke-dashoffset`,array:`stroke-dasharray`},bI={offset:`strokeDashoffset`,array:`strokeDasharray`};function xI(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?yI:bI;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var SI=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function CI(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(lI(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of SI)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&xI(d,i,a,o,!1)}var wI=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`]),TI=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function EI(e,t,n,r){for(let n in uI(e,t,void 0,r),t.attrs)e.setAttribute(wI.has(n)?n:xP(n),t.attrs[n])}function DI(e,t,n){let r=gI(e,t,n);for(let n in e)if(vP(e[n])||vP(t[n])){let t=rN.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var OI=class extends RF{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=bF}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(iN.has(t)){let e=VP(t);return e&&e.default||0}return t=wI.has(t)?t:xP(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return DI(e,t,n)}build(e,t,n){CI(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){EI(e,t,n,r)}mount(e){this.isSVGTag=TI(e.tagName),super.mount(e)}},kI=kF.length;function AI(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&AI(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<kI;n++){let r=kF[n],i=e.props[r];(DF(i)||i===!1)&&(t[r]=i)}return t}function jI(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var MI=[...OF].reverse(),NI=OF.length;function PI(e){return t=>Promise.all(t.map(({animation:t,options:n})=>OP(e,t,n)))}function FI(e){let t=PI(e),n=RI(),r=!0,i=t=>(n,r)=>{let i=sP(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(n){t=n(e)}function o(a){let{props:o}=e,s=AI(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<NI;t++){let f=MI[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=DF(m),g=f===a?p.isActive:null;g===!1&&(d=t);let _=m===s[f]&&m!==o[f]&&h;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),p.protectedKeys={...u},!p.isActive&&g===null||!m&&!p.prevProp||EF(m)||typeof m==`boolean`)continue;let v=II(p.prevProp,m),y=v||f===a&&p.isActive&&!_&&h||t>d&&h,b=!1,x=Array.isArray(m)?m:[m],S=x.reduce(i(f),{});g===!1&&(S={});let{prevResolvedValues:ee={}}=p,C={...ee,...S},te=t=>{y=!0,l.has(t)&&(b=!0,l.delete(t)),p.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in C){let t=S[e],n=ee[e];if(u.hasOwnProperty(e))continue;let r=!1;r=mP(t)&&mP(n)?!jI(t,n):t!==n,r?t==null?l.add(e):te(e):t!==void 0&&l.has(e)?te(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(y=!1);let ne=_&&v;y&&(!ne||b)&&c.push(...x.map(t=>{let n={type:f};if(typeof t==`string`&&r&&!ne&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=sP(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=GN(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(l.size){let t={};if(typeof o.initial!=`boolean`){let n=sP(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}l.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let f=!!c.length;return r&&(o.initial===!1||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}function s(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=o(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=RI()}}}function II(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!jI(t,e):!1}function LI(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function RI(){return{animate:LI(!0),whileInView:LI(),whileHover:LI(),whileTap:LI(),whileDrag:LI(),whileFocus:LI(),exit:LI()}}function zI(e,t){e.min=t.min,e.max=t.max}function BI(e,t){zI(e.x,t.x),zI(e.y,t.y)}function VI(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var HI=1e-4,UI=1-HI,WI=1+HI,GI=.01,KI=0-GI,qI=0+GI;function JI(e){return e.max-e.min}function YI(e,t,n){return Math.abs(e-t)<=n}function XI(e,t,n,r=.5){e.origin=r,e.originPoint=Xj(t.min,t.max,e.origin),e.scale=JI(n)/JI(t),e.translate=Xj(n.min,n.max,e.origin)-e.originPoint,(e.scale>=UI&&e.scale<=WI||isNaN(e.scale))&&(e.scale=1),(e.translate>=KI&&e.translate<=qI||isNaN(e.translate))&&(e.translate=0)}function ZI(e,t,n,r){XI(e.x,t.x,n.x,r?r.originX:void 0),XI(e.y,t.y,n.y,r?r.originY:void 0)}function QI(e,t,n){e.min=n.min+t.min,e.max=e.min+JI(t)}function $I(e,t,n){QI(e.x,t.x,n.x),QI(e.y,t.y,n.y)}function eL(e,t,n){e.min=t.min-n.min,e.max=e.min+JI(t)}function tL(e,t,n){eL(e.x,t.x,n.x),eL(e.y,t.y,n.y)}function nL(e,t,n,r,i){return e-=t,e=JF(e,1/n,r),i!==void 0&&(e=JF(e,1/i,r)),e}function rL(e,t=0,n=1,r=.5,i,a=e,o=e){if(Dj.test(t)&&(t=parseFloat(t),t=Xj(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Xj(a.min,a.max,r);e===a&&(s-=t),e.min=nL(e.min,t,n,s,i),e.max=nL(e.max,t,n,s,i)}function iL(e,t,[n,r,i],a,o){rL(e,t[n],t[r],t[i],t.scale,a,o)}var aL=[`x`,`scaleX`,`originX`],oL=[`y`,`scaleY`,`originY`];function sL(e,t,n,r){iL(e.x,t,aL,n?n.x:void 0,r?r.x:void 0),iL(e.y,t,oL,n?n.y:void 0,r?r.y:void 0)}function cL(e){return e.translate===0&&e.scale===1}function lL(e){return cL(e.x)&&cL(e.y)}function uL(e,t){return e.min===t.min&&e.max===t.max}function dL(e,t){return uL(e.x,t.x)&&uL(e.y,t.y)}function fL(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function pL(e,t){return fL(e.x,t.x)&&fL(e.y,t.y)}function mL(e){return JI(e.x)/JI(e.y)}function hL(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function gL(e){return[e(`x`),e(`y`)]}function _L(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var vL=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],yL=vL.length,bL=e=>typeof e==`string`?parseFloat(e):e,xL=e=>typeof e==`number`||$.test(e);function SL(e,t,n,r,i,a){i?(e.opacity=Xj(0,n.opacity??1,wL(r)),e.opacityExit=Xj(t.opacity??1,0,TL(r))):a&&(e.opacity=Xj(t.opacity??1,n.opacity??1,r));for(let i=0;i<yL;i++){let a=`border${vL[i]}Radius`,o=CL(t,a),s=CL(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||xL(o)===xL(s)?(e[a]=Math.max(Xj(bL(o),bL(s),r),0),(Dj.test(s)||Dj.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Xj(t.rotate||0,n.rotate||0,r))}function CL(e,t){return e[t]===void 0?e.borderRadius:e[t]}var wL=EL(0,.5,IA),TL=EL(.5,.95,gA);function EL(e,t,n){return r=>r<e?0:r>t?1:n(yA(e,t,r))}function DL(e,t,n){let r=vP(e)?e:pP(e);return r.start(iP(``,r,t,n)),r.animation}function OL(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var kL=(e,t)=>e.depth-t.depth,AL=class{constructor(){this.children=[],this.isDirty=!1}add(e){cA(this.children,e),this.isDirty=!0}remove(e){lA(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(kL),this.isDirty=!1,this.children.forEach(e)}};function jL(e,t){let n=rj.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(QA(r),e(a-t))};return ZA.setup(r,!0),()=>QA(r)}function ML(e){return vP(e)?e.get():e}var NL=class{constructor(){this.members=[]}add(e){cA(this.members,e),e.scheduleRender()}remove(e){if(lA(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender();let r=n.options.layoutDependency,i=e.options.layoutDependency;r!==void 0&&i!==void 0&&r===i||(e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0));let{crossfade:a}=e.options;a===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}},PL={hasAnimatedSinceResize:!0,hasEverUpdated:!1},FL={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},IL=[``,`X`,`Y`,`Z`],LL=1e3,RL=0;function zL(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function BL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=CP(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,ZA,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&BL(r)}function VL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=RL++,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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,qA.value&&(FL.nodes=FL.calculatedTargetDeltas=FL.calculatedProjections=0),this.nodes.forEach(WL),this.nodes.forEach(ZL),this.nodes.forEach(QL),this.nodes.forEach(GL),qA.addProjectionMetrics&&qA.addProjectionMetrics(FL)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new AL)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new bA),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=pF(t)&&!mF(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;ZA.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=jL(i,250),PL.hasAnimatedSinceResize&&(PL.hasAnimatedSinceResize=!1,this.nodes.forEach(XL)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||aR,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!pL(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...nP(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||XL(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),QA(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach($L),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&BL(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(qL);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(JL);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(YL),this.nodes.forEach(HL),this.nodes.forEach(UL)):this.nodes.forEach(JL),this.clearAllSnapshots();let e=rj.now();$A.delta=uA(0,1e3/60,e-$A.timestamp),$A.timestamp=e,$A.isProcessing=!0,ej.update.process($A),ej.preRender.process($A),ej.render.process($A),$A.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,YP.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(KL),this.sharedNodes.forEach(eR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ZA.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ZA.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!JI(this.snapshot.measuredBox.x)&&!JI(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 e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=bF(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!lL(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||GF(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),lR(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return bF();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(dR))){let{scroll:e}=this.root;e&&(tI(t.x,e.offset.x),tI(t.y,e.offset.y))}return t}removeElementScroll(e){let t=bF();if(BI(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&BI(t,e),tI(t.x,i.offset.x),tI(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=bF();BI(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&rI(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),GF(r.latestValues)&&rI(n,r.latestValues)}return GF(this.latestValues)&&rI(n,this.latestValues),n}removeTransform(e){let t=bF();BI(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!GF(n.latestValues))continue;WF(n.latestValues)&&n.updateSnapshot();let r=bF();BI(r,n.measurePageBox()),sL(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return GF(this.latestValues)&&sL(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}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!==$A.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=$A.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=bF(),this.targetWithTransforms=bF()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),$I(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):BI(this.target,this.layout.layoutBox),ZF(this.target,this.targetDelta)):BI(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),qA.value&&FL.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||WF(this.parent.latestValues)||KF(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=bF(),this.relativeTargetOrigin=bF(),tL(this.relativeTargetOrigin,t,n),BI(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===$A.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;BI(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;eI(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=bF());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(VI(this.prevProjectionDelta.x,this.projectionDelta.x),VI(this.prevProjectionDelta.y,this.projectionDelta.y)),ZI(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!hL(this.projectionDelta.x,this.prevProjectionDelta.x)||!hL(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),qA.value&&FL.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=vF(),this.projectionDelta=vF(),this.projectionDeltaWithTransform=vF()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=vF();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=bF(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(iR));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;tR(a.x,e.x,n),tR(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(tL(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),rR(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&dL(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=bF(),BI(d,this.relativeTarget)),s&&(this.animationValues=i,SL(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(QA(this.pendingAnimation),void 0),this.pendingAnimation=ZA.update(()=>{PL.hasAnimatedSinceResize=!0,ij.layout++,this.motionValue||=pP(0),this.currentAnimation=DL(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{ij.layout--},onComplete:()=>{ij.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(LL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&uR(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||bF();let t=JI(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=JI(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}BI(t,n),rI(t,i),ZI(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new NL),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&zL(`z`,e,r,this.animationValues);for(let t=0;t<IL.length;t++)zL(`rotate${IL[t]}`,e,r,this.animationValues),zL(`skew${IL[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=ML(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=ML(t?.pointerEvents)||``),this.hasProjected&&!GF(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=_L(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;for(let t in e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit,mI){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=mI[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?ML(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(qL),this.root.sharedNodes.clear()}}}function HL(e){e.updateLayout()}function UL(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?gL(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=JI(r);r.min=n[e].min,r.max=r.min+i}):uR(i,t.layoutBox,n)&&gL(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=JI(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=vF();ZI(o,n,t.layoutBox);let s=vF();a?ZI(s,e.applyTransform(r,!0),t.measuredBox):ZI(s,n,t.layoutBox);let c=!lL(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=bF();tL(o,t.layoutBox,i.layoutBox);let s=bF();tL(s,n,a.layoutBox),pL(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function WL(e){qA.value&&FL.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function GL(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KL(e){e.clearSnapshot()}function qL(e){e.clearMeasurements()}function JL(e){e.isLayoutDirty=!1}function YL(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function XL(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ZL(e){e.resolveTargetDelta()}function QL(e){e.calcProjection()}function $L(e){e.resetSkewAndRotation()}function eR(e){e.removeLeadSnapshot()}function tR(e,t,n){e.translate=Xj(t.translate,0,n),e.scale=Xj(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function nR(e,t,n,r){e.min=Xj(t.min,n.min,r),e.max=Xj(t.max,n.max,r)}function rR(e,t,n,r){nR(e.x,t.x,n.x,r),nR(e.y,t.y,n.y,r)}function iR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var aR={duration:.45,ease:[.4,0,.1,1]},oR=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),sR=oR(`applewebkit/`)&&!oR(`chrome/`)?Math.round:gA;function cR(e){e.min=sR(e.min),e.max=sR(e.max)}function lR(e){cR(e.x),cR(e.y)}function uR(e,t,n){return e===`position`||e===`preserve-aspect`&&!YI(mL(t),mL(n),.2)}function dR(e){return e!==e.root&&e.scroll?.wasRoot}var fR=VL({attachResizeListener:(e,t)=>OL(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),pR={current:void 0},mR=VL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pR.current){let e=new fR({});e.mount(window),e.setOptions({layoutScroll:!0}),pR.current=e}return pR.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),hR=(0,T.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function gR(e=!0){let t=(0,T.useContext)(sA);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,T.useId)();(0,T.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,T.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var _R=(0,T.createContext)({strict:!1}),vR={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},yR=!1;function bR(){if(yR)return;let e={};for(let t in vR)e[t]={isEnabled:e=>vR[t].some(t=>!!e[t])};FF(e),yR=!0}function xR(){return bR(),IF()}function SR(e){let t=xR();for(let n in e)t[n]={...t[n],...e[n]};FF(t)}var CR=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function wR(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||CR.has(e)}var TR=r({default:()=>ER},1),ER,DR=t((()=>{throw ER={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),OR=e=>!wR(e);function kR(e){typeof e==`function`&&(OR=t=>t.startsWith(`on`)?!wR(t):e(t))}try{kR((DR(),e(TR)).default)}catch{}function AR(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(OR(i)||n===!0&&wR(i)||!t&&!wR(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var jR=(0,T.createContext)({});function MR(e,t){if(AF(e)){let{initial:t,animate:n}=e;return{initial:t===!1||DF(t)?t:void 0,animate:DF(n)?n:void 0}}return e.inherit===!1?{}:t}function NR(e){let{initial:t,animate:n}=MR(e,(0,T.useContext)(jR));return(0,T.useMemo)(()=>({initial:t,animate:n}),[PR(t),PR(n)])}function PR(e){return Array.isArray(e)?e.join(` `):e}var FR=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function IR(e,t,n){for(let r in t)!vP(t[r])&&!hI(r,n)&&(e[r]=t[r])}function LR({transformTemplate:e},t){return(0,T.useMemo)(()=>{let n=FR();return lI(n,t,e),Object.assign({},n.vars,n.style)},[t])}function RR(e,t){let n=e.style||{},r={};return IR(r,n,e),Object.assign(r,LR(e,t)),r}function zR(e,t){let n={},r=RR(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var BR=()=>({...FR(),attrs:{}});function VR(e,t,n,r){let i=(0,T.useMemo)(()=>{let n=BR();return CI(n,t,TI(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};IR(t,e.style,e),i.style={...t,...i.style}}return i}var HR=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function UR(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(HR.indexOf(e)>-1||/[A-Z]/u.test(e))}function WR(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??UR(e)?VR:zR)(t,r,i,e),c=AR(t,typeof e==`string`,a),l=e===T.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,T.useMemo)(()=>vP(u)?u.get():u,[u]);return(0,T.createElement)(e,{...l,children:d})}function GR({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:KR(n,r,i,e),renderState:t()}}function KR(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=ML(a[e]);let{initial:o,animate:s}=e,c=AF(e),l=jF(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!EF(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=oP(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var qR=e=>(t,n)=>{let r=(0,T.useContext)(jR),i=(0,T.useContext)(sA),a=()=>GR(e,t,r,i);return n?a():iA(a)},JR=qR({scrapeMotionValuesFromProps:gI,createRenderState:FR}),YR=qR({scrapeMotionValuesFromProps:DI,createRenderState:BR}),XR=Symbol.for(`motionComponentSymbol`);function ZR(e,t,n){let r=(0,T.useRef)(n);(0,T.useInsertionEffect)(()=>{r.current=n});let i=(0,T.useRef)(null);return(0,T.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var QR=(0,T.createContext)({});function $R(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function ez(e,t,n,r,i,a){let{visualElement:o}=(0,T.useContext)(jR),s=(0,T.useContext)(_R),c=(0,T.useContext)(sA),l=(0,T.useContext)(hR).reducedMotion,u=(0,T.useRef)(null),d=(0,T.useRef)(!1);r||=s.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,isSVG:a}),d.current&&u.current&&(u.current.manuallyAnimateOnMount=!0));let f=u.current,p=(0,T.useContext)(QR);f&&!f.projection&&i&&(f.type===`html`||f.type===`svg`)&&tz(u.current,n,i,p);let m=(0,T.useRef)(!1);(0,T.useInsertionEffect)(()=>{f&&m.current&&f.update(n,c)});let h=n[SP],g=(0,T.useRef)(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return oA(()=>{d.current=!0,f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),g.current&&f.animationState&&f.animationState.animateChanges())}),(0,T.useEffect)(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),!1),f.enteringChildren=void 0)}),f}function tz(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:nz(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&$R(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function nz(e){if(e)return e.options.allowProjection===!1?nz(e.parent):e.projection}function rz(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&SR(r);let a=n?n===`svg`:UR(e),o=a?YR:JR;function s(n,s){let c,l={...(0,T.useContext)(hR),...n,layoutId:iz(n)},{isStatic:u}=l,d=NR(n),f=o(n,u);if(!u&&aA){az(l,r);let t=oz(l);c=t.MeasureLayout,d.visualElement=ez(e,f,l,i,t.ProjectionNode,a)}return(0,O.jsxs)(jR.Provider,{value:d,children:[c&&d.visualElement?(0,O.jsx)(c,{visualElement:d.visualElement,...l}):null,WR(e,n,ZR(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,T.forwardRef)(s);return c[XR]=e,c}function iz({layoutId:e}){let t=(0,T.useContext)(rA).id;return t&&e!==void 0?t+`-`+e:e}function az(e,t){(0,T.useContext)(_R).strict}function oz(e){let{drag:t,layout:n}=xR();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function sz(e,t){if(typeof Proxy>`u`)return rz;let n=new Map,r=(n,r)=>rz(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,rz(a,void 0,e,t)),n.get(a))})}var cz=(e,t)=>t.isSVG??UR(e)?new OI(t):new vI(t,{allowProjection:e!==T.Fragment}),lz=class extends zF{constructor(e){super(e),e.animationState||=FI(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();EF(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},uz=0,dz={animation:{Feature:lz},exit:{Feature:class extends zF{constructor(){super(...arguments),this.id=uz++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function fz(e){return{point:{x:e.pageX,y:e.pageY}}}var pz=e=>t=>iF(t)&&e(t,fz(t));function mz(e,t,n,r){return OL(e,t,pz(n),r)}var hz=({current:e})=>e?e.ownerDocument.defaultView:null,gz=(e,t)=>Math.abs(e-t);function _z(e,t){let n=gz(e.x,t.x),r=gz(e.y,t.y);return Math.sqrt(n**2+r**2)}var vz=new Set([`auto`,`scroll`]),yz=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=Sz(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=_z(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=$A;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=bz(t,this.transformPagePoint),ZA.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Sz(e.type===`pointercancel`?this.lastMoveEventInfo:bz(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!iF(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=bz(fz(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=$A;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Sz(s,this.history)),this.removeListeners=vA(mz(this.contextWindow,`pointermove`,this.handlePointerMove),mz(this.contextWindow,`pointerup`,this.handlePointerUp),mz(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(vz.has(e.overflowX)||vz.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.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(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?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(e,r),ZA.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),QA(this.updatePoint)}};function bz(e,t){return t?{point:t(e.point)}:e}function xz(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Sz({point:e},t){return{point:e,delta:xz(e,wz(t)),offset:xz(e,Cz(t)),velocity:Tz(t,.1)}}function Cz(e){return e[0]}function wz(e){return e[e.length-1]}function Tz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=wz(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>xA(t)));)n--;if(!r)return{x:0,y:0};let a=SA(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Ez(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Xj(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Xj(n,e,r.max):Math.min(e,n)),e}function Dz(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Oz(e,{top:t,left:n,bottom:r,right:i}){return{x:Dz(e.x,n,i),y:Dz(e.y,t,r)}}function kz(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Az(e,t){return{x:kz(e.x,t.x),y:kz(e.y,t.y)}}function jz(e,t){let n=.5,r=JI(e),i=JI(t);return i>r?n=yA(t.min,t.max-r,e.min):r>i&&(n=yA(e.min,e.max-i,t.min)),uA(0,1,n)}function Mz(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Nz=.35;function Pz(e=Nz){return e===!1?e=0:e===!0&&(e=Nz),{x:Fz(e,`left`,`right`),y:Fz(e,`top`,`bottom`)}}function Fz(e,t,n){return{min:Iz(e,t),max:Iz(e,n)}}function Iz(e,t){return typeof e==`number`?e:e[t]||0}var Lz=new WeakMap,Rz=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=bF(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t?(this.stopAnimation(),this.snapToCursor(fz(e).point)):this.pauseAnimation()},a=(e,t)=>{this.stopAnimation();let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$P(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),gL(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Dj.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=JI(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&ZA.postRender(()=>i(e,t)),bP(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Bz(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>gL(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new yz(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:hz(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&ZA.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!zz(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Ez(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&$R(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Oz(n.layoutBox,e):this.constraints=!1,this.elastic=Pz(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&gL(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Mz(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!$R(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=aI(n,r.root,this.visualElement.getTransformPagePoint()),a=Az(r.layout.layoutBox,i);if(t){let e=t(VF(a));this.hasMutatedConstraints=!!e,e&&(a=BF(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=gL(o=>{if(!zz(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return bP(this.visualElement,e),n.start(iP(e,n,0,t,this.visualElement,!1))}stopAnimation(){gL(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){gL(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){gL(t=>{let{drag:n}=this.getProps();if(!zz(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Xj(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!$R(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};gL(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=jz({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),gL(t=>{if(!zz(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Xj(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;Lz.set(this.visualElement,this);let e=this.visualElement.current,t=mz(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&oF(i);n&&r&&!a&&this.start(t)}),n=()=>{let{dragConstraints:e}=this.getProps();$R(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ZA.read(n);let a=OL(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(gL(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Nz,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function zz(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Bz(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Vz=class extends zF{constructor(e){super(e),this.removeGroupControls=gA,this.removeListeners=gA,this.controls=new Rz(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gA}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Hz=e=>(t,n)=>{e&&ZA.postRender(()=>e(t,n))},Uz=class extends zF{constructor(){super(...arguments),this.removePointerDownListener=gA}onPointerDown(e){this.session=new yz(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:hz(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Hz(e),onStart:Hz(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&ZA.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=mz(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Wz=!1,Gz=class extends T.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Wz&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),PL.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Wz=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||ZA.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),YP.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Wz=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Kz(e){let[t,n]=gR(),r=(0,T.useContext)(rA);return(0,O.jsx)(Gz,{...e,layoutGroup:r,switchLayoutGroup:(0,T.useContext)(QR),isPresent:t,safeToRemove:n})}var qz={pan:{Feature:Uz},drag:{Feature:Vz,ProjectionNode:mR,MeasureLayout:Kz}};function Jz(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&ZA.postRender(()=>i(t,fz(t)))}var Yz=class extends zF{mount(){let{current:e}=this.node;e&&(this.unmount=nF(e,(e,t)=>(Jz(this.node,t,`Start`),e=>Jz(this.node,e,`End`))))}unmount(){}},Xz=class extends zF{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=vA(OL(this.node.current,`focus`,()=>this.onFocus()),OL(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Zz(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&ZA.postRender(()=>i(t,fz(t)))}var Qz=class extends zF{mount(){let{current:e}=this.node;e&&(this.unmount=fF(e,(e,t)=>(Zz(this.node,t,`Start`),(e,{success:t})=>Zz(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}},$z=new WeakMap,eB=new WeakMap,tB=e=>{let t=$z.get(e.target);t&&t(e)},nB=e=>{e.forEach(tB)};function rB({root:e,...t}){let n=e||document;eB.has(n)||eB.set(n,{});let r=eB.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(nB,{root:e,...t})),r[i]}function iB(e,t,n){let r=rB(t);return $z.set(e,n),r.observe(e),()=>{$z.delete(e),r.unobserve(e)}}var aB={some:0,all:1},oB=class extends zF{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:aB[r]};return iB(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(sB(e,t))&&this.startObserver()}unmount(){}};function sB({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var cB={inView:{Feature:oB},tap:{Feature:Qz},focus:{Feature:Xz},hover:{Feature:Yz}},lB={layout:{ProjectionNode:mR,MeasureLayout:Kz}},uB=sz({...dz,...cB,...qz,...lB},cz);const dB=(0,T.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=uB.create(t),o=(0,T.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,O.jsx)(a,{animate:{backgroundPosition:`0% center`},className:Bt(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{repeat:1/0,duration:r,ease:`linear`},children:e})});var fB=(0,T.createContext)(null);const pB=()=>{let e=(0,T.useContext)(fB);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e};var mB=1e3,hB=1e3;const gB=(0,T.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r=!0,onOpenChange:i,duration:a,children:o,...s})=>{let[c,l]=g({prop:n,defaultProp:r,onChange:i}),[u,d]=g({prop:a,defaultProp:void 0}),[f,p]=(0,T.useState)(!1),[m,h]=(0,T.useState)(null);return(0,T.useEffect)(()=>{t?m===null&&h(Date.now()):m!==null&&(d(Math.ceil((Date.now()-m)/hB)),h(null))},[t,m,d]),(0,T.useEffect)(()=>{if(r&&!t&&c&&!f){let e=setTimeout(()=>{l(!1),p(!0)},mB);return()=>clearTimeout(e)}},[t,c,r,l,f]),(0,O.jsx)(fB.Provider,{value:{isStreaming:t,isOpen:c??!1,setIsOpen:l,duration:u},children:(0,O.jsx)(Wk,{className:Bt(`not-prose mb-4`,e),onOpenChange:e=>{l(e)},open:c,...s,children:o})})});var _B=(e,t)=>e||t===0?(0,O.jsx)(dB,{duration:1,children:`Thinking...`}):t===void 0?(0,O.jsx)(`p`,{children:`Thought for a few seconds`}):(0,O.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]});const vB=(0,T.memo)(({className:e,children:t,getThinkingMessage:n=_B,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=pB();return(0,O.jsx)(Gk,{className:Bt(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(fn,{className:`size-4`}),n(i,o),(0,O.jsx)(mn,{className:Bt(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),yB=(0,T.memo)(({className:e,children:t,...n})=>(0,O.jsx)(Kk,{className:Bt(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:t}));gB.displayName=`Reasoning`,vB.displayName=`ReasoningTrigger`,yB.displayName=`ReasoningContent`;function bB(e){switch(e){case`allow_once`:case`allow_always`:return`default`;case`reject_once`:case`reject_always`:return`destructive`;default:return`outline`}}function xB(e){switch(e){case`allow_once`:case`allow_always`:return(0,O.jsx)(pn,{className:`size-4`});case`reject_once`:case`reject_always`:return(0,O.jsx)(Dn,{className:`size-4`});default:return null}}function SB({requestId:e,options:t,onRespond:n,className:r}){let i=t=>{n(e,t.optionId,t.kind)};return(0,O.jsxs)(`div`,{className:Bt(`p-3 border-t border-yellow-500/30 bg-yellow-50/50 dark:bg-yellow-950/10`,r),children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,O.jsx)(wn,{className:`size-4 text-yellow-600 dark:text-yellow-500`}),(0,O.jsx)(`span`,{className:`text-xs font-medium text-yellow-800 dark:text-yellow-200`,children:`Permission Required`})]}),(0,O.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,O.jsxs)(Ht,{variant:bB(e.kind),size:`sm`,onClick:()=>i(e),className:`gap-1.5`,children:[xB(e.kind),e.name]},e.optionId))})]})}function CB(){let e=jk();return(0,O.jsxs)(Rk,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>e.openFileDialog(),children:[(0,O.jsx)(bn,{className:`size-4`}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Attach image`})]})}function wB(e,t){if(e&&e.length>0){let t=[];for(let n of e)n.type===`content`?n.content.type===`text`&&n.content.text&&t.push(n.content.text):n.type===`diff`?t.push(`📝 ${n.path}\n--- Old\n+++ New\n${n.newText}`):n.type===`terminal`&&t.push(`🖥️ Terminal: ${n.terminalId}`);if(t.length>0)return t.length===1?t[0]:t.join(`
|
|
377
377
|
|
|
378
|
-
`)}return t&&Object.keys(t).length>0?t:null}function TB(e){return e===`completed`?`complete`:e===`failed`?`error`:`running`}function EB(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r&&r.type===`tool_call`&&r.toolCall.id===t)return n}return-1}function DB({client:e}){let[t,n]=(0,T.useState)([]),[r,i]=(0,T.useState)(!1),[a,o]=(0,T.useState)(!1),[s,c]=(0,T.useState)(!1),l=(0,T.useCallback)(e=>{console.log(`[ChatInterface] Permission request:`,e),n(t=>{let n=EB(t,e.toolCall.toolCallId);if(n>=0)return t.map((t,r)=>r!==n||t.type!==`tool_call`||t.toolCall.status!==`running`?t:{type:`tool_call`,toolCall:{...t.toolCall,status:`waiting_for_confirmation`,permissionRequest:{requestId:e.requestId,options:e.options}}});{console.log(`[ChatInterface] No matching tool call, creating standalone permission request`);let n={type:`tool_call`,toolCall:{id:e.toolCall.toolCallId,title:e.toolCall.title||`Permission Request`,status:`waiting_for_confirmation`,permissionRequest:{requestId:e.requestId,options:e.options},isStandalonePermission:!0}};return[...t,n]}})},[]),u=(0,T.useCallback)(e=>{if(e.sessionUpdate===`agent_message_chunk`){let t=e.content.type===`text`&&e.content.text?e.content.text:``;if(!t)return;n(e=>{let n=e[e.length-1];if(n?.type===`assistant_message`){let r=n.chunks[n.chunks.length-1];return r?.type===`message`?[...e.slice(0,-1),{...n,chunks:[...n.chunks.slice(0,-1),{type:`message`,text:r.text+t}]}]:[...e.slice(0,-1),{...n,chunks:[...n.chunks,{type:`message`,text:t}]}]}let r={type:`assistant_message`,id:`assistant-${Date.now()}`,chunks:[{type:`message`,text:t}]};return[...e,r]})}else if(e.sessionUpdate===`agent_thought_chunk`){let t=e.content.type===`text`&&e.content.text?e.content.text:``;if(!t)return;n(e=>{let n=e[e.length-1];if(n?.type===`assistant_message`){let r=n.chunks[n.chunks.length-1];return r?.type===`thought`?[...e.slice(0,-1),{...n,chunks:[...n.chunks.slice(0,-1),{type:`thought`,text:r.text+t}]}]:[...e.slice(0,-1),{...n,chunks:[...n.chunks,{type:`thought`,text:t}]}]}let r={type:`assistant_message`,id:`assistant-${Date.now()}`,chunks:[{type:`thought`,text:t}]};return[...e,r]})}else if(e.sessionUpdate===`user_message_chunk`){let t=e.content.type===`text`&&e.content.text?e.content.text:``;if(!t)return;n(e=>{let n=e[e.length-1];if(n?.type===`user_message`)return[...e.slice(0,-1),{...n,content:n.content+t}];let r={type:`user_message`,id:`user-${Date.now()}`,content:t};return[...e,r]})}else if(e.sessionUpdate===`tool_call`){let t={id:e.toolCallId,title:e.title,status:TB(e.status),content:e.content,rawInput:e.rawInput,rawOutput:e.rawOutput};n(n=>{let r=EB(n,e.toolCallId);if(r>=0)return n.map((e,n)=>n!==r||e.type!==`tool_call`?e:{type:`tool_call`,toolCall:{...e.toolCall,...t}});let i={type:`tool_call`,toolCall:t};return[...n,i]})}else e.sessionUpdate===`tool_call_update`&&n(t=>{let n=EB(t,e.toolCallId);if(n<0){console.warn(`[ChatInterface] Tool call not found for update: ${e.toolCallId}`);let n={type:`tool_call`,toolCall:{id:e.toolCallId,title:e.title||`Tool call not found`,status:`error`,content:[{type:`content`,content:{type:`text`,text:`Tool call not found`}}]}};return[...t,n]}return t.map((t,r)=>{if(r!==n||t.type!==`tool_call`)return t;let i=e.status?TB(e.status):t.toolCall.status,a=e.content?[...t.toolCall.content||[],...e.content]:t.toolCall.content;return{type:`tool_call`,toolCall:{...t.toolCall,status:i,...e.title&&{title:e.title},content:a,...e.rawInput&&{rawInput:e.rawInput},...e.rawOutput&&{rawOutput:e.rawOutput}}}})})},[]);(0,T.useEffect)(()=>{e.setSessionCreatedHandler(t=>{console.log(`[ChatInterface] Session created:`,t),o(!0),c(e.supportsImages),console.log(`[ChatInterface] supportsImages:`,e.supportsImages)}),e.setSessionUpdateHandler(e=>{u(e)}),e.setPromptCompleteHandler(e=>{console.log(`[ChatInterface] Prompt complete:`,e),i(!1)}),e.setPermissionRequestHandler(l),e.createSession()},[e,l,u]);let d=async t=>{let o=t.text.trim(),s=t.files||[];if(!o&&s.length===0||r||!a)return;let c=[];o&&c.push({type:`text`,text:o});let l=[];for(let e of s)if(e.mediaType?.startsWith(`image/`)&&e.url)try{let t;if(e.url.startsWith(`data:`)){let n=e.url.indexOf(`,`);t=n>=0?e.url.slice(n+1):e.url}else{let n=await(await fetch(e.url)).blob();t=await new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>{let t=r.result,n=t.indexOf(`,`);e(n>=0?t.slice(n+1):t)},r.onerror=t,r.readAsDataURL(n)})}let n={type:`image`,mimeType:e.mediaType,data:t};c.push(n),l.push({mimeType:e.mediaType,data:t})}catch(e){console.error(`[ChatInterface] Failed to convert image:`,e)}if(c.length===0)return;let u={type:`user_message`,id:`user-${Date.now()}`,content:o,images:l.length>0?l:void 0};n(e=>[...e,u]),i(!0);try{await e.sendPrompt(c)}catch(e){console.error(`[ChatInterface] Failed to send prompt:`,e),i(!1)}},f=()=>{console.log(`[ChatInterface] Cancel requested`),n(e=>e.map(e=>e.type!==`tool_call`||!(e.toolCall.status===`running`||e.toolCall.status===`waiting_for_confirmation`)?e:(console.log(`[ChatInterface] Marking tool call as canceled:`,e.toolCall.id),{type:`tool_call`,toolCall:{...e.toolCall,status:`canceled`,permissionRequest:void 0}}))),e.cancel()},p=(0,T.useCallback)((t,r,i)=>{console.log(`[ChatInterface] Permission response:`,{requestId:t,optionId:r,optionKind:i}),e.respondToPermission(t,r);let a=i===`reject_once`||i===`reject_always`||r===null;n(e=>e.map(e=>{if(e.type!==`tool_call`||e.toolCall.permissionRequest?.requestId!==t)return e;let n;return n=a?`rejected`:e.toolCall.isStandalonePermission?`complete`:`running`,{type:`tool_call`,toolCall:{...e.toolCall,status:n,permissionRequest:void 0,isStandalonePermission:void 0}}}))},[e]),m=e=>{switch(e){case`error`:return`output-error`;case`running`:return`input-available`;case`waiting_for_confirmation`:return`waiting-for-confirmation`;case`rejected`:return`rejected`;case`canceled`:return`output-error`;case`complete`:default:return`output-available`}},h=e=>{let t=e.toolCall,n=wB(t.content,t.rawOutput);return(0,O.jsxs)(Zk,{defaultOpen:t.status!==`running`&&t.status!==`waiting_for_confirmation`&&n!==null||t.status===`waiting_for_confirmation`,className:t.status===`rejected`?`border-dashed border-orange-500/50`:void 0,children:[(0,O.jsx)($k,{title:t.title,type:`tool-invocation`,state:m(t.status)}),(0,O.jsxs)(eA,{children:[t.rawInput&&(0,O.jsx)(tA,{input:t.rawInput}),t.status===`waiting_for_confirmation`&&t.permissionRequest&&(0,O.jsx)(SB,{requestId:t.permissionRequest.requestId,options:t.permissionRequest.options,onRespond:p}),t.status!==`waiting_for_confirmation`&&t.status!==`rejected`&&(0,O.jsx)(nA,{output:n,errorText:t.status===`error`?`Tool execution failed`:void 0})]})]},t.id)},g=r&&t.length>0&&t[t.length-1]?.type===`user_message`,_=r?`streaming`:`ready`;return(0,O.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,O.jsxs)(Vn,{className:`flex-1`,children:[(0,O.jsx)(Hn,{children:a?t.length===0?(0,O.jsx)(Un,{title:`Start a conversation`,description:`Type a message below to chat with the ACP agent`}):(0,O.jsxs)(O.Fragment,{children:[t.map((e,t)=>e.type===`user_message`?(0,O.jsx)(uk,{from:`user`,children:(0,O.jsxs)(dk,{children:[e.images&&e.images.length>0&&(0,O.jsx)(mk,{children:e.images.map((e,t)=>(0,O.jsx)(pk,{data:{type:`file`,mediaType:e.mimeType,url:`data:${e.mimeType};base64,${e.data}`}},t))}),e.content&&(0,O.jsx)(fk,{children:e.content})]})},e.id):e.type===`assistant_message`?(0,O.jsx)(uk,{from:`assistant`,children:(0,O.jsx)(dk,{children:e.chunks.map((t,n)=>{if(t.type===`thought`){let i=n===e.chunks.length-1;return(0,O.jsxs)(gB,{isStreaming:r&&i,children:[(0,O.jsx)(vB,{}),(0,O.jsx)(yB,{children:(0,O.jsx)(fk,{children:t.text})})]},n)}return(0,O.jsx)(fk,{children:t.text},n)})})},e.id):e.type===`tool_call`?(0,O.jsx)(uk,{from:`assistant`,children:(0,O.jsx)(dk,{children:h(e)})},e.toolCall.id):null),g&&(0,O.jsx)(uk,{from:`assistant`,children:(0,O.jsx)(dk,{children:(0,O.jsx)(dB,{children:`Thinking...`})})})]}):(0,O.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,O.jsx)(dB,{children:`Creating session...`})})}),(0,O.jsx)(Wn,{})]}),(0,O.jsx)(`div`,{className:`border-t p-4`,children:(0,O.jsxs)(Pk,{onSubmit:d,accept:s?`image/*`:void 0,multiple:s,children:[s&&(0,O.jsx)(Ik,{children:(0,O.jsx)(Nk,{children:e=>(0,O.jsx)(Mk,{data:e})})}),(0,O.jsx)(Fk,{placeholder:a?`Type a message...`:`Waiting for session...`,disabled:!a}),(0,O.jsxs)(Lk,{children:[s?(0,O.jsx)(CB,{}):(0,O.jsx)(`div`,{}),(0,O.jsx)(zk,{status:_,disabled:!a,onClick:r?f:void 0})]})]})})]})}function OB(){let[e,t]=(0,T.useState)(null),[n,r]=(0,T.useState)(!0),[i,a]=(0,T.useState)(`disconnected`),[o,s]=(0,T.useState)(``),c=(0,T.useRef)(!1),l=n=>{let i=e!==null,a=n!==null;t(n),!i&&a&&!c.current&&(c.current=!0,r(!1)),a||(c.current=!1)},u=(0,T.useCallback)((e,t)=>{a(e),s(t)},[]),d=o.replace(/^wss?:\/\//,``).replace(/\/ws$/,``);return(0,O.jsxs)(`div`,{className:`flex flex-col h-screen w-full max-w-2xl mx-auto`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b bg-background/80 backdrop-blur-sm`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(kB,{state:i}),(0,O.jsx)(`span`,{className:`text-sm font-medium`,children:i===`connected`?`Connected`:i===`connecting`?`Connecting...`:i===`error`?`Error`:`Disconnected`}),i===`connected`&&d&&(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground truncate max-w-[150px]`,children:d})]}),(0,O.jsx)(`button`,{onClick:()=>r(!n),className:`p-1.5 rounded-md hover:bg-muted transition-colors`,children:(0,O.jsx)(Cn,{className:`w-4 h-4 text-muted-foreground`})})]}),(0,O.jsx)(`div`,{className:`overflow-hidden transition-all duration-200 ${n?`border-b`:``}`,children:(0,O.jsx)(`div`,{className:`p-4 bg-muted/30 ${n?``:`hidden`}`,children:(0,O.jsx)(en,{onClientReady:l,onConnectionStateChange:u})})}),(0,O.jsx)(`main`,{className:`flex-1 overflow-hidden p-4`,children:e?(0,O.jsx)(DB,{client:e}):(0,O.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground`,children:(0,O.jsxs)(`div`,{className:`text-center`,children:[(0,O.jsx)(`p`,{className:`text-lg mb-2`,children:`No agent connected`}),(0,O.jsx)(`p`,{className:`text-sm`,children:`Configure and connect to an ACP agent above`})]})})})]})}function kB({state:e}){return(0,O.jsx)(`span`,{className:`w-2 h-2 rounded-full ${{disconnected:`bg-gray-400`,connecting:`bg-yellow-400 animate-pulse`,connected:`bg-green-500 shadow-[0_0_8px_rgba(34,197,94,0.6)]`,error:`bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.6)]`}[e]}`})}var AB=document.getElementById(`root`);AB&&(0,me.createRoot)(AB).render((0,O.jsx)(OB,{}));export{ql as _,ND as a,$l as c,M as d,Jl as f,Zl as g,Xl as h,PD as i,V as l,Kl as m,ID as n,k as o,eu as p,lk as r,wi as s,ik as t,U as u,la as v,Ql as y};
|
|
379
|
-
//# sourceMappingURL=main-
|
|
378
|
+
`)}return t&&Object.keys(t).length>0?t:null}function TB(e){return e===`completed`?`complete`:e===`failed`?`error`:`running`}function EB(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r&&r.type===`tool_call`&&r.toolCall.id===t)return n}return-1}function DB({client:e}){let[t,n]=(0,T.useState)([]),[r,i]=(0,T.useState)(!1),[a,o]=(0,T.useState)(!1),[s,c]=(0,T.useState)(!1),l=(0,T.useCallback)(e=>{console.log(`[ChatInterface] Permission request:`,e),n(t=>{let n=EB(t,e.toolCall.toolCallId);if(n>=0)return t.map((t,r)=>r!==n||t.type!==`tool_call`||t.toolCall.status!==`running`?t:{type:`tool_call`,toolCall:{...t.toolCall,status:`waiting_for_confirmation`,permissionRequest:{requestId:e.requestId,options:e.options}}});{console.log(`[ChatInterface] No matching tool call, creating standalone permission request`);let n={type:`tool_call`,toolCall:{id:e.toolCall.toolCallId,title:e.toolCall.title||`Permission Request`,status:`waiting_for_confirmation`,permissionRequest:{requestId:e.requestId,options:e.options},isStandalonePermission:!0}};return[...t,n]}})},[]),u=(0,T.useCallback)(e=>{if(e.sessionUpdate===`agent_message_chunk`){let t=e.content.type===`text`&&e.content.text?e.content.text:``;if(!t)return;n(e=>{let n=e[e.length-1];if(n?.type===`assistant_message`){let r=n.chunks[n.chunks.length-1];return r?.type===`message`?[...e.slice(0,-1),{...n,chunks:[...n.chunks.slice(0,-1),{type:`message`,text:r.text+t}]}]:[...e.slice(0,-1),{...n,chunks:[...n.chunks,{type:`message`,text:t}]}]}let r={type:`assistant_message`,id:`assistant-${Date.now()}`,chunks:[{type:`message`,text:t}]};return[...e,r]})}else if(e.sessionUpdate===`agent_thought_chunk`){let t=e.content.type===`text`&&e.content.text?e.content.text:``;if(!t)return;n(e=>{let n=e[e.length-1];if(n?.type===`assistant_message`){let r=n.chunks[n.chunks.length-1];return r?.type===`thought`?[...e.slice(0,-1),{...n,chunks:[...n.chunks.slice(0,-1),{type:`thought`,text:r.text+t}]}]:[...e.slice(0,-1),{...n,chunks:[...n.chunks,{type:`thought`,text:t}]}]}let r={type:`assistant_message`,id:`assistant-${Date.now()}`,chunks:[{type:`thought`,text:t}]};return[...e,r]})}else if(e.sessionUpdate===`user_message_chunk`){let t=e.content.type===`text`&&e.content.text?e.content.text:``;if(!t)return;n(e=>{let n=e[e.length-1];if(n?.type===`user_message`)return[...e.slice(0,-1),{...n,content:n.content+t}];let r={type:`user_message`,id:`user-${Date.now()}`,content:t};return[...e,r]})}else if(e.sessionUpdate===`tool_call`){let t={id:e.toolCallId,title:e.title,status:TB(e.status),content:e.content,rawInput:e.rawInput,rawOutput:e.rawOutput};n(n=>{let r=EB(n,e.toolCallId);if(r>=0)return n.map((e,n)=>n!==r||e.type!==`tool_call`?e:{type:`tool_call`,toolCall:{...e.toolCall,...t}});let i={type:`tool_call`,toolCall:t};return[...n,i]})}else e.sessionUpdate===`tool_call_update`&&n(t=>{let n=EB(t,e.toolCallId);if(n<0){console.warn(`[ChatInterface] Tool call not found for update: ${e.toolCallId}`);let n={type:`tool_call`,toolCall:{id:e.toolCallId,title:e.title||`Tool call not found`,status:`error`,content:[{type:`content`,content:{type:`text`,text:`Tool call not found`}}]}};return[...t,n]}return t.map((t,r)=>{if(r!==n||t.type!==`tool_call`)return t;let i=e.status?TB(e.status):t.toolCall.status,a=e.content?[...t.toolCall.content||[],...e.content]:t.toolCall.content;return{type:`tool_call`,toolCall:{...t.toolCall,status:i,...e.title&&{title:e.title},content:a,...e.rawInput&&{rawInput:e.rawInput},...e.rawOutput&&{rawOutput:e.rawOutput}}}})})},[]);(0,T.useEffect)(()=>{e.setSessionCreatedHandler(t=>{console.log(`[ChatInterface] Session created:`,t),o(!0),c(e.supportsImages),console.log(`[ChatInterface] supportsImages:`,e.supportsImages)}),e.setSessionUpdateHandler(e=>{u(e)}),e.setPromptCompleteHandler(e=>{console.log(`[ChatInterface] Prompt complete:`,e),i(!1)}),e.setPermissionRequestHandler(l),e.createSession()},[e,l,u]);let d=async t=>{let o=t.text.trim(),s=t.files||[];if(!o&&s.length===0||r||!a)return;let c=[];o&&c.push({type:`text`,text:o});let l=[];for(let e of s)if(e.mediaType?.startsWith(`image/`)&&e.url)try{console.log(`[ChatInterface] Processing image:`,{filename:e.filename,mediaType:e.mediaType,urlType:e.url.startsWith(`data:`)?`data URL`:e.url.startsWith(`blob:`)?`blob URL`:`other`,urlLength:e.url.length});let t;if(e.url.startsWith(`data:`)){let n=e.url.indexOf(`,`);t=n>=0?e.url.slice(n+1):e.url,console.log(`[ChatInterface] Extracted base64 from data URL, length:`,t.length)}else{console.log(`[ChatInterface] Fetching blob URL...`);let n=await fetch(e.url);if(!n.ok)throw Error(`Fetch failed: ${n.status} ${n.statusText}`);let r=await n.blob();console.log(`[ChatInterface] Blob fetched, size:`,r.size,`type:`,r.type),t=await new Promise((e,t)=>{let n=new FileReader;n.onloadend=()=>{let t=n.result,r=t.indexOf(`,`);e(r>=0?t.slice(r+1):t)},n.onerror=()=>t(Error(`FileReader error: `+n.error?.message)),n.readAsDataURL(r)}),console.log(`[ChatInterface] Base64 conversion complete, length:`,t.length)}let n={type:`image`,mimeType:e.mediaType,data:t};c.push(n),l.push({mimeType:e.mediaType,data:t})}catch(t){console.error(`[ChatInterface] Failed to convert image:`,{filename:e.filename,mediaType:e.mediaType,url:e.url?.substring(0,100),error:t instanceof Error?t.message:String(t)})}if(c.length===0)return;let u={type:`user_message`,id:`user-${Date.now()}`,content:o,images:l.length>0?l:void 0};n(e=>[...e,u]),i(!0);try{await e.sendPrompt(c)}catch(e){console.error(`[ChatInterface] Failed to send prompt:`,e),i(!1)}},f=()=>{console.log(`[ChatInterface] Cancel requested`),n(e=>e.map(e=>e.type!==`tool_call`||!(e.toolCall.status===`running`||e.toolCall.status===`waiting_for_confirmation`)?e:(console.log(`[ChatInterface] Marking tool call as canceled:`,e.toolCall.id),{type:`tool_call`,toolCall:{...e.toolCall,status:`canceled`,permissionRequest:void 0}}))),e.cancel()},p=(0,T.useCallback)((t,r,i)=>{console.log(`[ChatInterface] Permission response:`,{requestId:t,optionId:r,optionKind:i}),e.respondToPermission(t,r);let a=i===`reject_once`||i===`reject_always`||r===null;n(e=>e.map(e=>{if(e.type!==`tool_call`||e.toolCall.permissionRequest?.requestId!==t)return e;let n;return n=a?`rejected`:e.toolCall.isStandalonePermission?`complete`:`running`,{type:`tool_call`,toolCall:{...e.toolCall,status:n,permissionRequest:void 0,isStandalonePermission:void 0}}}))},[e]),m=e=>{switch(e){case`error`:return`output-error`;case`running`:return`input-available`;case`waiting_for_confirmation`:return`waiting-for-confirmation`;case`rejected`:return`rejected`;case`canceled`:return`output-error`;case`complete`:default:return`output-available`}},h=e=>{let t=e.toolCall,n=wB(t.content,t.rawOutput);return(0,O.jsxs)(Zk,{defaultOpen:t.status!==`running`&&t.status!==`waiting_for_confirmation`&&n!==null||t.status===`waiting_for_confirmation`,className:t.status===`rejected`?`border-dashed border-orange-500/50`:void 0,children:[(0,O.jsx)($k,{title:t.title,type:`tool-invocation`,state:m(t.status)}),(0,O.jsxs)(eA,{children:[t.rawInput&&(0,O.jsx)(tA,{input:t.rawInput}),t.status===`waiting_for_confirmation`&&t.permissionRequest&&(0,O.jsx)(SB,{requestId:t.permissionRequest.requestId,options:t.permissionRequest.options,onRespond:p}),t.status!==`waiting_for_confirmation`&&t.status!==`rejected`&&(0,O.jsx)(nA,{output:n,errorText:t.status===`error`?`Tool execution failed`:void 0})]})]},t.id)},g=r&&t.length>0&&t[t.length-1]?.type===`user_message`,_=r?`streaming`:`ready`;return(0,O.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,O.jsxs)(Vn,{className:`flex-1`,children:[(0,O.jsx)(Hn,{children:a?t.length===0?(0,O.jsx)(Un,{title:`Start a conversation`,description:`Type a message below to chat with the ACP agent`}):(0,O.jsxs)(O.Fragment,{children:[t.map((e,t)=>e.type===`user_message`?(0,O.jsx)(uk,{from:`user`,children:(0,O.jsxs)(dk,{children:[e.images&&e.images.length>0&&(0,O.jsx)(mk,{children:e.images.map((e,t)=>(0,O.jsx)(pk,{data:{type:`file`,mediaType:e.mimeType,url:`data:${e.mimeType};base64,${e.data}`}},t))}),e.content&&(0,O.jsx)(fk,{children:e.content})]})},e.id):e.type===`assistant_message`?(0,O.jsx)(uk,{from:`assistant`,children:(0,O.jsx)(dk,{children:e.chunks.map((t,n)=>{if(t.type===`thought`){let i=n===e.chunks.length-1;return(0,O.jsxs)(gB,{isStreaming:r&&i,children:[(0,O.jsx)(vB,{}),(0,O.jsx)(yB,{children:(0,O.jsx)(fk,{children:t.text})})]},n)}return(0,O.jsx)(fk,{children:t.text},n)})})},e.id):e.type===`tool_call`?(0,O.jsx)(uk,{from:`assistant`,children:(0,O.jsx)(dk,{children:h(e)})},e.toolCall.id):null),g&&(0,O.jsx)(uk,{from:`assistant`,children:(0,O.jsx)(dk,{children:(0,O.jsx)(dB,{children:`Thinking...`})})})]}):(0,O.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,O.jsx)(dB,{children:`Creating session...`})})}),(0,O.jsx)(Wn,{})]}),(0,O.jsx)(`div`,{className:`border-t p-4`,children:(0,O.jsxs)(Pk,{onSubmit:d,accept:s?`image/*`:void 0,multiple:s,children:[s&&(0,O.jsx)(Ik,{children:(0,O.jsx)(Nk,{children:e=>(0,O.jsx)(Mk,{data:e})})}),(0,O.jsx)(Fk,{placeholder:a?`Type a message...`:`Waiting for session...`,disabled:!a}),(0,O.jsxs)(Lk,{children:[s?(0,O.jsx)(CB,{}):(0,O.jsx)(`div`,{}),(0,O.jsx)(zk,{status:_,disabled:!a,onClick:r?f:void 0})]})]})})]})}function OB(){let[e,t]=(0,T.useState)(null),[n,r]=(0,T.useState)(!0),[i,a]=(0,T.useState)(`disconnected`),[o,s]=(0,T.useState)(``),c=(0,T.useRef)(!1),l=n=>{let i=e!==null,a=n!==null;t(n),!i&&a&&!c.current&&(c.current=!0,r(!1)),a||(c.current=!1)},u=(0,T.useCallback)((e,t)=>{a(e),s(t)},[]),d=o.replace(/^wss?:\/\//,``).replace(/\/ws$/,``);return(0,O.jsxs)(`div`,{className:`flex flex-col h-screen w-full max-w-2xl mx-auto`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b bg-background/80 backdrop-blur-sm`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(kB,{state:i}),(0,O.jsx)(`span`,{className:`text-sm font-medium`,children:i===`connected`?`Connected`:i===`connecting`?`Connecting...`:i===`error`?`Error`:`Disconnected`}),i===`connected`&&d&&(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground truncate max-w-[150px]`,children:d})]}),(0,O.jsx)(`button`,{onClick:()=>r(!n),className:`p-1.5 rounded-md hover:bg-muted transition-colors`,children:(0,O.jsx)(Cn,{className:`w-4 h-4 text-muted-foreground`})})]}),(0,O.jsx)(`div`,{className:`overflow-hidden transition-all duration-200 ${n?`border-b`:``}`,children:(0,O.jsx)(`div`,{className:`p-4 bg-muted/30 ${n?``:`hidden`}`,children:(0,O.jsx)(en,{onClientReady:l,onConnectionStateChange:u})})}),(0,O.jsx)(`main`,{className:`flex-1 overflow-hidden p-4`,children:e?(0,O.jsx)(DB,{client:e}):(0,O.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground`,children:(0,O.jsxs)(`div`,{className:`text-center`,children:[(0,O.jsx)(`p`,{className:`text-lg mb-2`,children:`No agent connected`}),(0,O.jsx)(`p`,{className:`text-sm`,children:`Configure and connect to an ACP agent above`})]})})})]})}function kB({state:e}){return(0,O.jsx)(`span`,{className:`w-2 h-2 rounded-full ${{disconnected:`bg-gray-400`,connecting:`bg-yellow-400 animate-pulse`,connected:`bg-green-500 shadow-[0_0_8px_rgba(34,197,94,0.6)]`,error:`bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.6)]`}[e]}`})}var AB=document.getElementById(`root`);AB&&(0,me.createRoot)(AB).render((0,O.jsx)(OB,{}));export{ql as _,ND as a,$l as c,M as d,Jl as f,Zl as g,Xl as h,PD as i,V as l,Kl as m,ID as n,k as o,eu as p,lk as r,wi as s,ik as t,U as u,la as v,Ql as y};
|
|
379
|
+
//# sourceMappingURL=main-DbEuNKip.js.map
|